My current function is as follows:
def soft_max(z):
t = np.exp(z)
a = np.exp(z) / np.sum(t, axis=1)
return a
However I get the error: ValueError: operands could not be broadcast together with shapes (20,10) (20,)
since np.sum(t, axis=1) isn't a scalar.
I want to have t / the sum of each row
but I don't know how to do this.