Skip to main content

large population models

Project description

Large Population Models

making complexity simple
differentiable learning over millions of autonomous agents

Released under the MIT license. Documentation Get in Touch Join Us

Large Population Models (LPMs) help simulate million-size populations by designing realistic environments and capturing expressive indvidual behavior. Our goal is to "re-invent the census": built entirely in simulation, captured passively and used to protect country-scale populations. Our research is early but actively making an impact - winning awards at AI conferences and being deployed across the world. Learn more about LPMs here.

AgentTorch LPMs have four design principles:

  • Scalability: AgentTorch models can simulate country-size populations in seconds on commodity hardware.
  • Differentiability: AgentTorch models can differentiate through simulations with stochastic dynamics and conditional interventions, enabling gradient-based learning.
  • Composition: AgentTorch models can compose with deep neural networks (eg: LLMs), mechanistic simulators (eg: mitsuba) or other LPMs. This helps describe agent behavior using LLMs, calibrate simulation parameters and specify expressive interaction rules.
  • Generalization: AgentTorch helps simulate diverse ecosystems - humans in geospatial worlds, cells in anatomical worlds, autonomous avatars in digital worlds.

AgentTorch is building the future of decision engines - inside the body, around us and beyond!

https://github.com/AgentTorch/AgentTorch/assets/13482350/4c3f9fa9-8bce-4ddb-907c-3ee4d62e7148

Installation

AgentTorch is meant to be used in a Python 3.9 environment. If you have not installed Python 3.9, please do so first from python.org/downloads.

Install the framework using pip, like so:

> pip install git+https://github.com/agenttorch/agenttorch

Some models require extra dependencies that have to be installed separately. For more information regarding this, as well as the hardware the project has been run on, please see docs/install.md.

Getting Started

The following section depicts the usage of existing models and population data to run simulations on your machine. It also acts as a showcase of the Agent Torch API.

A Jupyter Notebook containing the below examples can be found here.

Executing a Simulation with Gradient Based Learning

# re-use existing models and population data easily
from agent_torch.models import covid
from agent_torch.populations import astoria

# use the executor to plug-n-play
from agent_torch.core.executor import Executor
from agent_torch.core.dataloader import LoadPopulation

# agent_"torch" works seamlessly with the pytorch API
from torch.optim import SGD

loader = LoadPopulation(astoria)
simulation = Executor(model=covid, pop_loader=loader)

simulation.init(SGD)
simulation.execute()

Guides and Tutorials

Understanding the Framework

A detailed explanation of the architecture of the Agent Torch framework can be found here.

Creating a Model

A tutorial on how to create a simple predator-prey model can be found in the tutorials/ folder.

Contributing to Agent Torch

Thank you for your interest in contributing! You can contribute by reporting and fixing bugs in the framework or models, working on new features for the framework, creating new models, or by writing documentation for the project.

Take a look at the contributing guide for instructions on how to setup your environment, make changes to the codebase, and contribute them back to the project.

Impact

AgentTorch models are being deployed across the globe.

Impact

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agent_torch-0.4.0.tar.gz (17.3 MB view details)

Uploaded Source

Built Distribution

agent_torch-0.4.0-py3-none-any.whl (17.7 MB view details)

Uploaded Python 3

File details

Details for the file agent_torch-0.4.0.tar.gz.

File metadata

  • Download URL: agent_torch-0.4.0.tar.gz
  • Upload date:
  • Size: 17.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for agent_torch-0.4.0.tar.gz
Algorithm Hash digest
SHA256 188a6cb01bc6d02b43be97c7b1f063a744b3892f8e8d66487a4115d7d4c8ab95
MD5 35924de8f385081d1df88596ff435a38
BLAKE2b-256 fe8dede47455b41f25c8f7427ab82ed850da7780522d26906968cc00207d09b1

See more details on using hashes here.

File details

Details for the file agent_torch-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: agent_torch-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 17.7 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for agent_torch-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 255c1a4b8e839a63b0780fa033f51f81b393537be6af395599efd8e651ba2b29
MD5 348ce0fa7e1e968dc79b3ef6e06b7383
BLAKE2b-256 b55a0b4e0bcaf82b6c306f3491993d33b56502e93d93f99c5b1d13c1063251d6

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page