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
28da58f0
Commit
28da58f0
authored
May 05, 2015
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a max iterations option to the svm_multiclass_linear_trainer.
parent
1372472d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
0 deletions
+30
-0
svm_multiclass_linear_trainer.h
dlib/svm/svm_multiclass_linear_trainer.h
+13
-0
svm_multiclass_linear_trainer_abstract.h
dlib/svm/svm_multiclass_linear_trainer_abstract.h
+17
-0
No files found.
dlib/svm/svm_multiclass_linear_trainer.h
View file @
28da58f0
...
...
@@ -188,6 +188,7 @@ namespace dlib
num_threads
(
4
),
C
(
1
),
eps
(
0
.
001
),
max_iterations
(
10000
),
verbose
(
false
),
learn_nonnegative_weights
(
false
)
{
...
...
@@ -224,6 +225,16 @@ namespace dlib
const
scalar_type
get_epsilon
(
)
const
{
return
eps
;
}
unsigned
long
get_max_iterations
(
)
const
{
return
max_iterations
;
}
void
set_max_iterations
(
unsigned
long
max_iter
)
{
max_iterations
=
max_iter
;
}
void
be_verbose
(
)
{
...
...
@@ -358,6 +369,7 @@ namespace dlib
problem
.
set_max_cache_size
(
0
);
problem
.
set_c
(
C
);
problem
.
set_epsilon
(
eps
);
problem
.
set_max_iterations
(
max_iterations
);
unsigned
long
num_nonnegative
=
0
;
if
(
learn_nonnegative_weights
)
...
...
@@ -403,6 +415,7 @@ namespace dlib
unsigned
long
num_threads
;
scalar_type
C
;
scalar_type
eps
;
unsigned
long
max_iterations
;
bool
verbose
;
oca
solver
;
bool
learn_nonnegative_weights
;
...
...
dlib/svm/svm_multiclass_linear_trainer_abstract.h
View file @
28da58f0
...
...
@@ -34,6 +34,7 @@ namespace dlib
- get_num_threads() == 4
- learns_nonnegative_weights() == false
- get_epsilon() == 0.001
- get_max_iterations() == 10000
- get_c() == 1
- this object will not be verbose unless be_verbose() is called
- #get_oca() == oca() (i.e. an instance of oca with default parameters)
...
...
@@ -79,6 +80,22 @@ namespace dlib
to execute.
!*/
void
set_max_iterations
(
unsigned
long
max_iter
);
/*!
ensures
- #get_max_iterations() == max_iter
!*/
unsigned
long
get_max_iterations
(
);
/*!
ensures
- returns the maximum number of iterations the SVM optimizer is allowed to
run before it is required to stop and return a result.
!*/
void
be_verbose
(
);
/*!
...
...
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