espnet2.spk.loss.aamsoftmax.AAMSoftmax
espnet2.spk.loss.aamsoftmax.AAMSoftmax
class espnet2.spk.loss.aamsoftmax.AAMSoftmax(nout, nclasses, margin=0.3, scale=15, easy_margin=False, **kwargs)
Bases: AbsLoss
Additive angular margin softmax.
Paper: Deng, Jiankang, et al. “Arcface: Additive angular margin loss for deep face recognition.” Proceedings of the IEEE/CVF conference on computer vision and pattern recognition. 2019.
- Parameters:
- nout – dimensionality of speaker embedding
- nclases – number of speakers in the training set
- margin – margin value of AAMSoftmax
- scale – scale value of AAMSoftmax
Initializes internal Module state, shared by both nn.Module and ScriptModule.
forward(x, label=None)
Defines the computation performed at every call.
Should be overridden by all subclasses.
NOTE
Although the recipe for forward pass needs to be defined within this function, one should call the Module
instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.