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

ValueError: cannot reshape array of size 200 into shape (328,461) #18

Open
sukasenyumm opened this issue Feb 15, 2018 · 2 comments
Open

Comments

@sukasenyumm
Copy link

thanks for your great tutorial!

I have an issue when trying to plot "Decision Boundary for hidden layer size 3". Below the error:

ValueError Traceback (most recent call last)
in ()
1 # Plot hasil
----> 2 plot_decision_boundary(lambda x: predict(model, x))
3 plt.title("Decision Boundary for hidden layer size 3")

in plot_decision_boundary(pred_func)
28 # Predict the function value for the whole gid
29 Z = pred_func(np.c_[xx.ravel(), yy.ravel()])
---> 30 Z = Z.reshape(xx.shape)
31 # Plot the contour and training examples
32 plt.contourf(xx, yy, Z, cmap=plt.cm.Spectral)

ValueError: cannot reshape array of size 200 into shape (328,461)

Is there any solution for this? Thank you

@shivamsaboo17
Copy link

@sukasenyumm just check your predict function. You must have used the 'X' which was globally declared input rather than the x parameter of your predict function.

@tastyminerals
Copy link

In your predict function find z1 = X.dot(W1) + b1 and replace X.dot to x.dot.

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