Merge pull request #779 from PaddlePaddle/aug

fix specaug config
pull/781/head
Hui Zhang 3 years ago committed by GitHub
commit 30a71de217
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -245,6 +245,8 @@ class SpecAugmentor(AugmentorBase):
Returns: Returns:
x (np.ndarray): `[T, F]` x (np.ndarray): `[T, F]`
""" """
assert isinstance(x, np.ndarray)
assert x.ndim == 2
x = self.time_warp(x, self.mode) x = self.time_warp(x, self.mode)
x = self.mask_freq(x, self.replace_with_zero) x = self.mask_freq(x, self.replace_with_zero)
x = self.mask_time(x, self.replace_with_zero) x = self.mask_time(x, self.replace_with_zero)

@ -19,17 +19,18 @@
{ {
"type": "specaug", "type": "specaug",
"params": { "params": {
"F": 10, "W": 5,
"T": 50, "warp_mode": "PIL",
"F": 30,
"n_freq_masks": 2, "n_freq_masks": 2,
"T": 40,
"n_time_masks": 2, "n_time_masks": 2,
"p": 1.0, "p": 1.0,
"W": 80,
"adaptive_number_ratio": 0, "adaptive_number_ratio": 0,
"adaptive_size_ratio": 0, "adaptive_size_ratio": 0,
"max_n_time_masks": 20, "max_n_time_masks": 20,
"replace_with_zero": true "replace_with_zero": false
}, },
"prob": 1.0 "prob": 1.0
} }
] ]

@ -28,7 +28,8 @@
"adaptive_number_ratio": 0, "adaptive_number_ratio": 0,
"adaptive_size_ratio": 0, "adaptive_size_ratio": 0,
"max_n_time_masks": 20, "max_n_time_masks": 20,
"replace_with_zero": true "replace_with_zero": true,
"warp_mode": "PIL"
}, },
"prob": 1.0 "prob": 1.0
} }

@ -52,17 +52,18 @@
{ {
"type": "specaug", "type": "specaug",
"params": { "params": {
"W": 80,
"warp_mode": "PIL",
"F": 10, "F": 10,
"T": 50,
"n_freq_masks": 2, "n_freq_masks": 2,
"T": 50,
"n_time_masks": 2, "n_time_masks": 2,
"p": 1.0, "p": 1.0,
"W": 80,
"adaptive_number_ratio": 0, "adaptive_number_ratio": 0,
"adaptive_size_ratio": 0, "adaptive_size_ratio": 0,
"max_n_time_masks": 20, "max_n_time_masks": 20,
"replace_with_zero": true "replace_with_zero": false
}, },
"prob": 0.0 "prob": 1.0
} }
] ]

@ -28,7 +28,8 @@
"adaptive_number_ratio": 0, "adaptive_number_ratio": 0,
"adaptive_size_ratio": 0, "adaptive_size_ratio": 0,
"max_n_time_masks": 20, "max_n_time_masks": 20,
"replace_with_zero": true "replace_with_zero": true,
"warp_mode": "PIL"
}, },
"prob": 1.0 "prob": 1.0
} }

@ -28,7 +28,8 @@
"adaptive_number_ratio": 0, "adaptive_number_ratio": 0,
"adaptive_size_ratio": 0, "adaptive_size_ratio": 0,
"max_n_time_masks": 20, "max_n_time_masks": 20,
"replace_with_zero": true "replace_with_zero": true,
"warp_mode": "PIL"
}, },
"prob": 1.0 "prob": 1.0
} }

@ -11,7 +11,8 @@
"adaptive_number_ratio": 0, "adaptive_number_ratio": 0,
"adaptive_size_ratio": 0, "adaptive_size_ratio": 0,
"max_n_time_masks": 20, "max_n_time_masks": 20,
"replace_with_zero": true "replace_with_zero": true,
"warp_mode": "PIL"
}, },
"prob": 1.0 "prob": 1.0
} }

@ -28,7 +28,8 @@
"adaptive_number_ratio": 0, "adaptive_number_ratio": 0,
"adaptive_size_ratio": 0, "adaptive_size_ratio": 0,
"max_n_time_masks": 20, "max_n_time_masks": 20,
"replace_with_zero": true "replace_with_zero": true,
"warp_mode": "PIL"
}, },
"prob": 1.0 "prob": 1.0
} }

@ -6,7 +6,7 @@
"max_speed_rate": 1.1, "max_speed_rate": 1.1,
"num_rates": 3 "num_rates": 3
}, },
"prob": 1.0 "prob": 0.0
}, },
{ {
"type": "shift", "type": "shift",
@ -19,16 +19,18 @@
{ {
"type": "specaug", "type": "specaug",
"params": { "params": {
"F": 10, "W": 5,
"T": 50, "warp_mode": "PIL",
"F": 30,
"n_freq_masks": 2, "n_freq_masks": 2,
"T": 40,
"n_time_masks": 2, "n_time_masks": 2,
"p": 1.0, "p": 1.0,
"W": 80,
"adaptive_number_ratio": 0, "adaptive_number_ratio": 0,
"adaptive_size_ratio": 0, "adaptive_size_ratio": 0,
"max_n_time_masks": 20, "max_n_time_masks": 20,
"replace_with_zero": true "replace_with_zero": true,
"warp_mode": "PIL"
}, },
"prob": 1.0 "prob": 1.0
} }

@ -28,7 +28,8 @@
"adaptive_number_ratio": 0, "adaptive_number_ratio": 0,
"adaptive_size_ratio": 0, "adaptive_size_ratio": 0,
"max_n_time_masks": 20, "max_n_time_masks": 20,
"replace_with_zero": true "replace_with_zero": true,
"warp_mode": "PIL"
}, },
"prob": 1.0 "prob": 1.0
} }

Loading…
Cancel
Save