bp神经网络matlab实例(bp神经网络matlab实例).doc
bp神经网络matlab实例(bp神经网络matlab实例)Case 1 training BP network by momentum gradient descent algorithm.
Training samples are defined as follows:
Input vector as
P =[-1 -2 31
-1 15 -3]
The target vector is t = [-1 -1 1 1]
Solution: the MATLAB program of this example is as follows:
Close all
Clear
Echo on
CLC
% NEWFF - generating a new feedforward neural network
% TRAIN -- training BP neural network
% SIM -- Simulation of BP neural network
Pause
Start by hitting any key
CLC
Percent defines training samples
% P as input vector
P=[-1, -2, 3, 1; -1, 1, 5, -3];
% T is the target vector
T=[-1, -1, 1, 1];
Pause;
CLC
% create a new feedforward neural network
Net=newff (minmax (P), [3