Skip to content

Instantly share code, notes, and snippets.

@danielcwq
Created November 28, 2021 05:48
Show Gist options
  • Save danielcwq/f8f9008af8455c4a5693d63edbbc8fde to your computer and use it in GitHub Desktop.
Save danielcwq/f8f9008af8455c4a5693d63edbbc8fde to your computer and use it in GitHub Desktop.
Creating the mnist_loss function
def mnist_loss(predictions, targets):
return torch.where(targets==1, 1-predictions, predictions).mean()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment