雾聪
2024-01-15 8a8d60d5786510ec7b1dd4f622e848de8a15f8a8
funasr/models/specaug/specaug.py
@@ -3,14 +3,16 @@
from typing import Sequence
from typing import Union
from funasr.models.specaug.abs_specaug import AbsSpecAug
from funasr.layers.mask_along_axis import MaskAlongAxis
from funasr.layers.mask_along_axis import MaskAlongAxisVariableMaxWidth
from funasr.layers.mask_along_axis import MaskAlongAxisLFR
from funasr.layers.time_warp import TimeWarp
from funasr.models.specaug.mask_along_axis import MaskAlongAxis
from funasr.models.specaug.mask_along_axis import MaskAlongAxisVariableMaxWidth
from funasr.models.specaug.mask_along_axis import MaskAlongAxisLFR
from funasr.models.specaug.time_warp import TimeWarp
from funasr.register import tables
import torch.nn as nn
class SpecAug(AbsSpecAug):
@tables.register("specaug_classes", "SpecAug")
class SpecAug(nn.Module):
    """Implementation of SpecAug.
    Reference:
@@ -99,7 +101,8 @@
            x, x_lengths = self.time_mask(x, x_lengths)
        return x, x_lengths
class SpecAugLFR(AbsSpecAug):
@tables.register("specaug_classes", "SpecAugLFR")
class SpecAugLFR(nn.Module):
    """Implementation of SpecAug.
    lfr_rate:low frame rate
    """