tfmot.quantization.keras.experimental.default_n_bit.DefaultNBitQuantizeLayoutTransform

Default model transformations.

Inherits From: QuantizeLayoutTransform

Methods

apply

View source

Implement default 8-bit transforms.

Currently this means the following.

  1. Pull activations into layers, and apply fuse activations. (
  2. Modify range in incoming layers for Concat. (
  3. Fuse Conv2D/DepthwiseConv2D + BN into single layer.

Args
model Keras model to be quantized.
layer_quantize_map Map with keys as layer names, and values as dicts containing custom QuantizeConfigs which may have been passed with layers.

Returns
(Transformed Keras model to better match TensorFlow Lite backend, updated layer quantize map.)