qkeras.qdense_batchnorm
Fold batchnormalization with previous QDense layers.
Classes
|
Implements a quantized Dense layer fused with Batchnorm. |
- class qkeras.qdense_batchnorm.QDenseBatchnorm(*args, **kwargs)[source]
Bases:
QDenseImplements a quantized Dense layer fused with Batchnorm.
- get_config()[source]
Returns the config of the object.
An object config is a Python dictionary (serializable) containing the information needed to re-instantiate it.
- get_folded_weights()[source]
Function to get the batchnorm folded weights. This function converts the weights by folding batchnorm parameters into the weight of QDense. The high-level equation: W_fold = gamma * W / sqrt(variance + epsilon) bias_fold = gamma * (bias - moving_mean) / sqrt(variance + epsilon) + beta