loeweX / Greedy_InfoMax

Code for the paper: Putting An End to End-to-End: Gradient-Isolated Learning of Representations
https://arxiv.org/abs/1905.11786
MIT License
283 stars 36 forks source link

Is any Guide , that i can use InfoNCE_Loss in my custom model ? #14

Closed aceprojectx closed 3 years ago

aceprojectx commented 3 years ago

https://github.com/loeweX/Greedy_InfoMax/blob/d5a050b0cdb5502a6a25b819db0f8de3ac5fc55a/GreedyInfoMax/audio/models/loss_InfoNCE.py#L9 Hi @loeweX i already read the code , but how can i use it , i am not sure some parameter in this class

update : i success mod this loss, but when train the model , when i get the loss is 1.8xxx , the acc only 27% ~ 30% , is it normal ?

loeweX commented 3 years ago

Hi aceprojectx,

Thanks for your interest in the code!

I'm not sure I understand your problem. What kind of modifications are you trying to apply to the loss? When using the original implementation of the repo, it should be able to achieve the performance as stated in the paper.

aceprojectx commented 3 years ago

@loeweX Infact i want to build a CPC model , and i need infoNCE loss .

This loss function your implement , is following by contrastive predictive coding right ? so can i directly use it in my custom cpc model ?

Thanks for your reply , and sorry for my poor English 😅

loeweX commented 3 years ago

Yes, this code also implements the basic CPC model. To use it, simply use the command-line parameter --model_splits 1