本页对应的英文页面已更新,但尚未翻译。 若要查看最新内容,请点击此处访问英文页面。

深度学习导入、导出和自定义

导入和导出网络并定义自定义深度学习层和数据存储

从 TensorFlow®-Keras、Caffe 和 ONNX™(开放式神经网络交换)模型格式导入网络和网络架构。您还可以将经过训练的 Deep Learning Toolbox™ 网络导出为 ONNX 模型格式。

您可以针对您的问题定义自己的自定义深度学习层。您可以定义带或不带可学习参数的自定义输出层和自定义层。例如,您可以将具有加权交叉熵损失的自定义加权分类层用于类分布不平衡的分类问题。您可以检查层的有效性、GPU 兼容性和正确定义的梯度。

为了充分灵活地使用预处理图像和序列数据,请构建您自己的数据存储来训练深度学习网络。您可以选择添加对一些功能的支持,例如训练期间打乱数据、并行和多 GPU 训练以及后台调度等功能。

函数

全部展开

importKerasNetworkImport a pretrained Keras network and weights
importKerasLayersImport layers from Keras network
importCaffeNetworkImport pretrained convolutional neural network models from Caffe
importCaffeLayersImport convolutional neural network layers from Caffe
importONNXNetworkImport pretrained ONNX network
importONNXLayersImport layers from ONNX network
exportONNXNetworkExport network to ONNX model format
findPlaceholderLayersFind placeholder layers in network architecture imported from Keras or ONNX
replaceLayerReplace layer in layer graph
assembleNetworkAssemble deep learning network from pretrained layers
PlaceholderLayerLayer replacing an unsupported Keras or ONNX layer
setLearnRateFactorSet learn rate factor of layer learnable parameter
setL2FactorSet L2 regularization factor of layer learnable parameter
getLearnRateFactorGet learn rate factor of layer learnable parameter
getL2FactorGet L2 regularization factor of layer learnable parameter
checkLayerCheck validity of custom layer

全部展开

MiniBatchableAdd mini-batch support to datastore
BackgroundDispatchable(Not recommended) Add prefetch reading support to datastore
PartitionableByIndex(Not recommended) Add parallelization support to datastore
Shuffleable

主题

Define Custom Deep Learning Layers

Learn how to define custom deep learning layers

Define Custom Deep Learning Layer with Learnable Parameters

This example shows how to define a PReLU layer and use it in a convolutional neural network.

Define Custom Weighted Classification Layer

This example shows how to define and create a custom weighted classification output layer with weighted cross entropy loss.

Define Custom Regression Output Layer

This example shows how to define a custom regression output layer with mean absolute error (MAE) loss and use it in a convolutional neural network.

Define Custom Classification Output Layer

This example shows how to define a custom classification output layer with sum of squares error (SSE) loss and use it in a convolutional neural network.

Check Custom Layer Validity

Learn how to check the validity of custom deep learning layers

Develop Custom Mini-Batch Datastore

Create a fully customized mini-batch datastore that contains training and test data sets for network training, prediction, and classification.

使用无法放入内存的序列数据训练网络

此示例说明如何使用自定义小批量数据存储基于无法放入内存的序列数据来训练深度学习网络。

基于预训练的 Keras 层组合网络

此示例说明如何从预训练的 Keras 网络中导入层、用自定义层替换不支持的层,以及将各层组合成可以进行预测的网络。

Deep Learning Tips and Tricks

Learn how to improve the accuracy of deep learning networks.

特色示例