DML_LOCAL_RESPONSE_NORMALIZATION_OPERATOR_DESC structure (directml.h)
Performs a local response normalization (LRN) function on the input. This operator performs the following computation.
Output = Input / (Bias + (Alpha / LocalSize) * sum(Input^2 for every Input in the local region))^Beta
The data type and size of the input and output tensors must be the same.
Syntax
struct DML_LOCAL_RESPONSE_NORMALIZATION_OPERATOR_DESC {
const DML_TENSOR_DESC *InputTensor;
const DML_TENSOR_DESC *OutputTensor;
BOOL CrossChannel;
UINT LocalSize;
FLOAT Alpha;
FLOAT Beta;
FLOAT Bias;
};
Members
InputTensor
Type: const DML_TENSOR_DESC*
The tensor containing the input data. This tensor's Sizes should be { BatchCount, ChannelCount, Height, Width }
.
OutputTensor
Type: const DML_TENSOR_DESC*
The tensor to write the results to. This tensor's Sizes should match the InputTensor.
CrossChannel
Type: BOOL
TRUE if the LRN layer sums across channels; otherwise, FALSE.
LocalSize
Type: UINT
The number of elements to sum over per dimension: Width, Height, and optionally Channel (if CrossChannel is set). This value must be at least 1.
Alpha
Type: FLOAT
The value of the scaling parameter. A value of 0.0001 is recommended as default.
Beta
Type: FLOAT
The value of the exponent. A value of 0.75 is recommended as default.
Bias
Type: FLOAT
The value of bias. A value of 1 is recommended as default.
Availability
This operator was introduced in DML_FEATURE_LEVEL_1_0
.
Tensor constraints
InputTensor and OutputTensor must have the same DataType and Sizes.
Tensor support
Tensor | Kind | Supported dimension counts | Supported data types |
---|---|---|---|
InputTensor | Input | 4 | FLOAT32, FLOAT16 |
OutputTensor | Output | 4 | FLOAT32, FLOAT16 |
Requirements
Requirement | Value |
---|---|
Header | directml.h |