This script provides the code used to model and solve the benchmark model in Azinovic, Gaegauf, & Scheidegger (2022) (see section 3). For a more streamlined application, see the analytic notebook.
Note that, this script was originally programmed in TensorFlow 1. The current default version of TensorFlow is now TensorFlow 2. This script is TensorFlow 2 compatible. To install the correct version, use
$ pip install tensorflow
There are two modes to run this code:
- the final network weights presented in the paper can be loaded and used to output a host of plots,
- the deep equilibrium net can be trained from scratch.
We have simplified the code such that the only user input is the desired running mode. To run, follow these instructions:
In terminal:
$ cd <PATH to the repository>/DeepEquilibriumNets/code/python-scripts/benchmark
$ python benchmark.py
The results are saved to ./output/deqn_benchmark_restart
.
$ python benchmark.py --train_from_scratch
The results are saved to ./output/deqn_benchmark
.
Note: the results presented in the paper (see, section 5) were achieved by training the neural
network on 2 training schedules. Once the first training schedule is complete (after running the
above command), uncomment lines 1314-1320 and run the previous command again
(python benchmark.py --train_from_scratch
). The results are saved to
./output/deqn_benchmark_2ndschedule
.