Skip to content

Instantly share code, notes, and snippets.

@agastidukare
Created April 1, 2020 02:04
Show Gist options
  • Save agastidukare/8b1c9a4f16dab0518015e5df616e3c14 to your computer and use it in GitHub Desktop.
Save agastidukare/8b1c9a4f16dab0518015e5df616e3c14 to your computer and use it in GitHub Desktop.
def accuracy(params, batch):
inputs, targets = batch
target_class = np.argmax(targets, axis=1)
predicted_class = np.argmax(predict(params, inputs), axis=1)
return np.mean(predicted_class == target_class), target_class, predicted_class
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment