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

Function step

gcn/main.py:55–61  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

53
54 @partial(mx.compile, inputs=state, outputs=state)
55 def step():
56 loss_and_grad_fn = nn.value_and_grad(gcn, forward_fn)
57 (loss, y_hat), grads = loss_and_grad_fn(
58 gcn, x, adj, y, train_mask, args.weight_decay
59 )
60 optimizer.update(gcn, grads)
61 return loss, y_hat
62
63 best_val_loss = float("inf")
64 cnt = 0

Callers 1

mainFunction · 0.70

Calls 1

updateMethod · 0.45

Tested by

no test coverage detected