MCPcopy Create free account
hub / github.com/LeCAR-Lab/model-based-diffusion / loss

Function loss

mbd/blackbox/mbd_mnist.py:158–161  ·  view source on GitHub ↗
(params, batch)

Source from the content-addressed store, hash-verified

156
157
158def loss(params, batch):
159 inputs, targets = batch
160 preds = predict(params, inputs)
161 return -jnp.mean(jnp.sum(preds * targets, axis=1))
162
163
164def accuracy(params, batch):

Callers 1

eval_fnFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected