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

Add generative models and datasets #34

Open
wants to merge 61 commits into
base: main
Choose a base branch
from
Open

Conversation

josephbowles
Copy link
Collaborator

@josephbowles josephbowles commented Oct 10, 2024

Major update to the repo to include new generative models and datasets.

New Models

  • RestrictedBoltzmannMachine: A wrapped version of sklearn's BernoulliRBM model
  • DeepEBM: an energy based model in JAX that uses a MLP network as its energy function and is trained with k-contrastive divergence.

Both models can be scored using the maximum mean discrepancy distance.

New dataset generating functions

These are designed for generative learning

  • generate_ising: sample data from an ising distribution via Metropolis Hastings MCMC
  • generate_spin_blobs: a binary version of 'gaussian blobs' where configurations are sampled close in Hamming weight to a set of peak configuration

Backwards compatibility
All code from the previous version of the repo should work identically. Training and hyperparameter optimization scripts have been updated accordingly to handle generative models. As a general rule, we specify the model is generative by using y=None in place of labels.

future changes
The repo does not contain any quantum generative models at the moment; it would be good to add a simple example. There is also no changes to the folder structure, so e.g. classifier and generative models are stored in the same directory. It may make sense to change this structure to account for the classifier/generative dichotomy going forward.

@josephbowles josephbowles changed the title Generative models update Add generative models and datasets Oct 10, 2024
@josephbowles josephbowles requested review from quantshah and mariaschuld and removed request for quantshah October 10, 2024 15:31
README.md Outdated Show resolved Hide resolved
Copy link
Collaborator

@mariaschuld mariaschuld left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only minor comments, but overall good to go! Thanks for making the changes, and nice to see that it wasn't overly painful to extend the scope of the repo...

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

Successfully merging this pull request may close these issues.

4 participants