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 19, 2024
1 parent c95af87 commit cd792cc
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 41 deletions.
30 changes: 15 additions & 15 deletions examples/notebooks/Functional_API/functional_ops.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "markdown",
"id": "05a384ac-fa4d-434e-a8c0-367350dec224",
"id": "0",
"metadata": {},
"source": [
"# Genetic algorithm with the help of functional operators\n",
Expand Down Expand Up @@ -32,7 +32,7 @@
},
{
"cell_type": "markdown",
"id": "0f9f42f4-43ad-4766-84ee-8a4fe2a9fe2b",
"id": "1",
"metadata": {},
"source": [
"---\n",
Expand All @@ -47,7 +47,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "3dd28c51-e08b-43b3-8cf9-efecdce49203",
"id": "2",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -59,7 +59,7 @@
},
{
"cell_type": "markdown",
"id": "8379cbbb-084c-461e-889a-2b334d52c138",
"id": "3",
"metadata": {},
"source": [
"Below, we have the implementations for the fitness functions `rastrigin` and `sphere`.\n",
Expand All @@ -71,7 +71,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "5f1d45aa-50a4-4bc8-90a9-ed75b1bb1fbd",
"id": "4",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -86,7 +86,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "ea8ddfeb-48de-4eab-9296-9e7862950d77",
"id": "5",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -97,7 +97,7 @@
},
{
"cell_type": "markdown",
"id": "fd1fe365-ae1b-4898-91d0-cb7517ef5f84",
"id": "6",
"metadata": {},
"source": [
"In this notebook, the variable `f` points to the fitness function whose value we want to minimize:"
Expand All @@ -106,7 +106,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "fc6d3958-61e7-4838-a9c8-0c9c3d0e343c",
"id": "7",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -116,7 +116,7 @@
},
{
"cell_type": "markdown",
"id": "da899fd2-5bfe-41bd-8c76-20d8b5c2bf71",
"id": "8",
"metadata": {},
"source": [
"Various hyperparameters and problem settings:"
Expand All @@ -125,7 +125,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "6625c172-0ec2-492e-9851-0a60594d9086",
"id": "9",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -146,7 +146,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "36782df7-9728-44e2-ab24-312a0e83b0d2",
"id": "10",
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -217,7 +217,7 @@
},
{
"cell_type": "markdown",
"id": "84b24feb-1e84-4de6-ae24-ca277f5f5f4d",
"id": "11",
"metadata": {},
"source": [
"Decision values of the final population:"
Expand All @@ -226,7 +226,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "21898601-e05d-489f-8cc1-3beef8bdd33b",
"id": "12",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -235,7 +235,7 @@
},
{
"cell_type": "markdown",
"id": "a067340a-5c87-4406-82f4-9cdcccaa3349",
"id": "13",
"metadata": {},
"source": [
"Best solution of the final population:"
Expand All @@ -244,7 +244,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "28fccbc1-c605-4b3f-9545-9e4de01b7f07",
"id": "14",
"metadata": {},
"outputs": [],
"source": [
Expand Down
52 changes: 26 additions & 26 deletions examples/notebooks/Functional_API/multiobj_batched_ops.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "markdown",
"id": "3a0bd5c3-661c-4b5d-9960-6f679ac6e1c7",
"id": "0",
"metadata": {},
"source": [
"# Multiobjective optimization via functional operators API\n",
Expand All @@ -13,7 +13,7 @@
},
{
"cell_type": "markdown",
"id": "f37a843a-5d3e-4bdd-a743-244c156d1408",
"id": "1",
"metadata": {},
"source": [
"---\n",
Expand All @@ -24,7 +24,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "fda7ae3a-970b-4803-a222-35cf0550bf19",
"id": "2",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -39,7 +39,7 @@
},
{
"cell_type": "markdown",
"id": "3019da0f-4545-4cbb-bf28-ee0fc5ea2f62",
"id": "3",
"metadata": {},
"source": [
"Below, we implement Kursawe's function.\n",
Expand All @@ -50,7 +50,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "0455f2df-c438-470c-a9e2-c35086c8eed3",
"id": "4",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -73,7 +73,7 @@
},
{
"cell_type": "markdown",
"id": "9b904d3b-8008-4782-9d8d-b9be3f7ec770",
"id": "5",
"metadata": {},
"source": [
"Below, we have the constants regarding the problem, and hyperparameters:"
Expand All @@ -82,7 +82,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "9c634129-8b1e-4050-a618-d5cce7b6843f",
"id": "6",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -100,7 +100,7 @@
},
{
"cell_type": "markdown",
"id": "b29688fc-73ae-4a07-8377-b2c7ddeb9640",
"id": "7",
"metadata": {},
"source": [
"Initialize a population, and store it via the variable `population`:"
Expand All @@ -109,7 +109,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "ab53d77a-c30a-4ed3-ab05-6969a9933280",
"id": "8",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -119,7 +119,7 @@
},
{
"cell_type": "markdown",
"id": "4c7b7c69-d728-4a29-8b5e-6dbb26b4f7b8",
"id": "9",
"metadata": {},
"source": [
"Evaluate the initial population, and store the evaluation results within the variable `evals`:"
Expand All @@ -128,7 +128,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "a3d63e29-6849-4593-bc18-49d200a1298a",
"id": "10",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -138,7 +138,7 @@
},
{
"cell_type": "markdown",
"id": "8022fda7-0d73-432e-afe3-d5c1c2ca7d12",
"id": "11",
"metadata": {},
"source": [
"Main loop of the optimization:"
Expand All @@ -147,7 +147,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "378e59ee-31f7-41e0-b3e1-a9059e4c6aef",
"id": "12",
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -206,7 +206,7 @@
},
{
"cell_type": "markdown",
"id": "7fae1133-c0a5-4867-ad65-58bd4d25cb77",
"id": "13",
"metadata": {},
"source": [
"Considering that `evals` now stores the evaluation results of the latest population, we can take the best solutions belonging to the best pareto-front as follows:"
Expand All @@ -215,7 +215,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "2a26ede1-490d-4925-914a-475c731b119c",
"id": "14",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -239,7 +239,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "4349eb26-1d33-403b-8f59-b9a3c506f4dc",
"id": "15",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -248,7 +248,7 @@
},
{
"cell_type": "markdown",
"id": "6027aa8a-cc0a-433a-b0de-2956137becaa",
"id": "16",
"metadata": {},
"source": [
"Plot the fitnesses of the best solutions:"
Expand All @@ -257,7 +257,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "f2e29903-a3e5-4f2a-9f35-2e73fd5988ec",
"id": "17",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -268,7 +268,7 @@
},
{
"cell_type": "markdown",
"id": "6d5be444-bad7-42eb-be8f-3bdb57f358c0",
"id": "18",
"metadata": {},
"source": [
"---\n",
Expand All @@ -283,7 +283,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "8f38b144-9bf3-4d4e-a266-14efbe909905",
"id": "19",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -305,7 +305,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "1c82431e-e9f4-4d6e-9dba-b4a711139480",
"id": "20",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -328,7 +328,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "24f5a201-7d33-4bee-a569-dbfa97d0efd3",
"id": "21",
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -373,7 +373,7 @@
},
{
"cell_type": "markdown",
"id": "66418331-30da-48b0-a2ea-425ba8b30730",
"id": "22",
"metadata": {},
"source": [
"For each solution within each population, compute the domination count:"
Expand All @@ -382,7 +382,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "4f7cd61d-0396-4e52-a4a2-e793791991c7",
"id": "23",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -392,7 +392,7 @@
},
{
"cell_type": "markdown",
"id": "403568ab-5463-4c4a-bccc-3dd918eb60a5",
"id": "24",
"metadata": {},
"source": [
"From each population, take the best pareto-front, and plot the fitnesses belonging to that pareto-front:"
Expand All @@ -401,7 +401,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "ccc9ffcc-06ff-44b0-998f-5874468c2383",
"id": "25",
"metadata": {},
"outputs": [],
"source": [
Expand Down

0 comments on commit cd792cc

Please sign in to comment.