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
edeb4f86
Commit
edeb4f86
authored
Nov 21, 2013
by
Davis King
Browse files
Made the multiclass SVM work with label types other than basic integers and floats.
parent
967b5215
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletion
+9
-1
dlib/svm/svm_multiclass_linear_trainer.h
dlib/svm/svm_multiclass_linear_trainer.h
+9
-1
No files found.
dlib/svm/svm_multiclass_linear_trainer.h
View file @
edeb4f86
...
...
@@ -77,7 +77,15 @@ namespace dlib
psi
.
push_back
(
std
::
make_pair
(
dims
-
1
,
static_cast
<
scalar_type
>
(
-
1
)));
// Find which distinct label goes with this psi.
const
long
label_idx
=
index_of_max
(
mat
(
distinct_labels
)
==
labels
[
idx
]);
long
label_idx
=
0
;
for
(
unsigned
long
i
=
0
;
i
<
distinct_labels
.
size
();
++
i
)
{
if
(
distinct_labels
[
i
]
==
labels
[
idx
])
{
label_idx
=
i
;
break
;
}
}
offset_feature_vector
(
psi
,
dims
*
label_idx
);
}
...
...
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