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
05c0b373
Commit
05c0b373
authored
May 23, 2014
by
Davis King
Browse files
Fixed a bug in the prior support related to sparse vector usage.
parent
6a8b0e74
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
dlib/svm/svm_multiclass_linear_trainer.h
dlib/svm/svm_multiclass_linear_trainer.h
+2
-1
No files found.
dlib/svm/svm_multiclass_linear_trainer.h
View file @
05c0b373
...
...
@@ -376,6 +376,7 @@ namespace dlib
temp
=
0
;
b
=
0
;
const
long
pad_size
=
dims
-
prior
.
weights
.
nc
();
// Copy the prior into the temp and b matrices. We have to do this row
// by row copy because the new training data might have new labels we
// haven't seen before and therefore the sizes of these matrices could be
...
...
@@ -383,7 +384,7 @@ namespace dlib
for
(
unsigned
long
i
=
0
;
i
<
prior
.
labels
.
size
();
++
i
)
{
const
long
r
=
std
::
find
(
df
.
labels
.
begin
(),
df
.
labels
.
end
(),
prior
.
labels
[
i
])
-
df
.
labels
.
begin
();
set_rowm
(
temp
,
r
)
=
rowm
(
prior
.
weights
,
i
);
set_rowm
(
temp
,
r
)
=
join_rows
(
rowm
(
prior
.
weights
,
i
)
,
zeros_matrix
<
scalar_type
>
(
1
,
pad_size
))
;
b
(
r
)
=
prior
.
b
(
i
);
}
...
...
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