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
31078ade
Commit
31078ade
authored
Mar 16, 2014
by
Csaba Kertesz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add maximal iterations option for relevance vector machine trainer
parent
2ba3c4d4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
2 deletions
+23
-2
rvm.h
dlib/svm/rvm.h
+18
-2
rvm_ex.cpp
examples/rvm_ex.cpp
+5
-0
No files found.
dlib/svm/rvm.h
View file @
31078ade
...
...
@@ -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
(
int
max_iterations_
)
{
max_iterations
=
max_iterations_
;
}
int
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
;
int
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
;
int
max_iterations
;
const
static
scalar_type
tau
;
...
...
examples/rvm_ex.cpp
View file @
31078ade
...
...
@@ -104,6 +104,11 @@ int main()
// reliable. But sometimes it works out well. 0.001 is the default.
trainer
.
set_epsilon
(
0.001
);
// The relevance vector machine with radial basis function tends to learn too long and
// sometimes it is stuck forever. A default iterations limit is 2000, but it can be disabled by
// setting equal or less than zero.
trainer
.
set_max_iterations
(
0
);
// 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
// should look at the model_selection_ex.cpp program for examples of more sophisticated
...
...
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