set_dl_model_paramT_set_dl_model_paramSetDlModelParamSetDlModelParam (Operator)

Name

set_dl_model_paramT_set_dl_model_paramSetDlModelParamSetDlModelParam — Set the parameters of a deep learning model.

Signature

set_dl_model_param( : : DLModelHandle, GenParamName, GenParamValue : )

Herror T_set_dl_model_param(const Htuple DLModelHandle, const Htuple GenParamName, const Htuple GenParamValue)

void SetDlModelParam(const HTuple& DLModelHandle, const HTuple& GenParamName, const HTuple& GenParamValue)

void HDlModel::SetDlModelParam(const HString& GenParamName, const HTuple& GenParamValue) const

void HDlModel::SetDlModelParam(const HString& GenParamName, double GenParamValue) const

void HDlModel::SetDlModelParam(const char* GenParamName, double GenParamValue) const

void HDlModel::SetDlModelParam(const wchar_t* GenParamName, double GenParamValue) const   (Windows only)

static void HOperatorSet.SetDlModelParam(HTuple DLModelHandle, HTuple genParamName, HTuple genParamValue)

void HDlModel.SetDlModelParam(string genParamName, HTuple genParamValue)

void HDlModel.SetDlModelParam(string genParamName, double genParamValue)

Description

set_dl_model_paramset_dl_model_paramSetDlModelParamSetDlModelParamSetDlModelParam sets the parameters and hyperparameters GenParamNameGenParamNameGenParamNameGenParamNamegenParamName of the deep learning model DLModelHandleDLModelHandleDLModelHandleDLModelHandleDLModelHandle to the values GenParamValueGenParamValueGenParamValueGenParamValuegenParamValue.

The values GenParamNameGenParamNameGenParamNameGenParamNamegenParamName can attain, depend on the model type: There are parameters which can be set for any deep learning model while others can only be set for specific model types. A description of the parameters whose value you can only set but not retrieve is given below. For all other parameters the specific description is given in get_dl_model_paramget_dl_model_paramGetDlModelParamGetDlModelParamGetDlModelParam. In get_dl_model_paramget_dl_model_paramGetDlModelParamGetDlModelParamGetDlModelParam we also give an overview, for which type of model and using which operator a parameter can be set.

In the following we list the parameters GenParamNameGenParamNameGenParamNameGenParamNamegenParamName you can set using this operator, set_dl_model_paramset_dl_model_paramSetDlModelParamSetDlModelParamSetDlModelParam. Thereby, the following symbols denote the model type for which the parameter can be set and has a possible influence:

'batch_size'"batch_size""batch_size""batch_size""batch_size": Any
'batch_size_multiplier'"batch_size_multiplier""batch_size_multiplier""batch_size_multiplier""batch_size_multiplier": CL OD SE
'class_ids'"class_ids""class_ids""class_ids""class_ids": OD SE
'enable_resizing'"enable_resizing""enable_resizing""enable_resizing""enable_resizing": Any

Calling this option, converts pooling certain layers within the network. More precisely, every non-global pooling layer with a resulting feature map of size 1x1 is converted into a global pooling layer. This means, a pooling layer performing e.g., average pooling is converted into one performing global average pooling. For more information about pooling layer and possible modes of operation, see the “Solution Guide on Classification”.

Note, if this operation is performed, it can not be undone. Accordingly, you can only call it with the value 'true'"true""true""true""true". Also, if the network has no such layer, nothing is done and therewith the operation is regarded as successful.

'fuse_conv_relu'"fuse_conv_relu""fuse_conv_relu""fuse_conv_relu""fuse_conv_relu": Any

Calling this option, fuses layer pairs consisting of a convolution layer without activation and a directly connected activation layer with ReLU activation. In order to so do, the output of the convolution layer is only used as input for the activation layer. As a result a convolution layer with activation mode ReLU is obtained. For more information about layers and possible modes of operation, see the “Solution Guide on Classification”.

Note, if this operation is performed, it can not be undone. Accordingly, you can only call it with the value 'true'"true""true""true""true". Also, if the network has no such fusible layers, nothing is done and therewith the operation is regarded as successful.

'fuse_bn_relu'"fuse_bn_relu""fuse_bn_relu""fuse_bn_relu""fuse_bn_relu": Any

Calling this option, fuses layer pairs consisting of a batchnormalization layer without activation and a directly connected activation layer with ReLU activation. In order to so do, the output of the batchnormalization layer is only used as input for the activation layer. As a result a batchnormalization layer with activation mode ReLU is obtained. For more information about layers and possible modes of operation, see the “Solution Guide on Classification”.

Note, if this operation is performed, it can not be undone. Accordingly, you can only call it with the value 'true'"true""true""true""true". Also, if the network has no such fusible layers, nothing is done and therewith the operation is regarded as successful.

'gpu'"gpu""gpu""gpu""gpu": Any
'image_dimensions'"image_dimensions""image_dimensions""image_dimensions""image_dimensions": AD CL SE
'image_height'"image_height""image_height""image_height""image_height", 'image_width'"image_width""image_width""image_width""image_width": AN CL SE
'image_num_channels'"image_num_channels""image_num_channels""image_num_channels""image_num_channels": AD CL SE
'image_range_max'"image_range_max""image_range_max""image_range_max""image_range_max", 'image_range_min'"image_range_min""image_range_min""image_range_min""image_range_min": SE
'learning_rate'"learning_rate""learning_rate""learning_rate""learning_rate": CL OD SE
'momentum'"momentum""momentum""momentum""momentum": CL OD SE
'optimize_for_inference'"optimize_for_inference""optimize_for_inference""optimize_for_inference""optimize_for_inference": CL OD SE
'runtime'"runtime""runtime""runtime""runtime": Any
'runtime_init'"runtime_init""runtime_init""runtime_init""runtime_init": Any

If called with 'immediately'"immediately""immediately""immediately""immediately", the GPU memory is initialized and the corresponding handle created. Otherwise this is done on demand, which may result in significantly larger execution times for the first call of apply_dl_modelapply_dl_modelApplyDlModelApplyDlModelApplyDlModel or train_dl_model_batchtrain_dl_model_batchTrainDlModelBatchTrainDlModelBatchTrainDlModelBatch.

If the network architecture is changed subsequently, the GPU memory is reinitialized. This can happen e.g., for changes of 'batch_size'"batch_size""batch_size""batch_size""batch_size" or 'image_dimensions'"image_dimensions""image_dimensions""image_dimensions""image_dimensions" with subsequent calls of set_dl_model_paramset_dl_model_paramSetDlModelParamSetDlModelParamSetDlModelParam.

Note, this parameter has no effect if running on CPUs, thus if 'runtime'"runtime""runtime""runtime""runtime" is set to 'cpu'"cpu""cpu""cpu""cpu".

'weight_prior'"weight_prior""weight_prior""weight_prior""weight_prior": CL OD SE
'complexity'"complexity""complexity""complexity""complexity": AD
'standard_deviation_factor'"standard_deviation_factor""standard_deviation_factor""standard_deviation_factor""standard_deviation_factor": AD
'backbone_docking_layers'"backbone_docking_layers""backbone_docking_layers""backbone_docking_layers""backbone_docking_layers": CL

The docking layers can be specified for every classifier, also without using them as backbone. The specification is only considered for object detection backbones.

'class_names'"class_names""class_names""class_names""class_names": CL
'extract_feature_maps'"extract_feature_maps""extract_feature_maps""extract_feature_maps""extract_feature_maps": CL
'freeze_backbone_level'"freeze_backbone_level""freeze_backbone_level""freeze_backbone_level""freeze_backbone_level": OD
'max_num_detections'"max_num_detections""max_num_detections""max_num_detections""max_num_detections": OD
'max_overlap'"max_overlap""max_overlap""max_overlap""max_overlap": OD
'max_overlap_class_agnostic'"max_overlap_class_agnostic""max_overlap_class_agnostic""max_overlap_class_agnostic""max_overlap_class_agnostic": OD
'min_confidence'"min_confidence""min_confidence""min_confidence""min_confidence": OD
'ignore_class_ids'"ignore_class_ids""ignore_class_ids""ignore_class_ids""ignore_class_ids": SE
'type'"type""type""type""type": Gen

Change the type of a generic model. Some models read from the ONNX format are not recognized as models of type 'classification'"classification""classification""classification""classification". By setting 'type'"type""type""type""type" to 'classification'"classification""classification""classification""classification", a SoftMax layer is appended and the model can be trained. All other usage of this parameter is unsupported and may corrupt your model.

Attention

System requirements: To successfully set 'gpu'"gpu""gpu""gpu""gpu" parameters, cuDNN and cuBLAS are required, i.e., to set the parameter GenParamNameGenParamNameGenParamNameGenParamNamegenParamName 'runtime'"runtime""runtime""runtime""runtime" to 'gpu'"gpu""gpu""gpu""gpu". For further details, please refer to the “Installation Guide”, paragraph “Requirements for Deep Learning”.

Execution Information

Parameters

DLModelHandleDLModelHandleDLModelHandleDLModelHandleDLModelHandle (input_control)  dl_model HDlModel, HTupleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Handle of the deep learning model.

GenParamNameGenParamNameGenParamNameGenParamNamegenParamName (input_control)  attribute.name HTupleHTupleHtuple (string) (string) (HString) (char*)

Name of the generic parameter.

Default value: 'learning_rate' "learning_rate" "learning_rate" "learning_rate" "learning_rate"

