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 {
48 arma::mat& weightVectors,
49 const size_t labelIndex,
50 const size_t vectorIndex,
51 const size_t rowIndex,
52 const arma::rowvec& D)
54 weightVectors.row(rowIndex) = weightVectors.row(rowIndex) -
55 D(labelIndex) * trainData.col(labelIndex).t();
57 weightVectors.row(vectorIndex) = weightVectors.row(vectorIndex) +
58 D(labelIndex) * trainData.col(labelIndex).t();
Linear algebra utility functions, generally performed on matrices or vectors.
void UpdateWeights(const arma::mat &trainData, arma::mat &weightVectors, const size_t labelIndex, const size_t vectorIndex, const size_t rowIndex, const arma::rowvec &D)
This function is called to update the weightVectors matrix.