python - Trying to compute softmax values, getting ...
https://stackoverflow.com/questions/35703963Look at the type and shape of variables in your code. x is a 1d array; scores is 2d (3 rows):. In [535]: x.shape Out[535]: (80,) In [536]: scores.shape Out[536]: (3, 80) softmax produces a list of 3 items; the first is the number 0, the rest are arrays with shape like x.. In [537]: s=softmax(scores) In [538]: len(s) Out[538]: 3 In [539]: s[0] Out[539]: 0 In [540]: s[1].shape Out[540]: (80,) In ...