[mlpack-svn] [MLPACK] #83: Refactor bound classes (DHRectBound and DHRectPeriodicBound and similar) to allow arbitrary metrics (was: Refactor bound classes (DHRectBound and DHRectPeriodicBound and similar) to allow arbitrary kernels)

MLPACK Trac trac at coffeetalk-1.cc.gatech.edu
Wed Dec 14 13:18:51 EST 2011


#83: Refactor bound classes (DHRectBound and DHRectPeriodicBound and similar) to
allow arbitrary metrics
--------------------------------+-------------------------------------------
  Reporter:  rcurtin            |        Owner:            
      Type:  enhancement        |       Status:  new       
  Priority:  minor              |    Milestone:  MLPACK 1.0
 Component:  FASTLIB            |   Resolution:            
  Keywords:  metric bound tree  |     Blocking:  35        
Blocked By:  30                 |  
--------------------------------+-------------------------------------------
Changes (by rcurtin):

  * keywords:  kernel bound tree => metric bound tree
  * blocking:  35, 78 => 35


Old description:

> Currently the definition for DHrectBound is this:
>
> {{{
> template<int t_pow = 2>
> class DHrectBound {
>   ...
> };
> }}}
>
> But this restricts us to L-norms with an integer power.  For
> flexibility's sake, we should allow the entire class of kernel functions.
> Then, the definition would look like this:
>
> {{{
> template<typename Kernel>
> class DHrectBound {
>   ...
> };
> }}}
>
> This way, a user could use any kernel (or distance) that they wanted.  I
> outlined a basic kernel definition class for #78:
>
> {{{
> class SomeKernel {
>  public:
>   SomeKernel(); // Default constructor.
>
>   double Evaluate(arma::vec&, arma::vec&);
> };
> }}}
>
> That should not be a static function, because some kernels have state
> (consider the Mahalanobis distance, which has a covariance matrix we
> would have to set).

New description:

 Currently the definition for DHrectBound is this:

 {{{
 template<int t_pow = 2>
 class DHrectBound {
   ...
 };
 }}}

 But this restricts us to L-norms with an integer power.  For flexibility's
 sake, we should allow the entire class of metrics.  Then, the definition
 would look like this:

 {{{
 template<typename Metric>
 class DHrectBound {
   ...
 };
 }}}

 This way, a user could use any kernel (or distance) that they wanted.  I
 outlined a basic kernel definition class for #78:

 {{{
 class SomeMetric {
  public:
   SomeMetric(); // Default constructor.

   double Evaluate(arma::vec&, arma::vec&);
 };
 }}}

 That should not be a static function, because some metrics have state
 (consider the Mahalanobis distance, which has a covariance matrix we would
 have to set).

--

-- 
Ticket URL: <http://trac.research.cc.gatech.edu/fastlab/ticket/83#comment:1>
MLPACK <www.fast-lab.org>
MLPACK is an intuitive, fast, and scalable C++ machine learning library developed by the FASTLAB at Georgia Tech under Dr. Alex Gray.


More information about the mlpack-svn mailing list