Implementation of BP Neural network algorithm in detail matlab

Source: Internet
Author: User

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

      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.

    2.  

      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.

    3.  

      Normalization of sample data.

    4.  

      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.

    5.  

      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.

    6.  

      The network structure and running process displayed when the program runs.

    7.  

      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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.