train_dl_model_anomaly_dataset — 训练用于异常检测的深度学习模型。
train_dl_model_anomaly_dataset( : : DLModelHandle, DLSamples, DLTrainParam : DLTrainResult)
算子 train_dl_model_anomaly_dataset performs the training
of a deep learning model with 'type'='anomaly_detection'
contained in DLModelHandle (for deep learning models
with 'type'='gc_anomaly_detection' see
train_dl_model_batch).
This operator processes the full training dataset at once.
This is in contrast to the operator train_dl_model_batch。The iterations over the dataset are performed internally by the operator.
Consequently, you only need to call this operator once with the full training
dataset to train your anomaly detection model.
The training dataset is handed over in the tuple of dictionaries
DLSamples.
See the chapter 深度学习 / 模型 for further information to the
used dictionaries and their keys.
The operator expects within the training dataset only images without anomaly
to train the anomaly detection model.
The dictionary DLTrainParam can be used to change the
hyperparameters.
The following values are supported:
max_num_epochs:This parameter specifies the maximum number of epochs performed
during training.
In case the criterion specified by error_threshold is reached in
an earlier epoch, the training will terminate regardless.
Restriction: max_num_epochs >=1.
Default: max_num_epochs = 30.
error_threshold:This parameter is a termination criterion for the training.
If the training error is less than the specified
error_threshold, the training terminates successfully.
Restriction:
0.0 <= error_threshold <= 1.0.
Default: error_threshold = 0.001.
domain_ratio:This parameter determines the percentage of information of each image used
for training.
Since images tend to contain an abundance of information,
it is advisable to reduce its amount.
Additionally, reducing domain_ratio can decrease the time needed
for training.
Please note, however, sufficient information needs to remain and
therefore this value should not be set too small either.
Otherwise the training result might not be satisfactory or the training
itself might even fail.
Restriction: 0.0 < domain_ratio <= 1.0.
Default: domain_ratio = 0.1.
regularization_noise:This parameter can be set to regularize the training in order to
improve robustness.
Restriction: regularization_noise >=0.0.
Default: regularization_noise = 0.0.
The output dictionary DLTrainResult contains the following values:
final_error:The best error received during training.
final_epoch
The epoch in which the error final_error was achieved.
算子 train_dl_model_anomaly_dataset internally calls functions
that might not be deterministic.
Therefore, results from multiple calls of
train_dl_model_anomaly_dataset can slightly differ, although the same
input values have been used.
System requirements:
To run this operator on GPU by setting 'runtime' to 'gpu'
(see get_dl_model_param), cuDNN and cuBLAS are required.更多详细信息,请参阅 “安装指南” 中的“深度学习及基于深度学习方法的要求”一章。
Alternatively, this operator
can also be run on CPU by setting 'runtime' to 'cpu'.
DLModelHandle (输入控制) dl_model → (handle)
Deep learning model handle.
DLSamples (输入控制) dict-array → (handle)
Tuple of Dictionaries with input images and corresponding information.
DLTrainParam (输入控制) dict → (handle)
Parameter for training the anomaly detection model.
默认值: []
DLTrainResult (输出控制) dict → (handle)
Dictionary with the train result data.
如果参数有效,算子
train_dl_model_anomaly_dataset 返回值 2 ( H_MSG_TRUE )。如有必要,则抛出异常。
read_dl_model,
set_dl_model_param,
get_dl_model_param
基础。该算子采用动态许可机制(详见《安装指南》)。所需模块取决于算子的具体使用场景: 深度学习训练