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
9904a3ae
Commit
9904a3ae
authored
May 19, 2011
by
Davis King
Browse files
Made caching object a little more robust.
parent
bb72961a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
dlib/svm/structural_svm_problem.h
dlib/svm/structural_svm_problem.h
+4
-1
No files found.
dlib/svm/structural_svm_problem.h
View file @
9904a3ae
...
@@ -65,7 +65,7 @@ namespace dlib
...
@@ -65,7 +65,7 @@ namespace dlib
feature_vector_type
&
out_psi
feature_vector_type
&
out_psi
)
const
)
const
{
{
if
(
!
skip_cache
)
if
(
!
skip_cache
&&
prob
->
get_max_cache_size
()
!=
0
)
{
{
scalar_type
best_risk
=
-
std
::
numeric_limits
<
scalar_type
>::
infinity
();
scalar_type
best_risk
=
-
std
::
numeric_limits
<
scalar_type
>::
infinity
();
unsigned
long
best_idx
=
0
;
unsigned
long
best_idx
=
0
;
...
@@ -102,6 +102,9 @@ namespace dlib
...
@@ -102,6 +102,9 @@ namespace dlib
prob
->
separation_oracle
(
sample_idx
,
current_solution
,
out_loss
,
out_psi
);
prob
->
separation_oracle
(
sample_idx
,
current_solution
,
out_loss
,
out_psi
);
if
(
prob
->
get_max_cache_size
()
==
0
)
return
;
// if the cache is full
// if the cache is full
if
(
loss
.
size
()
>=
prob
->
get_max_cache_size
())
if
(
loss
.
size
()
>=
prob
->
get_max_cache_size
())
{
{
...
...
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