Giter VIP home page Giter VIP logo

airi-institute / him-agent Goto Github PK

View Code? Open in Web Editor NEW
35.0 8.0 1.0 3.08 MB

The Hierarchical Intrinsically Motivated Agent (HIMA) is an algorithm that is intended to exhibit an adaptive goal-directed behavior using neurophysiological models of the neocortex, basal ganglia, and thalamus.

License: GNU Affero General Public License v3.0

Python 95.09% Jupyter Notebook 4.91%
reinforcement-learning biologically-plausible-learning hierarchical-temporal-memory intrinsic-motivation model-based-reinforcement-learning sparse-distributed-representations

him-agent's Introduction

Hierarchical Intrinsically Motivated Agent - HIMA

DOI

The Repository

This repository ("Hierarchical Intrinsically Motivated Agent - HIMA") is where we (AIRI and MIPT) publicate the source code of the HIMA model. This source code is available to everyone under AGPLv3 license.

Hierarchical Intrinsically Motivated Agent

The Hierarchical Intrinsically Motivated Agent (HIMA) is an algorithm that is intended to exhibit an adaptive goal-directed behavior using neurophysiological models of the neocortex, basal ganglia, and thalamus:

  • The neocortex model is used to form hierarchical internal representations of raw sensory input and a model of the environment.
  • The basal ganglia model provides an association of internal representations projected from the neocortex with rewarding signals and selects appropriate actions via thalamocortical loops.
  • The Dreaming component models circuits of the brain responsible for the initiation of planning via the model of the environment in the neocortex, improving the learning speed.
  • The Empowerment module is in charge of producing intrinsic motivation signal utilizing the environmental model learned by the neocortex to guide exploration to the most promising states first.

A detailed description of HIMA model is provided in the supporting paper.

HIMA Architecture

Links

Quick install

There're two setup guides:

Before cloning the repository, make sure Git LFS is installed (see help). Then:

# create new env with the required packages via conda, then activate it
conda create --name hima python=3.9 numpy matplotlib jupyterlab ruamel.yaml tqdm wandb mock imageio seaborn
conda activate hima

# install with pip the packages that cannot be installed with conda
pip install hexy prettytable "pytest>=4.6.5"

# git clone our `htm.core` fork to an arbitrary place and pip install it from sources
# pip will install missing dependencies to the current environment if needed
cd <where to clone>
git clone https://github.com/ZhekaHauska/htm.core.git
cd htm.core
pip install .

#  cd to the hima subdirectory in the project root and install hima package
cd <hima_project_root>
pip install -e .

Repository structure

  • hima/ - HIMA package sources

Run examples

How to run HIMA agent

Sign up to wandb and get access token in your profile settings to authorize locally further on.

Run one experiment

# cd to the package sources root
cd <hima_project_root>/hima

# cd to the hima experiments directory
cd experiments/hima/scripts

# replace <config name> with the config filename without extension
python run_agent.py <environment>/<config_name>

Do not forget to change entity parameter in the corresponding config file to match your wandb login. When wandb asks you to login for the first time, use your access token obtained earlier.

Run Sweep

Wandb sweep runs series of experiments with different seeds and parameters.

# cd to the package sources root
cd <hima_project_root>/hima

# cd to the hima experiments directory
cd experiments/hima

# replace <sweep config name> with the sweep config filename without extension
wandb sweep sweep/<sweep config name>

# replace <sweep id> with the returned id
python scripts/run_agents.py -n n_processes -c "wandb agent <sweep id>"

Cite us

If you use this repository in your research or wish to cite it, please make a reference to this piece of software:

@software{petr_kuderov_2022_7133430,
  author       = {Petr Kuderov and
                  Evgenij Dzhivelikyan and
                  Artem Latyshev and
                  Aleksandr I. Panov},
  title        = {{AIRI-Institute/him-agent: Hierarchical 
                   Intrinsically Motivated Agent Planning Behavior
                   with Dreaming in Grid Environments}},
  month        = mar,
  year         = 2022,
  publisher    = {Zenodo},
  version      = {v3.2-hima-airi},
  doi          = {10.5281/zenodo.7133430},
  url          = {https://doi.org/10.5281/zenodo.7133430}
}

or to the supporting paper:

@article{Dzhivelikian_Latyshev_Kuderov_Panov_2022,
  title        = {Hierarchical intrinsically motivated agent planning behavior with dreaming in grid environments},
  volume       = {9},
  rights       = {All rights reserved},
  issn         = {2198-4026},
  doi          = {10.1186/s40708-022-00156-6},
  number       = {1},
  journal      = {Brain Informatics},
  author       = {Dzhivelikian, Evgenii and Latyshev, Artem and Kuderov, Petr and Panov, Aleksandr I.},
  year         = {2022},
  month        = {Apr},
  pages        = {8},

License

© 2022 Autonomous Non-Profit Organization "Artificial Intelligence Research Institute" (AIRI); Moscow Institute of Physics and Technology (National Research University). All rights reserved.

Licensed under the AGPLv3 license.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.