Hi, I noticed that the outputs from my custom Conv3d and PyTorch’s nn.Conv3d were very different,
so I added some simple print() statements in both constructors (added at level1 question 60)
to check their weights.
Here’s what I got:
[RefModel] in=3, out=64, kernel=(3, 5, 7), stride=1, padding=0, bias=False
[RefModel Conv3d] weight shape: (64, 3, 3, 5, 7)
mean=-0.000240, std=0.032601, min=-0.056343, max=0.056341
[ModelNew] in=3, out=64, kernel=(3, 5, 7), stride=1, padding=(0, 0, 0), bias=False
[ModelNew Conv3d] weight shape: (64, 3, 3, 5, 7)
mean=0.009656, std=1.001391, min=-4.590487, max=4.220885
The shapes match, but the distributions are very different — nn.Conv3d has much smaller weights (std≈0.03),
while the custom one uses torch.randn() (std≈1.0).
This likely causes large output differences even if the kernels are correct.