Train Deep Neural Networks - MATLAB & Simulink (original) (raw)
Main Content
Train networks using built-in training functions or custom training loops
After defining the network architecture, you can define training parameters using the trainingOptions function. You can then train the network using the trainnet function. Use the trained network to predict class labels or numeric responses.
You can train a neural network on a CPU, a GPU, multiple CPUs or GPUs, or in parallel on a cluster or in the cloud. Training on a GPU or in parallel requires Parallel Computing Toolbox™. Using a GPU requires a supported GPU device (for information on supported devices, see GPU Computing Requirements (Parallel Computing Toolbox)). Specify the execution environment using the trainingOptions function.
If the trainingOptions function does not provide the training options that you need for your task, or custom output layers do not support the loss functions that you need, then you can define a custom training loop. For models that cannot be specified as networks of layers, you can define the model as a function. To learn more, see Define Custom Training Loops, Loss Functions, and Networks.
After you identify some good starting options, you can automate sweeping of hyperparameters or try Bayesian optimization using Experiment Manager. Use Experiment Manager to test different training configurations at the same time by running your experiment in parallel and monitor your progress by using training plots.
Categories
- Built-In Training
Train deep learning networks using built-in training functions - Custom Training Using Automatic Differentiation
Train deep learning networks using custom training loops - Tuning
Programmatically tune training options, resume training from a checkpoint, and investigate adversarial examples - Manage Experiments
Train networks under multiple initial conditions, interactively tune training options, and evaluate your results - Parallel and Cloud
Scale up deep learning with multiple GPUs locally or in the cloud and train multiple networks interactively or in batch jobs - Function Approximation, Clustering, and Control
Perform regression, classification, clustering, and model nonlinear dynamic systems using shallow neural networks