neuronPCA
Description
The compressNetworkUsingProjection
function uses principal
component analysis (PCA) to identify the subspace of learnable parameters that result in the
highest variance in neuron activations by analyzing the network activations using a data set
representative of the training data. The PCA step can be computationally intensive. If you
expect to compress the same network multiple times (for example, when exploring different
levels of compression), then you can perform the PCA step up front using a
neuronPCA
object.
Forward passes of a projected deep neural network are typically faster when you deploy the network to embedded hardware using library-free C or C++ code generation.
If you prune or quantize your network, then use compression using projection after pruning and before quantization. Network compression using projection supports projecting LSTM layers only.
Creation
Syntax
Description
computes the principal component analysis of the neuron activations in
npca
= neuronPCA(net
,mbq
)net
using the data in the mini-batch queue
mbq
. The software analyzes the input and output activations of the
projectable layers in net
. This function requires the Deep Learning Toolbox™ Model Quantization Library support package. This support package is a free add-on that you can download
using the Add-On Explorer. Alternatively, see Deep Learning Toolbox Model Quantization Library.
specifies which layers to analyze and sets the npca
= neuronPCA(___,LayerNames=names)LayerNames
property.
specifies the amount of information displayed in the command window.npca
= neuronPCA(___,VerbosityLevel=level
)
Input Arguments
Properties
Examples
Extended Capabilities
Version History
Introduced in R2022b