DML_LOCAL_RESPONSE_NORMALIZATION_GRAD_OPERATOR_DESC structure (directml.h)

Computes backpropagation gradients for local response normalization.

The data type and size of all tensors must be the same.

Syntax

struct DML_LOCAL_RESPONSE_NORMALIZATION_GRAD_OPERATOR_DESC {
  const DML_TENSOR_DESC *InputTensor;
  const DML_TENSOR_DESC *InputGradientTensor;
  const DML_TENSOR_DESC *OutputGradientTensor;
  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 }.

InputGradientTensor

Type: const DML_TENSOR_DESC*

The incoming gradient tensor. This is typically obtained from the output of backpropagation of a preceding layer.

OutputGradientTensor

Type: const DML_TENSOR_DESC*

An output tensor containing the backpropagated gradients.

CrossChannel

Type: BOOL

TRUE if the LRN layer sums across channels; FALSE if the LRN layer sums across spatial dimensions.

LocalSize

Type: UINT

The maximum number of elements to sum over per dimension (the local region is clipped so that all elements are within bounds). If CrossChannel is TRUE, then this is the width and height of the local region. If CrossChannel is FALSE, then this is the number of elements in the local region. This value must be at least 1.

Alpha

Type: FLOAT

The value of the scaling parameter. We recommend a value of 0.0001 as default.

Beta

Type: FLOAT

The value of the exponent. We recommend a value of 0.75 as default.

Bias

Type: FLOAT

The value of bias. We recommend a value of 1 as default.

Remarks

Availability

This operator was introduced in DML_FEATURE_LEVEL_3_1.

Tensor constraints

InputGradientTensor, InputTensor, and OutputGradientTensor must have the same DataType and Sizes.

Tensor support

Tensor Kind Supported dimension counts Supported data types
InputTensor Input 4 FLOAT32, FLOAT16
InputGradientTensor Input 4 FLOAT32, FLOAT16
OutputGradientTensor Output 4 FLOAT32, FLOAT16

Requirements

Requirement Value
Minimum supported client Windows Build 22000
Minimum supported server Windows Build 22000
Header directml.h