neural_compressor.compression.pruner.pruners.basic

Basic pruner.

Module Contents

Classes

PytorchBasicPruner

Pruning Pruner.

KerasBasicPruner

Pruning Pruner.

class neural_compressor.compression.pruner.pruners.basic.PytorchBasicPruner(config, modules)[source]

Pruning Pruner.

The class which executes pruning process. 1. Defines pruning functions called at step begin/end, epoch begin/end. 2. Defines the pruning criterion.

Parameters:
  • modules – A dict {“module_name”: Tensor} that stores the pruning modules’ weights.

  • config – A config dict object that contains the pruner information.

pattern[source]

A Pattern object that defines pruning weights’ arrangements within space.

criterion[source]

A Criterion Object that defines which weights are to be pruned

scheduler[source]

A Scheduler object that defines how the model’s sparsity changes as training/pruning proceeds.

reg[source]

A Reg object that defines regulization terms.

class neural_compressor.compression.pruner.pruners.basic.KerasBasicPruner(config, modules)[source]

Pruning Pruner.

The class which executes pruning process. 1. Defines pruning functions called at step begin/end, epoch begin/end. 2. Defines the pruning criterion.

Parameters:
  • modules – A dict {“module_name”: Tensor} that stores the pruning modules’ weights.

  • config – A config dict object that contains the pruner information.

pattern[source]

A Pattern object that defines pruning weights’ arrangements within space.

criterion[source]

A Criterion Object that defines which weights are to be pruned

scheduler[source]

A Scheduler object that defines how the model’s sparsity changes as training/pruning proceeds.

reg[source]

A Reg object that defines regulization terms.