-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CMA-ES: fix numerical overflow errors #126
Conversation
c-bata
commented
Apr 22, 2020
- Cache B and D for faster sampling
- Avoid numerical overflow errors.
Benchmark result of rosenbrock function
Please refer to "A Strategy for Ranking Optimizers using Multiple Criteria" for the ranking strategy used in this report. Please expand here for more details.Table of ContentsOverall Results
Individual Results(1) Problem: Rosenbrock Function
SolversID: bcb361930b088ad765b33edfe444986095c910402687ed162e8f6c11a5351b43recipe: {
"command": {
"path": "/home/runner/work/goptuna/goptuna/bin/goptuna_solver",
"args": [
"cmaes"
]
}
} specification: {
"name": "Goptuna (CMA-ES)",
"attrs": {
"github": "https://github.com/c-bata/goptuna"
},
"capabilities": [
"UNIFORM_CONTINUOUS",
"UNIFORM_DISCRETE",
"LOG_UNIFORM_CONTINUOUS",
"CATEGORICAL",
"CONDITIONAL",
"CONCURRENT"
]
} ID: 0ad8d093bea14b3a09cf7d28c548620c8df56b6dfd330f74aa6cd234c7898c44recipe: {
"command": {
"path": "python",
"args": [
"/home/runner/work/goptuna/goptuna/_benchmarks/optuna_solver.py",
"cmaes"
]
}
} specification: {
"name": "Optuna (CMA-ES)",
"attrs": {
"github": "https://github.com/optuna/optuna",
"paper": "Akiba, Takuya, et al. \"Optuna: A next-generation hyperparameter optimization framework.\" Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining. ACM, 2019.",
"version": "optuna=1.3.0, kurobako-py=0.1.5"
},
"capabilities": [
"UNIFORM_CONTINUOUS",
"UNIFORM_DISCRETE",
"LOG_UNIFORM_CONTINUOUS",
"CATEGORICAL",
"CONDITIONAL",
"CONCURRENT"
]
} ID: d68b081af9fa6cddfbb0253616526b338f391dc7050393134faec93c510a22a2recipe: {
"random": {}
} specification: {
"name": "Random",
"attrs": {
"version": "kurobako_solvers=0.1.7"
},
"capabilities": [
"UNIFORM_CONTINUOUS",
"UNIFORM_DISCRETE",
"LOG_UNIFORM_CONTINUOUS",
"LOG_UNIFORM_DISCRETE",
"CATEGORICAL",
"CONDITIONAL",
"MULTI_OBJECTIVE",
"CONCURRENT"
]
} ProblemsID: 01f15f09812e2d814a26d1219a981765c157b45100698158c37abe239cea997brecipe: {
"command": {
"path": "/home/runner/work/goptuna/goptuna/bin/rosenbrock_problem",
"args": []
}
} specification: {
"name": "Rosenbrock Function",
"attrs": {},
"params_domain": [
{
"name": "x1",
"range": {
"type": "CONTINUOUS",
"low": -5.0,
"high": 10.0
},
"distribution": "UNIFORM",
"constraint": null
},
{
"name": "x2",
"range": {
"type": "CONTINUOUS",
"low": -5.0,
"high": 10.0
},
"distribution": "UNIFORM",
"constraint": null
}
],
"values_domain": [
{
"name": "Rosenbrock",
"range": {
"type": "CONTINUOUS"
},
"distribution": "UNIFORM",
"constraint": null
}
],
"steps": 1
} StudiesID: 5215baebf9217aa9dd2b3904fde351f6eba751db45f36a9b9f84e616754878ab
ID: 767ec7bc7a60a8108a1e2885a50073ed21887babf6355d916e1ce7c1c4711caf
ID: ff11e028559c0dd7fba670fdbaa978c691eed425893e295908fde1ab9f6a3501
|
Benchmark result of himmelblau function
Please refer to "A Strategy for Ranking Optimizers using Multiple Criteria" for the ranking strategy used in this report. Please expand here for more details.Table of ContentsOverall Results
Individual Results(1) Problem: Himmelblau Function
SolversID: bcb361930b088ad765b33edfe444986095c910402687ed162e8f6c11a5351b43recipe: {
"command": {
"path": "/home/runner/work/goptuna/goptuna/bin/goptuna_solver",
"args": [
"cmaes"
]
}
} specification: {
"name": "Goptuna (CMA-ES)",
"attrs": {
"github": "https://github.com/c-bata/goptuna"
},
"capabilities": [
"UNIFORM_CONTINUOUS",
"UNIFORM_DISCRETE",
"LOG_UNIFORM_CONTINUOUS",
"CATEGORICAL",
"CONDITIONAL",
"CONCURRENT"
]
} ID: 0ad8d093bea14b3a09cf7d28c548620c8df56b6dfd330f74aa6cd234c7898c44recipe: {
"command": {
"path": "python",
"args": [
"/home/runner/work/goptuna/goptuna/_benchmarks/optuna_solver.py",
"cmaes"
]
}
} specification: {
"name": "Optuna (CMA-ES)",
"attrs": {
"github": "https://github.com/optuna/optuna",
"paper": "Akiba, Takuya, et al. \"Optuna: A next-generation hyperparameter optimization framework.\" Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining. ACM, 2019.",
"version": "optuna=1.3.0, kurobako-py=0.1.5"
},
"capabilities": [
"UNIFORM_CONTINUOUS",
"UNIFORM_DISCRETE",
"LOG_UNIFORM_CONTINUOUS",
"CATEGORICAL",
"CONDITIONAL",
"CONCURRENT"
]
} ID: d68b081af9fa6cddfbb0253616526b338f391dc7050393134faec93c510a22a2recipe: {
"random": {}
} specification: {
"name": "Random",
"attrs": {
"version": "kurobako_solvers=0.1.7"
},
"capabilities": [
"UNIFORM_CONTINUOUS",
"UNIFORM_DISCRETE",
"LOG_UNIFORM_CONTINUOUS",
"LOG_UNIFORM_DISCRETE",
"CATEGORICAL",
"CONDITIONAL",
"MULTI_OBJECTIVE",
"CONCURRENT"
]
} ProblemsID: 7fdd0558317568e22a2e73e288d22ae45e759e2927344a1d7d35855b93f7200frecipe: {
"command": {
"path": "/home/runner/work/goptuna/goptuna/bin/himmelblau_problem",
"args": []
}
} specification: {
"name": "Himmelblau Function",
"attrs": {},
"params_domain": [
{
"name": "x1",
"range": {
"type": "CONTINUOUS",
"low": -4.0,
"high": 4.0
},
"distribution": "UNIFORM",
"constraint": null
},
{
"name": "x2",
"range": {
"type": "CONTINUOUS",
"low": -4.0,
"high": 4.0
},
"distribution": "UNIFORM",
"constraint": null
}
],
"values_domain": [
{
"name": "Himmelblau",
"range": {
"type": "CONTINUOUS"
},
"distribution": "UNIFORM",
"constraint": null
}
],
"steps": 1
} StudiesID: ae946b970cfe58137d8cdb686af8fdea34750af1108e1ce4e9902ed5c4bbb7da
ID: 684ad9080bf355bb5760fd9212020f1ea2119a8a0aa377f1552b265b6e2de5f5
ID: d3db75251403a5a572731f0b93433b3142f7ef594e7b0f317f0768fb30b34572
|
|
I confirmed the error won't be raised even if I updated 1M generations (and sampled 6M trials): package main
import (
"fmt"
"math"
"github.com/c-bata/goptuna/cmaes"
)
func objective(x1, x2 float64) float64 {
return math.Pow(x1-3, 2) + math.Pow(10*(x2+2), 2)
}
func main() {
mean := []float64{1, 2}
sigma0 := 1.3
optimizer, err := cmaes.NewOptimizer(
mean, sigma0,
cmaes.OptimizerOptionSeed(0),
)
if err != nil {
panic(err)
}
n := 0
solutions := make([]*cmaes.Solution, optimizer.PopulationSize())
for generation := 0; generation < 1000000; generation++ {
for i := 0; i < optimizer.PopulationSize(); i++ {
x, err := optimizer.Ask()
if err != nil {
panic(err)
}
n++
x1, x2 := x[0], x[1]
v := objective(x1, x2)
solutions[i] = &cmaes.Solution{
Params: x,
Value: v,
}
fmt.Printf("generation %d: %f (x1=%f, x2=%f)\n",
generation, v, x1, x2)
}
err = optimizer.Tell(solutions)
if err != nil {
panic(err)
}
}
fmt.Println("n:", n)
}
|