主要内容

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

操作

开发自定义深度学习函数

对于大多数任务,您可以使用内置层。如果没有您的任务所需的内置层,则可以定义您自己的自定义层。您可以定义具有可学习参数和状态参数的自定义层。定义自定义层后,您可以检查该层是否有效,是否与 GPU 兼容,以及是否输出正确定义的梯度。要了解详细信息,请参阅定义自定义深度学习层。要查看支持的层的列表,请参阅深度学习层列表

使用深度学习运算为自定义层、训练循环和模型函数开发 MATLAB® 代码。

函数

全部展开

dlarray用于自定义的深度学习数组
dimsdlarray 对象的数据格式
finddimFind dimensions with specified label
stripdimsRemove dlarray data format
extractdatadlarray 中提取数据
isdlarrayCheck if object is dlarray
dlconvDeep learning convolution
dltranspconvDeep learning transposed convolution
lstm长短期记忆
gru门控循环单元
attentionDot-product attention (自 R2022b 起)
embedEmbed discrete data
fullyconnectSum all weighted input data and apply a bias
dlode45Deep learning solution of nonstiff ordinary differential equation (ODE) (自 R2021b 起)
batchnormNormalize data across all observations for each channel independently
crosschannelnormCross channel square-normalize using local responses
groupnormNormalize data across grouped subsets of channels for each observation independently
instancenormNormalize across each channel for each observation independently
layernormNormalize data across all channels for each observation independently
avgpoolPool data to average values over spatial dimensions
maxpoolPool data to maximum value
maxunpoolUnpool the output of a maximum pooling operation
relu应用修正线性单元激活
leakyrelu应用泄漏修正线性单元激活
gelu应用高斯误差线性单元 (GELU) 激活 (自 R2022b 起)
softmax对通道维度应用 softmax 激活
sigmoid应用 sigmoid 激活
crossentropyCross-entropy loss for classification tasks
indexcrossentropyIndex cross-entropy loss for classification tasks (自 R2024b 起)
l1lossL1 loss for regression tasks (自 R2021b 起)
l2lossL2 loss for regression tasks (自 R2021b 起)
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

主题

自动微分

模型函数

深度学习函数加速

精选示例