@@ -49,8 +49,8 @@ def mask(self, data: np.ndarray) -> np.ndarray:
4949
5050class FreqMaskingAugmenter (SpectrogramAugmenter ):
5151 def __init__ (self ,
52- mask_factor = 27 ,
53- name = "FreqMaskingAugmenter" ,
52+ mask_factor : float = 27 ,
53+ name : str = "FreqMaskingAugmenter" ,
5454 verbose = 0 ):
5555 super (FreqMaskingAugmenter , self ).__init__ (
5656 action = Action .SUBSTITUTE , zone = (0.2 , 0.8 ), name = name , device = "cpu" , verbose = verbose ,
@@ -63,9 +63,9 @@ def substitute(self, data):
6363
6464class FreqMasking (SpectrogramAugmenter ):
6565 def __init__ (self ,
66- num_masks = 1 ,
67- mask_factor = 27 ,
68- name = "FreqMasking" ,
66+ num_masks : int = 1 ,
67+ mask_factor : float = 27 ,
68+ name : str = "FreqMasking" ,
6969 verbose = 0 ):
7070 super (FreqMasking , self ).__init__ (
7171 action = Action .SUBSTITUTE , zone = (0.2 , 0.8 ), name = name , device = "cpu" , verbose = verbose ,
@@ -79,7 +79,7 @@ def substitute(self, data):
7979
8080
8181class TimeMaskingModel (Spectrogram ):
82- def __init__ (self , mask_factor : int = 100 , p_upperbound : float = 1.0 ):
82+ def __init__ (self , mask_factor : float = 100 , p_upperbound : float = 1.0 ):
8383 """
8484 Args:
8585 time_mask_param: parameter W of time masking
@@ -110,9 +110,9 @@ def mask(self, data: np.ndarray) -> np.ndarray:
110110
111111class TimeMaskingAugmenter (SpectrogramAugmenter ):
112112 def __init__ (self ,
113- mask_factor = 100 ,
114- p_upperbound = 1 ,
115- name = "TimeMaskingAugmenter" ,
113+ mask_factor : float = 100 ,
114+ p_upperbound : float = 1 ,
115+ name : str = "TimeMaskingAugmenter" ,
116116 verbose = 0 ):
117117 super (TimeMaskingAugmenter , self ).__init__ (
118118 action = Action .SUBSTITUTE , zone = (0.2 , 0.8 ), name = name , device = "cpu" , verbose = verbose ,
@@ -125,10 +125,10 @@ def substitute(self, data):
125125
126126class TimeMasking (SpectrogramAugmenter ):
127127 def __init__ (self ,
128- num_masks = 1 ,
129- mask_factor = 100 ,
130- p_upperbound = 1 ,
131- name = "TimeMasking" ,
128+ num_masks : int = 1 ,
129+ mask_factor : float = 100 ,
130+ p_upperbound : float = 1 ,
131+ name : str = "TimeMasking" ,
132132 verbose = 0 ):
133133 super (TimeMasking , self ).__init__ (
134134 action = Action .SUBSTITUTE , zone = (0.2 , 0.8 ), name = name , device = "cpu" , verbose = verbose ,
0 commit comments