Skip to content

Commit

Permalink
[Opt] Exposed Powell and NelderMead gradient-free optimizers
Browse files Browse the repository at this point in the history
  • Loading branch information
arpastrana committed Oct 9, 2024
1 parent c87bd04 commit 2fba7bc
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- Wrapped two gradient-free optimizers from scipy: Nelder-Mead and Powell. They are available as `jax_fdm.optimizers.NelderMead` and `jax_fdm.optimizers.Powell`, respectively.
- Linked two evolutionary optimizers from scipy They are available as `jax_fdm.optimizers.DualAnnealing` and `jax_fdm.optimizers.DifferentialEvolution`.
- Added support for kwargs in `LossPlotter.plot()`. The kwargs control the parameters of the equilibrium model used to plot the loss history.
- Added `VertexSupportParameter.index()`. This change might appear redundant, but it was necessary to deal with the method resolution order of the parent classes of `VertexSupportParameter`.
- Added `VertexGroupSupportParameter.index()` for similar reasons as the listed above.
Expand Down
24 changes: 24 additions & 0 deletions src/jax_fdm/optimization/optimizers/gradient_free.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
"""
A collection of scipy-powered, gradient-free optimizers.
"""
from jax_fdm.optimization.optimizers import Optimizer


# ==========================================================================
# Optimizers
# ==========================================================================

class Powell(Optimizer):
"""
The modified Powell algorithm for gradient-free optimization with box constraints.
"""
def __init__(self, **kwargs):
super().__init__(name="Powell", disp=0, **kwargs)


class NelderMead(Optimizer):
"""
The Nelder-Mead gradient-free optimizer with box constraints.
"""
def __init__(self, **kwargs):
super().__init__(name="Nelder-Mead", disp=0, **kwargs)

0 comments on commit 2fba7bc

Please sign in to comment.