cc01e8a726fabd2c758303b1a3174fb2b17be5a2,catalyst/contrib/nn/modules/cosface.py,CosFace,forward,#CosFace#Any#Any#,64

Before Change


        
        cosine = F.linear(F.normalize(input), F.normalize(self.weight))
        phi = cosine - self.m
        one_hot = torch.zeros(cosine.size()).to(input.device)
        one_hot.scatter_(1, target.view(-1, 1).long(), 1)
        logits = (one_hot * phi) + ((1.0 - one_hot) * cosine)
        logits *= self.s

After Change


        cosine = F.linear(F.normalize(input), F.normalize(self.weight))
        phi = cosine - self.m

        one_hot = torch.zeros_like(cosine)
        one_hot.scatter_(1, target.view(-1, 1).long(), 1)

        logits = (one_hot * phi) + ((1.0 - one_hot) * cosine)
        logits *= self.s
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 5

Instances


Project Name: Scitator/catalyst
Commit Name: cc01e8a726fabd2c758303b1a3174fb2b17be5a2
Time: 2020-10-10
Author: dimdoroshenko@gmail.com
File Name: catalyst/contrib/nn/modules/cosface.py
Class Name: CosFace
Method Name: forward


Project Name: Scitator/catalyst
Commit Name: cc01e8a726fabd2c758303b1a3174fb2b17be5a2
Time: 2020-10-10
Author: dimdoroshenko@gmail.com
File Name: catalyst/contrib/nn/modules/arcface.py
Class Name: SubCenterArcFace
Method Name: forward