Coder Social home page Coder Social logo

richardkelley / ai-economist Goto Github PK

View Code? Open in Web Editor NEW

This project forked from maciejmacko/ai-economist

0.0 1.0 0.0 377 KB

Foundation is a flexible, modular, and composable framework to model socio-economic behaviors and dynamics with both agents and governments. This framework can be used in conjunction with reinforcement learning to learn optimal economic policies, as done by the AI Economist (https://www.einstein.ai/the-ai-economist).

Home Page: https://www.einstein.ai/the-ai-economist

License: BSD 3-Clause "New" or "Revised" License

Python 66.89% Shell 0.25% Jupyter Notebook 32.85%

ai-economist's Introduction

Foundation: An Economic Simulation Framework

This repo contains an implementation of Foundation, a framework for flexible, modular, and composable environments that model socio-economic behaviors and dynamics in a society with both agents and governments.

Foundation provides a Gym-style API:

  • reset: resets the environment's state and returns the observation.
  • step: advances the environment by one timestep, and returns the tuple (observation, reward, done, info).

This simulation can be used in conjunction with reinforcement learning to learn optimal economic policies, as detailed in:

The AI Economist: Improving Equality and Productivity with AI-Driven Tax Policies, Stephan Zheng, Alexander Trott, Sunil Srinivasa, Nikhil Naik, Melvin Gruesbeck, David C. Parkes, Richard Socher.

If you use this code in your research, please cite us using this BibTeX entry:

@misc{2004.13332,
  Author = {Stephan Zheng, Alexander Trott, Sunil Srinivasa, Nikhil Naik, Melvin Gruesbeck, David C. Parkes, Richard Socher},
  Title = {The AI Economist: Improving Equality and Productivity with AI-Driven Tax Policies},
  Year = {2020},
  Eprint = {arXiv:2004.13332},
}

For more information and context, check out:

Join us on Slack

If you're interested in extending this framework, discussing machine learning for economics, and collaborating on research project:

Installation Instructions

To get started, you'll need to have Python 3.6+ installed.

Using pip

Simply use the Python package manager:

pip install ai-economist

Installing from Source

  1. Clone this repository to your local machine:

    git clone www.github.com/salesforce/ai-economist
    
  2. Create a new conda environment (named "ai-economist" below - replace with anything else) and activate it

    conda create --name ai-economist python=3.6
    conda activate ai-economist
    
  3. Either

    a) Edit the PYTHONPATH to include the ai-economist directory

    export PYTHONPATH=<local path to ai-economist>:$PYTHONPATH
    

    OR

    b) Install as an editable Python package

    cd ai-economist
    pip install -e .
    

Useful tip: for quick access, add the following to your ~/.bashrc or ~/.bash_profile:

alias aiecon="conda activate ai-economist; cd <local path to ai-economist>"

You can then simply run aiecon once to activate the conda environment.

Testing your Install

To test your installation, try running:

conda activate ai-economist
python -c "import ai_economist"

Getting Started

Tutorials

To familiarize yourself with Foundation, check out the tutorials in the tutorials folder. You can run these notebooks interactively in your browser on Google Colab.

To run these notebooks locally, you need Jupyter. See https://jupyter.readthedocs.io/en/latest/install.html for installation instructions and (https://jupyter-notebook.readthedocs.io/en/stable/ for examples of how to work with Jupyter.

Structure of the Code

The simulation is located in the ai_economist/foundation folder.

The code repository is organized into the following components:

Component Description
base Contains base classes to can be extended to define Agents, Components and Scenarios.
agents Agents represent economic actors in the environment. Currently, we have mobile Agents (representing workers) and a social planner (representing a government).
entities Endogenous and exogenous components of the environment. Endogenous entities include labor, while exogenous entity includes landmarks (such as Water and Grass) and collectible Resources (such as Wood and Stone).
components Components are used to add some particular dynamics to an environment. They also add action spaces that define how Agents can interact with the environment via the Component.
scenarios Scenarios compose Components to define the dynamics of the world. It also computes rewards and exposes state for visualization.

Releases and Contributing

  • Please let us know if you encounter any bugs by filing a Github issue.
  • We appreciate all your contributions. If you plan to contribute new Components, Scenarios Entities, or anything else, please see our contribution guidelines.

Changelog

Current version: v1.1.1

For the complete release history, see CHANGELOG.md.

License

Foundation and the AI Economist are released under the BSD-3 License.

ai-economist's People

Contributors

alextrott16 avatar sunil-s avatar

Watchers

 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.