Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
optimization
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Erik Strand
optimization
Commits
d04cb601
Commit
d04cb601
authored
5 years ago
by
Erik Strand
Browse files
Options
Downloads
Patches
Plain Diff
Add CMA-ES method that uses with a single std dev
parent
764be714
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
optimization/optimizers/cma_es/cma_es.h
+20
-0
20 additions, 0 deletions
optimization/optimizers/cma_es/cma_es.h
optimization/optimizers/cma_es/main.cpp
+1
-1
1 addition, 1 deletion
optimization/optimizers/cma_es/main.cpp
with
21 additions
and
1 deletion
optimization/optimizers/cma_es/cma_es.h
+
20
−
0
View file @
d04cb601
...
@@ -30,6 +30,13 @@ public:
...
@@ -30,6 +30,13 @@ public:
uint32_t
pop_size
()
const
{
return
pop_size_
;
}
uint32_t
pop_size
()
const
{
return
pop_size_
;
}
uint32_t
&
pop_size
()
{
return
pop_size_
;
}
uint32_t
&
pop_size
()
{
return
pop_size_
;
}
template
<
typename
Objective
>
VectorXs
optimize
(
Objective
&
objective
,
VectorXs
const
&
initial_point
,
Scalar
initial_std_dev
=
0.3
);
template
<
typename
Objective
>
template
<
typename
Objective
>
VectorXs
optimize
(
VectorXs
optimize
(
Objective
&
objective
,
Objective
&
objective
,
...
@@ -49,6 +56,19 @@ private:
...
@@ -49,6 +56,19 @@ private:
uint32_t
n_iterations_
;
uint32_t
n_iterations_
;
};
};
//..................................................................................................
template
<
typename
Objective
>
VectorXs
CmaEs
::
optimize
(
Objective
&
objective
,
VectorXs
const
&
initial_point
,
Scalar
initial_std_dev
)
{
VectorXs
std_dev_vector
;
std_dev_vector
.
resize
(
initial_point
.
size
());
std_dev_vector
.
fill
(
initial_std_dev
);
return
optimize
(
objective
,
initial_point
,
std_dev_vector
);
}
//..................................................................................................
//..................................................................................................
template
<
typename
Objective
>
template
<
typename
Objective
>
VectorXs
CmaEs
::
optimize
(
VectorXs
CmaEs
::
optimize
(
...
...
This diff is collapsed.
Click to expand it.
optimization/optimizers/cma_es/main.cpp
+
1
−
1
View file @
d04cb601
...
@@ -35,7 +35,7 @@ int main(int const argc, char const** argv) {
...
@@ -35,7 +35,7 @@ int main(int const argc, char const** argv) {
clara
::
Opt
(
pop_size
,
"pop_size"
)[
"-p"
][
"--pop-size"
](
"Population size"
)
|
clara
::
Opt
(
pop_size
,
"pop_size"
)[
"-p"
][
"--pop-size"
](
"Population size"
)
|
clara
::
Opt
(
seed
,
"seed"
)[
"-s"
][
"--seed"
](
"Seed for CMA-ES random number generator"
)
|
clara
::
Opt
(
seed
,
"seed"
)[
"-s"
][
"--seed"
](
"Seed for CMA-ES random number generator"
)
|
clara
::
Opt
(
max_evaluations
,
"max_evaluations"
)[
"-n"
][
"--max-evaluations"
](
"Max number of function evaluations"
)
|
clara
::
Opt
(
max_evaluations
,
"max_evaluations"
)[
"-n"
][
"--max-evaluations"
](
"Max number of function evaluations"
)
|
clara
::
Opt
(
max_iterations
,
"max_iterations"
)[
"-
n
"
][
"--max-iterations"
](
"Max number of generations"
)
|
clara
::
Opt
(
max_iterations
,
"max_iterations"
)[
"-
i
"
][
"--max-iterations"
](
"Max number of generations"
)
|
clara
::
Opt
(
rel_y_tol
,
"rel_y_tol"
)[
"-t"
][
"--rel-y-tol"
](
"Termination condition"
)
|
clara
::
Opt
(
rel_y_tol
,
"rel_y_tol"
)[
"-t"
][
"--rel-y-tol"
](
"Termination condition"
)
|
clara
::
Opt
(
x0
,
"x0"
)[
"-x"
][
"--x0"
](
"X coordinate of initial point"
)
|
clara
::
Opt
(
x0
,
"x0"
)[
"-x"
][
"--x0"
](
"X coordinate of initial point"
)
|
clara
::
Opt
(
y0
,
"y0"
)[
"-y"
][
"--y0"
](
"Y coordinate of initial point"
);
clara
::
Opt
(
y0
,
"y0"
)[
"-y"
][
"--y0"
](
"Y coordinate of initial point"
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment