37 #ifndef SHARK_ALGORITHMS_KERNELSGDTRAINER_H 38 #define SHARK_ALGORITHMS_KERNELSGDTRAINER_H 89 template <
class InputType,
class CacheType =
float>
138 {
return "KernelSGDTrainer"; }
148 RealMatrix& alpha = model.
alpha();
157 double alphaScale = 1.0;
158 std::size_t iterations;
163 RealVector f_b(classes, 0.0);
164 RealVector derivative(classes, 0.0);
168 for(std::size_t iter = 0; iter < iterations; iter++)
174 const double eta = 1.0 / (lambda * (iter + ell));
186 alphaScale = (ell - 1.0) / (ell + iter);
188 noalias(
row(alpha, b)) -= (eta / alphaScale) * derivative;
242 RealVector ret(kp + 1);