knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
An R implementation of 'Your Classifier is Secretly an Energy Based Model and You Should Treat it Like One'. Code heavily inspired by https://github.com/tohmae/pytorch-jem and https://github.com/wgrathwohl/JEM.
JEM is not on CRAN and can be installed with:
remotes::install_github("dfalbel/JEM")
You can run an experiment with the run_experiment
function. The configuration is found
by default in the config.yaml
file in the root directory.
experiment <- JEM::run_experiment()
After the model is run, you can generate samples from $p(x|y)$ with:
samples <- JEM::generate_samples( experiment, rep(1:9, each = 10), eta = 200 ) JEM::plot_samples(samples, nrow = 10)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.