Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Agilerl updates #1196

Merged
merged 3 commits into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion .github/workflows/linux-tutorials-test.yml
elliottower marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,32 @@ jobs:
fail-fast: false
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
tutorial: [Tianshou, CustomEnvironment, CleanRL, SB3/kaz, SB3/waterworld, SB3/connect_four, SB3/test, AgileRL] # TODO: fix tutorials and add back Ray
tutorial: [Tianshou, CustomEnvironment, CleanRL, SB3/kaz, SB3/waterworld, SB3/connect_four, SB3/test] # TODO: fix tutorials and add back Ray
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies and run tutorials
run: |
sudo apt-get install python3-opengl xvfb parallel
export PATH=/path/to/parallel:$PATH
export root_dir=$(pwd)
cd tutorials/${{ matrix.tutorial }}
pip install -r requirements.txt
pip uninstall -y pettingzoo
pip install -e $root_dir[testing]
AutoROM -v
for f in *.py; do xvfb-run -a -s "-screen 0 1024x768x24" python "$f"; done

agilerl-tutorial-test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.9', '3.10', '3.11']
tutorial: [AgileRL]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
Expand Down
8 changes: 4 additions & 4 deletions docs/tutorials/agilerl/DQN.md
Original file line number Diff line number Diff line change
Expand Up @@ -612,10 +612,10 @@ Before we go any further in this tutorial, it would be helpful to define and set
# Define the network configuration
NET_CONFIG = {
"arch": "cnn", # Network architecture
"h_size": [64, 64], # Actor hidden size
"c_size": [128], # CNN channel size
"k_size": [4], # CNN kernel size
"s_size": [1], # CNN stride size
"hidden_size": [64, 64], # Actor hidden size
"channel_size": [128], # CNN channel size
"kernel_size": [4], # CNN kernel size
"stride_size": [1], # CNN stride size
"normalize": False, # Normalize image from range [0,255] to [0,1]
}

Expand Down
8 changes: 4 additions & 4 deletions tutorials/AgileRL/agilerl_dqn_curriculum.py
Original file line number Diff line number Diff line change
Expand Up @@ -494,10 +494,10 @@ def outcome(self, action, player, return_length=False):
# Define the network configuration
NET_CONFIG = {
"arch": "cnn", # Network architecture
"h_size": [64, 64], # Actor hidden size
"c_size": [128], # CNN channel size
"k_size": [4], # CNN kernel size
"s_size": [1], # CNN stride size
"hidden_size": [64, 64], # Actor hidden size
"channel_size": [128], # CNN channel size
"kernel_size": [4], # CNN kernel size
"stride_size": [1], # CNN stride size
"normalize": False, # Normalize image from range [0,255] to [0,1]
}

Expand Down
8 changes: 4 additions & 4 deletions tutorials/AgileRL/agilerl_maddpg.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
# Define the network configuration
NET_CONFIG = {
"arch": "cnn", # Network architecture
"h_size": [32, 32], # Network hidden size
"c_size": [32, 32], # CNN channel size
"k_size": [3, 3], # CNN kernel size
"s_size": [2, 2], # CNN stride size
"hidden_size": [32, 32], # Network hidden size
"channel_size": [32, 32], # CNN channel size
"kernel_size": [3, 3], # CNN kernel size
"stride_size": [2, 2], # CNN stride size
"normalize": True, # Normalize image from range [0,255] to [0,1]
}

Expand Down
2 changes: 1 addition & 1 deletion tutorials/AgileRL/agilerl_matd3.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
# Define the network configuration
NET_CONFIG = {
"arch": "mlp", # Network architecture
"h_size": [32, 32], # Actor hidden size
"hidden_size": [32, 32], # Actor hidden size
elliottower marked this conversation as resolved.
Show resolved Hide resolved
}

# Define the initial hyperparameters
Expand Down
3 changes: 1 addition & 2 deletions tutorials/AgileRL/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
agilerl==0.1.21; python_version >= '3.9'
agilerl==0.1.20; python_version < '3.9'
agilerl==0.1.22; python_version >= '3.9'
pettingzoo[classic,atari,mpe]>=1.23.1
SuperSuit>=3.9.0
torch>=2.0.1
Expand Down
Loading