You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm running a script, based on the tutorial for distribution learning with qGAN's.
I have two variants of the script, grounded on the two different implementations of the qGAN discriminator, namely the NumPyDiscriminator and the PyTorchDiscriminator.
The two variants should provide the same results, as they both run the amsgrad optimizer, but I get significantly different worse results with NumPyDiscriminator. This suggests a bug in the NumPyDiscriminator implementation or in the ADAM class of qiskit.
Steps to reproduce the problem
I attach a simple script to run a single instance of the problem with either one or the other discriminator. Runtime is around 7-8min on my computer. testqGAN_bug.py.zip
To make the results more directly comparable, I made the following modifications to the standard qiskit classes:
Script _pytorch_discriminator_net.py, rows 57, 62, 66: replaced 512 with 50 and 256 with 20 to match the same architecture as in rows 52-56 of script numpy_discriminator.
Script pytorch_discriminator, row 65: modified to self._optimizer = optim.Adam(self._discriminator.parameters(), lr=1e-3, betas = (.7, .99), eps=1e-6, amsgrad=True), to match parameters at row 226 of numpy_discriminator.
The script provided in the attachment should give similar results both if run with qgan.set_discriminator(discriminator1) or qgan.set_discriminator(discriminator2) (small differences in different runs are possible, due to randomness in the algorithms).
Suggested solutions
None at the moment.
The text was updated successfully, but these errors were encountered:
Information
What is the current behavior?
I'm running a script, based on the tutorial for distribution learning with qGAN's.
I have two variants of the script, grounded on the two different implementations of the qGAN discriminator, namely the
NumPyDiscriminator
and thePyTorchDiscriminator
.The two variants should provide the same results, as they both run the amsgrad optimizer, but I get significantly different worse results with
NumPyDiscriminator
. This suggests a bug in theNumPyDiscriminator
implementation or in the ADAM class of qiskit.Steps to reproduce the problem
I attach a simple script to run a single instance of the problem with either one or the other discriminator. Runtime is around 7-8min on my computer. testqGAN_bug.py.zip
To make the results more directly comparable, I made the following modifications to the standard qiskit classes:
512
with50
and256
with20
to match the same architecture as in rows 52-56 of script numpy_discriminator.0
.self._optimizer = optim.Adam(self._discriminator.parameters(), lr=1e-3, betas = (.7, .99), eps=1e-6, amsgrad=True)
, to match parameters at row 226 of numpy_discriminator.What is the expected behavior?
The script provided in the attachment should give similar results both if run with
qgan.set_discriminator(discriminator1)
orqgan.set_discriminator(discriminator2)
(small differences in different runs are possible, due to randomness in the algorithms).Suggested solutions
None at the moment.
The text was updated successfully, but these errors were encountered: