Main Content

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

plot

绘制神经网络架构

说明

示例

plot(lgraph) 绘制层图 lgraph 的图。plot 函数按每个层的名称标注每个层,并显示所有层连接。

提示

要创建交互式网络可视化并分析网络架构,请使用 deepNetworkDesigner(lgraph)。有关详细信息,请参阅深度网络设计器

示例

plot(net) 绘制网络 net 的图。

示例

全部折叠

基于层数组创建一个层图。将 'relu_1' 层连接到 'add' 层。

layers = [
    imageInputLayer([32 32 3],'Name','input')   
    convolution2dLayer(3,16,'Padding','same','Name','conv_1')
    batchNormalizationLayer('Name','BN_1')
    reluLayer('Name','relu_1')
    
    convolution2dLayer(3,16,'Padding','same','Stride',2,'Name','conv_2')
    batchNormalizationLayer('Name','BN_2')
    reluLayer('Name','relu_2') 
    additionLayer(2,'Name','add')];

lgraph = layerGraph(layers);
lgraph = connectLayers(lgraph,'relu_1','add/in2');

绘制层图。

figure
plot(lgraph);

Figure contains an axes object. The axes object contains an object of type graphplot.

将一个预训练的 GoogLeNet 卷积神经网络作为 DAGNetwork 对象加载。如果未安装 Deep Learning Toolbox™ Model for GoogLeNet Network 支持包,则软件会提供下载链接。

net = googlenet
net = 
  DAGNetwork with properties:

         Layers: [144×1 nnet.cnn.layer.Layer]
    Connections: [170×2 table]

绘制该网络。

figure('Units','normalized','Position',[0.1 0.1 0.8 0.8]);
plot(net)

将一个预训练的 AlexNet 卷积神经网络作为 SeriesNetwork 对象加载。如果未安装 Deep Learning Toolbox™ Model for AlexNet Network 支持包,则软件会提供下载链接。

net = alexnet
net = 
  SeriesNetwork with properties:

         Layers: [25x1 nnet.cnn.layer.Layer]
     InputNames: {'data'}
    OutputNames: {'output'}

绘制该网络。

plot(net)

Figure contains an axes object. The axes object contains an object of type graphplot.

输入参数

全部折叠

层图,指定为 LayerGraph 对象。要创建层图,请使用 layerGraph

深度学习网络,指定为 SeriesNetworkDAGNetworkdlnetwork 对象。

版本历史记录

在 R2017b 中推出