MCPcopy Create free account
hub / github.com/ml-explore/mlx / init_single

Method init_single

python/mlx/optimizers/optimizers.py:268–270  ·  view source on GitHub ↗

Initialize optimizer state

(self, parameter: mx.array, state: dict)

Source from the content-addressed store, hash-verified

266 self.nesterov = nesterov
267
268 def init_single(self, parameter: mx.array, state: dict):
269 """Initialize optimizer state"""
270 state["v"] = mx.zeros_like(parameter)
271
272 def apply_single(self, gradient: mx.array, parameter: mx.array, state: dict):
273 """Performs the SGD parameter update and stores :math:`v` in the

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected