Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dlib
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
钟尚武
dlib
Commits
1eee5ccd
Commit
1eee5ccd
authored
Nov 21, 2017
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup
parent
f924b448
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
8 deletions
+12
-8
global_function_search.cpp
dlib/global_optimization/global_function_search.cpp
+9
-6
global_function_search.h
dlib/global_optimization/global_function_search.h
+3
-2
No files found.
dlib/global_optimization/global_function_search.cpp
View file @
1eee5ccd
...
...
@@ -573,13 +573,16 @@ namespace dlib
global_function_search
::
global_function_search
(
const
std
::
vector
<
function_spec
>&
functions_
,
const
std
::
vector
<
std
::
vector
<
function_evaluation
>>&
initial_function_evals
)
:
global_function_search
(
functions_
)
const
std
::
vector
<
std
::
vector
<
function_evaluation
>>&
initial_function_evals
,
const
double
relative_noise_magnitude_
)
:
global_function_search
(
functions_
)
{
DLIB_CASSERT
(
functions_
.
size
()
==
initial_function_evals
.
size
());
DLIB_CASSERT
(
relative_noise_magnitude
>=
0
);
relative_noise_magnitude
=
relative_noise_magnitude_
;
for
(
size_t
i
=
0
;
i
<
initial_function_evals
.
size
();
++
i
)
{
functions
[
i
]
->
ub
=
upper_bound_function
(
initial_function_evals
[
i
]);
functions
[
i
]
->
ub
=
upper_bound_function
(
initial_function_evals
[
i
]
,
relative_noise_magnitude
);
}
}
...
...
@@ -669,7 +672,7 @@ namespace dlib
auto
tmp
=
pick_next_sample_quad_interp
(
info
->
ub
.
get_points
(),
info
->
radius
,
info
->
spec
.
lower
,
info
->
spec
.
upper
,
info
->
spec
.
is_integer_variable
);
std
::
cout
<<
"QP predicted improvement: "
<<
tmp
.
predicted_improvement
<<
std
::
endl
;
if
(
tmp
.
predicted_improvement
>
qp_eps
)
if
(
tmp
.
predicted_improvement
>
min_trust_region_epsilon
)
{
do_trust_region_step
=
false
;
outstanding_function_eval_request
new_req
;
...
...
@@ -746,7 +749,7 @@ namespace dlib
double
global_function_search
::
get_solver_epsilon
(
)
const
{
return
qp_eps
;
}
)
const
{
return
min_trust_region_epsilon
;
}
void
global_function_search
::
set_solver_epsilon
(
...
...
@@ -754,7 +757,7 @@ namespace dlib
)
{
DLIB_CASSERT
(
0
<=
eps
);
qp_eps
=
eps
;
min_trust_region_epsilon
=
eps
;
}
double
global_function_search
::
...
...
dlib/global_optimization/global_function_search.h
View file @
1eee5ccd
...
...
@@ -144,7 +144,8 @@ namespace dlib
global_function_search
(
const
std
::
vector
<
function_spec
>&
functions_
,
const
std
::
vector
<
std
::
vector
<
function_evaluation
>>&
initial_function_evals
const
std
::
vector
<
std
::
vector
<
function_evaluation
>>&
initial_function_evals
,
const
double
relative_noise_magnitude
=
0
.
001
);
global_function_search
(
const
global_function_search
&
)
=
delete
;
...
...
@@ -210,7 +211,7 @@ namespace dlib
dlib
::
rand
rnd
;
double
pure_random_search_probability
=
0
.
02
;
double
qp_eps
=
1e-11
;
double
min_trust_region_epsilon
=
1e-11
;
double
relative_noise_magnitude
=
0
.
001
;
size_t
num_random_samples
=
5000
;
bool
do_trust_region_step
=
true
;
...
...
Write
Preview
Markdown
is supported
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