All Projects → zfountas → deep-active-inference-mc

zfountas / deep-active-inference-mc

Licence: GPL-3.0 license
Deep active inference agents using Monte-Carlo methods

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to deep-active-inference-mc

active-inference
A toy model of Friston's active inference in Tensorflow
Stars: ✭ 36 (-12.2%)
Mutual labels:  cognitive-science, variational-inference
ladder-vae-pytorch
Ladder Variational Autoencoders (LVAE) in PyTorch
Stars: ✭ 59 (+43.9%)
Mutual labels:  variational-inference, variational-autoencoders
BayesByHypernet
Code for the paper Implicit Weight Uncertainty in Neural Networks
Stars: ✭ 63 (+53.66%)
Mutual labels:  variational-inference
quasi-unsupervised-cc
Implementation of the method described in the paper "Quasi-unsupervised color constancy" - CVPR 2019
Stars: ✭ 35 (-14.63%)
Mutual labels:  machine-learning-models
UCThello
UCThello - a board game demonstrator (Othello variant) with computer AI using Monte Carlo Tree Search (MCTS) with UCB (Upper Confidence Bounds) applied to trees (UCT in short)
Stars: ✭ 26 (-36.59%)
Mutual labels:  monte-carlo-tree-search
racing dreamer
Latent Imagination Facilitates Zero-Shot Transfer in Autonomous Racing
Stars: ✭ 31 (-24.39%)
Mutual labels:  model-based-reinforcement-learning
probai-2021-pyro
Repo for the Tutorials of Day1-Day3 of the Nordic Probabilistic AI School 2021 (https://probabilistic.ai/)
Stars: ✭ 45 (+9.76%)
Mutual labels:  variational-inference
connect4
Solving board games like Connect4 using Deep Reinforcement Learning
Stars: ✭ 33 (-19.51%)
Mutual labels:  monte-carlo-tree-search
haskell-vae
Learning about Haskell with Variational Autoencoders
Stars: ✭ 18 (-56.1%)
Mutual labels:  variational-inference
atomai
Deep and Machine Learning for Microscopy
Stars: ✭ 77 (+87.8%)
Mutual labels:  variational-autoencoders
MAX-Audio-Embedding-Generator
Generate embedding vectors from audio files
Stars: ✭ 33 (-19.51%)
Mutual labels:  machine-learning-models
artificial neural networks
A collection of Methods and Models for various architectures of Artificial Neural Networks
Stars: ✭ 40 (-2.44%)
Mutual labels:  variational-inference
VINF
Repository for DTU Special Course, focusing on Variational Inference using Normalizing Flows (VINF). Supervised by Michael Riis Andersen
Stars: ✭ 23 (-43.9%)
Mutual labels:  variational-inference
AnimalChess
Animal Fight Chess Game(斗兽棋) written in rust.
Stars: ✭ 76 (+85.37%)
Mutual labels:  monte-carlo-tree-search
linguistic-style-transfer-pytorch
Implementation of "Disentangled Representation Learning for Non-Parallel Text Style Transfer(ACL 2019)" in Pytorch
Stars: ✭ 55 (+34.15%)
Mutual labels:  disentangled-representations
prosper
A Python Library for Probabilistic Sparse Coding with Non-Standard Priors and Superpositions
Stars: ✭ 17 (-58.54%)
Mutual labels:  variational-inference
continuous Bernoulli
There are C language computer programs about the simulator, transformation, and test statistic of continuous Bernoulli distribution. More than that, the book contains continuous Binomial distribution and continuous Trinomial distribution.
Stars: ✭ 22 (-46.34%)
Mutual labels:  variational-autoencoders
Reinforcement-Learning-In-Motion
Code repository for my course on the fundamentals of reinforcement learning
Stars: ✭ 78 (+90.24%)
Mutual labels:  monte-carlo-methods
Voice2Mesh
CVPR 2022: Cross-Modal Perceptionist: Can Face Geometry be Gleaned from Voices?
Stars: ✭ 67 (+63.41%)
Mutual labels:  cognitive-science
MAX-Audio-Classifier
Identify sounds in short audio clips
Stars: ✭ 115 (+180.49%)
Mutual labels:  machine-learning-models

Deep active inference agents using Monte-Carlo methods

This source code release accompanies the manuscript:

Z. Fountas, N. Sajid, P. A.M. Mediano and K. Friston "Deep active inference agents using Monte-Carlo methods", Advances in Neural Information Processing Systems 33 (NeurIPS 2020).

If you use this model or the dynamic dSprites environment in your work, please cite our paper.


Description

For a quick overview see this video. In this work, we propose the deep neural architecture illustrated below, which can be used to train scaled-up active inference agents for continuous complex environments based on amortized inference, M-C tree search, M-C dropouts and top-down transition precision, that encourages disentangled latent representations.

We test this architecture on two tasks from the Animal-AI Olympics and a new simple object-sorting task based on DeepMind's dSprites dataset.

Demo behavior

Agent trained in the Dynamic dSprites environment Agent trained in the Animal-AI environment

Requirements

  • Programming language: Python 3
  • Libraries: tensorflow >= 2.0.0, numpy, matplotlib, scipy, opencv-python
  • dSprites dataset.

Instructions

Installation
  • Initially, make sure the required libraries are installed in your computer. Open a terminal and type
pip install -r requirements.txt
  • Then, clone this repository, navigate to the project directory and download the dSrpites dataset by typing
wget https://github.com/deepmind/dsprites-dataset/raw/master/dsprites_ndarray_co1sh3sc6or40x32y32_64x64.npz

or by manually visiting the above URL.

Training
  • To train an active inference agent to solve the dynamic dSprites task, type
python train.py

This script will automatically generate checkpoints with the optimized parameters of the agent and store this checkpoints to a different sub-folder every 25 training iterations. The default folder that will contain all sub-folders is figs_final_model_0.01_30_1.0_50_10_5. The script will also generate a number of performance figures, also stored in the same folder. You can stop the process at any point by pressing Ctr+c.

Testing
  • Finally, once training has been completed, the performance of the newly-trained agent can be demonstrated in real-time by typing
python test_demo.py -n figs_final_model_0.01_30_1.0_50_10_5/checkpoints/ -m

This command will open a graphical interface which can be controlled by a number of keyboard shortcuts. In particular, press:

  • q or esc to exit the simulation at any point.
  • 1 to enable the MCTS-based full-scale active inference agent (enable by default).
  • 2 to enable the active inference agent that minimizes expected free energy calculated only for a single time-step into the future.
  • 3 to make the agent being controlled entirely by the habitual network (see manuscript for explanation)
  • 4 to activate manual mode where the agents are disabled and the environment can be manipulated by the user. Use the keys w, s, a or d to move the current object up, down, left or right respectively.
  • 5 to enable an agent that minimizes the terms a and b of equation 8 in the manuscript.
  • 6 to enable an agent that minimizes only the term a of the same equation (reward-seeking agent).
  • m to toggle the use of sampling in calculating future transitions.

Bibtex

@inproceedings{fountas2020daimc,
author = {Fountas, Zafeirios and Sajid, Noor and Mediano, Pedro and Friston, Karl},
booktitle = {Advances in Neural Information Processing Systems},
editor = {H. Larochelle and M. Ranzato and R. Hadsell and M. F. Balcan and H. Lin},
pages = {11662--11675},
publisher = {Curran Associates, Inc.},
title = {Deep active inference agents using Monte-Carlo methods},
url = {https://proceedings.neurips.cc/paper/2020/file/865dfbde8a344b44095495f3591f7407-Paper.pdf},
volume = {33},
year = {2020}
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].