/FERMI_RL_Paper

The repo for the FERMI FEL paper using model-based and model-free reinforcement learning methods to solve a particle accelerator operation problem.

Primary LanguagePythonMIT LicenseMIT

Model-free and Bayesian Ensembling Model-based Deep Reinforcement Learning for Particle Accelerator Control Demonstrated on the FERMI FEL

Contact: simon.hirlaender(at)sbg.ac.at

Pre-print https://arxiv.org/abs/2012.09737

Please cite code as:

DOI

The included scripts:

  1. To run the NAF2 as used in the paper on the pendulum run: run_naf2.py
  2. To run the AE-DYNA as used in the paper on the pendulum run: AEDYNA.py
  3. To run the AE-DYNA with tensorflow 2 on the pendulum run: AE_Dyna_Tensorflow_2.py

The rest should be straight forward, otherwise contact us.

These are the results of RL tests @FERMI-FEL

The problem has four degrees of freedom in state and action space. A schematic overview:

SchemaFERMIFEL

Algorithm Type Representational power Noise resistive Sample efficiency
NAF Model-free Low No High
NAF2 Model-free Low Yes High
ME-TRPO Model-based High No High
AE-DYNA Model-based High Yes High

Experiments done on the machine:

A new implementation of the NAF with double Q learning (single network dashed, double network solid):

NAF2_training

NAF2_training

A new implementation of a AE-DYNA:

AE-DYNA

AE-DYNA

A variant of the ME-TRPO:

ME-TRPO

ME-TRPO

ME-TRPO

Experiments done on the inverted pendulum openai gym environment:

Cumulative reward of different NAF implementations on the inverted pendulum with artificial noise.

NAF_NOISE

Comparison of the inclusion of aleatoric noise in the AE-DYNA in the noisy inverted pendulum:

AE-DYNA_NOISE

Comparison of the inclusion of aleatoric noise in the AE-DYNA in the noisy inverted pendulum:

AE-DYNA_NOISE

Sample efficiency of NAF and AE-DYNA:

AE-DYNA

Free run on the inverted pendulum:

AE-DYNA

Update of AE-Dyna-(SAC) to Tensorflow 2

Finally, there is an update of the AE-dyna to use tensorflow 2. Run the script AE_Dyna_Tensorflow_2.py. It is based on tensor_layers tensorlayer, which has to be installed. The script AE_Dyna_Tensorflow_2.py runs on the inverted pendulum and produces results like shown in the figure below.

img.png If you have questions do not hesitate to contact us.