mlx.optimizers.OptimizerState#
- class mlx.optimizers.OptimizerState#
The optimizer state implements a recursively defined
collections.defaultdict
, namely a missing key in an optimizer state is anOptimizerState
.Note
OptimizerState.get()
in contrast to a normal dictionary also sets the key to thedefault
value if thekey
was not present in the dictionary.Methods
get
(key, default)If
key
doesn't exist set its value todefault
and then return it.