create_dl_layer_depth_maxT_create_dl_layer_depth_maxCreateDlLayerDepthMaxCreateDlLayerDepthMaxcreate_dl_layer_depth_max创建深度学习层深度最大(算子)

名称

create_dl_layer_depth_maxT_create_dl_layer_depth_maxCreateDlLayerDepthMaxCreateDlLayerDepthMaxcreate_dl_layer_depth_max — 创建深度最大层。

签名

create_dl_layer_depth_max( : : DLLayerInput, LayerName, DepthMaxMode, GenParamName, GenParamValue : DLLayerDepthMaxArg, DLLayerDepthMaxValue)

Herror T_create_dl_layer_depth_max(const Htuple DLLayerInput, const Htuple LayerName, const Htuple DepthMaxMode, const Htuple GenParamName, const Htuple GenParamValue, Htuple* DLLayerDepthMaxArg, Htuple* DLLayerDepthMaxValue)

void CreateDlLayerDepthMax(const HTuple& DLLayerInput, const HTuple& LayerName, const HTuple& DepthMaxMode, const HTuple& GenParamName, const HTuple& GenParamValue, HTuple* DLLayerDepthMaxArg, HTuple* DLLayerDepthMaxValue)

HDlLayerArray HDlLayer::CreateDlLayerDepthMax(const HString& LayerName, const HString& DepthMaxMode, const HTuple& GenParamName, const HTuple& GenParamValue, HDlLayerArray* DLLayerDepthMaxValue) const

HDlLayer HDlLayer::CreateDlLayerDepthMax(const HString& LayerName, const HString& DepthMaxMode, const HString& GenParamName, const HString& GenParamValue, HDlLayer* DLLayerDepthMaxValue) const

HDlLayer HDlLayer::CreateDlLayerDepthMax(const char* LayerName, const char* DepthMaxMode, const char* GenParamName, const char* GenParamValue, HDlLayer* DLLayerDepthMaxValue) const

HDlLayer HDlLayer::CreateDlLayerDepthMax(const wchar_t* LayerName, const wchar_t* DepthMaxMode, const wchar_t* GenParamName, const wchar_t* GenParamValue, HDlLayer* DLLayerDepthMaxValue) const   ( Windows only)

static void HOperatorSet.CreateDlLayerDepthMax(HTuple DLLayerInput, HTuple layerName, HTuple depthMaxMode, HTuple genParamName, HTuple genParamValue, out HTuple DLLayerDepthMaxArg, out HTuple DLLayerDepthMaxValue)

HDlLayer[] HDlLayer.CreateDlLayerDepthMax(string layerName, string depthMaxMode, HTuple genParamName, HTuple genParamValue, out HDlLayer[] DLLayerDepthMaxValue)

HDlLayer HDlLayer.CreateDlLayerDepthMax(string layerName, string depthMaxMode, string genParamName, string genParamValue, out HDlLayer DLLayerDepthMaxValue)

def create_dl_layer_depth_max(dllayer_input: HHandle, layer_name: str, depth_max_mode: str, gen_param_name: MaybeSequence[str], gen_param_value: MaybeSequence[Union[int, float, str]]) -> Tuple[Sequence[HHandle], Sequence[HHandle]]

def create_dl_layer_depth_max_s(dllayer_input: HHandle, layer_name: str, depth_max_mode: str, gen_param_name: MaybeSequence[str], gen_param_value: MaybeSequence[Union[int, float, str]]) -> Tuple[HHandle, HHandle]

描述

算子 create_dl_layer_depth_maxcreate_dl_layer_depth_maxCreateDlLayerDepthMaxCreateDlLayerDepthMaxCreateDlLayerDepthMaxcreate_dl_layer_depth_max 创建深度最大层。

参数 DLLayerInputDLLayerInputDLLayerInputDLLayerInputDLLayerInputdllayer_input 确定输入层,并期望该层句柄作为值。

根据 DepthMaxModeDepthMaxModeDepthMaxModeDepthMaxModedepthMaxModedepth_max_mode,可能存在两种输出层:

注意:仅当请求此类输出层时才需设置这些参数(参见 DepthMaxModeDepthMaxModeDepthMaxModeDepthMaxModedepthMaxModedepth_max_mode)。

参数 LayerNameLayerNameLayerNameLayerNamelayerNamelayer_name 根据 DepthMaxModeDepthMaxModeDepthMaxModeDepthMaxModedepthMaxModedepth_max_mode 定义输出层的名称:

请注意,若使用 create_dl_modelcreate_dl_modelCreateDlModelCreateDlModelCreateDlModelcreate_dl_model 创建模型,则创建网络中的每个层必须具有唯一名称。

模式 DepthMaxModeDepthMaxModeDepthMaxModeDepthMaxModedepthMaxModedepth_max_mode 指示实际作为输出返回的深度最大值。支持以下取值:

