Main Content

Neural Net Fitting

Solve fitting problem using two-layer feed-forward networks

Description

The Neural Net Fitting app lets you create, visualize, and train a two-layer feed-forward network to solve data fitting problems.

Using this app, you can:

  • Import data from file, the MATLAB® workspace, or use one of the example data sets.

  • Split data into training, validation, and test sets.

  • Define and train a neural network.

  • Evaluate network performance using mean squared error and regression analysis.

  • Analyze results using visualization plots, such as regression fit or histogram of errors.

  • Generate MATLAB scripts to reproduce results and customize the training process.

  • Generate functions suitable for deployment with MATLAB Compiler™ and MATLAB Coder™ tools, and export to Simulink® for use with Simulink Coder.

Tip

To interactively build and visualize deep learning neural networks, use the Deep Network Designer app. For more information, see Get Started with Deep Network Designer.

Neural Net Fitting app

Open the Neural Net Fitting App

  • MATLAB Toolstrip: On the Apps tab, under Machine Learning and Deep Learning, click the app icon.

  • MATLAB command prompt: Enter nftool.

Algorithms

The Neural Net Fitting app provides built-in training algorithms that you can use to train your neural network.

Training AlgorithmDescription
Levenberg-Marquardt

Update weight and bias values according to Levenberg-Marquardt optimization. Levenberg-Marquardt training is often the fastest training algorithm, although it does require more memory than other techniques.

To implement this algorithm, the Neural Net Fitting app uses the trainlm function.

Bayesian regularization

Bayesian regularization updates the weight and bias values according to Levenberg-Marquardt optimization. It then minimizes a combination of squared errors and weights, and determines the correct combination so as to produce a network that generalizes well. This algorithm typically takes longer but is good at generalizing to noisy or small data sets.

To implement this algorithm, the Neural Net Fitting app uses the trainbr function.

Scaled conjugate gradient backpropagation

Scaled conjugate gradient backpropagation updates weight and bias values according to the scaled conjugate gradient method. For large problems, scaled conjugate gradient is recommended as it uses gradient calculations which are more memory efficient than the Jacobian calculations used by Levenberg-Marquardt or Bayesian regularization.

To implement this algorithm, the Neural Net Fitting app uses the trainscg function.