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
ceec4566
Commit
ceec4566
authored
Jan 05, 2015
by
Davis King
Browse files
Added some checks that the user produces PSI vectors that are the proper
dimension.
parent
afa4fe0c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
dlib/svm/structural_svm_problem.h
dlib/svm/structural_svm_problem.h
+11
-0
No files found.
dlib/svm/structural_svm_problem.h
View file @
ceec4566
...
@@ -75,6 +75,12 @@ namespace dlib
...
@@ -75,6 +75,12 @@ namespace dlib
psi
=
true_psi
;
psi
=
true_psi
;
else
else
prob
->
get_truth_joint_feature_vector
(
sample_idx
,
psi
);
prob
->
get_truth_joint_feature_vector
(
sample_idx
,
psi
);
if
(
is_matrix
<
feature_vector_type
>::
value
)
{
DLIB_CASSERT
(
psi
.
size
()
==
(
unsigned
long
)
prob
->
get_num_dimensions
(),
"The dimensionality of your PSI vector doesn't match get_num_dimensions()"
);
}
}
}
void
separation_oracle_cached
(
void
separation_oracle_cached
(
...
@@ -128,6 +134,11 @@ namespace dlib
...
@@ -128,6 +134,11 @@ 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
(
is_matrix
<
feature_vector_type
>::
value
)
{
DLIB_CASSERT
(
out_psi
.
size
()
==
(
unsigned
long
)
prob
->
get_num_dimensions
(),
"The dimensionality of your PSI vector doesn't match get_num_dimensions()"
);
}
if
(
!
cache_enabled
)
if
(
!
cache_enabled
)
return
;
return
;
...
...
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