Skip to content

Commit

Permalink
sincerely fixed softmax
Browse files Browse the repository at this point in the history
  • Loading branch information
cipri-tom committed Jan 27, 2017
1 parent 760ab51 commit 3d5f73c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scripts/starter.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@

def softmax(x, tau):
""" Returns softmax probabilities with temperature tau"""
e_x = np.exp(x / tau)
x = x / tau
e_x = np.exp(x - np.max(x))
return e_x / e_x.sum()

class Agent():
Expand Down

0 comments on commit 3d5f73c

Please sign in to comment.