Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Matthias Mayr
limbo
Commits
a2b91d3f
Commit
a2b91d3f
authored
Sep 27, 2016
by
Konstantinos Chatzilygeroudis
Committed by
GitHub
Sep 27, 2016
Browse files
Merge pull request #165 from resibots/cleaning_mo
Cleaning experimental/Multi objective
parents
49228900
c760f420
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/examples/experimental/multi.cpp
View file @
a2b91d3f
...
...
@@ -46,7 +46,9 @@
#include
<limbo/experimental/bayes_opt/parego.hpp>
#include
<limbo/experimental/bayes_opt/nsbo.hpp>
#include
<limbo/experimental/bayes_opt/ehvi.hpp>
#include
<limbo/experimental/stat/pareto_front.hpp>
#include
<limbo/experimental/stat/pareto_benchmark.hpp>
#include
<limbo/experimental/stat/hyper_volume.hpp>
using
namespace
limbo
;
...
...
@@ -90,10 +92,17 @@ struct Params {
struct
mean_constant
:
public
defaults
::
mean_constant
{
};
struct
bayes_opt_ehvi
{
struct
bayes_opt_ehvi
:
public
defaults
::
bayes_opt_ehvi
{
BO_PARAM
(
double
,
x_ref
,
-
11
);
BO_PARAM
(
double
,
y_ref
,
-
11
);
};
struct
model_gp_parego
:
public
experimental
::
defaults
::
model_gp_parego
{
};
struct
stat_hyper_volume
{
BO_PARAM_ARRAY
(
double
,
ref
,
10
,
10
);
};
};
#ifdef DIM6
...
...
@@ -106,6 +115,8 @@ struct Params {
struct
zdt1
{
static
constexpr
size_t
dim_in
=
ZDT_DIM
;
static
constexpr
size_t
dim_out
=
2
;
Eigen
::
VectorXd
operator
()(
const
Eigen
::
VectorXd
&
x
)
const
{
Eigen
::
VectorXd
res
(
2
);
...
...
@@ -123,6 +134,8 @@ struct zdt1 {
struct
zdt2
{
static
constexpr
size_t
dim_in
=
ZDT_DIM
;
static
constexpr
size_t
dim_out
=
2
;
Eigen
::
VectorXd
operator
()(
const
Eigen
::
VectorXd
&
x
)
const
{
Eigen
::
VectorXd
res
(
2
);
...
...
@@ -140,6 +153,8 @@ struct zdt2 {
struct
zdt3
{
static
constexpr
size_t
dim_in
=
ZDT_DIM
;
static
constexpr
size_t
dim_out
=
2
;
Eigen
::
VectorXd
operator
()(
const
Eigen
::
VectorXd
&
x
)
const
{
Eigen
::
VectorXd
res
(
2
);
...
...
@@ -190,13 +205,16 @@ int main()
typedef
mop2
func_t
;
#endif
using
stat_t
=
boost
::
fusion
::
vector
<
experimental
::
stat
::
ParetoBenchmark
<
func_t
>>
;
#ifdef PAREGO
Parego
<
Params
,
statsfun
<
stat_t
>>
opt
;
using
stat_t
=
boost
::
fusion
::
vector
<
experimental
::
stat
::
ParetoFront
<
Params
>
,
experimental
::
stat
::
HyperVolume
<
Params
>
,
stat
::
ConsoleSummary
<
Params
>>
;
experimental
::
bayes_opt
::
Parego
<
Params
,
statsfun
<
stat_t
>>
opt
;
#elif defined(NSBO)
Nsbo
<
Params
,
statsfun
<
stat_t
>>
opt
;
using
stat_t
=
boost
::
fusion
::
vector
<
experimental
::
stat
::
ParetoBenchmark
<
func_t
>>
;
experimental
::
bayes_opt
::
Nsbo
<
Params
,
statsfun
<
stat_t
>>
opt
;
#else
using
stat_t
=
boost
::
fusion
::
vector
<
experimental
::
stat
::
ParetoBenchmark
<
func_t
>>
;
experimental
::
bayes_opt
::
Ehvi
<
Params
,
statsfun
<
stat_t
>>
opt
;
#endif
opt
.
optimize
(
func_t
());
...
...
src/examples/experimental/wscript
View file @
a2b91d3f
...
...
@@ -62,9 +62,23 @@ def build(bld):
obj
=
bld
.
program
(
features
=
'cxx'
,
source
=
'multi.cpp'
,
includes
=
'.. ../.. ../../../'
,
target
=
'multi'
,
target
=
'multi
_ehvi
'
,
uselib
=
'BOOST EIGEN TBB SFERES LIBCMAES NLOPT'
,
use
=
'limbo'
)
obj
=
bld
.
program
(
features
=
'cxx'
,
source
=
'multi.cpp'
,
includes
=
'.. ../.. ../../../'
,
target
=
'multi_parego'
,
uselib
=
'BOOST EIGEN TBB SFERES LIBCMAES NLOPT'
,
defines
=
'PAREGO'
,
use
=
'limbo'
)
obj
=
bld
.
program
(
features
=
'cxx'
,
source
=
'multi.cpp'
,
includes
=
'.. ../.. ../../../'
,
target
=
'multi_nsbo'
,
uselib
=
'BOOST EIGEN TBB SFERES LIBCMAES NLOPT'
,
defines
=
'NSBO'
,
use
=
'limbo'
)
obj
=
bld
.
program
(
features
=
'cxx'
,
source
=
'constrained_ei.cpp'
,
includes
=
'.. ../.. ../../../'
,
...
...
src/limbo/experimental/bayes_opt/ehvi.hpp
View file @
a2b91d3f
...
...
@@ -106,7 +106,6 @@ namespace limbo {
acqui_optimizer_t
inner_opt
;
while
(
this
->
_samples
.
size
()
==
0
||
!
this
->
_stop
(
*
this
,
FirstElem
()))
{
std
::
cout
.
flush
();
this
->
template
update_pareto_model
<
EvalFunction
::
dim_in
>();
this
->
update_pareto_data
();
...
...
@@ -141,7 +140,7 @@ namespace limbo {
};
auto
comp
=
[](
const
pair_t
&
v1
,
const
pair_t
&
v2
)
{
return
v1
.
second
>
v2
.
second
;
return
v1
.
second
>
v2
.
second
;
};
auto
m
=
tools
::
par
::
max
(
init
,
this
->
pareto_data
().
size
(),
body
,
comp
);
...
...
src/limbo/experimental/bayes_opt/nsbo.hpp
View file @
a2b91d3f
...
...
@@ -74,7 +74,7 @@ namespace limbo {
while
(
this
->
_samples
.
size
()
==
0
||
!
this
->
_stop
(
*
this
,
FirstElem
()))
{
std
::
cout
<<
"updating pareto model..."
;
std
::
cout
.
flush
();
this
->
template
update_pareto_model
<
EvalFunction
::
dim
>();
this
->
template
update_pareto_model
<
EvalFunction
::
dim
_in
>();
std
::
cout
<<
"ok"
<<
std
::
endl
;
auto
pareto
=
this
->
pareto_model
();
...
...
@@ -98,9 +98,10 @@ namespace limbo {
protected:
// former way to deal with the template of RefreshStat
/* void _update_stats() {
boost::fusion::for_each(this->_stat, RefreshStat_f<Nsbo>(*this));
}*/
// void _update_stats()
// {
// boost::fusion::for_each(this->_stat, RefreshStat_f<Nsbo>(*this));
// }
};
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment