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

Power File layer #2

Closed
naranjuelo opened this issue Jun 8, 2016 · 3 comments
Closed

Power File layer #2

naranjuelo opened this issue Jun 8, 2016 · 3 comments

Comments

@naranjuelo
Copy link

Hi, thank you for sharing your approaches!

I'm trying to train a model that contains your STLayer but I have some doubts about the "PowerFile" layer that I see in your examples, which adds some shift values to the input data (thetas). What is the objective of using this layer before the "LocLoss" layer?

I would also like to know which values are set in the file crop_init_1.txt (shift_file: "models/CUB_googLeNet_ST/crop_init_1.txt"), and what they represent.

Thank you very much!!

@daerduoCarey
Copy link
Owner

Hello, thanks for interests in my code.

PowerFile layer is to read some values from the file and perform the shifts to the bottom data (thetas in this case). The reason to shift the thetas is to initialize the thetas to a location at the very beginning according to some prior knowledge. For example, we hope the crop to focus on the head of the bird while another crop focus on the tail, etc.

The objective of using LocLoss layer is totally not related with the usage of PowerFile layer. LocLoss layer, as I said in the README, is designed as a loss function to make the crop not fall too far from the central location of the image space. They are totally two unrelated layers.

Sorry that I cannot find my crop_init_1.txt, but I guess it should be something like 0.5, 0 or -0.5, 0 to make the initial crops to focus on the left part and the right part on the original image.

Ask more if you are still confusing. Hope my implementation helps you with your research projects.

@naranjuelo
Copy link
Author

Ok, I see. I wanted to use the LocLoss layer so the crop does not fall too far as you said, but the problem is that in my case it focuses too much so my net is not learning anything. I understand that there's no way to limit this minimum value (minimum threshold), am I right?

Instead of that I also tried to use the STLoss layer, but I wanted to fix some theta values, for example 2 of them to avoid rotation (in the same way that it's possible for the LocLoss layer). The problem is that the STLoss layer needs 6 input parameters, so I cannot fix 2 thetas in the SpatialTransformer layer and then set the number of outputs of the layer previous to the STLoss to 4. Is there any way? Thank you!!

@daerduoCarey
Copy link
Owner

First of all, sorry that I may release too many confusing layers. They are the helper layers I added when I did the experiments. But finally when I got everything correct (learning something useful), I didn't activate any of these layers. The difficulty of training the networks with STLayer is that it's hard to fine-tune for the learning rates for the layers. Notice that finally when my trainings work out, my learning rate for the small net (localization net) is very small (like 1e-5) while the rates for other layers are much bigger (like 1e-2). So, please do not rely too much on my helper layers.

Besides, you can edit STLossLayer as your need. Sorry that I didn't do the work.

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