-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix all notebooks and update typing extensions (for running notebooks)
- Loading branch information
1 parent
1191a14
commit 9bf9177
Showing
15 changed files
with
36 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -67,12 +67,6 @@ | |
" import jumanji\n", | ||
"\n", | ||
"try:\n", | ||
" import haiku\n", | ||
"except:\n", | ||
" !pip install git+https://github.com/deepmind/[email protected] |tail -n 1\n", | ||
" import haiku\n", | ||
"\n", | ||
"try:\n", | ||
" import qdax\n", | ||
"except:\n", | ||
" !pip install --no-deps git+https://github.com/adaptive-intelligent-robotics/QDax@main |tail -n 1\n", | ||
|
@@ -554,7 +548,7 @@ | |
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.9.2" | ||
"version": "3.10.12" | ||
}, | ||
"vscode": { | ||
"interpreter": { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -67,12 +67,6 @@ | |
" import jumanji\n", | ||
"\n", | ||
"try:\n", | ||
" import haiku\n", | ||
"except:\n", | ||
" !pip install git+https://github.com/deepmind/[email protected] |tail -n 1\n", | ||
" import haiku\n", | ||
"\n", | ||
"try:\n", | ||
" import qdax\n", | ||
"except:\n", | ||
" !pip install --no-deps git+https://github.com/adaptive-intelligent-robotics/QDax@main |tail -n 1\n", | ||
|
@@ -544,7 +538,7 @@ | |
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.9.2" | ||
"version": "3.10.12" | ||
}, | ||
"vscode": { | ||
"interpreter": { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,12 +38,6 @@ | |
" import jumanji\n", | ||
"\n", | ||
"try:\n", | ||
" import haiku\n", | ||
"except:\n", | ||
" !pip install git+https://github.com/deepmind/[email protected] |tail -n 1\n", | ||
" import haiku\n", | ||
"\n", | ||
"try:\n", | ||
" import qdax\n", | ||
"except:\n", | ||
" !pip install --no-deps git+https://github.com/adaptive-intelligent-robotics/QDax@main |tail -n 1\n", | ||
|
@@ -80,7 +74,8 @@ | |
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"devices = jax.devices(\"tpu\")\n", | ||
"# Get devices (change gpu by tpu if needed)\n", | ||
"devices = jax.devices('gpu')\n", | ||
"num_devices = len(devices)\n", | ||
"print(f\"Detected the following {num_devices} device(s): {devices}\")" | ||
] | ||
|
@@ -261,7 +256,7 @@ | |
" lambda x: jnp.repeat(x, population_size, axis=0), first_states\n", | ||
" )\n", | ||
" population_returns, population_bds, _, _ = eval_policy(genotypes, first_states)\n", | ||
" return population_returns, population_bds, None, random_key" | ||
" return population_returns, population_bds, {}, random_key" | ||
] | ||
}, | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,12 +39,6 @@ | |
" import jumanji\n", | ||
"\n", | ||
"try:\n", | ||
" import haiku\n", | ||
"except:\n", | ||
" !pip install git+https://github.com/deepmind/[email protected] |tail -n 1\n", | ||
" import haiku\n", | ||
"\n", | ||
"try:\n", | ||
" import qdax\n", | ||
"except:\n", | ||
" !pip install --no-deps git+https://github.com/adaptive-intelligent-robotics/QDax@main |tail -n 1\n", | ||
|
@@ -82,7 +76,8 @@ | |
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"devices = jax.devices(\"tpu\")\n", | ||
"# Get devices (change gpu by tpu if needed)\n", | ||
"devices = jax.devices('gpu')\n", | ||
"num_devices = len(devices)\n", | ||
"print(f\"Detected the following {num_devices} device(s): {devices}\")" | ||
] | ||
|
@@ -264,7 +259,7 @@ | |
" lambda x: jnp.repeat(x, population_size, axis=0), first_states\n", | ||
" )\n", | ||
" population_returns, population_bds, _, _ = eval_policy(genotypes, first_states)\n", | ||
" return population_returns, population_bds, None, random_key" | ||
" return population_returns, population_bds, {}, random_key" | ||
] | ||
}, | ||
{ | ||
|
@@ -443,7 +438,7 @@ | |
"num_cols = 5\n", | ||
"\n", | ||
"fig, axes = plt.subplots(\n", | ||
" nrows=math.ceil(num_repertoires / num_cols), ncols=num_cols, figsize=(30, 30)\n", | ||
" nrows=math.ceil(num_repertoires / num_cols), ncols=num_cols, figsize=(30, 30), squeeze=False,\n", | ||
")\n", | ||
"for i, repertoire in enumerate(repertoires):\n", | ||
"\n", | ||
|
@@ -492,7 +487,7 @@ | |
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.8.16" | ||
"version": "3.10.12" | ||
} | ||
}, | ||
"nbformat": 4, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,12 +44,6 @@ | |
" import jumanji\n", | ||
"\n", | ||
"try:\n", | ||
" import haiku\n", | ||
"except:\n", | ||
" !pip install git+https://github.com/deepmind/[email protected] |tail -n 1\n", | ||
" import haiku\n", | ||
"\n", | ||
"try:\n", | ||
" import qdax\n", | ||
"except:\n", | ||
" !pip install --no-deps git+https://github.com/adaptive-intelligent-robotics/QDax@main |tail -n 1\n", | ||
|
@@ -95,7 +89,8 @@ | |
}, | ||
"outputs": [], | ||
"source": [ | ||
"devices = jax.devices(\"tpu\")\n", | ||
"# Get devices (change gpu by tpu if needed)\n", | ||
"devices = jax.devices('gpu')\n", | ||
"num_devices = len(devices)\n", | ||
"print(f\"Detected the following {num_devices} device(s): {devices}\")" | ||
] | ||
|
@@ -123,8 +118,8 @@ | |
"buffer_size = 100000\n", | ||
"\n", | ||
"# PBT Config\n", | ||
"num_best_to_replace_from = 20\n", | ||
"num_worse_to_replace = 40\n", | ||
"num_best_to_replace_from = 1\n", | ||
"num_worse_to_replace = 1\n", | ||
"\n", | ||
"# SAC config\n", | ||
"batch_size = 256\n", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -67,12 +67,6 @@ | |
" import jumanji\n", | ||
"\n", | ||
"try:\n", | ||
" import haiku\n", | ||
"except:\n", | ||
" !pip install git+https://github.com/deepmind/[email protected] |tail -n 1\n", | ||
" import haiku\n", | ||
"\n", | ||
"try:\n", | ||
" import qdax\n", | ||
"except:\n", | ||
" !pip install --no-deps git+https://github.com/adaptive-intelligent-robotics/QDax@main |tail -n 1\n", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,12 +41,6 @@ | |
" import jumanji\n", | ||
"\n", | ||
"try:\n", | ||
" import haiku\n", | ||
"except:\n", | ||
" !pip install git+https://github.com/deepmind/[email protected] |tail -n 1\n", | ||
" import haiku\n", | ||
"\n", | ||
"try:\n", | ||
" import qdax\n", | ||
"except:\n", | ||
" !pip install --no-deps git+https://github.com/adaptive-intelligent-robotics/QDax@main |tail -n 1\n", | ||
|
@@ -84,7 +78,8 @@ | |
}, | ||
"outputs": [], | ||
"source": [ | ||
"devices = jax.devices(\"gpu\")\n", | ||
"# Get devices (change gpu by tpu if needed)\n", | ||
"devices = jax.devices('gpu')\n", | ||
"num_devices = len(devices)\n", | ||
"print(f\"Detected the following {num_devices} device(s): {devices}\")" | ||
] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters