Closed FengheTan9 closed 4 months ago
(sparse_bn(sparse_conv(raw_inp)) > 0) * 255
should be changed to like (sparse_bn(sparse_conv(raw_inp)).abs() > 1e-5) * 255
. Because non-masked features after BN can <0. Also, some non-zero non-masked values can be 0 after BN (normalized to 0, not masked to 0).
thank you for your reply. I have another question, when implementing InstanceNorm2D, is this the correct definition?
I'm not quite familiar with how nn.InstanceNorm1d/2d works, but I'm sure what InstanceNorm1d is to InstanceNorm2d is different from what BatchNorm1d is to BatchNorm2d. So I don't think directly replacing BN with IN is correct (like above).
I suggest you to first implement an InstanceNorm without calling nn.InstanceNorm and make sure it is identical to nn.InstanceNorm. Then try to calculate the statistics (mean, std) on those non-masked positions only (maybe re-use our _get_active_ex_or_ii
, or maybe need to implement a new similar function).
hello, i visualize the SparseConv2d and SparseBatchNorm2d find SparseBatchNorm2d can not mask correctly, could you give some solution or support ?