FilesLast commitLast update
22 days ago
3 months ago
2 months ago
23 days ago
3 months ago
23 days ago
1 month ago
15 days ago
15 days ago
README

DropOutV3Grad

English | 简体中文

Product Support Status

Product Supported
Ascend 950PR&950DT products √
Atlas A3 products ×
Atlas A2 products ×
Atlas 200I/500 A2 inference products ×
Atlas inference products ×
Atlas training products ×

Function Description

  • Operator function: the Dropout operator dedicated to the backward process. During training, the elements in the input gradY are scaled up by scale or set to zero according to the values of the corresponding bits in mask.

  • Computation formula:

    gradXi=gradYi∗maski∗scalegradX_i = gradY_i * mask_i * scale

Parameter Description

Parameter Name Input/Output/Attribute Description Data Type Data Format
grad_y Input Input gradY_i in the formula, which is the backward gradient input. Dimensions 0-8 are supported for the shape. FLOAT, FLOAT16, BFLOAT16 ND
mask Input Input mask_i in the formula, which is the mask bit corresponding to the i-th element of gradY. The value is 0 (discard) or 1 (keep). The data is of the bit type stored in the UINT8 type, and the shape must be (align(number of elements of grad_y, 128)/8). UINT8 ND
scale Input Input scale in the formula, which is the scaling factor used to compute the scaling ratio of the output data. The range is not verified, and the computation is performed directly as gradY*mask*scale. In normal services, scale comes from the forward 1/(1-p), that is, it is 0 or greater than or equal to 1. FLOAT ND
grad_x Output gradX_i in the formula, which is the backward gradient output. The data type must be a data type to which grad_y can be converted, and the shape must be the same as that of grad_y. FLOAT, FLOAT16, BFLOAT16 ND

Constraint Description

  1. The range of scale is not verified, and any value is computed directly as gradY×\timesmask×\timesscale. In normal services, scale comes from the forward 1/(1-p), that is, it is 0 or greater than or equal to 1.

  2. The data type of mask is UINT8, and its shape must satisfy the following condition:

    mask_shape=align(num(grad_y),128)8\text{mask\_shape} = \frac{\text{align}(\text{num}(grad\_y), 128)}{8}

  3. Dimensions 0-8 are supported.

Invocation Description

Invocation Method Invocation Sample Description
aclnn invocation test_aclnn_drop_out_v3_grad Invokes the DropOutV3Grad operator through the aclnnDropoutV3Grad API.