[object Object][object Object][object Object]undefined
[object Object]
  • This API is used to implement the backpropagation of 1D convolution with the input and output dimensions being T** (time or spatial dimension), B (batch), and C (channel).

  • The calculation formula is as follows: Assume that the shape of the input inputinput of the Conv_tbc forward propagation is (Hin,N,Cin)(H_{\text{in}},N,C_{\text{in}}), the shape of the output gradient gradOutputgradOutput is (Hout,N,Cout)(H_{\text{out}},N,C_{\text{out}}), the shape of the convolution kernel weightweight is (K,Cin,Cout)(K,C_{\text{in}},C_{\text{out}}), and the shape of the bias biasbias is (Cout)(C_{\text{out}}). During backpropagation, the input padding is padpad. The relationship between the preceding parameters is as follows:

    Hout=Hin+2padK+1H_{out} = {H_{in} + 2 \cdot pad - K} + 1

    The backpropagation of convolution needs to calculate the gradients of the forward input tensor xx (corresponding to the input in the function prototype), convolution kernel weight tensor ww (corresponding to the weight in the function prototype), and bias bb (corresponding to the bias in the function prototype).

    • Gradient with respect to xx, Lx\frac{\partial L}{\partial x} (corresponding to the gradInput parameter in the function prototype):

      Lxt,b,cin=k=0K1cout=0Cout1Lytk,b,coutwk,cin,cout\frac{\partial L}{\partial x_{t,b,c_{in}}} = \sum_{k=0}^{K-1} \sum_{c_{out}=0}^{C_{out}-1} \frac{\partial L}{\partial y_{t-k,b,c_{out}}} \cdot w_{k,c_{in},c_{out}}

      NN indicates the batch size, CC indicates the number of channels, HH indicates the time or spatial dimension, and LL indicates the loss function. Ly\frac{\partial L}{\partial y} indicates the gradient of the output tensor yy to LL (corresponding to the self parameter in the function prototype).

    • Gradient with respect to ww, Lw\frac{\partial L}{\partial w} (corresponding to the gradWeight parameter in the function prototype):

      Lwk,cin,cout=b=0N1t=0Hout1xt+k,b,cinLyt,b,cout\frac{\partial L}{\partial w_{k,c_{in},c_{out}}} = \sum_{b=0}^{N-1} \sum_{t=0}^{H_{out}-1} x_{t+k,b,c_{in}} \cdot \frac{\partial L}{\partial y_{t,b,c_{out}}}
    • Gradient with respect to bb, Lb\frac{\partial L}{\partial b} (corresponding to the gradBias parameter in the function prototype):

      Lbcout=b=0N1t=0Hout1Lyt,b,cout\frac{\partial L}{\partial b_{c_{out}}} = \sum_{b=0}^{N-1}\sum_{t=0}^{H_{\text{out}}-1} \frac{\partial L}{\partial y_{t,b,c_{out}}}
[object Object]

Each operator has calls. You must call aclnnConvTbcBackwardGetWorkspaceSize to obtain the workspace size required for computation and the executor that contains the operator computation process, and then call aclnnConvTbcBackward to perform the computation.

[object Object]
[object Object]
[object Object]
  • Parameters

    [object Object]
  • Returns

    [object Object]: status code. For details, see .

    The first-phase API implements input parameter verification. The following errors may be thrown.

    [object Object]
[object Object]
  • Parameters

    [object Object]
  • Returns

    [object Object]: status code. For details, see .

[object Object]
  • Deterministic computation:
    • aclnnConvTbcBackward defaults to a non-deterministic implementation. You can call aclrtCtxSetSysParamOpt to enable deterministic computation.
[object Object][object Object]

The following example is for reference only. For details, see .

[object Object]