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
34a9e4f6
"...api/git@developer.sourcefind.cn:renzhc/diffusers_dcu.git" did not exist on "7f0f7e1e913d47adce149e3c1d558254ed3fd664"
Commit
34a9e4f6
authored
Dec 16, 2012
by
Davis King
Browse files
added a method to enable or disable shrinking
parent
50fe106d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
3 deletions
+13
-3
dlib/svm/svm_c_linear_dcd_trainer.h
dlib/svm/svm_c_linear_dcd_trainer.h
+13
-3
No files found.
dlib/svm/svm_c_linear_dcd_trainer.h
View file @
34a9e4f6
...
@@ -46,7 +46,8 @@ namespace dlib
...
@@ -46,7 +46,8 @@ namespace dlib
max_iterations
(
10000
),
max_iterations
(
10000
),
verbose
(
false
),
verbose
(
false
),
have_bias
(
true
),
have_bias
(
true
),
last_weight_1
(
false
)
last_weight_1
(
false
),
do_shrinking
(
true
)
{
{
}
}
...
@@ -57,7 +58,8 @@ namespace dlib
...
@@ -57,7 +58,8 @@ namespace dlib
Cneg
(
C_
),
Cneg
(
C_
),
eps
(
0.1
),
eps
(
0.1
),
max_iterations
(
10000
),
max_iterations
(
10000
),
verbose
(
false
)
verbose
(
false
),
do_shrinking
(
true
)
{
{
// make sure requires clause is not broken
// make sure requires clause is not broken
DLIB_ASSERT
(
0
<
C_
,
DLIB_ASSERT
(
0
<
C_
,
...
@@ -93,6 +95,13 @@ namespace dlib
...
@@ -93,6 +95,13 @@ namespace dlib
last_weight_1
=
should_last_weight_be_1
;
last_weight_1
=
should_last_weight_be_1
;
}
}
bool
shrinking_enabled
(
)
const
{
return
do_shrinking
;
}
void
enable_shrinking
(
bool
enabled
)
{
do_shrinking
=
enabled
;
}
void
be_verbose
(
void
be_verbose
(
)
)
{
{
...
@@ -411,7 +420,7 @@ namespace dlib
...
@@ -411,7 +420,7 @@ namespace dlib
PG_max_prev
=
std
::
numeric_limits
<
scalar_type
>::
infinity
();
PG_max_prev
=
std
::
numeric_limits
<
scalar_type
>::
infinity
();
PG_min_prev
=
-
std
::
numeric_limits
<
scalar_type
>::
infinity
();
PG_min_prev
=
-
std
::
numeric_limits
<
scalar_type
>::
infinity
();
}
}
else
else
if
(
do_shrinking
)
{
{
PG_max_prev
=
PG_max
;
PG_max_prev
=
PG_max
;
PG_min_prev
=
PG_min
;
PG_min_prev
=
PG_min
;
...
@@ -466,6 +475,7 @@ namespace dlib
...
@@ -466,6 +475,7 @@ namespace dlib
bool
verbose
;
bool
verbose
;
bool
have_bias
;
// having a bias means we pretend all x vectors have an extra element which is always -1.
bool
have_bias
;
// having a bias means we pretend all x vectors have an extra element which is always -1.
bool
last_weight_1
;
bool
last_weight_1
;
bool
do_shrinking
;
};
// end of class svm_c_linear_dcd_trainer
};
// end of class svm_c_linear_dcd_trainer
...
...
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