The easy implementation of the Nelder-Mead method.
The Nelder-Mead is the one of derivative-free optimization method. This method is called simplex method or ameba method.
pip install git+https://github.com/owruby/nelder_mead.git
- numpy
from nelder_mead import NelderMead
def sphere(x):
return sum([t**2 for t in x])
def main():
func = sphere
params = {
"x1": ["real", (-512, 512)],
"x2": ["real", (-512, 512)],
}
nm = NelderMead(func, params)
nm.minimize(n_iter=30)
if __name__ == "__main__":
main()