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

[BUG] Quanvolution demo results don't match rendered version #257

Open
glassnotes opened this issue Apr 21, 2021 · 14 comments
Open

[BUG] Quanvolution demo results don't match rendered version #257

glassnotes opened this issue Apr 21, 2021 · 14 comments

Comments

@glassnotes
Copy link
Contributor

First noted by a user here, and confirmed independently by me using a fresh environment with the most recent version of PennyLane and contents of the qml repo requirements file.

The plots produced at the end (left) don't match the results in the demo (right). The user obtained identical plots to my locally run version (given this, and the consistency of the results, the issue doesn't appear to be one that stems from random seeds or anything).

image

@josh146
Copy link
Member

josh146 commented Apr 21, 2021

My first guess was that this was a non-executed demo, but it looks like it is executed 🤔

@glassnotes
Copy link
Contributor Author

My first guess was that this was a non-executed demo, but it looks like it is executed thinking

Yes, same here. Do you get different results as well when you run it locally?

@josh146
Copy link
Member

josh146 commented Apr 21, 2021

Might not get a chance currently! Will pencil it in as a todo. I wonder if this is related to @co9olguy's numerical accuracy issue. @glassnotes, if you run the PL test suite locally, does everything pass?

@glassnotes
Copy link
Contributor Author

It actually does not - I get a few failures (noted below), but nothing I would expect to affect the results of the demo execution.

FAILED tests/test_about.py::test_about - AssertionError: assert '0.16.0.dev' in '0.15.0.dev0'
FAILED tests/circuit_graph/test_qasm.py::TestQASMConformanceTests::test_agrees_qiskit_plugin - pkg_resources.VersionConflict: (Penn...
FAILED tests/circuit_graph/test_qasm.py::TestQASMConformanceTests::test_basis_state_agrees_qiskit_plugin - pkg_resources.VersionCon...
FAILED tests/math/test_functions.py::test_conj[t5] - TypeError: loop of ufunc does not support argument 0 of type ResourceVariable ...

@josh146
Copy link
Member

josh146 commented Oct 14, 2021

Hey @glassnotes, is this still showing the incorrect result?

@glassnotes
Copy link
Contributor Author

Just ran locally, yes it does. The results in this graph are consistent with the previous version I obtained running locally, which is still inconsistent with the live demo.

image

@josh146
Copy link
Member

josh146 commented Oct 14, 2021

😬 😬 😬

@glassnotes
Copy link
Contributor Author

It's super weird... I again used a fresh environment, installing directly from the repo requirements file. Maybe it's because I used Python 3.8? What version does the CI use? Do you observe this locally too?

@josh146
Copy link
Member

josh146 commented Oct 14, 2021

Looks like the CI is using Python 3.7.2.

If the demo doesn't set a seed, it could be due to the CI running all the demos, resulting in a 'better' seed when this demo is run

@glassnotes
Copy link
Contributor Author

This demo actually does set seeds though, that's the weird thing. For both numpy and tensorflow 😕

@KetpuntoG
Copy link
Contributor

It seems that this problem has been solved.
I have run the notebook in Google Colab and this is my output
Captura de Pantalla 2022-11-24 a las 15 28 06

In the demo seems the same:

Captura de Pantalla 2022-11-24 a las 15 28 26

@josh146
Copy link
Member

josh146 commented Nov 24, 2022

@KetpuntoG nice! Although I suppose the mystery is not solved, as your results show classical training beating the quantum training, which isn't what the demo originally showed

@KetpuntoG
Copy link
Contributor

seems very dependent on the seed. If we want something that quantum "wins", we can put seed 42 although I'm not a big fan of these things

Captura de Pantalla 2022-11-24 a las 17 20 06

@josh146
Copy link
Member

josh146 commented Nov 24, 2022

Yeah, I would say this is maybe more an issue with the conclusion of the demo, rather than a seed issue

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