主要内容

GenerateMATLABCode from Deep Network Designer

The Deep Network Designer app enables you to generate MATLAB®重新创建应用程序中的建筑物,编辑和培训网络的代码。

在里面设计师tab, you can generate a live script to:

  • Recreate the layers in your network. SelectExport>生成代码

  • Recreate the layers in your network, including any initial parameters. SelectExport>生成代码with Initial Parameters

在里面Trainingtab, you can generate a live script to:

  • Recreate the building and training of a network you construct in Deep Network Designer. SelectExport>生成培训代码

GenerateMATLABCode to Recreate Network Layers

生成MATLAB代码,用于重新创建在深网络设计器中构建的网络。在里面设计师tab, choose one of these options:

  • To recreate the layers in your network, selectExport>生成代码。This network does not contain initial parameters, such as pretrained weights.

  • To recreate the layers in your network, including any initial parameters, selectExport>生成代码with Initial Parameters。该应用程序创建一个直播脚本和包含来自网络的初始参数(权重和偏见)的MAT文件。运行脚本以重新创建网络图层,包括来自MAT文件的可读参数。如果要执行转移学习,请使用此选项来保留权重。

Running the generated script returns the network architecture as a variable in the workspace. Depending on the network architecture, the variable is a layer graph namedlgraphor a layer array namedlayers。For an example of training a network exported from Deep Network Designer, seeCreate Simple Sequence Classification Network Using Deep Network Designer

GenerateMATLABCode to Train Network

To recreate the construction and training of a network in Deep Network Designer, generate MATLAB code after training. For an example of using Deep Network Designer to train an image classification network, seeTransfer Learning with Deep Network Designer

Once training is complete, on theTrainingtab, selectExport>生成培训代码。该应用程序创建一个直播脚本和包含来自网络的初始参数(权重和偏见)的MAT文件。If you import data from the workspace into Deep Network Designer then this is also contained in the generated MAT-file.

Running the generated script builds the network (including the learnable parameters from the MAT-file), imports the data, sets the training options, and trains the network. Examine the generated script to learn how to construct and train a network at the command line.

Note

If you change the network, training and validation data, or training options, clickTrain在生成实时脚本之前。

Use Network for Prediction

Suppose that the trained network is contained in the variable。To use the trained network for prediction, use the预测function. For example, suppose you have a trained image classification network. Use the exported network to predict the class ofpeppers.png

img = imread(“peppers.png”);img = imresize (img,净。层(1).InputSize(1:2)); label = predict(net, img); imshow(img); title(label);

参考

[1] Kudo, Mineichi, Jun Toyama, and Masaru Shimbo. “Multidimensional Curve Classification Using Passing-through Regions.”Pattern Recognition Letters20, no. 11–13 (November 1999): 1103–11. https://doi.org/10.1016/S0167-8655(99)00077-X.

[2] Kudo, Mineichi, Jun Toyama, and Masaru Shimbo. Japanese Vowels Data Set. Distributed by UCI Machine Learning Repository. https://archive.ics.uci.edu/ml/datasets/Japanese+Vowels.

See Also

||

相关话题