Skip to content

Commit

Permalink
Dates, getting nan_to_num order right
Browse files Browse the repository at this point in the history
  • Loading branch information
mnielsen committed Feb 11, 2015
1 parent 348541e commit b89484d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ free to fork and modify the code.

MIT License

Copyright (c) 2012-2013 Michael Nielsen
Copyright (c) 2012-2015 Michael Nielsen

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
Expand Down
2 changes: 1 addition & 1 deletion src/network2.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def fn(a, y):
to the correct value (0.0).
"""
return np.nan_to_num(np.sum(-y*np.log(a)-(1-y)*np.log(1-a)))
return np.sum(np.nan_to_num(-y*np.log(a)-(1-y)*np.log(1-a)))

@staticmethod
def delta(z, a, y):
Expand Down

0 comments on commit b89484d

Please sign in to comment.