The realization of BP neural network algorithm in MATLAB
The BP neural Network algorithm provides a general and practical method to learn the function of real, discrete, or vector from the sample, here is a brief introduction of how to implement the algorithm with MATLAB programming.
Specific steps
-  
Here is a general and practical example of a simple case for programming instructions.
Assumes that a set of X1,X2,X3 values corresponds to a Y value, there are 2000 sets of such numbers, we select 1900 groups of X1,x2,x3 and y as samples, and the remaining 100 groups of X1,X2,X3 are validated as test data.
-  
You first need to read the data and assign the data to input and output.
I'm storing the data in an Excel table, so I use the Xlsread function to read the data. The data that is read is the 2000*4 matrix.
-  
Normalization of sample data.
-  
Initialize network results, set parameters, and train the network with data. The
Newff function gives the simplest setting, that is, the input sample data, the output sample data and the number of hidden layer nodes; epochs is the number of set iterations; LR is the set learning rate; goal is setting the target value.
-  
Set parameters, the predictive data needs to be normalized, and then output the predicted results, and the output of the results of the inverse normalization, The neural network is complete. The bpoutput is the predicted result.
-  
The network structure and running process displayed when the program runs.
-  
If you need to use a trained network in the future to store the well-trained network, the next time you can predict directly, see the specific method.
However, when predicting with a neural network, you need to be aware of the number of input data and the number of samples, and the availability and accuracy of the network should be considered when the sample count is low.
Detailed implementation of BP neural network algorithm in MATLAB