Emile Beukes
Emile Beukes

Reputation: 423

Initializing convolutional layers in CNN

Is there a function to initialize weights of a convolutional layer to focus more on information closer to the center of input images?

All my input images are centered, so pixels further away from the center of an image matter less than pixels closer to the center.

Upvotes: 1

Views: 1201

Answers (2)

prosti
prosti

Reputation: 46301

Is there a function to initialize weights of a convolutional layer to focus more on information closer to the center of input images?

This is not possible because, initialization is there just to trigger the process of learning. Model however, is the one that can have functions, achieving the the attention.

You don't need to initialize conv. layers also because in PyTorch this is already done automatically.

Upvotes: 0

thedch
thedch

Reputation: 177

Please see the GIFs here for a demonstration of convolutions:

https://github.com/vdumoulin/conv_arithmetic#convolution-animations

As you can see, convolutions operate the same regardless of the position in the image, so weight initialization cannot change the focus of the image.

It is also not advisable to rush into thinking about what the net will and won't need to learn your task. There are sometimes surprising amounts of signal outside what you as a human might focus on. I would suggest training the net and seeing how it performs, and then (as others have suggested) thinking about cropping.

Upvotes: 1

Related Questions