示例#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;
    }
  }