tfmot.quantization.keras.graph_transformations.model_transformer.ModelTransformer

Matches patterns to apply transforms in a tf.keras model graph.

model Keras model to be transformed.
transforms List of transforms to be applied to the model.
candidate_layers Names of layers which may be transformed. Only layers whose names are in candidate_layers are matched against patterns. The default is that all layers may be transformed.
layer_metadata Dictionary of metadata associated with each layer in the model. The keys are layer names.

Methods

transform

View source

Transforms the Keras model by applying all the specified transforms.

This is the main entry point function used to apply the transformations to the Keras model.

Not suitable for multi-threaded use. Creates and manipulates internal state.

Returns
(Keras model after transformation, Updated layer metadata map)