This setup guide helps you to reproduce the results from the paper.
The first part is a direct copy from the Setup Guide of the factor-graph framework's README.
Use a command line to cd into the repository.
Check if you have Python on your system, we recommend version 3.9. We advise you to use a activate a virtual environment for the dependencies with pipenv. You can install pipenv by running
pip install pipenvfollowed by
python -m pipenvto create the virtual env. If it is not activated yet, please run
python -m pipenv shell(On some systems, you must type python3 instead of python.)
Then, run
pip install requirements.txtRun
where pythonto find out the path of the Python installation on your system.
At the beginning of the Julia files, the Python path must be entered. Copy it there. In the following line, the path to your repository's local path is needed. Copy it there.
It is useful to create a new user-wide Julia env that is not constrained to one repository or directory. Julia offers this feature as "shared env", which can be used when activating julia in the command line. VSCode also has some button (at the bottom) that allows to set the julia env.
You can create a new Julia env called "myenv" like this:
julia --project=@bayesian_actor_critic --threads 1Next, install all dependencies:
import Pkg; Pkg.add(["Adapt", "BenchmarkTools", "CalibrationErrors", "Distributions", "GraphRecipes", "Graphs", "HDF5", "Integrals", "InvertedIndices", "IrrationalConstants", "KernelAbstractions", "MLDatasets", "NNlib", "Plots", "Polyester", "ProgressBars", "QuadGK", "SpecialFunctions", "StatsBase", "Tullio", "Serialization", "PyCall", "Distributed", "Statistics", "ProgressMeter", "LinearAlgebra"])In your Julia environment, run
include("tools/train_agent_single.jl")which should start the training. This should take around 10 minutes, depending on the machine. Once the training is finished, you can run
include("tools/run_agent.jl")and check if you see the pendulum.
Now, you are ready to run the full evaluation pipeline with
include("main_evaluation_pipeline.jl")