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

Adding loss layer of type INFOGAIN_LOSS #1640

Closed
shaibagon opened this issue Dec 28, 2014 · 2 comments
Closed

Adding loss layer of type INFOGAIN_LOSS #1640

shaibagon opened this issue Dec 28, 2014 · 2 comments

Comments

@shaibagon
Copy link
Member

I would like to add loss layer of type INFOGAIN_LOSS. This layer requires three inputs: (1) class probabilities, (2) labels and (3) information gain matrix H of size (#labels)-by-(#labels).
I want H to be provided as the third input (bottom) to the loss layer (rather than as a model parameter). How can I do this?
Do I define a new data layer which "top" is H? If so, wouldn't the data of this layer be incremented every training iteration like the training data is incremented? How can I define multiple unrelated input "data" layers, and how does caffe know to read from the training/testing "data" layer batch after batch, while from the H "data" layer it knows to read only once for all the training process?

@shelhamer
Copy link
Member

There's no way at present to make data layers load input at different rates. Every forward pass all data layers will advance. However, the constant H input could be done by making an input lmdb / leveldb / hdf5 file that is only H since the data layer will loop and keep loading the same H. This obviously wastes disk IO.

One could orchestrate the training in Python by defining a data layer for the normal inputs and labels but input fields for H, and then assigning H at the beginning of training. The input blobs will persist across forward calls.

@shaibagon
Copy link
Member Author

@shelhamer - thank you for your answer. I'll look into it and give it a try!

@longjon longjon closed this as completed May 9, 2015
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

3 participants