Commit 51831d20 authored by Davis King's avatar Davis King

Added missing get/set epsilon functions to the RVM training objects.

I also changed the default epsilon from 0.0005 to 0.001.

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%403777
parent 8d08f3d5
...@@ -147,10 +147,29 @@ namespace dlib ...@@ -147,10 +147,29 @@ namespace dlib
typedef decision_function<kernel_type> trained_function_type; typedef decision_function<kernel_type> trained_function_type;
rvm_trainer ( rvm_trainer (
) : eps(0.0005) ) : eps(0.001)
{ {
} }
void set_epsilon (
scalar_type eps_
)
{
// make sure requires clause is not broken
DLIB_ASSERT(eps_ > 0,
"\tvoid rvm_trainer::set_epsilon(eps_)"
<< "\n\t invalid inputs were given to this function"
<< "\n\t eps: " << eps_
);
eps = eps_;
}
const scalar_type get_epsilon (
) const
{
return eps;
}
void set_kernel ( void set_kernel (
const kernel_type& k const kernel_type& k
) )
...@@ -600,8 +619,27 @@ namespace dlib ...@@ -600,8 +619,27 @@ namespace dlib
typedef decision_function<kernel_type> trained_function_type; typedef decision_function<kernel_type> trained_function_type;
rvm_regression_trainer ( rvm_regression_trainer (
) : eps(0.0005) ) : eps(0.001)
{
}
void set_epsilon (
scalar_type eps_
)
{
// make sure requires clause is not broken
DLIB_ASSERT(eps_ > 0,
"\tvoid rvm_regression_trainer::set_epsilon(eps_)"
<< "\n\t invalid inputs were given to this function"
<< "\n\t eps: " << eps_
);
eps = eps_;
}
const scalar_type get_epsilon (
) const
{ {
return eps;
} }
void set_kernel ( void set_kernel (
......
...@@ -49,6 +49,26 @@ namespace dlib ...@@ -49,6 +49,26 @@ namespace dlib
ensures ensures
- This object is properly initialized and ready to be used - This object is properly initialized and ready to be used
to train a relevance vector machine. to train a relevance vector machine.
- #get_epsilon() == 0.001
!*/
void set_epsilon (
scalar_type eps
);
/*!
requires
- eps > 0
ensures
- #get_epsilon() == eps
!*/
const scalar_type get_epsilon (
) const;
/*!
ensures
- returns the error epsilon that determines when training should stop.
Generally a good value for this is 0.001. Smaller values may result
in a more accurate solution but take longer to execute.
!*/ !*/
void set_kernel ( void set_kernel (
...@@ -152,6 +172,26 @@ namespace dlib ...@@ -152,6 +172,26 @@ namespace dlib
ensures ensures
- This object is properly initialized and ready to be used - This object is properly initialized and ready to be used
to train a relevance vector machine. to train a relevance vector machine.
- #get_epsilon() == 0.001
!*/
void set_epsilon (
scalar_type eps
);
/*!
requires
- eps > 0
ensures
- #get_epsilon() == eps
!*/
const scalar_type get_epsilon (
) const;
/*!
ensures
- returns the error epsilon that determines when training should stop.
Generally a good value for this is 0.001. Smaller values may result
in a more accurate solution but take longer to execute.
!*/ !*/
void set_kernel ( void set_kernel (
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment