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
7cfeffce
Commit
7cfeffce
authored
Jan 28, 2016
by
Federico Allocati
Browse files
Fixed basic example
parent
8f88c218
Changes
2
Hide whitespace changes
Inline
Side-by-side
docs/tutorials/basic_example.rst
View file @
7cfeffce
...
...
@@ -48,29 +48,29 @@ To begin, the ``main`` file has to include the necessary files, and declare the
using namespace limbo;
struct Params {
struct boptimizer {
struct
bayes_opt_
boptimizer {
BO_PARAM(double, noise, 0.0);
BO_PARAM(int, dump_period, -1);
};
struct
init
{
BO_PARAM(int,
nb_samp
le
s
,
10
);
struct
bayes_opt_bobase
{
BO_PARAM(int,
stats_enab
le
d
,
false
);
};
struct
max
it
e
ra
tions
{
BO_PARAM(int, n
_iteration
s,
4
0);
struct
in
it
_
ra
ndomsampling
{
BO_PARAM(int, n
b_sample
s,
1
0);
};
struct gp_ucb : public defaults::gp_ucb {
struct stop_maxiterations {
BO_PARAM(int, n_iterations, 40);
};
struct cmaes : public defaults::cmaes {
struct
opt_
cmaes : public defaults::
opt_
cmaes {
};
struct rprop : public defaults::rprop {
struct
opt_
rprop : public defaults::
opt_
rprop {
};
struct parallel
_
repeater : public defaults::parallel
_
repeater {
struct
opt_
parallelrepeater : public defaults::
opt_
parallelrepeater {
};
};
...
...
@@ -118,29 +118,29 @@ Full ``main.cpp``::
using namespace limbo;
struct Params {
struct boptimizer {
struct
bayes_opt_
boptimizer {
BO_PARAM(double, noise, 0.0);
BO_PARAM(int, dump_period, -1);
};
struct
init
{
BO_PARAM(int,
nb_samp
le
s
,
10
);
struct
bayes_opt_bobase
{
BO_PARAM(int,
stats_enab
le
d
,
false
);
};
struct
max
it
e
ra
tions
{
BO_PARAM(int, n
_iteration
s,
4
0);
struct
in
it
_
ra
ndomsampling
{
BO_PARAM(int, n
b_sample
s,
1
0);
};
struct gp_ucb : public defaults::gp_ucb {
struct stop_maxiterations {
BO_PARAM(int, n_iterations, 40);
};
struct cmaes : public defaults::cmaes {
struct
opt_
cmaes : public defaults::
opt_
cmaes {
};
struct rprop : public defaults::rprop {
struct
opt_
rprop : public defaults::
opt_
rprop {
};
struct parallel
_
repeater : public defaults::parallel
_
repeater {
struct
opt_
parallelrepeater : public defaults::
opt_
parallelrepeater {
};
};
...
...
wscript
View file @
7cfeffce
...
...
@@ -15,6 +15,8 @@ import subprocess
import
limbo
from
waflib.Build
import
BuildContext
import
inspect
def
options
(
opt
):
opt
.
load
(
'compiler_cxx boost waf_unit_test'
)
...
...
@@ -34,7 +36,8 @@ def options(opt):
opt
.
add_option
(
'--experimental'
,
type
=
'string'
,
help
=
'experimental should be compiled? (yes/no)'
,
dest
=
'experimental'
)
opt
.
load
(
'xcode'
)
for
i
in
glob
.
glob
(
'exp/*'
):
opt
.
recurse
(
i
)
if
os
.
path
.
isdir
(
i
):
opt
.
recurse
(
i
)
def
configure
(
conf
):
...
...
@@ -70,6 +73,8 @@ def configure(conf):
conf
.
check_nlopt
()
conf
.
check_libcmaes
()
conf
.
env
.
INCLUDES_LIMBO
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
inspect
.
getfile
(
inspect
.
currentframe
())))
+
"/src"
if
conf
.
env
[
'CXXFLAGS_ODE'
]:
common_flags
+=
' '
+
conf
.
env
[
'CXXFLAGS_ODE'
]
...
...
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