-
-
Notifications
You must be signed in to change notification settings - Fork 43
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
Implement contrastive loss function. #5
Comments
Isn't it already implemented? In layers.losses there is a contrastive loss function. But I tried, but the loss is always 0. So, indeed it seems not working, although you can hand over the loss function a an argument? What is actually the constrastive? Since there is also contrastive_lecun. In your function contrastive you only hand over I suppose this lecun_contrastive is similiar to triplet loss and to be a contrastive loss und need postive and negative examples. |
Hey @tlatkowski . Do you have an idea how I can use the loss other than MSE loss functions? I suppose I need to change the data set reader? |
Hi @datistiquo
just change mse to contrastive for example you also need to import it from losses module. In the next version i will make a change in pipeline so you will be able to change loss from the main config file. |
Hi @tlatkowski I already tried this, but I get for the loss zero. I think you also need to change the input dataset to get pairs for the postive and negative examples at least for the contrastive_lecun function? Why should the data set structure work for the contrastive function at all? You just handover the predction as argument. I dont see any operation where the postive and negative samples are extracted? |
Implement contrastive loss function according to paper:
http://yann.lecun.com/exdb/publis/pdf/hadsell-chopra-lecun-06.pdf
The text was updated successfully, but these errors were encountered: