neural_compressor.experimental.common.optimizer

Intel Neural Compressor built-in Optimizers on multiple framework backends.

Module Contents

Classes

TensorflowOptimizers

Class to get all registered TensorFlow Optimizers once only.

PyTorchOptimizers

Class to get all registered PyTorch Optimizers once only.

Optimizers

Main entry to get the specific type of optimizer.

TensorFlowSGD

TensorFlow keras SGD optimizer.

TensorFlowAdamW

tensorflow_addons AdamW optimizer.

TensorFlowAdam

tensorflow Adam optimizer.

PyTorchSGD

PyTorch SGD optimizer.

Functions

optimizer_registry(optimizer_type, framework)

Class decorator used to register all Optimizer subclasses.

class neural_compressor.experimental.common.optimizer.TensorflowOptimizers

Bases: object

Class to get all registered TensorFlow Optimizers once only.

class neural_compressor.experimental.common.optimizer.PyTorchOptimizers

Bases: object

Class to get all registered PyTorch Optimizers once only.

class neural_compressor.experimental.common.optimizer.Optimizers(framework)

Bases: object

Main entry to get the specific type of optimizer.

register(name, optimizer_cls)

Allow registration of non-built-in optimizers.

neural_compressor.experimental.common.optimizer.optimizer_registry(optimizer_type, framework)

Class decorator used to register all Optimizer subclasses.

Cross framework optimizer is supported by add param as framework=’tensorflow, pytorch’

Parameters:
  • optimizer_type (str) – The string of supported criterion.

  • framework (str) – The string of supported framework.

Returns:

The class of register.

Return type:

cls

class neural_compressor.experimental.common.optimizer.TensorFlowSGD(param_dict)

Bases: object

TensorFlow keras SGD optimizer.

Parameters:

param_dict (dict) – The dict of parameters setting by user for SGD optimizer

class neural_compressor.experimental.common.optimizer.TensorFlowAdamW(param_dict)

Bases: object

tensorflow_addons AdamW optimizer.

Parameters:

param_dict (dict) – The dict of parameters setting by user for AdamW optimizer

class neural_compressor.experimental.common.optimizer.TensorFlowAdam(param_dict)

Bases: object

tensorflow Adam optimizer.

Parameters:

param_dict (dict) – The dict of parameters setting by user for Adam optimizer

class neural_compressor.experimental.common.optimizer.PyTorchSGD(param_dict)

Bases: object

PyTorch SGD optimizer.

Parameters:

param_dict (dict) – The dict of parameters setting by user for SGD optimizer