nncf.common.statistics#

Classes#

NNCFStatistics

Groups statistics for all available NNCF compression algorithms.

class nncf.common.statistics.NNCFStatistics[source]#

Bases: nncf.api.statistics.Statistics

Groups statistics for all available NNCF compression algorithms. Statistics are present only if the algorithm has been started.

property magnitude_sparsity: nncf.common.sparsity.statistics.MagnitudeSparsityStatistics | None[source]#

Returns statistics of the magnitude sparsity algorithm. If statistics have not been collected, None will be returned.

Returns:

Instance of the MagnitudeSparsityStatistics class.

Return type:

Optional[nncf.common.sparsity.statistics.MagnitudeSparsityStatistics]

property rb_sparsity: nncf.common.sparsity.statistics.RBSparsityStatistics | None[source]#

Returns statistics of the RB-sparsity algorithm. If statistics have not been collected, None will be returned.

Returns:

Instance of the RBSparsityStatistics class.

Return type:

Optional[nncf.common.sparsity.statistics.RBSparsityStatistics]

property movement_sparsity: nncf.common.sparsity.statistics.MovementSparsityStatistics | None[source]#

Returns statistics of the movement sparsity algorithm. If statistics have not been collected, None will be returned.

Returns:

Instance of the MovementSparsityStatistics class.

Return type:

Optional[nncf.common.sparsity.statistics.MovementSparsityStatistics]

property const_sparsity: nncf.common.sparsity.statistics.ConstSparsityStatistics | None[source]#

Returns statistics of the const sparsity algorithm. If statistics have not been collected, None will be returned.

Returns:

Instance of the ConstSparsityStatistics class.

Return type:

Optional[nncf.common.sparsity.statistics.ConstSparsityStatistics]

property quantization: nncf.common.quantization.statistics.QuantizationStatistics | None[source]#

Returns statistics of the quantization algorithm. If statistics have not been collected, None will be returned.

Returns:

Instance of the QuantizationStatistics class.

Return type:

Optional[nncf.common.quantization.statistics.QuantizationStatistics]

property filter_pruning: nncf.common.pruning.statistics.FilterPruningStatistics | None[source]#

Returns statistics of the filter pruning algorithm. If statistics have not been collected, None will be returned.

Returns:

Instance of the FilterPruningStatistics class.

Return type:

Optional[nncf.common.pruning.statistics.FilterPruningStatistics]

register(algorithm_name, stats)[source]#

Registers statistics for the algorithm.

Parameters:
  • algorithm_name (str) – Name of the algorithm. Should be one of the following * magnitude_sparsity * rb_sparsity * const_sparsity * quantization * filter_pruning

  • stats (nncf.api.statistics.Statistics) – Statistics of the algorithm.

to_str()[source]#

Calls to_str() method for all registered statistics of the algorithm and returns a sum-up string.

Returns:

A representation of the NNCF statistics as a human-readable string.

Return type:

str