See: Single-Layer Feedforward Neural Network, Backpropagation of Errors (BP)-based Training Algorithm.