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

Function step

normalizing_flow/main.py:37–41  ·  view source on GitHub ↗
(x)

Source from the content-addressed store, hash-verified

35
36 @partial(mx.compile, inputs=state, outputs=state)
37 def step(x):
38 loss_and_grad_fn = nn.value_and_grad(model, loss_fn)
39 loss, grads = loss_and_grad_fn(model, x)
40 optimizer.update(model, grads)
41 return loss
42
43 with trange(args.n_steps) as steps:
44 for it in steps:

Callers 1

mainFunction · 0.70

Calls 1

updateMethod · 0.45

Tested by

no test coverage detected