List of values: 'anchor_angles'"anchor_angles""anchor_angles""anchor_angles""anchor_angles", 'anchor_aspect_ratios'"anchor_aspect_ratios""anchor_aspect_ratios""anchor_aspect_ratios""anchor_aspect_ratios", 'anchor_num_subscales'"anchor_num_subscales""anchor_num_subscales""anchor_num_subscales""anchor_num_subscales", 'backbone'"backbone""backbone""backbone""backbone", 'backbone_docking_layers'"backbone_docking_layers""backbone_docking_layers""backbone_docking_layers""backbone_docking_layers", 'batch_size'"batch_size""batch_size""batch_size""batch_size", 'batch_size_multiplier'"batch_size_multiplier""batch_size_multiplier""batch_size_multiplier""batch_size_multiplier", 'bbox_heads_weight'"bbox_heads_weight""bbox_heads_weight""bbox_heads_weight""bbox_heads_weight", 'capacity'"capacity""capacity""capacity""capacity", 'class_heads_weight'"class_heads_weight""class_heads_weight""class_heads_weight""class_heads_weight", 'class_ids'"class_ids""class_ids""class_ids""class_ids", 'class_names'"class_names""class_names""class_names""class_names", 'class_weights'"class_weights""class_weights""class_weights""class_weights", 'complexity'"complexity""complexity""complexity""complexity", 'enable_resizing'"enable_resizing""enable_resizing""enable_resizing""enable_resizing", 'extract_feature_maps'"extract_feature_maps""extract_feature_maps""extract_feature_maps""extract_feature_maps", 'freeze_backbone_level'"freeze_backbone_level""freeze_backbone_level""freeze_backbone_level""freeze_backbone_level", 'fuse_bn_relu'"fuse_bn_relu""fuse_bn_relu""fuse_bn_relu""fuse_bn_relu", 'fuse_conv_relu'"fuse_conv_relu""fuse_conv_relu""fuse_conv_relu""fuse_conv_relu", 'gpu'"gpu""gpu""gpu""gpu", 'ignore_class_ids'"ignore_class_ids""ignore_class_ids""ignore_class_ids""ignore_class_ids", 'ignore_direction'"ignore_direction""ignore_direction""ignore_direction""ignore_direction", 'image_dimensions'"image_dimensions""image_dimensions""image_dimensions""image_dimensions", 'image_height'"image_height""image_height""image_height""image_height", 'image_num_channels'"image_num_channels""image_num_channels""image_num_channels""image_num_channels", 'image_range_max'"image_range_max""image_range_max""image_range_max""image_range_max", 'image_range_min'"image_range_min""image_range_min""image_range_min""image_range_min", 'image_width'"image_width""image_width""image_width""image_width", 'instance_type'"instance_type""instance_type""instance_type""instance_type", 'learning_rate'"learning_rate""learning_rate""learning_rate""learning_rate", 'max_level'"max_level""max_level""max_level""max_level", 'max_num_detections'"max_num_detections""max_num_detections""max_num_detections""max_num_detections", 'max_overlap'"max_overlap""max_overlap""max_overlap""max_overlap", 'max_overlap_class_agnostic'"max_overlap_class_agnostic""max_overlap_class_agnostic""max_overlap_class_agnostic""max_overlap_class_agnostic", 'min_confidence'"min_confidence""min_confidence""min_confidence""min_confidence", 'min_level'"min_level""min_level""min_level""min_level", 'momentum'"momentum""momentum""momentum""momentum", 'num_classes'"num_classes""num_classes""num_classes""num_classes", 'optimize_for_inference'"optimize_for_inference""optimize_for_inference""optimize_for_inference""optimize_for_inference", 'runtime'"runtime""runtime""runtime""runtime", 'runtime_init'"runtime_init""runtime_init""runtime_init""runtime_init", 'standard_deviation_factor'"standard_deviation_factor""standard_deviation_factor""standard_deviation_factor""standard_deviation_factor", 'summary'"summary""summary""summary""summary", 'type'"type""type""type""type", 'weight_prior'"weight_prior""weight_prior""weight_prior""weight_prior"

GenParamValueGenParamValueGenParamValueGenParamValuegenParamValue (input_control)  attribute.value(-array) HTupleHTupleHtuple (real / string / integer) (double / string / int / long) (double / HString / Hlong) (double / char* / Hlong)

Value of the generic parameter.

Default value: 0.001

Suggested values: 1, 2, 3, 50, [80,60], 80, 60, 0.001, -127, 128, 'cpu'"cpu""cpu""cpu""cpu", 'gpu'"gpu""gpu""gpu""gpu", 'immediately'"immediately""immediately""immediately""immediately"

Result

If the parameters are valid, the operator set_dl_model_paramset_dl_model_paramSetDlModelParamSetDlModelParamSetDlModelParam returns the value 2 (H_MSG_TRUE). If necessary, an exception is raised.

Possible Predecessors

read_dl_modelread_dl_modelReadDlModelReadDlModelReadDlModel, get_dl_model_paramget_dl_model_paramGetDlModelParamGetDlModelParamGetDlModelParam

Possible Successors

get_dl_model_paramget_dl_model_paramGetDlModelParamGetDlModelParamGetDlModelParam, apply_dl_modelapply_dl_modelApplyDlModelApplyDlModelApplyDlModel, train_dl_model_batchtrain_dl_model_batchTrainDlModelBatchTrainDlModelBatchTrainDlModelBatch, train_dl_model_anomaly_datasettrain_dl_model_anomaly_datasetTrainDlModelAnomalyDatasetTrainDlModelAnomalyDatasetTrainDlModelAnomalyDataset

See also

get_dl_model_paramget_dl_model_paramGetDlModelParamGetDlModelParamGetDlModelParam

Module

Deep Learning Inference