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
28219262
Commit
28219262
authored
Apr 23, 2014
by
Davis King
Browse files
Options
Browse Files
Download
Plain Diff
merged changes and updated abstract file.
parents
7bb67fc1
31078ade
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
2 deletions
+38
-2
rvm.h
dlib/svm/rvm.h
+18
-2
rvm_abstract.h
dlib/svm/rvm_abstract.h
+17
-0
rvm_ex.cpp
examples/rvm_ex.cpp
+3
-0
No files found.
dlib/svm/rvm.h
View file @
28219262
...
...
@@ -147,8 +147,21 @@ namespace dlib
typedef
decision_function
<
kernel_type
>
trained_function_type
;
rvm_trainer
(
)
:
eps
(
0
.
001
)
)
:
eps
(
0
.
001
),
max_iterations
(
2000
)
{
}
void
set_max_iterations
(
unsigned
long
max_iterations_
)
{
max_iterations
=
max_iterations_
;
}
unsigned
long
get_max_iterations
(
)
const
{
return
max_iterations
;
}
void
set_epsilon
(
...
...
@@ -288,9 +301,11 @@ namespace dlib
bool
search_all_alphas
=
false
;
unsigned
long
ticker
=
0
;
const
unsigned
long
rounds_of_narrow_search
=
100
;
unsigned
long
iterations
=
0
;
while
(
true
)
while
(
iterations
!=
max_iterations
)
{
iterations
++
;
if
(
recompute_beta
)
{
// calculate the current t_estimate. (this is the predicted t value for each sample according to the
...
...
@@ -572,6 +587,7 @@ namespace dlib
// private member variables
kernel_type
kernel
;
scalar_type
eps
;
unsigned
long
max_iterations
;
const
static
scalar_type
tau
;
...
...
dlib/svm/rvm_abstract.h
View file @
28219262
...
...
@@ -50,6 +50,7 @@ namespace dlib
- This object is properly initialized and ready to be used
to train a relevance vector machine.
- #get_epsilon() == 0.001
- #get_max_iterations() == 2000
!*/
void
set_epsilon
(
...
...
@@ -86,6 +87,22 @@ namespace dlib
- returns a copy of the kernel function in use by this object
!*/
unsigned
long
get_max_iterations
(
)
const
;
/*!
ensures
- returns the maximum number of iterations the RVM optimizer is allowed to
run before it is required to stop and return a result.
!*/
void
set_max_iterations
(
unsigned
long
max_iter
);
/*!
ensures
- #get_max_iterations() == max_iter
!*/
template
<
typename
in_sample_vector_type
,
typename
in_scalar_vector_type
...
...
examples/rvm_ex.cpp
View file @
28219262
...
...
@@ -103,6 +103,9 @@ int main()
// stopping epsilon bigger. However, this might make the outputs less
// reliable. But sometimes it works out well. 0.001 is the default.
trainer
.
set_epsilon
(
0.001
);
// You can also set an explicit limit on the number of iterations used by the numeric
// solver. The default is 2000.
trainer
.
set_max_iterations
(
2000
);
// Now we loop over some different gamma values to see how good they are. Note
// that this is a very simple way to try out a few possible parameter choices. You
...
...
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