主要内容

本页翻译不是最新的。点击此处可查看最新英文版本。

使用自动微分进行自定义训练

R2026a
使用自定义训练循环来训练深度学习网络

如果 trainingOptions 函数不提供任务所需的训练选项,或您有 trainnet 函数不支持的损失函数,您可以定义自定义训练循环。对于无法指定为由层组成的网络的模型,可以将模型定义为函数。要了解详细信息,请参阅Custom Training Loops

函数

全部展开

dlnetwork深度学习神经网络
imagePretrainedNetwork适用于图像的预训练神经网络 (自 R2024a 起)
resnetNetwork2-D residual neural network (自 R2024a 起)
resnet3dNetwork3-D residual neural network (自 R2024a 起)
addLayers向神经网络添加层
removeLayers从神经网络中删除层
replaceLayerReplace layer in neural network
connectLayers在神经网络中连接各层
disconnectLayers在神经网络中断开层连接
addInputLayerAdd input layer to network (自 R2022b 起)
initialize初始化神经网络的可学习参数和状态参数
networkDataLayoutDeep learning network data layout for learnable parameter initialization (自 R2022b 起)
setL2FactorSet L2 regularization factor of layer learnable parameter
getL2FactorGet L2 regularization factor of layer learnable parameter
setLearnRateFactorSet learn rate factor of layer learnable parameter
getLearnRateFactorGet learn rate factor of layer learnable parameter
plot绘制神经网络架构
summary打印网络摘要 (自 R2022b 起)
analyzeNetworkAnalyze deep learning network architecture
checkLayerCheck validity of custom or function layer
isequalCheck equality of neural networks
isequalnCheck equality of neural networks ignoring NaN values
forwardCompute deep learning network output for training
predict计算深度学习网络输出以进行推断
adamupdateUpdate parameters using adaptive moment estimation (Adam)
rmspropupdate Update parameters using root mean squared propagation (RMSProp)
sgdmupdate Update parameters using stochastic gradient descent with momentum (SGDM)
lbfgsupdateUpdate parameters using limited-memory BFGS (L-BFGS) (自 R2023a 起)
lbfgsStateState of limited-memory BFGS (L-BFGS) solver (自 R2023a 起)
dlupdate Update parameters using custom function
trainingProgressMonitorMonitor and plot training progress for deep learning custom training loops (自 R2022b 起)
updateInfoUpdate information values for custom training loops (自 R2022b 起)
recordMetricsRecord metric values for custom training loops (自 R2022b 起)
groupSubPlotGroup metrics in training plot (自 R2022b 起)
exportPlotAsImageWrite training progress monitor to image file (自 R2026a 起)
padsequencesPad or truncate sequence data to same length
minibatchqueueCreate mini-batches for deep learning
onehotencodeEncode data labels into one-hot vectors
onehotdecodeDecode probability vectors into class labels
nextObtain next mini-batch of data from mini-batch queue
resetReset mini-batch queue to start of data
shuffleShuffle data in mini-batch queue
hasdataDetermine if mini-batch queue can return mini-batch
partitionPartition mini-batch queue
dlarray用于自定义的深度学习数组
dlgradient使用自动微分计算自定义训练循环的梯度
dljacobianJacobian matrix deep learning operation (自 R2024b 起)
dldivergenceDivergence of deep learning data (自 R2024b 起)
dllaplacianLaplacian of deep learning data (自 R2024b 起)
dlfeval评估用于自定义训练循环的深度学习模型
dimsdlarray 对象的数据格式
finddimFind dimensions with specified label
stripdims去除 dlarray 数据格式
extractdatadlarray 对象提取数据
isdlarrayCheck if object is dlarray
crossentropyCross-entropy loss for classification tasks
indexcrossentropyIndex cross-entropy loss for classification tasks (自 R2024b 起)
l1lossL1 loss for regression tasks
l2lossL2 loss for regression tasks
huberHuber loss for regression tasks
ctcConnectionist temporal classification (CTC) loss for unaligned sequence classification
mse半均方误差
dlaccelerateAccelerate deep learning function
AcceleratedFunctionAccelerated deep learning function
clearCacheClear accelerated deep learning function trace cache

主题

自定义训练循环

自动微分

生成对抗网络

图形神经网络

深度学习函数加速

相关信息

精选示例