The file cop.cpp contains a simple Monte Carlo routine to generate samples of the conserverd order parameter Ising model. You can store the raw configurations alongside with the order parameter and the temperature.
The python script vaeCOP.py creates a variational autoencoder using keras and trains and validates it with the Monte Carlo samples generated with cop.cpp.
The Jupyter notebook AnalyseVAE-COP.ipynb uses the trained keras models to do the phase-transition estimation.
The files accompany our machine learning blog
The details on the conserved order parameter Ising model you find in Lei Wang's paper
And the variational autoencoder is heavily based on the Keras blog