flopt
latest

Contents:

  • Installation
  • Tutorial
  • Case Studies
  • Solvers
    • Solver Selector
    • Iterative Search
    • Swarm Intelligence Search
    • Baysian Search
    • Evolution Search
      • OptunaCmaEsSearch
        • OptunaCmaEsSearch
      • OptunaNSGAIISearch
        • OptunaNSGAIISearch
    • Quadratic Programming Search
    • Linear Programming Search
    • non-Linear Programming Search
    • Quantum Annealing Search
  • API Reference
  • Internal Reference
  • Recipes
flopt
  • Solvers
  • Evolution Search
  • Edit on GitHub

Evolution Search

OptunaCmaEsSearch

Solver name is “OptunaCmaEs”.

https://img.shields.io/badge/Variable-Number-blue.svghttps://img.shields.io/badge/Objective-any-orange.svghttps://img.shields.io/badge/Constraints-None-green.svg
class flopt.solvers.optuna_searches.OptunaCmaEsSearch[source]

Covariance Matrix Adaptation Evolution Strategy (CMA-ES) search of Optuna. https://optuna.readthedocs.io/en/latest/reference/samplers/generated/optuna.samplers.CmaEsSampler.html

Parameters:
  • sigma0 –

  • n_startup_trials –

  • independent_sampler –

  • warn_independe_sampling –

  • seed –

Examples

import flopt

x = flopt.Variable("x", lowBound=-1, upBound=1, cat="Continuous")
y = flopt.Variable("y", lowBound=-1, upBound=1, cat="Continuous")

prob = flopt.Problem()
prob += 2*x*x + x*y + y*y + x + y

status, log = prob.solve(solver="OptunaCmaEs", msg=True, timelimit=1)

print("obj =", flopt.Value(prob.obj))
print("x =", flopt.Value(x))
print("y =", flopt.Value(y))
>>> obj = -0.2857142857142857
>>> x = -0.14285714185152507
>>> y = -0.4285714299429902

OptunaNSGAIISearch

Solver name is “OptunaNSGAII”.

https://img.shields.io/badge/Variable-Number-blue.svghttps://img.shields.io/badge/Objective-any-orange.svghttps://img.shields.io/badge/Constraints-any-green.svg
class flopt.solvers.optuna_searches.OptunaNSGAIISearch[source]

Multi-objective sampler using the NSGA-II algorithm of Optuna. This solver can solve constrainted problems, but it cannot handle equal constraints well.

Parameters:
  • name (str) – name

  • population_size (int) –

  • mutation_prob (float) –

  • crossover –

  • crossover_prob (float) –

  • swapping_prob (float) –

  • seed (float) – seed of random generater

Examples

import flopt

x = flopt.Variable("x", lowBound=-1, upBound=1, cat="Continuous")
y = flopt.Variable("y", lowBound=-1, upBound=1, cat="Continuous")

prob = flopt.Problem()
prob += 2*x*x + x*y + y*y + x + y
prob += x + y >= 0

status, log = prob.solve(solver="OptunaNSGAII", msg=True, timelimit=1)

print("obj =", flopt.Value(prob.obj))
print("x =", flopt.Value(x))
print("y =", flopt.Value(y))
Previous Next

© Copyright 2021, Nariaki Tateiwa. Revision ff418914.

Built with Sphinx using a theme provided by Read the Docs.