Advertisement
Guest User

Untitled

a guest
Feb 29th, 2020
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.18 KB | None | 0 0
  1.  
  2.     probs = softmax(predictions)
  3.     loss = cross_entropy_loss(probs, target_index)
  4.     sub = np.zeros(predictions.shape)
  5.     sub[target_index] = 1
  6.     dprediction = probs - sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement