-
Notifications
You must be signed in to change notification settings - Fork 1
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
QC-AAN #8
Conversation
To quickly run the script with minimal epochs/samples: python3 train.py --nb-epochs 2 --latent-size 8 --nb-samples 1000 --qcbm-nb-shots 100 --nb-qubits 8 ./particles.yaml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please let me know if it makes sense
# generate a new batch of noise | ||
noise = np.random.normal(0, 1, (batch_size, latent_size)) | ||
# sample from QCBM | ||
if nb_qubits > 0: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mainly this part
where it samples from QCBM
Also, it addresses the first half of #6 |
@@ -512,3 +531,8 @@ def _load_data(particle, datafile): | |||
|
|||
discriminator.save_weights('./weights/{0}{1:03d}.hdf5'.format(parse_args.d_pfx, epoch), | |||
overwrite=True) | |||
|
|||
dis_weights_f = h5py.File('./weights/{0}{1:03d}.hdf5'.format(parse_args.d_pfx, epoch), 'r') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I basically read the weight from that layer and passed it to QCBM
@@ -295,7 +297,9 @@ def _load_data(particle, datafile): | |||
mbd_energy | |||
]) | |||
|
|||
fake = Dense(1, activation='sigmoid', name='fakereal_output')(p) | |||
qcbm_w = Dense(2**nb_qubits, activation='linear', name='qcbm')(p) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added another layer to align our QCBM dimenstion
Now the CaloGAN is able to sample from the QCBM.
Assumption:
Next need to train QCBM from the discriminator.