set_dl_model_layer_weightsT_set_dl_model_layer_weightsSetDlModelLayerWeightsSetDlModelLayerWeightsset_dl_model_layer_weights (Operator)

Name

set_dl_model_layer_weightsT_set_dl_model_layer_weightsSetDlModelLayerWeightsSetDlModelLayerWeightsset_dl_model_layer_weights — Setzen der Gewichte (oder Werte) eines Deep Learning-Modell-Layers.

Signatur

set_dl_model_layer_weights(Weights : : DLModelHandle, LayerName, WeightsType : )

Herror T_set_dl_model_layer_weights(const Hobject Weights, const Htuple DLModelHandle, const Htuple LayerName, const Htuple WeightsType)

void SetDlModelLayerWeights(const HObject& Weights, const HTuple& DLModelHandle, const HTuple& LayerName, const HTuple& WeightsType)

void HDlModel::SetDlModelLayerWeights(const HImage& Weights, const HString& LayerName, const HString& WeightsType) const

void HDlModel::SetDlModelLayerWeights(const HImage& Weights, const char* LayerName, const char* WeightsType) const

void HDlModel::SetDlModelLayerWeights(const HImage& Weights, const wchar_t* LayerName, const wchar_t* WeightsType) const   (Nur Windows)

static void HOperatorSet.SetDlModelLayerWeights(HObject weights, HTuple DLModelHandle, HTuple layerName, HTuple weightsType)

void HDlModel.SetDlModelLayerWeights(HImage weights, string layerName, string weightsType)

def set_dl_model_layer_weights(weights: HObject, dlmodel_handle: HHandle, layer_name: str, weights_type: str) -> None

Beschreibung

Der Operator set_dl_model_layer_weightsset_dl_model_layer_weightsSetDlModelLayerWeightsSetDlModelLayerWeightsSetDlModelLayerWeightsset_dl_model_layer_weights setzt die in WeightsWeightsWeightsWeightsweightsweights gegebenen Gewichte für das Modell DLModelHandleDLModelHandleDLModelHandleDLModelHandleDLModelHandledlmodel_handle im Layer LayerNameLayerNameLayerNameLayerNamelayerNamelayer_name.

Der Parameter WeightsTypeWeightsTypeWeightsTypeWeightsTypeweightsTypeweights_type bestimmt, welcher Typ von Layerwerten gesetzt wird. Welche Werte gesetzt werden können kann in der Dokumentation zu get_dl_model_layer_weightsget_dl_model_layer_weightsGetDlModelLayerWeightsGetDlModelLayerWeightsGetDlModelLayerWeightsget_dl_model_layer_weights nachgelesen werden.

Achtung

Der Operator set_dl_model_layer_weightsset_dl_model_layer_weightsSetDlModelLayerWeightsSetDlModelLayerWeightsSetDlModelLayerWeightsset_dl_model_layer_weights ist nur auf eigens erstellte Netzwerke anwendbar. Für Netzwerke die von HALCON mitgeliefert werden hat der Operator keine Auswirkung.

Ausführungsinformationen

Parameter

WeightsWeightsWeightsWeightsweightsweights (input_object)  (multichannel-)image(-array) objectHImageHObjectHImageHobject (real)

Eingabegewichte.

DLModelHandleDLModelHandleDLModelHandleDLModelHandleDLModelHandledlmodel_handle (input_control)  dl_model HDlModel, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Handle des Deep Learning-Modells.

LayerNameLayerNameLayerNameLayerNamelayerNamelayer_name (input_control)  string HTuplestrHTupleHtuple (string) (string) (HString) (char*)

Name des Layers, dessen Gewichte gesetzt werden sollen.

WeightsTypeWeightsTypeWeightsTypeWeightsTypeweightsTypeweights_type (input_control)  string HTuplestrHTupleHtuple (string) (string) (HString) (char*)

Ausgewählter Typ von Layerwerten, die gesetzt werden sollen.

Defaultwert: 'weights' "weights" "weights" "weights" "weights" "weights"

Werteliste: 'batchnorm_mean'"batchnorm_mean""batchnorm_mean""batchnorm_mean""batchnorm_mean""batchnorm_mean", 'batchnorm_mean_avg'"batchnorm_mean_avg""batchnorm_mean_avg""batchnorm_mean_avg""batchnorm_mean_avg""batchnorm_mean_avg", 'batchnorm_variance'"batchnorm_variance""batchnorm_variance""batchnorm_variance""batchnorm_variance""batchnorm_variance", 'batchnorm_variance_avg'"batchnorm_variance_avg""batchnorm_variance_avg""batchnorm_variance_avg""batchnorm_variance_avg""batchnorm_variance_avg", 'bias'"bias""bias""bias""bias""bias", 'weights'"weights""weights""weights""weights""weights"

Beispiel (HDevelop)

* Create weights for a convolution layer.
gen_image_const (Weights, 'real', 1, 1)
paint_region (Weights, Weights, Weights, 1, 'fill')
gen_empty_obj (WeightsArray)
for Index := 0 to 10 by 1
    concat_obj (WeightsArray, Weights, WeightsArray)
endfor
*
* Input image with rows consisting of 1s to 10s.
gen_image_const (Image, 'real', 10, 10)
for Index := 0 to 9 by 1
    gen_rectangle1 (Rectangle, Index, 0, Index, 9)
    paint_region (Rectangle, Image, Image, Index + 1, 'fill')
endfor
*
* Create a small model network.
create_dl_layer_input ('image', [10, 2, 1], [], [], ImageNode)
create_dl_layer_convolution (ImageNode, 'conv', 1, 1, 2, 11, 1, 'none', \
                             'none', [], [], ConvNode)
create_dl_layer_zoom_factor (ConvNode, 'zoom', 2, 2, 'bilinear', 'true', [],\
                             [], ZoomNode)
create_dl_model (ZoomNode, DLModelHandle)
set_dl_model_param (DLModelHandle, 'runtime', 'cpu')
*
* Set the weights to the convolution layer.
set_dl_model_layer_weights (WeightsArray, DLModelHandle, 'conv', 'weights')

Vorgänger

create_dl_modelcreate_dl_modelCreateDlModelCreateDlModelCreateDlModelcreate_dl_model, get_dl_model_layer_weightsget_dl_model_layer_weightsGetDlModelLayerWeightsGetDlModelLayerWeightsGetDlModelLayerWeightsget_dl_model_layer_weights

Nachfolger

get_dl_model_layer_weightsget_dl_model_layer_weightsGetDlModelLayerWeightsGetDlModelLayerWeightsGetDlModelLayerWeightsget_dl_model_layer_weights

Modul

Foundation. Dieser Operator verwendet dynamische Lizensierung (siehe ``Installation Guide''). Welches der folgenden Module benötigt wird hängt von der Anwendung des Operators ab:
Deep Learning Training