---
name: "mlpack_perceptron_SimpleWeightUpdate"
section: "3"
platform: "linux"
package: "mlpack-doc"
version: "1.0.10-1"
release: "Debian 8 (Jessie)"
platforms: ["linux"]
url: "https://new.carta.tech/mlpack_perceptron_SimpleWeightUpdate"
---

# mlpack\_perceptron\_SimpleWeightUpdate(3)

## NAME

mlpack::perceptron::SimpleWeightUpdate -

## SYNOPSIS

### Public Member Functions

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.*

## Detailed Description

Definition at line 40 of file simple\_weight\_update.hpp.

## Member Function Documentation

### void mlpack::perceptron::SimpleWeightUpdate::UpdateWeights (const arma::mat &trainData, arma::mat &weightVectors, const size\_tlabelIndex, const size\_tvectorIndex, const size\_trowIndex, const arma::rowvec &D)` [inline]`

This function is called to update the weightVectors matrix. It decreases the weights of the incorrectly classified class while increasing the weight of the correct class it should have been classified to.

**Parameters:**

*trainData* The training dataset. \
 *weightVectors* Matrix of weight vectors. \
 *rowIndex* Index of the row which has been incorrectly predicted. \
 *labelIndex* Index of the vector in trainData. \
 *vectorIndex* Index of the class which should have been predicted. \
 *D* Cost of mispredicting the labelIndex instance.

Definition at line 55 of file simple\_weight\_update.hpp.

## Author

Generated automatically by Doxygen for MLPACK from the source code.
