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
typedef decision_function<kernel_type> trained_function_type;
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 (
const kernel_type& k
)
......@@ -600,10 +619,29 @@ namespace dlib
typedef decision_function<kernel_type> trained_function_type;
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 (
const kernel_type& k
)
......
......@@ -49,6 +49,26 @@ namespace dlib
ensures
- This object is properly initialized and ready to be used
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 (
......@@ -152,6 +172,26 @@ namespace dlib
ensures
- This object is properly initialized and ready to be used
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 (
......
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