-
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.
Hotfix: libraries installation in Colab notebooks (#193)
* fix installations of dependencies of QDax in all notebooks * add missing colab parameters and update description for DCRL
- Loading branch information
1 parent
8c9d2ec
commit f16b0da
Showing
23 changed files
with
532 additions
and
812 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,7 +31,25 @@ | |
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"#@title Installs and Imports\n", | ||
"from IPython.display import clear_output\n", | ||
"\n", | ||
"try:\n", | ||
" import qdax\n", | ||
"except:\n", | ||
" print(\"QDax not found. Installing...\")\n", | ||
" !pip install qdax[cuda12]\n", | ||
" import qdax\n", | ||
"\n", | ||
"clear_output()" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"\n", | ||
"!pip install ipympl |tail -n 1\n", | ||
"# %matplotlib widget\n", | ||
"# from google.colab import output\n", | ||
|
@@ -46,37 +64,6 @@ | |
"import jax\n", | ||
"import jax.numpy as jnp\n", | ||
"\n", | ||
"try:\n", | ||
" import brax\n", | ||
"except:\n", | ||
" !pip install git+https://github.com/google/[email protected] |tail -n 1\n", | ||
" import brax\n", | ||
"\n", | ||
"try:\n", | ||
" import flax\n", | ||
"except:\n", | ||
" !pip install --no-deps git+https://github.com/google/[email protected] |tail -n 1\n", | ||
" import flax\n", | ||
"\n", | ||
"try:\n", | ||
" import chex\n", | ||
"except:\n", | ||
" !pip install --no-deps git+https://github.com/deepmind/[email protected] |tail -n 1\n", | ||
" import chex\n", | ||
"\n", | ||
"try:\n", | ||
" import jumanji\n", | ||
"except:\n", | ||
" !pip install \"jumanji==0.3.1\"\n", | ||
" import jumanji\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", | ||
" import qdax\n", | ||
"\n", | ||
"\n", | ||
"from qdax.core.aurora import AURORA\n", | ||
"from qdax.core.containers.unstructured_repertoire import UnstructuredRepertoire\n", | ||
"from qdax import environments\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 |
---|---|---|
|
@@ -30,39 +30,28 @@ | |
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import jax\n", | ||
"import jax.numpy as jnp\n", | ||
"\n", | ||
"try:\n", | ||
" import brax\n", | ||
"except:\n", | ||
" !pip install git+https://github.com/google/[email protected] |tail -n 1\n", | ||
" import brax\n", | ||
"\n", | ||
"try:\n", | ||
" import flax\n", | ||
"except:\n", | ||
" !pip install --no-deps git+https://github.com/google/[email protected] |tail -n 1\n", | ||
" import flax\n", | ||
"\n", | ||
"try:\n", | ||
" import chex\n", | ||
"except:\n", | ||
" !pip install --no-deps git+https://github.com/deepmind/[email protected] |tail -n 1\n", | ||
" import chex\n", | ||
"\n", | ||
"try:\n", | ||
" import jumanji\n", | ||
"except:\n", | ||
" !pip install \"jumanji==0.3.1\"\n", | ||
" import jumanji\n", | ||
"from IPython.display import clear_output\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", | ||
" print(\"QDax not found. Installing...\")\n", | ||
" !pip install qdax[cuda12]\n", | ||
" import qdax\n", | ||
"\n", | ||
"clear_output()" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "3", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import jax\n", | ||
"import jax.numpy as jnp\n", | ||
"\n", | ||
"import matplotlib.pyplot as plt\n", | ||
"from matplotlib.patches import Ellipse\n", | ||
"\n", | ||
|
@@ -71,7 +60,7 @@ | |
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "3", | ||
"id": "4", | ||
"metadata": {}, | ||
"source": [ | ||
"## Set the hyperparameters" | ||
|
@@ -80,7 +69,7 @@ | |
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "4", | ||
"id": "5", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
|
@@ -98,7 +87,7 @@ | |
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "5", | ||
"id": "6", | ||
"metadata": { | ||
"pycharm": { | ||
"name": "#%% md\n" | ||
|
@@ -111,7 +100,7 @@ | |
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "6", | ||
"id": "7", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
|
@@ -133,7 +122,7 @@ | |
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "7", | ||
"id": "8", | ||
"metadata": { | ||
"pycharm": { | ||
"name": "#%% md\n" | ||
|
@@ -146,7 +135,7 @@ | |
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "8", | ||
"id": "9", | ||
"metadata": { | ||
"pycharm": { | ||
"name": "#%%\n" | ||
|
@@ -167,7 +156,7 @@ | |
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "9", | ||
"id": "10", | ||
"metadata": { | ||
"pycharm": { | ||
"name": "#%% md\n" | ||
|
@@ -180,7 +169,7 @@ | |
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "10", | ||
"id": "11", | ||
"metadata": { | ||
"pycharm": { | ||
"name": "#%%\n" | ||
|
@@ -194,7 +183,7 @@ | |
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "11", | ||
"id": "12", | ||
"metadata": { | ||
"pycharm": { | ||
"name": "#%% md\n" | ||
|
@@ -207,7 +196,7 @@ | |
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "12", | ||
"id": "13", | ||
"metadata": { | ||
"pycharm": { | ||
"name": "#%%\n" | ||
|
@@ -245,7 +234,7 @@ | |
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "13", | ||
"id": "14", | ||
"metadata": {}, | ||
"source": [ | ||
"## Check final fitnesses and distribution mean" | ||
|
@@ -254,7 +243,7 @@ | |
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "14", | ||
"id": "15", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
|
@@ -272,7 +261,7 @@ | |
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "15", | ||
"id": "16", | ||
"metadata": { | ||
"pycharm": { | ||
"name": "#%% md\n" | ||
|
@@ -285,7 +274,7 @@ | |
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "16", | ||
"id": "17", | ||
"metadata": { | ||
"pycharm": { | ||
"name": "#%%\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 |
---|---|---|
|
@@ -23,6 +23,24 @@ | |
"- how to visualise the optimization process" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"from IPython.display import clear_output\n", | ||
"\n", | ||
"try:\n", | ||
" import qdax\n", | ||
"except:\n", | ||
" print(\"QDax not found. Installing...\")\n", | ||
" !pip install qdax[cuda12]\n", | ||
" import qdax\n", | ||
"\n", | ||
"clear_output()" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
|
@@ -38,36 +56,6 @@ | |
"import jax\n", | ||
"import jax.numpy as jnp\n", | ||
"\n", | ||
"try:\n", | ||
" import brax\n", | ||
"except:\n", | ||
" !pip install git+https://github.com/google/[email protected] |tail -n 1\n", | ||
" import brax\n", | ||
"\n", | ||
"try:\n", | ||
" import flax\n", | ||
"except:\n", | ||
" !pip install --no-deps git+https://github.com/google/[email protected] |tail -n 1\n", | ||
" import flax\n", | ||
"\n", | ||
"try:\n", | ||
" import chex\n", | ||
"except:\n", | ||
" !pip install --no-deps git+https://github.com/deepmind/[email protected] |tail -n 1\n", | ||
" import chex\n", | ||
"\n", | ||
"try:\n", | ||
" import jumanji\n", | ||
"except:\n", | ||
" !pip install \"jumanji==0.3.1\"\n", | ||
" import jumanji\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", | ||
" import qdax\n", | ||
"\n", | ||
"from qdax.core.map_elites import MAPElites\n", | ||
"from qdax.core.emitters.cma_opt_emitter import CMAOptimizingEmitter\n", | ||
"from qdax.core.emitters.cma_rnd_emitter import CMARndEmitter\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 |
---|---|---|
|
@@ -29,39 +29,27 @@ | |
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import jax\n", | ||
"import jax.numpy as jnp\n", | ||
"\n", | ||
"try:\n", | ||
" import brax\n", | ||
"except:\n", | ||
" !pip install git+https://github.com/google/[email protected] |tail -n 1\n", | ||
" import brax\n", | ||
"\n", | ||
"try:\n", | ||
" import flax\n", | ||
"except:\n", | ||
" !pip install --no-deps git+https://github.com/google/[email protected] |tail -n 1\n", | ||
" import flax\n", | ||
"\n", | ||
"try:\n", | ||
" import chex\n", | ||
"except:\n", | ||
" !pip install --no-deps git+https://github.com/deepmind/[email protected] |tail -n 1\n", | ||
" import chex\n", | ||
"\n", | ||
"try:\n", | ||
" import jumanji\n", | ||
"except:\n", | ||
" !pip install \"jumanji==0.3.1\"\n", | ||
" import jumanji\n", | ||
"from IPython.display import clear_output\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", | ||
" print(\"QDax not found. Installing...\")\n", | ||
" !pip install qdax[cuda12]\n", | ||
" import qdax\n", | ||
"\n", | ||
"clear_output()" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import jax\n", | ||
"import jax.numpy as jnp\n", | ||
"\n", | ||
"from qdax.core.map_elites import MAPElites\n", | ||
"from qdax.core.emitters.cma_mega_emitter import CMAMEGAEmitter\n", | ||
"from qdax.core.containers.mapelites_repertoire import compute_cvt_centroids, MapElitesRepertoire\n", | ||
|
Oops, something went wrong.