Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The convolutional layers in localization network #4

Open
clelouch opened this issue Jun 16, 2020 · 4 comments
Open

The convolutional layers in localization network #4

clelouch opened this issue Jun 16, 2020 · 4 comments

Comments

@clelouch
Copy link

clelouch commented Jun 16, 2020

Hi, thanks for your code.
I want to plug the STN into a CNN, and after comparing your code with the code in pytorch tutorial, I find some differences.
image
The tutorial code only uses two convolutional layers, while you use four layers instead. As far as I know, the 7x7 layer can be replaced with three 3x3 layers, while you use two layers. The channel number is also different. I'm curious about why you select such a architecture. what's more, in STNModule.py 20-22.
image
I guess it might a bug?

@aicaffeinelife
Copy link
Owner

Since this was written a long time ago, I don't remember the exact details of my decision that led me to write that architecture. From what I know about Spatial Transformer's, the localization net can be made as deep as possible since all it does is downsample the input image. You need to be careful about how much you down sample (e.g. one MaxPool2d is sufficient for CIFAR-10x, more may be needed for ImageNet).

I agree with you that the module requires a bit more cleaning up. If you're interested, submit a PR and I'll merge it after our chat there.

@clelouch
Copy link
Author

Since this was written a long time ago, I don't remember the exact details of my decision that led me to write that architecture. From what I know about Spatial Transformer's, the localization net can be made as deep as possible since all it does is downsample the input image. You need to be careful about how much you down sample (e.g. one MaxPool2d is sufficient for CIFAR-10x, more may be needed for ImageNet).

I agree with you that the module requires a bit more cleaning up. If you're interested, submit a PR and I'll merge it after our chat there.

Thanks for your reply.
I don't know what PR means... can you explain it?

@aicaffeinelife
Copy link
Owner

PR is a pull request, just clone the repository and write your code in a different branch and submit it to the repo.

@clelouch
Copy link
Author

Thanks for your reply.
I just read the code in https://github.com/oarriaga/STN.keras. In oarriaga/STN.keras#11, the author points out the localization network architecture can be arbitrary. So, I guess your code don't need a modification.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants