Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C2_W2_Assignment - advanced-learning-algorithms issued #2

Open
johnfelipe opened this issue Jun 19, 2022 · 4 comments
Open

C2_W2_Assignment - advanced-learning-algorithms issued #2

johnfelipe opened this issue Jun 19, 2022 · 4 comments

Comments

@johnfelipe
Copy link

z = np.array([1., 2., 3., 4.])
a = my_softmax(z)
atf = tf.nn.softmax(z)
print(f"my_softmax(z):         {a}")
print(f"tensorflow softmax(z): {atf}")

# BEGIN UNIT TEST  
test_my_softmax(my_softmax)
# END UNIT TEST  

with this error

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-4-9cac3ae3f00f> in <module>
      1 z = np.array([1., 2., 3., 4.])
----> 2 a = my_softmax(z)
      3 atf = tf.nn.softmax(z)
      4 print(f"my_softmax(z):         {a}")
      5 print(f"tensorflow softmax(z): {atf}")

<ipython-input-3-666c0ba803d5> in my_softmax(z)
     12 
     13     ### END CODE HERE ###
---> 14     return a

NameError: name 'a' is not defined

@kaieye
Copy link
Owner

kaieye commented Jun 19, 2022

In the function my_softmax, you should calculate the value a and return it, so that you can use the function properly.
And if you have calculated the" softmax of z", just return it .
If there are still problems, I‘d like to see the content of your entire function

@johnfelipe
Copy link
Author

SNAG-1307

@kaieye
Copy link
Owner

kaieye commented Jun 20, 2022

You should know that it's an assignment, so it's different from those labs, which can be run to finish without writing something.
Look at cell 3,there are
###START CODE HERE###

###END CODE HERE###
that means you should write something to fill the missing code

@usernameuiui
Copy link

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants