simclr
SimCLRLoss(temperature=1.0)
¶
Bases: Module
SIMCLRloss module.
Parameters:
-
temperature
(
float
, default:1.0
) –temperature of SIM loss.
Source code in quadra/losses/ssl/simclr.py
61 62 63 |
|
forward(x1, x2)
¶
Forward pass of the loss.
Source code in quadra/losses/ssl/simclr.py
65 66 67 |
|
simclr_loss(features1, features2, temperature=1.0)
¶
SimCLR loss described in https://arxiv.org/pdf/2002.05709.pdf.
Parameters:
-
temperature
(
float
, default:1.0
) –optional temperature
-
features1
(
Tensor
) –First augmented features (i.e. T(features))
-
features2
(
Tensor
) –Second augmented features (i.e. T'(features))
Returns:
-
Tensor
–SimCLR loss
Source code in quadra/losses/ssl/simclr.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
|