Is conv2d using random filters? Is that good for the NN?
If I am using nn.Conv2d(in_dim, out_dim, kernel_size, bias=False) command in PyTorch, then the function creates as many filters as specified by out_dim. Are these filters random? Is it not be better to customize these filters? Does someone have a method for this?

Or is it better to use the random filter generated by this function?

Done in PyTorch, python.

Thanks


  Are these filters random? Is it not be better to customize these filters? Does someone have a method for this?


Yes, they are pretty random, made via the initialization function used for the Conv2d.

This may change but by default, nn.Conv2d uses init.kaiming_uniform_. You can tweak it as:

conv_layer = nn.Conv2d(in_dim, out_dim, kernel_size, bias=False)
torch.nn.init.kaiming_normal_(conv_layer.weight)


The concept is to learn the weights while training, so these random values at first will alter and become learned tensor values.
