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
3e9b7ebb
"...git@developer.sourcefind.cn:renzhc/diffusers_dcu.git" did not exist on "9946dcf8db300c22dc8bed660e62f1ba5aa85bfd"
Commit
3e9b7ebb
authored
Feb 18, 2016
by
Davis King
Browse files
Made it so you can get the optimal alpha values.
parent
ce517cfa
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
4 deletions
+15
-4
dlib/svm/svm_c_linear_dcd_trainer.h
dlib/svm/svm_c_linear_dcd_trainer.h
+3
-0
dlib/svm/svm_c_linear_dcd_trainer_abstract.h
dlib/svm/svm_c_linear_dcd_trainer_abstract.h
+12
-4
No files found.
dlib/svm/svm_c_linear_dcd_trainer.h
View file @
3e9b7ebb
...
@@ -414,6 +414,9 @@ namespace dlib
...
@@ -414,6 +414,9 @@ namespace dlib
dlib
::
rand
rnd
;
dlib
::
rand
rnd
;
public:
public:
const
std
::
vector
<
scalar_type
>&
get_alpha
()
const
{
return
alpha
;
}
friend
void
serialize
(
const
optimizer_state
&
item
,
std
::
ostream
&
out
)
friend
void
serialize
(
const
optimizer_state
&
item
,
std
::
ostream
&
out
)
{
{
const
int
version
=
1
;
const
int
version
=
1
;
...
...
dlib/svm/svm_c_linear_dcd_trainer_abstract.h
View file @
3e9b7ebb
...
@@ -304,10 +304,16 @@ namespace dlib
...
@@ -304,10 +304,16 @@ namespace dlib
!*/
!*/
// optimizer_state is used to record the internal state of the SVM optimizer. It
// optimizer_state is used to record the internal state of the SVM optimizer. It
// can be used with the following train() routine to warm-start the optimizer.
// can be used with the following train() routine to warm-start the optimizer or
// Note, that optimizer_state objects are serializable but are otherwise completely
// access the optimal alpha values (see the Hsieh paper mentioned above). The
// opaque to the user.
// optimizer_state objects are serializable and allow you to get the alphas, but
class
optimizer_state
;
// are otherwise completely opaque to the user.
class
optimizer_state
{
public:
const
std
::
vector
<
scalar_type
>&
get_alpha
(
)
const
;
};
template
<
template
<
typename
in_sample_vector_type
,
typename
in_sample_vector_type
,
...
@@ -355,6 +361,8 @@ namespace dlib
...
@@ -355,6 +361,8 @@ namespace dlib
- #state == the internal state of the optimizer at the solution to the SVM
- #state == the internal state of the optimizer at the solution to the SVM
problem. Therefore, passing #state to a new call to train() will start
problem. Therefore, passing #state to a new call to train() will start
the optimizer from the current solution.
the optimizer from the current solution.
- #state.get_alpha().size() == x.size()
- #state.get_alpha() == the optimal alpha/dual values learned by the optimizer.
- returns a decision function F with the following properties:
- returns a decision function F with the following properties:
- F.alpha.size() == 1
- F.alpha.size() == 1
- F.basis_vectors.size() == 1
- F.basis_vectors.size() == 1
...
...
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