code: def accuracy(params, batch):
      inputs, targets = batch
      target_class = jnp.argmax(targets, axis=1)
      predicted_class = jnp.argmax(predict(params, inputs), axis=1)
      return jnp.mean(predicted_class == target_class)
  
file_path: jax/examples/mnist_classifier_fromscratch.py
imports: import time
  import numpy.random
  from jax import jit, grad
  from jax.scipy.special import logsumexp
  import jax.numpy
  from examples import datasets
label_desc: Use image node_id 4 for calling a global function with example usage: accuracy(params, batch) and returns: jnp