Skip to content

Commit

Permalink
Add an example for the functional API and a bugfix
Browse files Browse the repository at this point in the history
This commit adds a new example notebook which
demonstrates how one can use the functional
operators API to solve problems where a solution
is expressed via objects.

A bugfix is also introduced for the method
`make_callable_evaluator` for problems where
the dtype is set as object.
  • Loading branch information
engintoklu committed Aug 30, 2024
1 parent cd792cc commit 8f3506c
Show file tree
Hide file tree
Showing 3 changed files with 903 additions and 1 deletion.
1 change: 1 addition & 0 deletions examples/notebooks/Functional_API/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ Here are the examples demonstrating various features of this functional API:
- **[Maintaining a batch of populations using the functional EvoTorch API](batched_searches.ipynb)**: 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](functional_ops.ipynb)**: 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](multiobj_batched_ops.ipynb)**: 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](func_rl_ga.ipynb)**: 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](constrained.ipynb)**: 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](problem.ipynb)**: 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 `GymNE` problem for the reinforcement learning task "CartPole-v1", and solves it using the functional `pgpe` implementation.
Loading

0 comments on commit 8f3506c

Please sign in to comment.