This file contains hidden or 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 softmax(x): | |
"""Calculates the softmax for each row of the input x. | |
Your code should work for a row vector and also for matrices of shape (n, m). | |
Argument: | |
x -- A numpy matrix of shape (n,m) | |
Returns: | |
s -- A numpy matrix equal to the softmax of x, of shape (n,m) |
NewerOlder