Update max_pooling_RHE.py

This commit is contained in:
xiaohou 2021-11-18 16:04:43 +08:00 committed by GitHub
parent f98da24382
commit 2dff1fd5fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -17,7 +17,8 @@ import torch
import numpy as np import numpy as np
def RHE(indice: torch.Tensor, k: int): def RHE(indice: torch.Tensor, k: int):
"""Regional hard example mining from 'Mining effective negative training samples for keyword spotting' """Regional hard example mining from
'Mining effective negative training samples for keyword spotting'
Attributes: Attributes:
index: indice of index: indice of
@ -77,8 +78,7 @@ def max_pooling_RHE_binary_CE(logits,
"""Max-pooling loss with regional hard example mining """Max-pooling loss with regional hard example mining
For each keyword utterance, select the frame with the highest posterior. For each keyword utterance, select the frame with the highest posterior.
The keyword is triggered when any of the frames is triggered. The keyword is triggered when any of the frames is triggered.
For each non-keyword utterance, select several hard examples using the
For each non-keyword utterance, select several hard examples using the
RHE algorithm. RHE algorithm.
Attributes: Attributes: