Skip to content

Commit

Permalink
merged down 2.0 to local
Browse files Browse the repository at this point in the history
  • Loading branch information
xinpw8 committed Jan 12, 2025
2 parents af9eabc + c543e3d commit 00f99c1
Show file tree
Hide file tree
Showing 49 changed files with 1,690 additions and 476 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/install.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: install
on:
push:
pull_request:

jobs:
test:
name: test ${{ matrix.py }} - ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
py:
- "3.11"
- "3.10"
- "3.9"
steps:
- name: Setup python for test ${{ matrix.py }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.py }}
- uses: actions/checkout@v3
- name: Upgrade pip
run: python -m pip install -U pip
- name: Install pufferlib
run: pip3 install -e .
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# Annoying temp files generated by Cython
c_gae.c
pufferlib/extensions.c
pufferlib/ocean/grid/c_grid.c
pufferlib/ocean/tactical/c_tactical.c
pufferlib/puffernet.c

# Raylib
raylib_wasm/

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
![figure](https://pufferai.github.io/source/resource/header.png)

[![PyPI version](https://badge.fury.io/py/pufferlib.svg)](https://badge.fury.io/py/pufferlib)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pufferlib)
![Github Actions](https://github.com/PufferAI/PufferLib/actions/workflows/install.yml/badge.svg)
[![](https://dcbadge.vercel.app/api/server/spT4huaGYV?style=plastic)](https://discord.gg/spT4huaGYV)
[![Twitter](https://img.shields.io/twitter/url/https/twitter.com/cloudposse.svg?style=social&label=Follow%20%40jsuarez5341)](https://twitter.com/jsuarez5341)

Expand Down
21 changes: 21 additions & 0 deletions config/ocean/pysquared.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[base]
package = ocean
env_name = puffer_pysquared
policy_name = Policy
rnn_name = Recurrent

[env]
num_envs = 1

[train]
total_timesteps = 40_000_000
checkpoint_interval = 50
num_envs = 12288
num_workers = 12
env_batch_size = 4096
batch_size = 131072
update_epochs = 1
minibatch_size = 8192
learning_rate = 0.0017
anneal_lr = False
device = cuda
64 changes: 64 additions & 0 deletions config/ocean/trash_pickup.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
[base]
package = ocean
env_name = trash_pickup puffer_trash_pickup
policy_name = TrashPickup
rnn_name = Recurrent

[env]
num_envs = 1024 # Recommended: 4096 (recommended start value) / num_agents
grid_size = 10
num_agents = 4
num_trash = 20
num_bins = 1
max_steps = 150
report_interval = 32
agent_sight_range = 5 # only used with 2D local crop obs space

[train]
total_timesteps = 100_000_000
checkpoint_interval = 200
num_envs = 2
num_workers = 2
env_batch_size = 1
batch_size = 131072
update_epochs = 1
minibatch_size = 16384
bptt_horizon = 8
anneal_lr = False
device = cuda
learning_rate=0.001
gamma = 0.95
gae_lambda = 0.85
vf_ceof = 0.4
clip_coef = 0.1
vf_clip_coef = 0.1
ent_coef = 0.01

[sweep.metric]
goal = maximize
name = environment/episode_return

[sweep.parameters.train.parameters.learning_rate]
distribution = log_uniform_values
min = 0.000001
max = 0.01

[sweep.parameters.train.parameters.gamma]
distribution = uniform
min = 0
max = 1

[sweep.parameters.train.parameters.gae_lambda]
distribution = uniform
min = 0
max = 1

[sweep.parameters.train.parameters.update_epochs]
distribution = int_uniform
min = 1
max = 4

[sweep.parameters.train.parameters.ent_coef]
distribution = log_uniform_values
min = 1e-5
max = 1e-1
Loading

0 comments on commit 00f99c1

Please sign in to comment.