Main Content




如果 trainingOptions 函数不提供任务所需的训练选项,或者自定义输出层不支持所需的损失函数,则您可以定义自定义训练循环。对于无法使用层图创建的网络,可以将自定义网络定义为函数。要了解详细信息,请参阅定义自定义训练循环、损失函数和网络



dlnetworkDeep learning network for custom training loops
resetStateReset state parameters of neural network
plotPlot neural network architecture
addInputLayerAdd input layer to network
addLayersAdd layers to layer graph or network
removeLayersRemove layers from layer graph or network
connectLayersConnect layers in layer graph or network
disconnectLayersDisconnect layers in layer graph or network
replaceLayerReplace layer in layer graph or network
summaryPrint network summary
initializeInitialize learnable and state parameters of a dlnetwork
networkDataLayoutDeep learning network data layout for learnable parameter initialization
forwardCompute deep learning network output for training
predictCompute deep learning network output for inference
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)
dlupdate Update parameters using custom function
minibatchqueueCreate mini-batches for deep learning
onehotencodeEncode data labels into one-hot vectors
onehotdecodeDecode probability vectors into class labels
padsequencesPad or truncate sequence data to same length
trainingProgressMonitorMonitor and plot training progress for deep learning custom training loops
dlarrayDeep learning array for customization
dlgradientCompute gradients for custom training loops using automatic differentiation
dlfevalEvaluate deep learning model for custom training loops
dimsDimension labels of dlarray
finddimFind dimensions with specified label
stripdimsRemove dlarray data format
extractdataExtract data from dlarray
isdlarrayCheck if object is dlarray
functionToLayerGraph(To be removed) Convert deep learning model function to a layer graph
dlconvDeep learning convolution
dltranspconvDeep learning transposed convolution
lstmLong short-term memory
gruGated recurrent unit
attentionDot-product attention
embedEmbed discrete data
fullyconnectSum all weighted input data and apply a bias
dlode45Deep learning solution of nonstiff ordinary differential equation (ODE)
reluApply rectified linear unit activation
leakyreluApply leaky rectified linear unit activation
geluApply Gaussian error linear unit (GELU) activation
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
softmaxApply softmax activation to channel dimension
sigmoid应用 sigmoid 激活
sigmoid应用 sigmoid 激活
crossentropyCross-entropy loss for classification tasks
l1lossL1 loss for regression tasks
l2lossL2 loss for regression tasks
huberHuber loss for regression tasks
mseHalf mean squared error
ctcConnectionist temporal classification (CTC) loss for unaligned sequence classification
dlaccelerateAccelerate deep learning function for custom training loops
AcceleratedFunctionAccelerated deep learning function
clearCacheClear accelerated deep learning function trace cache