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

Wrong code in [7] to plot the Rosenbrock function ? #628

Open
jason990420 opened this issue Jul 19, 2024 · 2 comments
Open

Wrong code in [7] to plot the Rosenbrock function ? #628

jason990420 opened this issue Jul 19, 2024 · 2 comments

Comments

@jason990420
Copy link

For statements in [7] of https://github.com/SMTorg/smt/blob/master/tutorial/SMT_Tutorial.ipynb, the shapes for x, y are different from z, and it will get following figure which is different from the figure shown on that web page.

ax.scatter(xt[:, 0], xt[:, 1], yt, zdir='z', marker='x', c='b', s=200, label='Training point')
ax.scatter(xtest[:, 0], xtest[:, 1], ytest, zdir='z', marker='.', c='k', s=200, label='Validation point')

image

Maybe it should be revised as following, but it looks like that there's still a little different.

ax.scatter(xt[:, 0], xt[:, 1], yt[:, 0], zdir='z', marker='x', c='b', s=200, label='Training point')
ax.scatter(xtest[:, 0], xtest[:, 1], ytest[:, 0], zdir='z', marker='.', c='k', s=200, label='Validation point')

image

@Paul-Saves
Copy link
Contributor

Thank you very much for noticing the problem and proposing a fix! It most likely is related to the release of numpy 2.0.0.

@jason990420
Copy link
Author

Installed numpy on my windows: 1.26.4.

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

2 participants