MCPcopy Create free account
hub / github.com/TPCD/DCCL / __init__

Method __init__

methods/representation_learning/representation_learning.py:39–44  ·  view source on GitHub ↗
(self, temperature=0.07, contrast_mode='all',
                 base_temperature=0.07)

Source from the content-addressed store, hash-verified

37 It also supports the unsupervised contrastive loss in SimCLR
38 From: https://github.com/HobbitLong/SupContrast"""
39 def __init__(self, temperature=0.07, contrast_mode='all',
40 base_temperature=0.07):
41 super(SupConLoss, self).__init__()
42 self.temperature = temperature
43 self.contrast_mode = contrast_mode
44 self.base_temperature = base_temperature
45
46 def forward(self, features, labels=None, mask=None):
47 """Compute loss for model. If both `labels` and `mask` are None,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected