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

How can I fix the scale to 50% (0.5) and learn only the translation parameters? #10

Open
abhisheksgumadi opened this issue Jun 14, 2016 · 2 comments

Comments

@abhisheksgumadi
Copy link

Thanks for this wonderful implementation. I want to learn just the translation parameters and fix the scale to 50% (0.5) and keep the scale a constant during training.

How can we do this please with this implementation? I couldn't think of a way to keep the scale as a constant with an initial value.

@albanD
Copy link
Contributor

albanD commented Jun 15, 2016

Hi,

Unfortunately, this is not supported right now.

  • You can modify the AffineTransformMatrixGenerator to be able to work with constants.
  • You can also create a custom module, that you will place between the AffineTransformMatrixGenerator and the AffineGridGeneratorBHWD, that will apply this scaling. The forward pass of this module would be very close to this and the backward pass to this where scaleFactors is the constant value 0.5.

@abhisheksgumadi
Copy link
Author

Thanks Alban, I got it working finally. I wrote a new Torch layer that takes the Affine matrix as input and just subtracts (0.5) from the initialised scale parameters that are not learned.

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