|
Download modules/evotorch/examples/notebooks/Functional_API/README.md from Johnny5b/portable-ai-runner: direct link, hf CLI and curl.
- Browser
- Download file 2.45 kB
-
https://huggingface.co/datasets/Johnny5b/portable-ai-runner/resolve/main/modules/evotorch/examples/notebooks/Functional_API/README.md
- Command line
-
hf download hf://datasets/Johnny5b/portable-ai-runner/modules/evotorch/examples/notebooks/Functional_API/README.md
-
curl -L -o README.md https://huggingface.co/datasets/Johnny5b/portable-ai-runner/resolve/main/modules/evotorch/examples/notebooks/Functional_API/README.md
2.45 kB
Functional API for Optimization
As an alternative to its object-oriented stateful API, EvoTorch provides an API that conforms to the functional programming paradigm. This functional API has its own advantages like being able to work on not just a single population, but on a batch of populations.
Here are the examples demonstrating various features of this functional API:
- Maintaining a batch of populations using the functional EvoTorch API: This notebook shows how one can efficiently run multiple searches simultaneously, each with its own population and hyperparameter configuration, by maintaining a batch of populations.
- Functional genetic algorithm operators: This notebook shows how one can implement a custom genetic algorithm by combining the genetic algorithm operator implementations provided by the functional API of EvoTorch.
- Functional operators for multi-objective optimization: This notebook shows how one can use the functional operators of EvoTorch for multi-objective optimization. Additionally, batched optimization capabilities of these operators are demonstrated.
- Functional operators for solving problems with non-numeric solutions: This notebook demonstrates how one can use the functional operators of EvoTorch for solving a problem where a solution is not expressed via a fixed-length numeric vector, but via objects (such as lists, dictionaries, etc.). In more details, this example focuses on a neuro-evolutionary reinforcement learning problem, where each policy is encoded via a dictionary.
- Solving constrained optimization problems: EvoTorch provides batching-friendly constraint penalization functions that can be used with both the object-oriented API and the functional API. In addition, these constraint penalization functions can be used with gradient-based optimization. This notebook demonstrates these features.
- Solving reinforcement learning tasks using functional evolutionary algorithms: The functional evolutionary algorithm implementations of EvoTorch can be used to solve problems that are expressed using the object-oriented core API of EvoTorch. To demonstrate this, this notebook instantiates a
GymNEproblem for the reinforcement learning task "CartPole-v1", and solves it using the functionalpgpeimplementation.