Code Monkey home page Code Monkey logo

butterfly-baselines's Introduction

This repo includes baseline learning code for all the PettingZoo Butterfly environments (except Prison, which is a toy debugging environment) based on parameter shared PPO via Stable Baslines 3 and SuperSuit.

To train all four Butterfly environments for five runs each:

sh train_all.sh

The specifically included environments/verisons are pistonball_v4, knights_archers_zombies_v7, prospector_v4 and cooperative_pong_v3.

To train individual environments:

python train.py --env-name=pistonball_v4 --n-runs=5 --n-evaluations=100 --timesteps=2000000 --num-cpus=8 --num-eval-cpus=4 --num-vec-envs=4

The above example trains pistonball_v4 for 5 runs, with 2000000 timesteps and 100 evaluations per run, on 8 cpus, with four more cpus for the evaluations, and four parallel environments per cpu, and saves the results of the evaluations to data/ENV_NAME/run_x.

To modify other hyperparameters e.g. learning rate, activation function, network size: modify config/ENV_NAME.json Note that the current ones are the result of a hyperparameter tuning search with Optuna via RL Baselines3 Zoo.

To plot learning and evaluations in an environment from the data folder:

python plot.py --env-name=pistonball_v4 --n-runs=10

To plot learning curves for all four environments:

sh plot_all.sh

butterfly-baselines's People

Contributors

jkterry1 avatar rohan138 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

butterfly-baselines's Issues

[knight archer zombie] agents could not observe enemy reach end line

In knight archer zombie env
I train default agent done and see such behaves:

  1. agents learn to search and slay enemy
  2. agents does not learn to prevent enemy reach border line

this may be because each agent only see 512 x 512
and when they spawn they stay too close : init position (400 410) (400 460) (400 610) (460 660)
but whole env is (1280 720)

so they only can see about half environment
if a zombie reach end line in another half , they could not see anything

so in early game agents almost get "sudden death" without known any information
this result in very large noise and variance in gradient

to fix this we may give agent more explict imformation to known games rule and environment

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.