Pruning Information

class model_compression_toolkit.pruning.PruningInfo(pruning_masks, importance_scores)

PruningInfo stores information about a pruned model, including the pruning masks and importance scores for each layer. This class acts as a container for accessing pruning-related metadata.

Parameters:
  • pruning_masks (Dict[BaseNode, np.ndarray]) – Stores the pruning masks for each layer. A pruning mask is an array where each element indicates whether the corresponding channel or neuron has been pruned (0) or kept (1).

  • importance_scores (Dict[BaseNode, np.ndarray]) – Stores the importance scores for each layer. Importance scores quantify the significance of each channel in the layer.

property importance_scores: Dict[BaseNode, ndarray]

The importance scores for each layer.

Returns:

The importance scores.

Return type:

Dict[BaseNode, np.ndarray]

Return type:

Dict[BaseNode, ndarray]

property pruning_masks: Dict[BaseNode, ndarray]

The pruning masks for each layer.

Returns:

The pruning masks.

Return type:

Dict[BaseNode, np.ndarray]

Return type:

Dict[BaseNode, ndarray]