Skip to content

Instantly share code, notes, and snippets.

@AyishaR
Created March 15, 2021 03:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AyishaR/5d5a9c4aa96ae3c5415fbb5752f7f28c to your computer and use it in GitHub Desktop.
Save AyishaR/5d5a9c4aa96ae3c5415fbb5752f7f28c to your computer and use it in GitHub Desktop.
onehot_labels = np.zeros((input_labels.size, n_classes)).astype(np.int32)
onehot_labels[np.arange(input_labels.size), input_labels] = 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment