Skip to content

Building Agents with Imagination: pytorch easy-to-follow step-by-step tutorial

Notifications You must be signed in to change notification settings

createamind/Imagination-Augmented-Agents

 
 

Repository files navigation

Building Agents with Imagination

Intelligent agents must have the capability to ‘imagine’ and reason about the future. Beyond that they must be able to construct a plan using this knowledge. [1] This tutorial presents a new family of approaches for imagination-based planning:

  • Imagination-Augmented Agents for Deep Reinforcement Learning [arxiv]
  • Learning and Querying Fast Generative Models for Reinforcement Learning [arxiv]

The tutorial consists of 4 parts:

1. MiniPacman Environemnt

MiniPacman is played in a 15 × 19 grid-world. Characters, the ghosts and Pacman, move through a maze. The environment was written by @sracaniere from DeepMind.
[minipacman.ipynb]

2. Actor Critic

Training standard model-free agent to play MiniPacman with advantage actor-critic (A2C)
[actor-critic.ipynb]

3. Environment Model

Environment model is a recurrent neural network which can be trained in an unsupervised fashion from agent trajectories: given a past state and current action, the environment model predicts the next state and reward.
[environment-model.ipynb]

4. Imagination Augmented Agent [in progress]

The I2A learns to combine information from its model-free and imagination-augmented paths. The environment model is rolled out over multiple time steps into the future, by initializing the imagined trajectory with the present time real observation, and subsequently feeding simulated observations into the model. Then a rollout encoder processes the imagined trajectories as a whole and learns to interpret it, i.e. by extracting any information useful for the agent’s decision, or even ignoring it when necessary This allows the agent to benefit from model-based imagination without the pitfalls of conventional model-based planning.
[imagination-augmented agent.ipynb]

More materials on model based + model free RL




Hybrid Active Inference https://arxiv.org/abs/1810.02647 We describe a framework of hybrid cognition by formulating a hybrid cognitive agent that performs hierarchical active inference across a human and a machine part. We suggest that, in addition to enhancing human cognitive functions with an intelligent and adaptive interface, integrated cognitive processing could accelerate emergent properties within artificial intelligence. To establish this, a machine learning part learns to integrate into human cognition by explaining away multi-modal sensory measurements from the environment and physiology simultaneously with the brain signal. With ongoing training, the amount of predictable brain signal increases. This lends the agent the ability to self-supervise on increasingly high levels of cognitive processing in order to further minimize surprise in predicting the brain signal. Furthermore, with increasing level of integration, the access to sensory information about environment and physiology is substituted with access to their representation in the brain. While integrating into a joint embodiment of human and machine, human action and perception are treated as the machine's own. The framework can be implemented with invasive as well as non-invasive sensors for environment, body and brain interfacing. Online and offline training with different machine learning approaches are thinkable. Building on previous research on shared representation learning, we suggest a first implementation leading towards hybrid active inference with non-invasive brain interfacing and state of the art probabilistic deep learning methods. We further discuss how implementation might have effect on the meta-cognitive abilities of the described agent and suggest that with adequate implementation the machine part can continue to execute and build upon the learned cognitive processes autonomously.

  • LEARNING ACTIONABLE REPRESENTATIONS WITH GOAL-CONDITIONED POLICIES

About

Building Agents with Imagination: pytorch easy-to-follow step-by-step tutorial

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 71.4%
  • Python 28.6%