# mlx.optimizers.Optimizer — MLX 0.0.7 documentation

Skip to main content
`Ctrl`+`K`

# mlx.optimizers.Optimizer

class mlx.optimizers.Optimizer

  The base class for all optimizers. It allows us to implement an optimizer on a per-parameter basis and apply it to a parameter tree.

  state

    It holds the optimizer’s state dictionary.

    Type:

      OptimizerState

  Methods

  `__init__`() |
  `apply_gradients`(gradients, model) | Apply the gradients to the parameters and return the updated parameters.
  `apply_single`(gradient, parameter, state) | To be extended by the children classes to implement each optimizer's update.
  `update`(model, gradients) | Apply the gradients to the parameters of the model and update the model with the new parameters.