Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Apr 15, 2024
1 parent 2c2dd48 commit 6d0235e
Show file tree
Hide file tree
Showing 8 changed files with 211 additions and 211 deletions.
64 changes: 32 additions & 32 deletions examples/notebooks/Brax_Experiments_with_PGPE.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "markdown",
"id": "096c868b-ef91-42df-903f-a0a046ccad95",
"id": "0",
"metadata": {},
"source": [
"# Solving a Brax environment using EvoTorch\n",
Expand All @@ -27,7 +27,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "c786f423-220e-4c86-8e06-05edbfd45c42",
"id": "1",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -42,7 +42,7 @@
},
{
"cell_type": "markdown",
"id": "8b547977-1478-4b82-95c4-12a79769336d",
"id": "2",
"metadata": {},
"source": [
"We now check if CUDA is available. If it is, we prepare a configuration which will tell `VecGymNE` to use a single GPU both for the population and for the fitness evaluation operations. If CUDA is not available, we will instead turn to actor-based parallelization on the CPU to boost the performance."
Expand All @@ -51,7 +51,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "d45edbf5-b0e9-43a0-869a-5146321ddd4e",
"id": "3",
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -90,7 +90,7 @@
},
{
"cell_type": "markdown",
"id": "f1387654-13b4-4367-9d3e-ffda6b3aaf5d",
"id": "4",
"metadata": {},
"source": [
"We now define our policy. The policy can be expressed as a string, or as an instance or as a subclass of `torch.nn.Module`."
Expand All @@ -99,7 +99,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "4d62b5e2-6471-4c86-b028-7997426270f8",
"id": "5",
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -162,7 +162,7 @@
},
{
"cell_type": "markdown",
"id": "166e7f59-b727-44b4-9f60-dc7cbec9943b",
"id": "6",
"metadata": {},
"source": [
"Below, we instantiate our `VecGymNE` problem."
Expand All @@ -171,7 +171,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "56b5f554-cdec-40a5-8e21-fa09ea53e047",
"id": "7",
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -207,7 +207,7 @@
},
{
"cell_type": "markdown",
"id": "bce02d7c-400c-4c22-9bb8-aa70fa4b1da2",
"id": "8",
"metadata": {},
"source": [
"---\n",
Expand All @@ -220,7 +220,7 @@
},
{
"cell_type": "markdown",
"id": "95417793-3835-47b1-b10a-7f36e78fa3ad",
"id": "9",
"metadata": {},
"source": [
"Initialize a PGPE to work on the problem.\n",
Expand All @@ -233,7 +233,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "bce9f851-68aa-4e67-9dbb-2474a5ebd4cf",
"id": "10",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -257,7 +257,7 @@
},
{
"cell_type": "markdown",
"id": "da60f156-6756-41a4-b261-82ee62d7f7cb",
"id": "11",
"metadata": {},
"source": [
"We register two loggers for our PGPE instance.\n",
Expand All @@ -269,7 +269,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "91270ba2-ce78-43e7-bf01-20c94b0529c3",
"id": "12",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -279,7 +279,7 @@
},
{
"cell_type": "markdown",
"id": "7b4d16c1-078c-4d7d-bd6f-e3ff28173667",
"id": "13",
"metadata": {},
"source": [
"We are now ready to start the evolutionary search."
Expand All @@ -288,7 +288,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "0a1a84a0-47ea-4592-bd37-5e96fc8f6e54",
"id": "14",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -298,7 +298,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "8491f968-4f43-4df6-aac0-a09c756185da",
"id": "15",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -310,7 +310,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "5731e007-55b3-49ef-9285-9d9137232c9d",
"id": "16",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -319,7 +319,7 @@
},
{
"cell_type": "markdown",
"id": "0efa9df1-c978-4c2a-a528-c98e761caec7",
"id": "17",
"metadata": {},
"source": [
"Now, we receive our trained policy as a torch module."
Expand All @@ -328,7 +328,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "8ea4d211-08c2-4a59-ab84-23988646895e",
"id": "18",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -339,7 +339,7 @@
},
{
"cell_type": "markdown",
"id": "e7c7581d-24ba-4f06-88e2-41bb3274cd37",
"id": "19",
"metadata": {},
"source": [
"---\n",
Expand All @@ -352,7 +352,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "c99f0ea4-7638-4e8a-a0a2-d9f483c8c096",
"id": "20",
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -386,7 +386,7 @@
},
{
"cell_type": "markdown",
"id": "19d38fe1-9d6f-40ec-926d-3c4066a4b66a",
"id": "21",
"metadata": {},
"source": [
"Below, we define a utility function named `use_policy(...)`.\n",
Expand All @@ -406,7 +406,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "e8c6554d-4bdb-49b9-8c2e-956bce6ddb8a",
"id": "22",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -430,7 +430,7 @@
},
{
"cell_type": "markdown",
"id": "28c044fe-4639-411c-be78-ac09cbe5e78f",
"id": "23",
"metadata": {},
"source": [
"We now initialize a new instance of our brax environment, and trigger the jit compilation on its `reset` and `step` methods."
Expand All @@ -439,7 +439,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "c1251e82-1d0f-4e43-a6c5-1ec4c0275dab",
"id": "24",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -454,7 +454,7 @@
},
{
"cell_type": "markdown",
"id": "55229cc2-aad5-4c78-b095-010a538adb40",
"id": "25",
"metadata": {},
"source": [
"Below we run our policy and collect the states of the episodes."
Expand All @@ -463,7 +463,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "220ec837-1d1a-401e-a144-5516bdb3e493",
"id": "26",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -489,7 +489,7 @@
},
{
"cell_type": "markdown",
"id": "c9bbe53a-40f5-4bf5-a063-47f1d88032d6",
"id": "27",
"metadata": {},
"source": [
"Length of the episode and the total reward:"
Expand All @@ -498,7 +498,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "80345e9c-0694-413d-81c2-205dfacdfb5a",
"id": "28",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -507,7 +507,7 @@
},
{
"cell_type": "markdown",
"id": "8b6ec424-e6cc-453a-93fd-eb07e44c1bd6",
"id": "29",
"metadata": {},
"source": [
"Visualization of the policy:"
Expand All @@ -516,7 +516,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "7ec60419-1ad0-4f19-bc1e-f2048577ea29",
"id": "30",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -531,7 +531,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "a07c70f6-2c93-43a1-b4c3-edd3f395302a",
"id": "31",
"metadata": {},
"outputs": [],
"source": [
Expand Down
Loading

0 comments on commit 6d0235e

Please sign in to comment.