14 #ifndef _MLPACK_METHODS_PERCEPTRON_LEARNING_POLICIES_SIMPLE_WEIGHT_UPDATE_HPP 15 #define _MLPACK_METHODS_PERCEPTRON_LEARNING_POLICIES_SIMPLE_WEIGHT_UPDATE_HPP 30 namespace perceptron {
51 template<
typename VecType>
55 const size_t incorrectClass,
56 const size_t correctClass,
57 const double instanceWeight = 1.0)
59 weights.col(incorrectClass) -= instanceWeight * trainingPoint;
60 biases(incorrectClass) -= instanceWeight;
62 weights.col(correctClass) += instanceWeight * trainingPoint;
63 biases(correctClass) += instanceWeight;
Linear algebra utility functions, generally performed on matrices or vectors.
void UpdateWeights(const VecType &trainingPoint, arma::mat &weights, arma::vec &biases, const size_t incorrectClass, const size_t correctClass, const double instanceWeight=1.0)
This function is called to update the weightVectors matrix.
Include all of the base components required to write MLPACK methods, and the main MLPACK Doxygen docu...