set_dl_classifier_param — Set the parameters of the deep-learning-based classifier.
set_dl_classifier_param sets the parameters and hyperparameters GenParamName of the neural network DLClassifierHandle to the values GenParamValue.
GenParamName can attain the following values:
Number of images (and corresponding labels) in a batch and thus the number of images that are processed simultaneously in a single iteration of the training. Please refer to train_dl_classifier_batch for further details. This parameter is stored in the pretrained classifier. Per default, the 'batch_size' is set such that a training of the pretrained classifier with up to 100 classes can be easily performed on a device with 8 gigabyte of memory. For the pretrained classifiers, the default values are hence given as follows:
|pretrained classifier||default value of 'batch_size'|
Tuple of labels corresponding to the classes of objects which are to be recognized. The order of the class names remains unchanged after the setting.
Identifier of the GPU where the training and inference operators (train_dl_classifier_batch and apply_dl_classifier are executed. Per default, the first available GPU is used. get_system with 'cuda_devices' can be used to retrieve a list of available GPUs. Pass the index in this list to 'gpu'.
Initial value of the factor determining the gradient influence during training. Please refer to train_dl_classifier_batch for further details. Per default, the 'learning_rate' is set to 0.001.
When updating the arguments of the loss function, the hyperparameter 'momentum' specifies to which extent previous updating vectors will be added to the current updating vector. Please refer to train_dl_classifier_batch for further details. Per default, the 'momentum' is set to 0.9.
If called with '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_classifier or train_dl_classifier_batch. If 'gpu' or 'batch_size' is changed with subsequent calls of set_dl_classifier_param, the GPU memory is reinitialized.
Regularization parameter used for regularization of the loss function. Regularization is helpful in the presence of overfitting during the classifier training. If the hyperparameter 'weight_prior' is non-zero, the regularization term given below is added to the loss function (see also train_dl_classifier_batch)
For an explanation of the concept of deep-learning-based classification see the introduction of chapter Deep Learning / Classification.
To run this operator, cuDNN is required when setting 'gpu' or 'runtime_init'. For further details, please refer to the Installation Guide, paragraph Requirements for Deep Learning.
Handle of the deep-learning-based classifier.
Name of the generic parameter.
Default value: 'classes'
List of values: 'batch_size', 'classes', 'gpu', 'learning_rate', 'momentum', 'runtime_init', 'weight_prior'
Value of the generic parameter.
Default value: ['class_1','class_2','class_3']
Suggested values: 1, 2, 3, 50, 0.001, 'immediately'
If the parameters are valid, the operator set_dl_classifier_param returns the value 2 (H_MSG_TRUE). If necessary, an exception is raised.
get_dl_classifier_param, apply_dl_classifier, train_dl_classifier_batch
Deep Learning Inference