Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dlib
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
钟尚武
dlib
Commits
ce517cfa
Commit
ce517cfa
authored
Feb 18, 2016
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed initialization bug in the new SVM L2 mode.
parent
4203da2b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
3 deletions
+16
-3
svm_c_linear_dcd_trainer.h
dlib/svm/svm_c_linear_dcd_trainer.h
+16
-3
No files found.
dlib/svm/svm_c_linear_dcd_trainer.h
View file @
ce517cfa
...
...
@@ -228,12 +228,17 @@ namespace dlib
private
:
template
<
typename
in_sample_vector_type
typename
in_sample_vector_type
,
typename
in_scalar_vector_type
>
void
init
(
const
in_sample_vector_type
&
x
,
const
in_scalar_vector_type
&
y
,
bool
have_bias_
,
bool
last_weight_1_
bool
last_weight_1_
,
bool
do_svm_l2_
,
scalar_type
Cpos
,
scalar_type
Cneg
)
{
const
long
new_dims
=
max_index_plus_one
(
x
);
...
...
@@ -346,6 +351,14 @@ namespace dlib
{
index
.
push_back
(
i
);
}
if
(
do_svm_l2_
)
{
if
(
y
(
i
)
>
0
)
Q
.
back
()
+=
1
/
(
2
*
Cpos
);
else
Q
.
back
()
+=
1
/
(
2
*
Cneg
);
}
}
if
(
last_weight_1
)
...
...
@@ -499,7 +512,7 @@ namespace dlib
}
#endif
state
.
init
(
x
,
have_bias
,
last_weight_1
);
state
.
init
(
x
,
y
,
have_bias
,
last_weight_1
,
do_svm_l2
,
Cpos
,
Cneg
);
std
::
vector
<
scalar_type
>&
alpha
=
state
.
alpha
;
scalar_vector_type
&
w
=
state
.
w
;
...
...
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