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