Пример #1
0
 void Gradient(const InputType& input,
               const arma::Mat<eT>& d,
               GradientDataType& g)
 {
   g = d * input.t() / static_cast<typename InputType::value_type>(
       input.n_cols) + lambda * weights;
 }
Пример #2
0
  void Gradient(const InputType& input,
                const arma::Mat<eT>& d,
                GradientDataType& g)
  {
    if (uselayer)
    {
      baseLayer.Gradient(input, d, g);

      // Denoise the weights.
      baseLayer.Weights() = denoise;
    }
    else
    {
      g = d * input.t();

      // Denoise the weights.
      weights = denoise;
    }
  }