Coverage for src/bob/bio/face/pytorch/head/regular.py: 57%

7 statements  

« prev     ^ index     » next       coverage.py v7.6.0, created at 2024-07-13 00:04 +0200

1from torch.nn import Linear, Module 

2 

3 

4class Regular(Module): 

5 """ 

6 Implement a regular head used for softmax layers 

7 """ 

8 

9 def __init__(self, feat_dim, num_class): 

10 super(Regular, self).__init__() 

11 

12 self.fc = Linear(feat_dim, num_class, bias=False) 

13 

14 def forward(self, feats, labels): 

15 return self.fc(feats)