Repository: lhotse-speech/lhotse

Issue:
Potential Typo in SpecAug documentation
In the documentation
```
        SpecAugment's constructor.
        :param time_warp_factor: parameter for the time warping; larger values mean more warping.
            Set to ``None``, or less than ``1``, to disable.
        :param num_feature_masks: how many feature masks should be applied. Set to ``0`` to disable.
        :param features_mask_size: the width of the feature mask (expressed in the number of masked feature bins).
            This is the ``T`` parameter from the SpecAugment paper.
        :param num_frame_masks: how many frame (temporal) masks should be applied. Set to ``0`` to disable.
        :param frames_mask_size: the width of the frame (temporal) masks (expressed in the number of masked frames).
            This is the ``F`` parameter from the SpecAugment paper.
        :param max_frames_mask_fraction: limits the size of the frame (temporal) mask to this value times the length
            of the utterance (or supervision segment).
            This is the parameter denoted by ``p`` in the SpecAugment paper.
        :param p: the probability of applying this transform.
            It is different from ``p`` in the SpecAugment paper!
```
Shouldn't the `T` and `F` parameter be flipped?  In the [paper](https://arxiv.org/pdf/1904.08779.pdf) T refers to the time mask parameter and F refers to the frequency mask parameter. Want to confirm my understanding in case I'm misusing SpecAugment at the moment. Thanks!


Discussion:

Resolving patch:
diff --git a/lhotse/dataset/signal_transforms.py b/lhotse/dataset/signal_transforms.py
--- a/lhotse/dataset/signal_transforms.py
+++ b/lhotse/dataset/signal_transforms.py
@@ -134,10 +134,10 @@ def __init__(
             Set to ``None``, or less than ``1``, to disable.
         :param num_feature_masks: how many feature masks should be applied. Set to ``0`` to disable.
         :param features_mask_size: the width of the feature mask (expressed in the number of masked feature bins).
-            This is the ``T`` parameter from the SpecAugment paper.
+            This is the ``F`` parameter from the SpecAugment paper.
         :param num_frame_masks: how many frame (temporal) masks should be applied. Set to ``0`` to disable.
         :param frames_mask_size: the width of the frame (temporal) masks (expressed in the number of masked frames).
-            This is the ``F`` parameter from the SpecAugment paper.
+            This is the ``T`` parameter from the SpecAugment paper.
         :param max_frames_mask_fraction: limits the size of the frame (temporal) mask to this value times the length
             of the utterance (or supervision segment).
             This is the parameter denoted by ``p`` in the SpecAugment paper.
@@ -179,7 +179,7 @@ def forward(
             The second dimension encoder three kinds of information:
             the sequence index of the corresponding feature matrix in `features`,
             the start frame index, and the number of frames for each segment.
-        :return: a tensor of shape ``(T, F)``, or a batch of them with shape ``(B, T, F)``
+        :return: an augmented tensor of shape ``(B, T, F)``.
         """
         assert len(features.shape) == 3, (
             "SpecAugment only supports batches of " "single-channel feature matrices."


Test patch:
diff --git a/test/dataset/test_signal_transforms.py b/test/dataset/test_signal_transforms.py
--- a/test/dataset/test_signal_transforms.py
+++ b/test/dataset/test_signal_transforms.py
@@ -45,7 +45,7 @@ def test_global_mvn_from_cuts():
     assert isinstance(stats2, GlobalMVN)
 
 
-def test_specaugment_single():
+def test_specaugment_2d_input_raises_error():
     cuts = CutSet.from_json("test/fixtures/ljspeech/cuts.json")
     feats = torch.from_numpy(cuts[0].load_features())
     tfnm = SpecAugment(p=1.0, time_warp_factor=10)
@@ -56,7 +56,7 @@ def test_specaugment_single():
 
 @pytest.mark.parametrize("num_feature_masks", [0, 1, 2])
 @pytest.mark.parametrize("num_frame_masks", [0, 1, 2])
-def test_specaugment_batch(num_feature_masks, num_frame_masks):
+def test_specaugment_3d_input_works(num_feature_masks, num_frame_masks):
     cuts = CutSet.from_json("test/fixtures/ljspeech/cuts.json")
     feats, feat_lens = collate_features(cuts)
     tfnm = SpecAugment(