Dinosaur Island, sample function

hello there, this function is a little confusing to me, I’ve tried different ways, but it’s still unsolved, any help please.Untitled

There’s nothing wrong with that line of code.
There may be a problem with how you computed ‘y’ as part of Step 2.

I defined y as softmax function of z, but it is after this line( according to default structure) and that’s the reason of error.
a = …
z = …
y = np.softmax(…)
z as input of softmax

That leads to the possibility that your code for ‘a’ or ‘z’ is incorrect.

Please send me your code for this function using a private message. I’ll review it and provide comments.