qkeras.quantizers package
Submodules
qkeras.quantizers.frozen_quantizer module
- class qkeras.quantizers.frozen_quantizer.FrozenFixedPointQuantizer(*args, **kwargs)
Bases:
FixedPointQuantizerKBI
Abstract base class for all fixed-point quantizers.
- add_weight(shape=None, initializer=None, dtype=None, trainable=True, autocast=True, regularizer=None, constraint=None, aggregation='mean', name=None)
Override add_weight to make it adds a constant weight.
- build(input_shape)
- get_config()
Returns the config of the object.
An object config is a Python dictionary (serializable) containing the information needed to re-instantiate it.
qkeras.quantizers.quantized_bits module
- class qkeras.quantizers.quantized_bits.quantized_bits(bits: int = 8, integer: int = 0, symmetric: int = 0, keep_negative: bool = True, alpha: int | float | ~numpy.integer | ~numpy.floating | str | None = None, use_stochastic_rounding: bool = False, scale_axis: ~collections.abc.Sequence[int] | None = None, qnoise_factor: float | None = None, var_name: None = None, use_ste: bool = True, use_variables: bool | None = None, bc=<hgq.constraints.Min object>, br=None, ic=<hgq.constraints.MinMax object>, ir=None)
Bases:
QuantizerConfig
- property bits
- classmethod from_string(string: str)
Create a quantized_bits configuration from a string representation.
- get_config()
- get_quantizer()
- property integers
- property keep_negative
- property max
- property min
- property symmetric
- class qkeras.quantizers.quantized_bits.quantized_relu(*args, **kwargs)
Bases:
quantized_bits
qkeras.quantizers.utils module
- qkeras.quantizers.utils.parse_string_to_args(string: str)
- qkeras.quantizers.utils.str_float_int_or_none(s: str)
Module contents
- class qkeras.quantizers.quantized_bits(bits: int = 8, integer: int = 0, symmetric: int = 0, keep_negative: bool = True, alpha: int | float | ~numpy.integer | ~numpy.floating | str | None = None, use_stochastic_rounding: bool = False, scale_axis: ~collections.abc.Sequence[int] | None = None, qnoise_factor: float | None = None, var_name: None = None, use_ste: bool = True, use_variables: bool | None = None, bc=<hgq.constraints.Min object>, br=None, ic=<hgq.constraints.MinMax object>, ir=None)
Bases:
QuantizerConfig
- property bits
- classmethod from_string(string: str)
Create a quantized_bits configuration from a string representation.
- get_config()
- get_quantizer()
- property integers
- property keep_negative
- property max
- property min
- property symmetric