'argmax'"argmax""argmax""argmax""argmax""argmax"

最大值的 depth 索引返回在 DLLayerDepthMaxArgDLLayerDepthMaxArgDLLayerDepthMaxArgDLLayerDepthMaxArgDLLayerDepthMaxArgdllayer_depth_max_arg 中。

'value'"value""value""value""value""value"

最大值本身返回在 DLLayerDepthMaxValueDLLayerDepthMaxValueDLLayerDepthMaxValueDLLayerDepthMaxValueDLLayerDepthMaxValuedllayer_depth_max_value 中。

'argmax_and_value'"argmax_and_value""argmax_and_value""argmax_and_value""argmax_and_value""argmax_and_value"

两者均被返回:最大值的 depth 索引在输出层 DLLayerDepthMaxArgDLLayerDepthMaxArgDLLayerDepthMaxArgDLLayerDepthMaxArgDLLayerDepthMaxArgdllayer_depth_max_arg 中,最大值本身在输出层 DLLayerDepthMaxValueDLLayerDepthMaxValueDLLayerDepthMaxValueDLLayerDepthMaxValueDLLayerDepthMaxValuedllayer_depth_max_value 中。

以下泛型参数 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_depth_maxcreate_dl_layer_depth_maxCreateDlLayerDepthMaxCreateDlLayerDepthMaxCreateDlLayerDepthMaxcreate_dl_layer_depth_max 算子创建的层,其特定参数可通过其他算子进行设置与检索。下表概述了可通过 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_paramget_dl_layer_paramget_dl_layer_paramGetDlLayerParamGetDlLayerParamGetDlLayerParamget_dl_layer_param 检索的参数。请注意,算子 set_dl_model_layer_paramset_dl_model_layer_paramSetDlModelLayerParamSetDlModelLayerParamSetDlModelLayerParamset_dl_model_layer_paramget_dl_model_layer_paramget_dl_model_layer_paramGetDlModelLayerParamGetDlModelLayerParamGetDlModelLayerParamget_dl_model_layer_param 需基于 create_dl_modelcreate_dl_modelCreateDlModelCreateDlModelCreateDlModelcreate_dl_model 创建的模型。

层参数 设置 获取
'input_layer'"input_layer""input_layer""input_layer""input_layer""input_layer" (DLLayerInputDLLayerInputDLLayerInputDLLayerInputDLLayerInputdllayer_input)
'mode'"mode""mode""mode""mode""mode" (DepthMaxModeDepthMaxModeDepthMaxModeDepthMaxModedepthMaxModedepth_max_mode)
'name'"name""name""name""name""name" (LayerNameLayerNameLayerNameLayerNamelayerNamelayer_name)
'output_layer'"output_layer""output_layer""output_layer""output_layer""output_layer" (DLLayerDepthMaxArgDLLayerDepthMaxArgDLLayerDepthMaxArgDLLayerDepthMaxArgDLLayerDepthMaxArgdllayer_depth_max_arg 和/或 DLLayerDepthMaxValueDLLayerDepthMaxValueDLLayerDepthMaxValueDLLayerDepthMaxValueDLLayerDepthMaxValuedllayer_depth_max_value)
'shape'"shape""shape""shape""shape""shape"
'type'"type""type""type""type""type"
泛型层参数 设置 获取
'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*)

输出层的名称。

DepthMaxModeDepthMaxModeDepthMaxModeDepthMaxModedepthMaxModedepth_max_mode (输入控制)  string HTuplestrHTupleHtuple (string) (string) (HString) (char*)

返回值类型的指示模式。

默认值: 'argmax' "argmax" "argmax" "argmax" "argmax" "argmax"

值列表: 'argmax'"argmax""argmax""argmax""argmax""argmax", 'argmax_and_value'"argmax_and_value""argmax_and_value""argmax_and_value""argmax_and_value""argmax_and_value", 'value'"value""value""value""value""value"

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"

DLLayerDepthMaxArgDLLayerDepthMaxArgDLLayerDepthMaxArgDLLayerDepthMaxArgDLLayerDepthMaxArgdllayer_depth_max_arg (输出控制)  dl_layer(-array) HDlLayer, HTupleSequence[HHandle]HTupleHtuple (handle) (IntPtr) (HHandle) (handle)

可选,深度最大层,模式为 'argmax'"argmax""argmax""argmax""argmax""argmax"

DLLayerDepthMaxValueDLLayerDepthMaxValueDLLayerDepthMaxValueDLLayerDepthMaxValueDLLayerDepthMaxValuedllayer_depth_max_value (输出控制)  dl_layer(-array) HDlLayer, HTupleSequence[HHandle]HTupleHtuple (handle) (IntPtr) (HHandle) (handle)

可选,深度最大层,模式为 'value'"value""value""value""value""value"

模块

深度学习训练