NetworkAnalysis
Description
Deep learning network analysis information, including total learnables, layer information, and network warnings.
Creation
Create a NetworkAnalysis
object using the output of the analyzeNetwork
function.
Properties
TotalLearnables
— Total number of network learnables
positive integer
This property is read-only.
Total number of network learnables, returned as a positive integer. Learnables are parameters that the networks learns during the training process. For example, layer weights and biases.
Note
If the network has any errors, then the total number of learnables returned by
the software is NaN
. To see the total learnables, you must first
fix any network errors. For more information, see Issues
.
Data Types: single
| double
| int8
| int16
| int32
| int64
| uint8
| uint16
| uint32
| uint64
LayerInfo
— Layer information
table
This property is read-only.
Layer information, returned as a table. The table contains these variables:
Name
— Layer nameType
— Layer typeActivationSizes
— Size of layer activationsActivationFormats
— Format of layer activationsLearnableSizes
— Size of layer learnables, returned as adictionary
object. object.NumLearnables
— Number of learnables in layerStateSizes
— Size of layer states, returned as adictionary
object.
If the network contains a ProjectedLayer
object, then the table
also contains:
LearnablesReduction
— Proportion of learnables removed by projection
If the network is a taylorPrunableNetwork
object, then the table
also contains:
LearnablesReduction
— Proportion of learnables removed by pruningNumPrunedFilters
— Number of pruned filters
Data Types: table
Issues
— Network issues
table
This property is read-only.
Network issues, including warnings and errors, returned as a table. The table contains these variables:
Type
— Issue type, such as warning or errorLayer
— Name of layer with the issueInfo
— Information about the issue
Data Types: table
NumErrors
— Number of errors
nonnegative integer
This property is read-only.
Number of network errors, returned as a nonnegative integer.
Data Types: single
| double
| int8
| int16
| int32
| int64
| uint8
| uint16
| uint32
| uint64
NumWarnings
— Number of warnings
nonnegative integer
This property is read-only.
Number of network warnings, returned as a nonnegative integer.
Data Types: single
| double
| int8
| int16
| int32
| int64
| uint8
| uint16
| uint32
| uint64
AnalysisDate
— Time of analysis
datetime
Object Functions
analyzeNetwork | Analyze deep learning network architecture |
Examples
Analyze Trained Network
Load a pretrained GoogLeNet convolutional neural network.
net = imagePretrainedNetwork("googlenet");
Analyze the network. analyzeNetwork
displays an interactive plot of the network architecture and a table containing information about the network layers.
info = analyzeNetwork(net);
Investigate the network architecture using the plot to the left. Select a layer in the plot. The selected layer is highlighted in the plot and in the layer table.
In the table, view layer information such as layer properties, layer type, and sizes of the layer activations and learnable parameters. The activations of a layer are the outputs of that layer. Each activation dimension has one of the following labels:
S — Spatial
C — Channel
B — Batch observations
T — Time or sequence
U — Unspecified
View the dimension labels to understand how data propagates through the network and how the layers modify the size and layout of activations.
Select a deeper layer in the network. Notice that activations in deeper layers are smaller in the spatial dimensions (the first two dimensions) and larger in the channel dimension (the last dimension). Using this structure enables convolutional neural networks to gradually increase the number of extracted image features while decreasing the spatial resolution.
The Deep Learning Network Analyzer shows the total number of learnable parameters in the network, to one decimal place. To see the exact number of learnable parameters, pause on total learnables. To show the number of learnable parameters in each layer, click the arrow in the top-right corner of the layer table and select Number of Learnables. To sort the layer table by column value, hover the mouse over the column heading and click the arrow that appears. For example, you can determine which layer contains the most parameters by sorting the layers by the number of learnable parameters.
Programmatically view the network analysis results.
info
info = NetworkAnalysis with properties: TotalLearnables: 6998552 LayerInfo: [143×7 table] Issues: [0×3 table] NumErrors: 0 NumWarnings: 0 AnalysisDate: 11-Dec-2023 17:48:12
Version History
Introduced in R2024aR2024b: Access compression related network analysis information programmatically
Starting in R2024b, if the input network is a taylorPrunableNetwork
object or contains a ProjectedLayer
object, then the
NetworkAnalysis
object contains compression-specific information.
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)