Example of Model Compressor

This page illustrates how a model's architecture changes when NetsPresso Model Compressor is applied.

1. Pruning

1. Pruning by Channel Index Example

The figure below describes how "Pruning by Channel Index" removes all the connected convolutional layers with the element-wise operation.

With the given configuration, the channels of the layer connected to the "add_2" layer are also removed. The figure below portraits a shape of the new model structure.

Details of the policy that handles element-wise operation can be found at document.

2. Pruning by Criteria Example

The figures below describe how "Pruning by Criteria" removes the convolutional layer with the element-wise connection.

The ratio of the "add_2" layer is set to be removed as 0.2 for all of the policies: average, intersection, union.
Here is a detailed description of the policy for dealing with element-wise operations.

2. Filter Decomposition

1. Tucker Decomposition Example

The figure below describes how Tucker Decomposition shapes a model.
In this example, In & Out Rank of the "features.3" layer were set as follows.

With the given configuration, Tucker Decomposition decomposes one weight into three weights. The figure below portraits a shape of the new model structure.

2. CP Decomposition Example

In this example, Rank of the "features.3" layer was set as follows.

With the given configuration, CP Decomposition decomposes one weight into four weights. The figure below portraits a shape of the new model structure.