Created
October 1, 2018 17:30
-
-
Save neuromusic/a12c3de5d976f28578ce817977c5d327 to your computer and use it in GitHub Desktop.
pure python argmax
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def argmax(vals): | |
return max( | |
range(len(vals)), | |
key = lambda ii: vals[ii], | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
cheers mate