BasisResearch / collab-creatures

Analyzing animal collaboration with Bayesian and causal inference.
4 stars 1 forks source link

.. image:: https://github.com/BasisResearch/collaborative-intelligence/actions/workflows/test_notebooks.yml/badge.svg :alt: Test Notebooks Badge :target: https://github.com/BasisResearch/collaborative-intelligence/actions/workflows/test_notebooks.yml

.. image:: https://github.com/BasisResearch/collaborative-intelligence/actions/workflows/test.yml/badge.svg :alt: Test Badge :target: https://github.com/BasisResearch/collaborative-intelligence/actions/workflows/test.yml

.. index-inclusion-marker

Collaborative Animal Behavior Modeling with Collab

Collab is a package that supports the use of Bayesian and causal inference with Pyro <https://github.com/pyro-ppl/pyro> and ChiRho <https://github.com/BasisResearch/chirho> in the study of animal collaborative behavior. The current version focuses on foraging animals and the probabilistic identification of foraging strategies. All the functionalities are illustrated in Jupyter notebooks (listed further down). Using the package you can:

  1. Simulate synthetic data of foraging animals (random walkers, foragers following only food trace, foragers following a leader, foragers communicating about the position of food).

  2. Expand a (real or simulated) dataset by calculating a set of predictor scores at each location each agent may decide to move to. Scores correspond to a relevant feature agents may value, such as presense of a food trace, proximity to other foragers, and availability of information communicated from other agents.

  3. Use the expanded data to profile the foraging strategy using Bayesian inference, to assess how strongly each feature drives agents' decisions of where to move.

  4. Compartmentalize synthetic or real-world animal movement data in preparation for Bayesian dynamical systems inference.

  5. Build your own dynamical systems model of the compartmentalized data and use it within a Bayesian inferential workflow.

This repository is a work in progress, with more documentation and functionality coming soon. Please reach out if you're interested in collaborating or contributing.

Installation

Basic Setup:

.. code-block:: sh

git clone git@github.com:BasisResearch/collaborative-intelligence.git cd collaborative-intelligence git checkout main pip install .

Dev Setup:

To install dev dependencies needed to contribute to Collab, run the following command:

.. code-block:: sh

pip install -e ".[test]"

or

.. code-block:: sh

pip install -e .[test]

Contributing:

Before submitting a pull request, please autoformat code and ensure that unit tests pass locally:

.. code-block:: sh

 make format            # runs black and isort
 make lint              # linting
 make tests             # notebook and unit tests

Getting started and notebooks

All the notebooks are located in the docs (especially docs/foraging) folder. The following notebooks are available:

Note: The inference steps assume some familiarity with Pyro <https://github.com/pyro-ppl/pyro> and probabilistic programming. The Pyro repository <https://github.com/pyro-ppl/pyro> contains links to introductory Pyro tutorials. The dynamical systems materials assume some familarity with ChiRho <https://github.com/BasisResearch/chirho>_ (see especially this tutorial <https://basisresearch.github.io/chirho/dynamical_intro.html>_).