qkeras.qconv2d_batchnorm
Fold batchnormalization with previous QConv2D layers.
Classes
|
Fold batchnormalization with a previous qconv2d layer. |
- class qkeras.qconv2d_batchnorm.QConv2DBatchnorm(*args, **kwargs)[source]
Bases:
QConv2DFold batchnormalization with a previous qconv2d layer.
- 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 QConv2D. The high-level equation:
W_fold = gamma * W / sqrt(variance + epsilon) bias_fold = gamma * (bias - moving_mean) / sqrt(variance + epsilon) + beta