[object Object]

[object Object][object Object]undefined
[object Object]
  • This API is used to implement the AdamW optimizer.

  • Formula:

    mt=β1mt1+(1β1)gtm_{t}=\beta_{1} m_{t-1}+\left(1-\beta_{1}\right) g_{t} \\ vt=β2vt1+(1β2)gt2v_{t}=\beta_{2} v_{t-1}+\left(1-\beta_{2}\right) g_{t}^{2} m^t=mt1β1t\hat{m}_{t}=\frac{m_{t}}{1-\beta_{1}^{t}} \\ v^t=vt1β2t\hat{v}_{t}=\frac{v_{t}}{1-\beta_{2}^{t}} \\ θt+1=θtηv^t+ϵm^tηλθt1\theta_{t+1}=\theta_{t}-\frac{\eta}{\sqrt{\hat{v}_{t}}+\epsilon} \hat{m}_{t}-\eta \cdot \lambda \cdot \theta_{t-1}
[object Object]

Each operator has calls. First, aclnnApplyAdamWV2GetWorkspaceSize is called to obtain the workspace size required for computation and the executor that contains the operator computation process. Then, aclnnApplyAdamWV2 is called to perform 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]
  • The data types of varRef, mRef, vRef, and grad in the input tensor must be the same. The supported data types are FLOAT16, BFLOAT16, and FLOAT32.
  • The shapes of varRef, mRef, vRef, and grad in the input tensor must be the same.
  • Deterministic compute:
    • aclnnApplyAdamWV2 defaults to a deterministic implementation.
[object Object]

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

[object Object]