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 Aug 30, 2024
1 parent 8f3506c commit 6644480
Showing 1 changed file with 41 additions and 41 deletions.
82 changes: 41 additions & 41 deletions examples/notebooks/Functional_API/func_rl_ga.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "markdown",
"id": "f9dc9f5e-802f-4305-9919-bd2202f8a63b",
"id": "0",
"metadata": {},
"source": [
"# Evolving objects using the functional operators API of EvoTorch\n",
Expand Down Expand Up @@ -44,7 +44,7 @@
},
{
"cell_type": "markdown",
"id": "8df623bd-3cc6-44d8-888f-fe16460ffa9a",
"id": "1",
"metadata": {},
"source": [
"## Summary of the evolutionary algorithm\n",
Expand All @@ -69,7 +69,7 @@
},
{
"cell_type": "markdown",
"id": "510e620e-a815-48c8-901b-7eeba7781786",
"id": "2",
"metadata": {},
"source": [
"## Implementation"
Expand All @@ -78,7 +78,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "9a2b0b8b-7bc6-49e3-ac27-21aba81cb2df",
"id": "3",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -102,7 +102,7 @@
},
{
"cell_type": "markdown",
"id": "e0b522cd-4ce1-4fc5-a0a7-f066bb1a2a04",
"id": "4",
"metadata": {},
"source": [
"The function below takes a series of seeds, and makes a tensor of real numbers out of them.\n",
Expand All @@ -112,7 +112,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "210a3488-9370-4a87-bf8f-46f059379243",
"id": "5",
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -157,7 +157,7 @@
},
{
"cell_type": "markdown",
"id": "7cdb5a99-7372-43a3-a7a1-07ec892c6192",
"id": "6",
"metadata": {},
"source": [
"Helper function to generate a random seed integer:"
Expand All @@ -166,7 +166,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "fe325334-8f42-41d8-98bb-a8db25980da4",
"id": "7",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -176,7 +176,7 @@
},
{
"cell_type": "markdown",
"id": "5808a486-5178-4409-9ba2-b0a34bf92dff",
"id": "8",
"metadata": {},
"source": [
"**Observation normalization.**\n",
Expand All @@ -187,7 +187,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "06b496a8-9874-44d0-859f-b67086f62474",
"id": "9",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -212,7 +212,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "abf2e4c9-abe7-4a8b-b844-a07729754458",
"id": "10",
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -307,7 +307,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "3fde9767-b959-450b-896b-6a5e129f329f",
"id": "11",
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -342,7 +342,7 @@
},
{
"cell_type": "markdown",
"id": "8f782f05-93b6-4d80-9679-e3b6028428e3",
"id": "12",
"metadata": {},
"source": [
"**Problem definition.**\n",
Expand All @@ -353,7 +353,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "c8216b77-0f64-4f9d-8a3d-44cfe3deaec5",
"id": "13",
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -526,7 +526,7 @@
},
{
"cell_type": "markdown",
"id": "394066c3-6eeb-44d1-baa0-fcae4e2101ef",
"id": "14",
"metadata": {},
"source": [
"We now define our mutation and cross-over operators, via the functions `mutate` and `cross_over`.\n",
Expand All @@ -536,7 +536,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "676714c9-6288-459f-aeef-411849a2af2b",
"id": "15",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -555,7 +555,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "62cf3114-83b0-48d3-be2e-3dd8387d8c32",
"id": "16",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -580,7 +580,7 @@
},
{
"cell_type": "markdown",
"id": "51178388-1db5-4864-8012-607558f7a151",
"id": "17",
"metadata": {},
"source": [
"ID of the considered reinforcement learning task:"
Expand All @@ -589,7 +589,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "68f3b4f1-9120-4d0c-a314-cff8a6a1ad93",
"id": "18",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -598,7 +598,7 @@
},
{
"cell_type": "markdown",
"id": "f2f43b33-d6a1-4fd0-97bb-750a8e3c6667",
"id": "19",
"metadata": {},
"source": [
"Generate or load observation data for the considered reinforcement learning environment:"
Expand All @@ -607,7 +607,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "35d310cd-fca4-4887-8dd8-0b586efd7e48",
"id": "20",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -617,7 +617,7 @@
},
{
"cell_type": "markdown",
"id": "6e6ef3aa-1f8f-4ee1-807c-0770dbb0312f",
"id": "21",
"metadata": {},
"source": [
"Instantiate the problem object:"
Expand All @@ -626,7 +626,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "c89d035f-c24f-45cb-ae3f-af2ffd49377d",
"id": "22",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -644,7 +644,7 @@
},
{
"cell_type": "markdown",
"id": "ff43c026-6588-4b38-841c-677bd4faf0e5",
"id": "23",
"metadata": {},
"source": [
"Out of the instantiated problem object, we make a callable evaluator named `f`.\n",
Expand All @@ -654,7 +654,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "bc9c6588-535a-4e3e-90f4-e994a730068b",
"id": "24",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -664,7 +664,7 @@
},
{
"cell_type": "markdown",
"id": "78b7f831-1202-44d3-88de-dbad81f1d7df",
"id": "25",
"metadata": {},
"source": [
"Helper function for converting a real number to a string.\n",
Expand All @@ -674,7 +674,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "fbd919a7-ca9d-4c13-90ef-d6cddb23faef",
"id": "26",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -684,7 +684,7 @@
},
{
"cell_type": "markdown",
"id": "5f1cc2b1-7d2d-44d7-8741-e523c2a01050",
"id": "27",
"metadata": {},
"source": [
"Hyperparameters and constants for the evolutionary algorithm:"
Expand All @@ -693,7 +693,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "b7c2b6eb-d1d4-4b54-a3db-7125dcb9725c",
"id": "28",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -705,7 +705,7 @@
},
{
"cell_type": "markdown",
"id": "ed62ae2d-87f5-4e5a-8dd8-57a90254dbd2",
"id": "29",
"metadata": {},
"source": [
"We now prepare the initial population.\n",
Expand All @@ -715,7 +715,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "f80777a0-8b9b-492f-8306-67f8913a3596",
"id": "30",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -725,7 +725,7 @@
},
{
"cell_type": "markdown",
"id": "b513cd3d-01b5-4b3f-ad2d-74631f443a65",
"id": "31",
"metadata": {},
"source": [
"Evaluate the fitnesses of the solutions within the initial population:"
Expand All @@ -734,7 +734,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "a6d075e7-27be-4019-a783-d0c024fa6cd0",
"id": "32",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -744,7 +744,7 @@
},
{
"cell_type": "markdown",
"id": "128ab3ce-30f8-43b3-b966-1a7c0a5099df",
"id": "33",
"metadata": {},
"source": [
"Main loop of the evolutionary search:"
Expand All @@ -753,7 +753,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "c78a7d4f-9c12-4bd5-977e-668acb44af79",
"id": "34",
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -819,7 +819,7 @@
},
{
"cell_type": "markdown",
"id": "57a2765d-df97-4a48-a593-323cfff07116",
"id": "35",
"metadata": {},
"source": [
"Take the index of the best solution within the last population:"
Expand All @@ -828,7 +828,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "2a6a6376-f296-498d-8ff0-d039d6c67099",
"id": "36",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -838,7 +838,7 @@
},
{
"cell_type": "markdown",
"id": "76691a35-b997-49d5-9585-0ecf850608fc",
"id": "37",
"metadata": {},
"source": [
"Take the best solution within the last population:"
Expand All @@ -847,7 +847,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "b2f773b5-3b46-4046-828a-7ca60fd4be5a",
"id": "38",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -857,7 +857,7 @@
},
{
"cell_type": "markdown",
"id": "f63d773f-3059-462f-808a-fddf4ae721dc",
"id": "39",
"metadata": {},
"source": [
"Visualize the gait of the population's best solution:"
Expand All @@ -866,7 +866,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "fe415cc7-b08b-4ffa-9548-78c3e890bfff",
"id": "40",
"metadata": {},
"outputs": [],
"source": [
Expand Down

0 comments on commit 6644480

Please sign in to comment.