knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

JEM

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.

Installation

JEM is not on CRAN and can be installed with:

remotes::install_github("dfalbel/JEM")

Experiment

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)


dfalbel/JEM documentation built on Oct. 26, 2020, 2:44 p.m.