[object Object]

[object Object][object Object]undefined
[object Object]
  • Description: Implements the AdamW optimizer function.

  • 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:

    aclnnStatus: 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:

    aclnnStatus: status code. For details, see .

[object Object]

If the data types of varRef, mRef, and vRef in the input tensor are the same, the data type can be FLOAT16, BFLOAT16, or FLOAT32.

  • Deterministic compute:
    • aclnnApplyAdamWV2 defaults to a deterministic implementation.
[object Object]

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

[object Object]