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

There is a mistake in Logistic_Regression_with_a_Neural_Network_mindset_v6a #7

Open
SoliGalaxy opened this issue Aug 2, 2024 · 0 comments

Comments

@SoliGalaxy
Copy link

In the assignment, you made a mistake that you cannot simply reshape a matrix by using code like this (suppose A is a 2 * 3 matrix):
A.reshape(3,2)
Instead, you should reshape it like this:
A.reshape(2,3).T
The specific place the mistake you made is:

START CODE HERE ### (≈ 2 lines of code)

train_set_x_flatten = train_set_x_orig.reshape(train_set_x_orig.shape[1]*train_set_x_orig.shape[2]*train_set_x_orig.shape[3],train_set_x_orig.shape[0])
test_set_x_flatten = test_set_x_orig.reshape(test_set_x_orig.shape[1]*test_set_x_orig.shape[2]*test_set_x_orig.shape[3],test_set_x_orig.shape[0])

END CODE HERE

You should change it to:

START CODE HERE ### (≈ 2 lines of code)

train_set_x_flatten = train_set_x_orig.reshape(train_set_x_orig.shape[0],train_set_x_orig.shape[1]*train_set_x_orig.shape[2]*train_set_x_orig.shape[3]).T
test_set_x_flatten = test_set_x_orig.reshape(test_set_x_orig.shape[0]test_set_x_orig.shape[1]*test_set_x_orig.shape[2]*test_set_x_orig.shape[3]).T

END CODE HERE

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

1 participant