Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
f32abe97
Commit
f32abe97
authored
Jul 24, 2018
by
Davis King
Browse files
Slightly changed solver code to avoid a wasted initial iteration.
parent
98d9703d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
dlib/optimization/optimization_solve_qp_using_smo.h
dlib/optimization/optimization_solve_qp_using_smo.h
+2
-2
No files found.
dlib/optimization/optimization_solve_qp_using_smo.h
View file @
f32abe97
...
@@ -511,7 +511,7 @@ namespace dlib
...
@@ -511,7 +511,7 @@ namespace dlib
// We need to get an upper bound on the Lipschitz constant for this QP. Since that
// We need to get an upper bound on the Lipschitz constant for this QP. Since that
// is just the max eigenvalue of Q we can do it using Gershgorin disks.
// is just the max eigenvalue of Q we can do it using Gershgorin disks.
const
T
lipschitz_bound
=
max
(
diag
(
Q
)
+
(
sum_cols
(
abs
(
Q
))
-
abs
(
diag
(
Q
))));
const
T
lipschitz_bound
=
max
(
diag
(
Q
)
+
(
sum_cols
(
abs
(
Q
))
-
abs
(
diag
(
Q
))));
double
lambda
=
0
;
double
lambda
=
1
;
unsigned
long
iter
;
unsigned
long
iter
;
for
(
iter
=
0
;
iter
<
max_iter
;
++
iter
)
for
(
iter
=
0
;
iter
<
max_iter
;
++
iter
)
{
{
...
@@ -829,7 +829,7 @@ namespace dlib
...
@@ -829,7 +829,7 @@ namespace dlib
std
::
vector
<
matrix
<
T
,
NR
,
NC
,
MM
,
L
>>
v
(
alphas
),
v_old
(
alphas
.
size
());
std
::
vector
<
matrix
<
T
,
NR
,
NC
,
MM
,
L
>>
v
(
alphas
),
v_old
(
alphas
.
size
());
double
lambda
=
0
;
double
lambda
=
1
;
unsigned
long
iter
;
unsigned
long
iter
;
// Now do the main iteration block of this solver. The coordinate descent method
// Now do the main iteration block of this solver. The coordinate descent method
// we used above can improve the objective rapidly in the beginning. However,
// we used above can improve the objective rapidly in the beginning. However,
...
...
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