22 #ifndef _MLPACK_METHODS_PERCEPTRON_LEARNING_POLICIES_SIMPLE_WEIGHT_UPDATE_HPP
23 #define _MLPACK_METHODS_PERCEPTRON_LEARNING_POLICIES_SIMPLE_WEIGHT_UPDATE_HPP
38 namespace perceptron {
56 arma::mat& weightVectors,
57 const size_t labelIndex,
58 const size_t vectorIndex,
59 const size_t rowIndex,
60 const arma::rowvec& D)
62 weightVectors.row(rowIndex) = weightVectors.row(rowIndex) -
63 D(labelIndex) * trainData.col(labelIndex).t();
65 weightVectors.row(vectorIndex) = weightVectors.row(vectorIndex) +
66 D(labelIndex) * trainData.col(labelIndex).t();
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.