Code Monkey home page Code Monkey logo

activeblockference's Introduction

๐Ÿ’ก ActiveBlockference

This is a work-in-progress repository for active inference agents in cadCAD.

Active Blockference is an open source project that will be stewarded through deep time by the Active Inference Institute. Reduce your uncertainty about how to participate in Active Inference Institute or contact us: https://activeinference.org/

๐Ÿšง Getting Started

# clone the repo

git clone https://github.com/ActiveInferenceInstitute/ActiveBlockference.git

cd ActiveBlockference/

# create new python environment

python -m venv cad

# activate the environment

source cad/bin/activate

# install requirements

pip install -r requirements.txt

Developing Active Inference Agents in cadCAD

An active inference agent consists of the following matrices:

  • $A$ - the generative model's prior beliefs about how hidden states relate to observations
  • $B$ - the generative model's prior beliefs about controllable transitions between hidden states over time
  • $C$ - the biased generative model's prior preference for particular observations encoded in terms of probabilities
  • $D$ - the generative model's prior belief over hidden states at the first timestep

pymdp ~ Active Inference

Analysis of actinf_from_scratch pymdp tutorial

The pymdp inference loop has the following steps (for more information visit the official tutorial):

  • initialize prior to the D matrix
  • get observation index from grid_locations
  • (q_s) perform inference over hidden states with infer_states, passing in the observation index, the A matrix, and the prior
  • calculate expected free energy, passing in the A, B, C matrices, the inferences (q_s) from the previous step, and available actions
  • compute action posterior (it's the softmax of -G)
  • sample the action posterior the get the action
  • compute the prior for next state with the dot product of the B matrix (indexed with the chosen action) and the current inference (q_s)

Active Gridference

The example notebook available in notebooks/ contain active inference agents moving in a grid environment with the aim of finding a preferred location.

activeblockference's People

Contributors

activeinferenceinstitute avatar docxology avatar nomercy77 avatar pitmonticone avatar smejak avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

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.