Skip to content

[NeurIPS 2021] Contrastive learning formulation of the active inference framework, for matching visual goal states.

License

Notifications You must be signed in to change notification settings

mazpie/contrastive-aif

Repository files navigation

Contrastive Active Inference

[website] [paper]

This repository is the official implementation of Contrastive Active Inference (NeurIPS 2021).

If you find the code useful, please refer to our work using:

@inproceedings{Mazzaglia2021ContrastiveAIF,
	title = {Contrastive Active Inference},
	author = {Pietro Mazzaglia and Tim Verbelen and Bart Dhoedt},
	booktitle = {Advances in Neural Information Processing Systems},
	year = {2021},
	url = {https://openreview.net/forum?id=5t5FPwzE6mq}
}

Installation

Recommended: Conda env

Create and activate a conda environment running:

conda create -n contrastive-aif python=3.8`
conda activate contrastive-aif

Dependencies

To install dependencies, run:

pip install -r requirements.txt

Note: for the experiments on the Deep Mind Control Suite, you will need a licensed copy of Mujoco and to install the dm_control package.

NOTE: new versions of dm_control automatically install Mujoco with free license. However, these haven't been tested.

Train Code

To run experiments you can use one the following:

Minigrid:

python main.py --suite minigrid_pixels --task empty --config minigrid_empty_8x8 --algo contrastive_actinf --seed 34

Reacher:

python main.py --suite dmc --task reacher_easy_13 --config dmc_small dmc_benchmark --algo contrastive_actinf --seed 34

Paper Results

Acknowledgments

We would like to thank the authors of the following repositories for their useful open source code:

Dreamer [TensorFlow implementation of Dreamer]

dreamer-pytorch [PyTorch implementation of Dreamer]

About

[NeurIPS 2021] Contrastive learning formulation of the active inference framework, for matching visual goal states.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages