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
211f98b5
Commit
211f98b5
authored
Sep 22, 2013
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tweaked find_min_box_constrained() so that the user can easily reuse
computations done in f() when computing der().
parent
bfcae263
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
4 deletions
+17
-4
optimization_abstract.h
dlib/optimization/optimization_abstract.h
+8
-0
optimization_line_search.h
dlib/optimization/optimization_line_search.h
+4
-3
optimization_line_search_abstract.h
dlib/optimization/optimization_line_search_abstract.h
+5
-1
No files found.
dlib/optimization/optimization_abstract.h
View file @
211f98b5
...
...
@@ -330,6 +330,10 @@ namespace dlib
- returns f(#x).
- When calling f() and der(), the input passed to them will always be inside
the box constraints defined by x_lower and x_upper.
- When calling der(x), it will always be the case that the last call to f() was
made with the same x value. This means that you can reuse any intermediate
results from the previous call to f(x) inside der(x) rather than recomputing
them inside der(x).
!*/
// ----------------------------------------------------------------------------------------
...
...
@@ -419,6 +423,10 @@ namespace dlib
- returns f(#x).
- When calling f() and der(), the input passed to them will always be inside
the box constraints defined by x_lower and x_upper.
- When calling der(x), it will always be the case that the last call to f() was
made with the same x value. This means that you can reuse any intermediate
results from the previous call to f(x) inside der(x) rather than recomputing
them inside der(x).
- Note that this function solves the maximization problem by converting it
into a minimization problem. Therefore, the values of f and its derivative
reported to the stopping strategy will be negated. That is, stop_strategy
...
...
dlib/optimization/optimization_line_search.h
View file @
211f98b5
...
...
@@ -452,10 +452,12 @@ namespace dlib
if
(
d0
>
0
&&
alpha
>
0
)
alpha
*=
-
1
;
for
(
unsigned
long
iter
=
0
;
iter
<
max_iter
;
++
iter
)
unsigned
long
iter
=
0
;
while
(
true
)
{
++
max_iter
;
const
double
val
=
f
(
alpha
);
if
(
val
<=
f0
+
alpha
*
rho
*
d0
)
if
(
val
<=
f0
+
alpha
*
rho
*
d0
||
iter
>=
max_iter
)
{
return
alpha
;
}
...
...
@@ -472,7 +474,6 @@ namespace dlib
alpha
*=
step
;
}
}
return
alpha
;
}
// ----------------------------------------------------------------------------------------
...
...
dlib/optimization/optimization_line_search_abstract.h
View file @
211f98b5
...
...
@@ -217,10 +217,14 @@ namespace dlib
rule to decide when the search can stop.
- rho == the parameter of the sufficient decrease condition.
- max_iter == the maximum number of iterations allowable. After this many
evaluations of f() line_search() is guaranteed to terminate.
evaluations of f()
backtracking_
line_search() is guaranteed to terminate.
- The line search starts with the input alpha value and then backtracks until
it finds a good enough alpha value. Once found, it returns the alpha value
such that f(alpha) is significantly closer to the minimum of f than f(0).
- The returned value of alpha will always be the last value of alpha which was
passed to f(). That is, it will always be the case that the last call to f()
made by backtracking_line_search() was f(alpha) where alpha is the return
value from this function.
!*/
// ----------------------------------------------------------------------------------------
...
...
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