create_dl_layer_dropoutT_create_dl_layer_dropoutCreateDlLayerDropoutCreateDlLayerDropoutcreate_dl_layer_dropout创建深度学习层丢弃(算子)
名称
create_dl_layer_dropoutT_create_dl_layer_dropoutCreateDlLayerDropoutCreateDlLayerDropoutcreate_dl_layer_dropout — 创建丢弃层。
签名
void CreateDlLayerDropout(const HTuple& DLLayerInput, const HTuple& LayerName, const HTuple& Probability, const HTuple& GenParamName, const HTuple& GenParamValue, HTuple* DLLayerDropOut)
HDlLayer HDlLayer::CreateDlLayerDropout(const HString& LayerName, double Probability, const HTuple& GenParamName, const HTuple& GenParamValue) const
HDlLayer HDlLayer::CreateDlLayerDropout(const HString& LayerName, double Probability, const HString& GenParamName, const HString& GenParamValue) const
HDlLayer HDlLayer::CreateDlLayerDropout(const char* LayerName, double Probability, const char* GenParamName, const char* GenParamValue) const
HDlLayer HDlLayer::CreateDlLayerDropout(const wchar_t* LayerName, double Probability, const wchar_t* GenParamName, const wchar_t* GenParamValue) const
(
Windows only)
static void HOperatorSet.CreateDlLayerDropout(HTuple DLLayerInput, HTuple layerName, HTuple probability, HTuple genParamName, HTuple genParamValue, out HTuple DLLayerDropOut)
HDlLayer HDlLayer.CreateDlLayerDropout(string layerName, double probability, HTuple genParamName, HTuple genParamValue)
HDlLayer HDlLayer.CreateDlLayerDropout(string layerName, double probability, string genParamName, string genParamValue)
描述
算子 create_dl_layer_dropoutcreate_dl_layer_dropoutCreateDlLayerDropoutCreateDlLayerDropoutCreateDlLayerDropoutcreate_dl_layer_dropout 创建一个概率为 ProbabilityProbabilityProbabilityProbabilityprobabilityprobability 的 DropOut 丢弃层,并返回句柄 DLLayerDropOutDLLayerDropOutDLLayerDropOutDLLayerDropOutDLLayerDropOutdllayer_drop_out。
参数 DLLayerInputDLLayerInputDLLayerInputDLLayerInputDLLayerInputdllayer_input 确定输入层,并期望该层句柄作为值。
参数 LayerNameLayerNameLayerNameLayerNamelayerNamelayer_name 用于设置单个层的名称。请注意,若使用 create_dl_modelcreate_dl_modelCreateDlModelCreateDlModelCreateDlModelcreate_dl_model 创建模型,则创建网络中的每个层必须具有唯一名称。
训练期间,DLLayerInputDLLayerInputDLLayerInputDLLayerInputDLLayerInputdllayer_input 中的激活值以概率 ProbabilityProbabilityProbabilityProbabilityprobabilityprobability 被置为 0。其余所有激活值按(1 - ProbabilityProbabilityProbabilityProbabilityprobabilityprobability)进行重新缩放。
以下泛型参数 GenParamNameGenParamNameGenParamNameGenParamNamegenParamNamegen_param_name 及其对应值 GenParamValueGenParamValueGenParamValueGenParamValuegenParamValuegen_param_value 受支持:
- 'is_inference_output'"is_inference_output""is_inference_output""is_inference_output""is_inference_output""is_inference_output":
-
确定 apply_dl_modelapply_dl_modelApplyDlModelApplyDlModelApplyDlModelapply_dl_model 是否将此层的输出包含在字典 DLResultBatchDLResultBatchDLResultBatchDLResultBatchDLResultBatchdlresult_batch 中,即使未在 OutputsOutputsOutputsOutputsoutputsoutputs 中指定此层('true'"true""true""true""true""true")或不包含('false'"false""false""false""false""false")。
默认值: 'false'"false""false""false""false""false"
使用
create_dl_layer_dropoutcreate_dl_layer_dropoutCreateDlLayerDropoutCreateDlLayerDropoutCreateDlLayerDropoutcreate_dl_layer_dropout 算子创建的层,其特定参数可通过其他算子进行设置与检索。下表概述了可通过 set_dl_model_layer_paramset_dl_model_layer_paramSetDlModelLayerParamSetDlModelLayerParamSetDlModelLayerParamset_dl_model_layer_param 设置的参数,以及可通过 get_dl_model_layer_paramget_dl_model_layer_paramGetDlModelLayerParamGetDlModelLayerParamGetDlModelLayerParamget_dl_model_layer_param 或 get_dl_layer_paramget_dl_layer_paramGetDlLayerParamGetDlLayerParamGetDlLayerParamget_dl_layer_param 检索的参数。请注意,算子 set_dl_model_layer_paramset_dl_model_layer_paramSetDlModelLayerParamSetDlModelLayerParamSetDlModelLayerParamset_dl_model_layer_param 和 get_dl_model_layer_paramget_dl_model_layer_paramGetDlModelLayerParamGetDlModelLayerParamGetDlModelLayerParamget_dl_model_layer_param
需基于 create_dl_modelcreate_dl_modelCreateDlModelCreateDlModelCreateDlModelcreate_dl_model 创建的模型。
|
泛型层参数 |
设置 |
获取 |
|
'is_inference_output'"is_inference_output""is_inference_output""is_inference_output""is_inference_output""is_inference_output" |
|
|
|
'num_trainable_params'"num_trainable_params""num_trainable_params""num_trainable_params""num_trainable_params""num_trainable_params" |
|
|
执行信息
- 多线程类型:可重入(与非独占算子并行运行)。
- 多线程作用域:全局(可从任何线程调用)。
- 未采用并行化处理。
参数
DLLayerInputDLLayerInputDLLayerInputDLLayerInputDLLayerInputdllayer_input (输入控制) dl_layer → HDlLayer, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)
输入层。
LayerNameLayerNameLayerNameLayerNamelayerNamelayer_name (输入控制) string → HTuplestrHTupleHtuple (string) (string) (HString) (char*)
输出层的名称。
ProbabilityProbabilityProbabilityProbabilityprobabilityprobability (输入控制) number → HTuplefloatHTupleHtuple (real) (double) (double) (double)
概率。
默认值:
0.5
GenParamNameGenParamNameGenParamNameGenParamNamegenParamNamegen_param_name (输入控制) attribute.name(-array) → HTupleMaybeSequence[str]HTupleHtuple (string) (string) (HString) (char*)
泛型输入参数名称。
默认值:
[]
值列表:
'is_inference_output'"is_inference_output""is_inference_output""is_inference_output""is_inference_output""is_inference_output"
GenParamValueGenParamValueGenParamValueGenParamValuegenParamValuegen_param_value (输入控制) attribute.value(-array) → HTupleMaybeSequence[Union[int, float, str]]HTupleHtuple (string / integer / real) (string / int / long / double) (HString / Hlong / double) (char* / Hlong / double)
泛型输入参数值。
默认值:
[]
建议值:
'true'"true""true""true""true""true", 'false'"false""false""false""false""false"
DLLayerDropOutDLLayerDropOutDLLayerDropOutDLLayerDropOutDLLayerDropOutdllayer_drop_out (输出控制) dl_layer → HDlLayer, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)
丢弃层。
模块
深度学习训练