Wenlve-Zhou / BIDFC-master

BIDFC: Weakly Contrastive Learning via Batch Instance Discrimination and Feature Clustering (Core Code)
6 stars 0 forks source link

Missing Functions #1

Open jasbrown96 opened 2 years ago

jasbrown96 commented 2 years ago

Hello,

I notice in the BIDFC.py file, it references the loss functions mentioned in the paper, which are called from 'import utils.loss as loss'. I don't see a utils function, however, to import the loss from (or the dataset from the matter). I imagine the get_model function from network.builder would also be important for replicating this code, but I cannot locate that either.

Wenlve-Zhou commented 2 years ago

HI,

Thanks for your notice! This code in the github is the core but not full. The "utils.loss" includes two losses, respectively for "Cross-Entropy Loss" and "DWV Loss". The first term you colud directly apply "torch.nn.CrossEntropyLoss()". The second term you could write "torch.mean(torch.mean(torch.std(x, dim=1), dim=1))" simply, and the dynamic term locate in the BIDFC.py.

Hope this could help you!