quantize_weights: Quantize the weights of a model.

quantize_weightsR Documentation

Quantize the weights of a model.

Description

Note that the model must be built first before calling this method. quantize_weights() will recursively call layer$quantize(mode) in all layers and will be skipped if the layer doesn't implement the function.

Currently only Dense and EinsumDense layers support quantization.

Usage

quantize_weights(object, mode, ...)

Arguments

object

A Keras Model or Layer.

mode

The mode of the quantization. Only 'int8' is supported at this time.

...

Passed on to the object quantization method.

Value

model, invisibly. Note this is just a convenience for usage with ⁠|>⁠, the model is modified in-place.

See Also

Other layer methods:
count_params()
get_config()
get_weights()
reset_state()


rstudio/keras documentation built on Feb. 4, 2025, 1:11 p.m.