<!--
{
  "availability" : [
    "iOS: 15.0.0 - 17.4.0",
    "iPadOS: 15.0.0 - 17.4.0",
    "macCatalyst: 15.0.0 - 17.4.0",
    "macOS: 12.0.0 - 14.3.0",
    "tvOS: 15.0.0 - 17.4.0"
  ],
  "documentType" : "symbol",
  "framework" : "MLCompute",
  "identifier" : "/documentation/MLCompute/MLCAdamWOptimizer",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "ML Compute"
    ],
    "preciseIdentifier" : "c:objc(cs)MLCAdamWOptimizer"
  },
  "title" : "MLCAdamWOptimizer"
}
-->

# MLCAdamWOptimizer

An optimizer that represents the Adam algorithm with weight decay.

```
class MLCAdamWOptimizer
```

## Topics

### Creating an AdamW Optimizer

[`init(descriptor:)`](/documentation/MLCompute/MLCAdamWOptimizer/init(descriptor:))

Creates a default optimizer with the descriptor you specify.

[`init(descriptor:beta1:beta2:epsilon:usesAMSGrad:timeStep:)`](/documentation/MLCompute/MLCAdamWOptimizer/init(descriptor:beta1:beta2:epsilon:usesAMSGrad:timeStep:))

Creates an AdamW optimizer with the values you specify.

### Inspecting an AdamW Optimizer

[`beta1`](/documentation/MLCompute/MLCAdamWOptimizer/beta1)

The coefficent for computing running averages of gradient.

[`beta2`](/documentation/MLCompute/MLCAdamWOptimizer/beta2)

The coefficent for computing running averages of square of gradient.

[`epsilon`](/documentation/MLCompute/MLCAdamWOptimizer/epsilon)

The epsilon value for improving numerical stability.

[`timeStep`](/documentation/MLCompute/MLCAdamWOptimizer/timeStep)

The initial timestep for the update.

[`usesAMSGrad`](/documentation/MLCompute/MLCAdamWOptimizer/usesAMSGrad)

A Boolean value that indicates whether to use a variant of the algorithm.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)