Closed flydephone closed 1 year ago
@flydephone Thank you for creating the issue and your contribution to Bayesian-Torch. All the convolutional layers (Conv2dReparameterization, Conv3dReparameterization, ConvTranspose2dReparameterization, ConvTranspose3dReparameterization, Conv2dFlipout, Conv3dFlipout, ConvTranspose2dFlipout, ConvTranspose3dFlipout) are now enabled to support arbitrary kernel sizes.
Commit https://github.com/IntelLabs/bayesian-torch/commit/a8543ad20672c7f4890741ff2fd9d8b0197d5570 (@msubedar ) fixes this issue.
The
Conv2dReparameterization
only allows kernels with same dim (e.g., 2×2) However, some CNN model has different kernels (e.g., ininceptionresnetv2
, the kernel size inblock17
is 1×7)So, I modified the code in
conv_variational.py
from:to
also, the
kernel_size=d.kernel_size[0]
was changes tokernel_size=d.kernel_size
in dnn_to_cnn.py