create_dl_layer_input T_create_dl_layer_input CreateDlLayerInput CreateDlLayerInput create_dl_layer_input (Operator)
Name
create_dl_layer_input T_create_dl_layer_input CreateDlLayerInput CreateDlLayerInput create_dl_layer_input
— Create an input layer.
Signature
void CreateDlLayerInput (const HTuple& LayerName , const HTuple& Shape , const HTuple& GenParamName , const HTuple& GenParamValue , HTuple* DLLayerInput )
void HDlLayer ::HDlLayer (const HString& LayerName , const HTuple& Shape , const HTuple& GenParamName , const HTuple& GenParamValue )
void HDlLayer ::HDlLayer (const HString& LayerName , const HTuple& Shape , const HString& GenParamName , const HString& GenParamValue )
void HDlLayer ::HDlLayer (const char* LayerName , const HTuple& Shape , const char* GenParamName , const char* GenParamValue )
void HDlLayer ::HDlLayer (const wchar_t* LayerName , const HTuple& Shape , const wchar_t* GenParamName , const wchar_t* GenParamValue )
(
Windows only)
void HDlLayer ::CreateDlLayerInput (const HString& LayerName , const HTuple& Shape , const HTuple& GenParamName , const HTuple& GenParamValue )
void HDlLayer ::CreateDlLayerInput (const HString& LayerName , const HTuple& Shape , const HString& GenParamName , const HString& GenParamValue )
void HDlLayer ::CreateDlLayerInput (const char* LayerName , const HTuple& Shape , const char* GenParamName , const char* GenParamValue )
void HDlLayer ::CreateDlLayerInput (const wchar_t* LayerName , const HTuple& Shape , const wchar_t* GenParamName , const wchar_t* GenParamValue )
(
Windows only)
static void HOperatorSet .CreateDlLayerInput (HTuple layerName , HTuple shape , HTuple genParamName , HTuple genParamValue , out HTuple DLLayerInput )
public HDlLayer (string layerName , HTuple shape , HTuple genParamName , HTuple genParamValue )
public HDlLayer (string layerName , HTuple shape , string genParamName , string genParamValue )
void HDlLayer .CreateDlLayerInput (string layerName , HTuple shape , HTuple genParamName , HTuple genParamValue )
void HDlLayer .CreateDlLayerInput (string layerName , HTuple shape , string genParamName , string genParamValue )
Description
The operator create_dl_layer_input create_dl_layer_input CreateDlLayerInput CreateDlLayerInput create_dl_layer_input
creates an input layer with
spatial dimensions given by Shape Shape Shape shape shape
whose handle is returned in
DLLayerInput DLLayerInput DLLayerInput DLLayerInput dllayer_input
.
The parameter LayerName LayerName LayerName layerName layer_name
sets an individual layer name.
Note that if creating a model using create_dl_model create_dl_model CreateDlModel CreateDlModel create_dl_model
each layer of
the created network must have a unique name.
When the created model is applied using e.g., apply_dl_model apply_dl_model ApplyDlModel ApplyDlModel apply_dl_model
or
train_dl_model_batch train_dl_model_batch TrainDlModelBatch TrainDlModelBatch train_dl_model_batch
, it must be possible to map an input with its
corresponding input layer.
Operators applying a model expect a feeding dictionary DLSample
,
see Deep Learning / Model .
The mentioned mapping is done using dictionary entries, where the key
matches the input layer name. Thus, for an input of this layer a sample
dictionary will need an entry with the key LayerName LayerName LayerName layerName layer_name
(except if the
'input_type' "input_type" "input_type" "input_type" "input_type" is set to 'constant' "constant" "constant" "constant" "constant" , see below).
The parameter Shape Shape Shape shape shape
defines the shape of the input values (the
values given in the feeding dictionary DLSample
) and
must be a tuple of length three, containing width
,
height
, and depth
of the input. The tuple values must be
given as integer values and have have different meaning
depending on the input type:
for an input image the layer Shape Shape Shape shape shape
defines the image size.
Images shall be given with type real
(for information on image types see Image ).
for an input tuple its length will need to match the product of the
individual values in Shape Shape Shape shape shape
, i.e., width
height
depth
.
Tuple values are distributed along the column- (width
), row-
(height
), and depth
-axes in this order.
Input tuple values can be given either as integer
or real
.
The batch size has to be set later with
set_dl_model_param set_dl_model_param SetDlModelParam SetDlModelParam set_dl_model_param
, once the model has been created by
create_dl_model create_dl_model CreateDlModel CreateDlModel create_dl_model
.
The following generic parameters GenParamName GenParamName GenParamName genParamName gen_param_name
and the corresponding
values GenParamValue GenParamValue GenParamValue genParamValue gen_param_value
are supported:
'allow_smaller_tuple' "allow_smaller_tuple" "allow_smaller_tuple" "allow_smaller_tuple" "allow_smaller_tuple" :
For tuple inputs, setting
'allow_smaller_tuple' "allow_smaller_tuple" "allow_smaller_tuple" "allow_smaller_tuple" "allow_smaller_tuple" to 'true' "true" "true" "true" "true" allows to have an
input tuple with less values than the total dimension given by
Shape Shape Shape shape shape
.
E.g., this can be the case if an input corresponds to the number of
objects within one image and the number of objects changes from
image to image. If fewer than the maximum number of values given
by the total dimension of Shape Shape Shape shape shape
are present, the
remaining values are set to zero.
Shape Shape Shape shape shape
should be set such that it fits the maximum expected
length. For the example above this would be the maximum number of
objects within one image present in the whole dataset.
Default:
'false' "false" "false" "false" "false" .
'const_val' "const_val" "const_val" "const_val" "const_val" :
Constant output value.
Restriction:
Only an integer or float is settable. This value is only settable or
gettable if 'input_type' "input_type" "input_type" "input_type" "input_type" is set to 'constant' "constant" "constant" "constant" "constant" .
Default:
0.0 .
'input_type' "input_type" "input_type" "input_type" "input_type" :
Defines the type of input that is expected.
The following values are possible:
'default' "default" "default" "default" "default" :
The layer expects a number of input images
corresponding to the batch size.
'region_to_bin' "region_to_bin" "region_to_bin" "region_to_bin" "region_to_bin" :
The layer
expects a tuple of regions as input and internally converts it to a
binary image where each region is encoded in one depth channel. Regions
reaching out of the given dimensions are clipped to the width and height
given by Shape Shape Shape shape shape
. The maximum number of regions is defined by the
depth of Shape Shape Shape shape shape
. If fewer than the maximum number of regions are
given, the output is filled up with empty (zero) images. For example,
this can be the case if the regions are corresponding to objects within
an image and the number of objects changes from image to image.
'constant' "constant" "constant" "constant" "constant" :
The layer does
not expect any key value pair in the input
dictionary. Instead all entries within the output of this layer are
filled with the value given by 'const_val' "const_val" "const_val" "const_val" "const_val" .
Default:
'default' "default" "default" "default" "default" .
'is_inference_output' "is_inference_output" "is_inference_output" "is_inference_output" "is_inference_output" :
Determines whether apply_dl_model apply_dl_model ApplyDlModel ApplyDlModel apply_dl_model
will include the output of this
layer in the dictionary DLResultBatch DLResultBatch DLResultBatch DLResultBatch dlresult_batch
even without specifying this
layer in Outputs Outputs Outputs outputs outputs
('true' "true" "true" "true" "true" ) or not ('false' "false" "false" "false" "false" ).
Default:
'false' "false" "false" "false" "false"
Certain parameters of layers created using create_dl_layer_input create_dl_layer_input CreateDlLayerInput CreateDlLayerInput create_dl_layer_input
can be set and retrieved using further operators.
The following tables give an overview, which parameters can be set
using set_dl_model_layer_param set_dl_model_layer_param SetDlModelLayerParam SetDlModelLayerParam set_dl_model_layer_param
and which ones can be retrieved
using get_dl_model_layer_param get_dl_model_layer_param GetDlModelLayerParam GetDlModelLayerParam get_dl_model_layer_param
or get_dl_layer_param get_dl_layer_param GetDlLayerParam GetDlLayerParam get_dl_layer_param
. Note, the
operators set_dl_model_layer_param set_dl_model_layer_param SetDlModelLayerParam SetDlModelLayerParam set_dl_model_layer_param
and get_dl_model_layer_param get_dl_model_layer_param GetDlModelLayerParam GetDlModelLayerParam get_dl_model_layer_param
require a model created by create_dl_model create_dl_model CreateDlModel CreateDlModel create_dl_model
.
Generic Layer Parameters
set
get
'allow_smaller_tuple' "allow_smaller_tuple" "allow_smaller_tuple" "allow_smaller_tuple" "allow_smaller_tuple"
x
'const_val' "const_val" "const_val" "const_val" "const_val"
(x)
(x)
'input_type' "input_type" "input_type" "input_type" "input_type"
x
'is_inference_output' "is_inference_output" "is_inference_output" "is_inference_output" "is_inference_output"
x
x
'num_trainable_params' "num_trainable_params" "num_trainable_params" "num_trainable_params" "num_trainable_params"
x
Execution Information
Multithreading type: reentrant (runs in parallel with non-exclusive operators).
Multithreading scope: global (may be called from any thread).
Processed without parallelization.
This operator returns a handle. Note that the state of an instance of this handle type may be changed by specific operators even though the handle is used as an input parameter by those operators.
Parameters
LayerName LayerName LayerName layerName layer_name
(input_control) string →
HTuple str HTuple Htuple (string) (string ) (HString ) (char* )
Name of the output layer.
Shape Shape Shape shape shape
(input_control) number-array →
HTuple Sequence[int] HTuple Htuple (integer) (int / long) (Hlong ) (Hlong )
Dimensions of the input (width, height, depth).
Default:
[224,224,3]
GenParamName GenParamName GenParamName genParamName gen_param_name
(input_control) attribute.name(-array) →
HTuple MaybeSequence[str] HTuple Htuple (string) (string ) (HString ) (char* )
Generic input parameter names.
Default:
[]
List of values:
'allow_smaller_tuple' "allow_smaller_tuple" "allow_smaller_tuple" "allow_smaller_tuple" "allow_smaller_tuple" , 'const_val' "const_val" "const_val" "const_val" "const_val" , 'input_type' "input_type" "input_type" "input_type" "input_type" , 'is_inference_output' "is_inference_output" "is_inference_output" "is_inference_output" "is_inference_output"
GenParamValue GenParamValue GenParamValue genParamValue gen_param_value
(input_control) attribute.value(-array) →
HTuple MaybeSequence[Union[int, float, str]] HTuple Htuple (string / integer / real) (string / int / long / double) (HString / Hlong / double) (char* / Hlong / double)
Generic input parameter values.
Default:
[]
Suggested values:
0.0, 'constant' "constant" "constant" "constant" "constant" , 'default' "default" "default" "default" "default" , 'false' "false" "false" "false" "false" , 'region_to_bin' "region_to_bin" "region_to_bin" "region_to_bin" "region_to_bin" , 'true' "true" "true" "true" "true"
DLLayerInput DLLayerInput DLLayerInput DLLayerInput dllayer_input
(output_control) dl_layer →
HDlLayer , HTuple HHandle HTuple Htuple (handle) (IntPtr ) (HHandle ) (handle )
Input layer.
Example (HDevelop)
* Create a model for summation.
create_dl_layer_input ('input_a', [2, 3, 4], [], [], DLLayerInputA)
create_dl_layer_input ('input_b', [2, 3, 4], [], [], DLLayerInputB)
create_dl_layer_elementwise ([DLLayerInputA, DLLayerInputB], 'sum', \
'sum', [], [], [], DLLayerElementWise)
create_dl_model (DLLayerElementWise, DLModel)
set_dl_model_param (DLModel, 'runtime', 'cpu')
*
* Add 'input_a' as an inference model output.
set_dl_model_layer_param (DLModel, 'input_a', 'is_inference_output', 'true')
*
* Feed input data as tuple (a) or image (b).
create_dict (Sample)
set_dict_tuple (Sample, 'input_a', [1:(2*3*4)])
gen_empty_obj (InputB)
for I := 1 to 4 by 1
gen_image_const (Channel, 'real', 2, 3)
get_region_points (Channel, Rows, Cols)
set_grayval (Channel, Rows, Cols, gen_tuple_const(|Rows|, I))
append_channel (InputB, Channel, InputB)
endfor
set_dict_object (InputB, Sample, 'input_b')
*
* Apply the model for summation and get results.
set_dl_model_param (DLModel, 'batch_size', 2)
apply_dl_model (DLModel, [Sample,Sample], [], Result)
get_dict_object (Sum, Result[0], 'sum')
get_dict_object (TupleInputA, Result[1], 'input_a')
Possible Successors
create_dl_layer_activation create_dl_layer_activation CreateDlLayerActivation CreateDlLayerActivation create_dl_layer_activation
,
create_dl_layer_batch_normalization create_dl_layer_batch_normalization CreateDlLayerBatchNormalization CreateDlLayerBatchNormalization create_dl_layer_batch_normalization
,
create_dl_layer_class_id_conversion create_dl_layer_class_id_conversion CreateDlLayerClassIdConversion CreateDlLayerClassIdConversion create_dl_layer_class_id_conversion
,
create_dl_layer_class_id_conversion create_dl_layer_class_id_conversion CreateDlLayerClassIdConversion CreateDlLayerClassIdConversion create_dl_layer_class_id_conversion
,
create_dl_layer_concat create_dl_layer_concat CreateDlLayerConcat CreateDlLayerConcat create_dl_layer_concat
,
create_dl_layer_convolution create_dl_layer_convolution CreateDlLayerConvolution CreateDlLayerConvolution create_dl_layer_convolution
,
create_dl_layer_dense create_dl_layer_dense CreateDlLayerDense CreateDlLayerDense create_dl_layer_dense
,
create_dl_layer_depth_max create_dl_layer_depth_max CreateDlLayerDepthMax CreateDlLayerDepthMax create_dl_layer_depth_max
,
create_dl_layer_dropout create_dl_layer_dropout CreateDlLayerDropout CreateDlLayerDropout create_dl_layer_dropout
,
create_dl_layer_elementwise create_dl_layer_elementwise CreateDlLayerElementwise CreateDlLayerElementwise create_dl_layer_elementwise
,
create_dl_layer_loss_cross_entropy create_dl_layer_loss_cross_entropy CreateDlLayerLossCrossEntropy CreateDlLayerLossCrossEntropy create_dl_layer_loss_cross_entropy
,
create_dl_layer_loss_ctc create_dl_layer_loss_ctc CreateDlLayerLossCtc CreateDlLayerLossCtc create_dl_layer_loss_ctc
,
create_dl_layer_loss_distance create_dl_layer_loss_distance CreateDlLayerLossDistance CreateDlLayerLossDistance create_dl_layer_loss_distance
,
create_dl_layer_loss_focal create_dl_layer_loss_focal CreateDlLayerLossFocal CreateDlLayerLossFocal create_dl_layer_loss_focal
,
create_dl_layer_loss_huber create_dl_layer_loss_huber CreateDlLayerLossHuber CreateDlLayerLossHuber create_dl_layer_loss_huber
,
create_dl_layer_lrn create_dl_layer_lrn CreateDlLayerLrn CreateDlLayerLrn create_dl_layer_lrn
,
create_dl_layer_pooling create_dl_layer_pooling CreateDlLayerPooling CreateDlLayerPooling create_dl_layer_pooling
,
create_dl_layer_reduce create_dl_layer_reduce CreateDlLayerReduce CreateDlLayerReduce create_dl_layer_reduce
,
create_dl_layer_reshape create_dl_layer_reshape CreateDlLayerReshape CreateDlLayerReshape create_dl_layer_reshape
,
create_dl_layer_softmax create_dl_layer_softmax CreateDlLayerSoftmax CreateDlLayerSoftmax create_dl_layer_softmax
,
create_dl_layer_transposed_convolution create_dl_layer_transposed_convolution CreateDlLayerTransposedConvolution CreateDlLayerTransposedConvolution create_dl_layer_transposed_convolution
,
create_dl_layer_zoom_factor create_dl_layer_zoom_factor CreateDlLayerZoomFactor CreateDlLayerZoomFactor create_dl_layer_zoom_factor
,
create_dl_layer_zoom_size create_dl_layer_zoom_size CreateDlLayerZoomSize CreateDlLayerZoomSize create_dl_layer_zoom_size
,
create_dl_layer_zoom_to_layer_size create_dl_layer_zoom_to_layer_size CreateDlLayerZoomToLayerSize CreateDlLayerZoomToLayerSize create_dl_layer_zoom_to_layer_size
Module
Deep Learning Professional