深度学习自定义训练循环
自定义深度学习训练循环和损失函数
如果 trainingOptions
函数不提供任务所需的训练选项,或者自定义输出层不支持所需的损失函数,则您可以定义自定义训练循环。对于无法使用层图创建的网络,可以将自定义网络定义为函数。要了解详细信息,请参阅定义自定义训练循环、损失函数和网络。
函数
主题
自定义训练循环
- Train Deep Learning Model in MATLAB
Learn how to training deep learning models in MATLAB®. - 定义自定义训练循环、损失函数和网络
了解如何使用自动微分来定义和自定义深度学习训练循环、损失函数和网络。 - Train Network Using Custom Training Loop
This example shows how to train a network that classifies handwritten digits with a custom learning rate schedule. - Specify Training Options in Custom Training Loop
Learn how to specify common training options in a custom training loop. - Define Model Loss Function for Custom Training Loop
Learn how to define a model loss function for a custom training loop. - Update Batch Normalization Statistics in Custom Training Loop
This example shows how to update the network state in a custom training loop. - Make Predictions Using dlnetwork Object
This example shows how to make predictions using adlnetwork
object by splitting data into mini-batches. - Monitor Custom Training Loop Progress
Track and plot custom training loop progress. - Train Network with Multiple Outputs
This example shows how to train a deep learning network with multiple outputs that predict both labels and angles of rotations of handwritten digits. - Classify Videos Using Deep Learning with Custom Training Loop
This example shows how to create a network for video classification by combining a pretrained image classification model and a sequence classification network. - Train Image Classification Network Robust to Adversarial Examples
This example shows how to train a neural network that is robust to adversarial examples using fast gradient sign method (FGSM) adversarial training. - Train Neural ODE Network
This example shows how to train an augmented neural ordinary differential equation (ODE) network. - Train Robust Deep Learning Network with Jacobian Regularization
This example shows how to train a neural network that is robust to adversarial examples using a Jacobian regularization scheme [1]. - Solve Ordinary Differential Equation Using Neural Network
This example shows how to solve an ordinary differential equation (ODE) using a neural network. - Assemble Multiple-Output Network for Prediction
This example shows how to assemble a multiple output network for prediction. - Run Custom Training Loops on a GPU and in Parallel
Speed up custom training loops by running on a GPU, in parallel using multiple GPUs, or on a cluster.
模型函数
- Train Network Using Model Function
This example shows how to create and train a deep learning network by using functions rather than a layer graph or adlnetwork
. - Update Batch Normalization Statistics Using Model Function
This example shows how to update the network state in a network defined as a function. - Make Predictions Using Model Function
This example shows how to make predictions using a model function by splitting data into mini-batches. - Initialize Learnable Parameters for Model Function
Learn how to initialize learnable parameters for custom training loops using a model function. - Train Latent ODE Network with Irregularly Sampled Time-Series Data
This example shows how to train a latent ordinary differential equation (ODE) autoencoder with time-series data that is sampled at irregular time intervals. - Multivariate Time Series Anomaly Detection Using Graph Neural Network
This example shows how to detect anomalies in multivariate time series data using a graph neural network (GNN).
自动微分
- List of Functions with dlarray Support
View the list of functions that supportdlarray
objects. - Automatic Differentiation Background
Learn how automatic differentiation works. - Use Automatic Differentiation In Deep Learning Toolbox
How to use automatic differentiation in deep learning.
深度学习函数加速
- Deep Learning Function Acceleration for Custom Training Loops
Accelerate model functions and model loss functions for custom training loops by caching and reusing traces. - Accelerate Custom Training Loop Functions
This example shows how to accelerate deep learning custom training loop and prediction functions. - Check Accelerated Deep Learning Function Outputs
This example shows how to check that the outputs of accelerated functions match the outputs of the underlying function. - Evaluate Performance of Accelerated Deep Learning Function
This example shows how to evaluate the performance gains of using an accelerated function.