Hi
My softmax funtion output doesn’t match the expected output, no sure what’s wrong with it, and why do the expected outputs not sum p to 1?
Here is my softmax implementation:
# UNIT TEST COMMENT: Candidate for Table Driven Tests
# UNQ_C2 GRADED FUNCTION: softmax
def softmax(z):
# mentor edit: code removed
and the output of the test:
Test the function
tmp = np.array([[1,2,3],
[1,1,1]
])
tmp_sm = softmax(tmp)
display(tmp_sm)
array([[0.09003057, 0.24472847, 0.66524096],
[0.33333333, 0.33333333, 0.33333333]])
array([[0.5 , 0.73105858, 0.88079708],
[0.5 , 0.26894142, 0.11920292]])
When creating a post, please add:
* Week # must be added in the tags option of the post.
* Link to the classroom item you are referring to:
* Description (include relevant info but please do not post solution code or your entire notebook)
https://www.coursera.org/learn/probabilistic-models-in-nlp/programming/OrMrl/word-embeddings/lab?workspaceGatewayHost=hub.labs.coursera.org&path=%2Fnotebooks%2FC2_W4_Assignment.ipynb