Hi Devs,

I was working on refactoring SGD optimizer to incorporate UpdatePolicyType
as a template param.

template<typename DecomposableFunctionType,
         typename UpdatePolicyType = EmptyUpdate>
class SGD

{
...
}

I came across Optimizer type being referenced in other places as "template
template parameters". DecomposableFunctionType in this case..

template<
  template<typename> class OptimizerType = mlpack::optimization::SGD
>
class RegularizedSVD
{

}

So I have modified the code to the following to make room for UpdatePolicyType..

template<
  template<typename, typename> class OptimizerType = mlpack::optimization::SGD
>
class RegularizedSVD
{

}

But it is used in many other places too.. For eg. LogisticRegression,
L_BFGS uses only one typename, but when the OptimizerType is set to
SGD this fails..

template<
    template<typename> class OptimizerType = mlpack::optimization::L_BFGS
>
void Train(const MatType& predictors,
           const arma::Row<size_t>& responses);


*Question*: Instead of adding additional template parameters everytime
we make some changes to the optimizer, can we make it more generic?


Thanks

Arun
_______________________________________________
mlpack mailing list
[email protected]
http://knife.lugatgt.org/cgi-bin/mailman/listinfo/mlpack

Reply via email to