Code to accompany Efficient training of energy-based models via spin-glass control
Alejandro Pozas-Kerstjens, Gorka Muñoz-Gil, Miguel Angel García-March, Antonio Acín, Maciej Lewenstein, and Przemyslaw R. Grzybowski
This is a repository containing the code for models with Restricted Axons and training via Pattern-InDuced correlations (RAPID), developed in the article "Efficient training of energy-based models via spin-glass control. Alejandro Pozas-Kerstjens, Gorka Muñoz-Gil, Eloy Piñol, Miguel Ángel García-March, Antonio Acín, Maciej Lewenstein, and Przemysław R. Grzybowski. arXiv:1910.01592."
All code is written in Python.
Libraries required:
- ebm-torch for energy-based models
- gc for garbage collection
- itertools for combinatorial operations
- math and numpy for math operations
- matplotlib for plot generation
- pytorch >= 0.4.0 as ML framework
- tqdm for custom progress bar
Files:
-
comparison: example of use. Trains restricted Boltzmann machines using commonplace samplers and via RAPID, and computes various indicators of quality of training.
-
MNIST training: example of use. Trains an RA-RBM in the MNIST dataset.
-
rapid: contains the relevant classes.
-
utils: additional functions relevant for the example.