- 20 May, 2020 1 commit
-
-
moto authored
-
- 14 Apr, 2020 1 commit
-
-
moto authored
This PR aims the following things; 1. Introduce and adopt helper function `get_asset_path` that abstract the logic to construct path to test assets. 2. Remove `create_temp_assets_dir` anywhere except `test_io`. The benefits of doing so are, a. the test code becomes simpler (no manual construction of asset path with `os.path.join`) b. No unnecessary directory creation and file copies. For 2. and b. tests in `test_io.py` (or tests that use `torchaudio.save`) are the only tests that need to write file to the disc, where the use of temporary directory makes it cleaner, therefore, `create_temp_assets_dir` is not necessary elsewhere. (still, `test_io` does not need to copy the entire asset directory, but that's not the point here.) Also if any test is accidentally overwriting an asset data, not using a copy will make us aware of such behavior, so it is better to get rid of `create_temp_assets_dir`.
-
- 06 Apr, 2020 1 commit
-
-
moto authored
* grep -l 'torch.allclose' -r test | xargs sed -i 's/assert torch.allclose/torch.testing.assert_allclose/g' * grep -l 'torch.allclose' -r test | xargs sed -i 's/self.assertTrue(torch.allclose(\(.*\)))/torch.testing.assert_allclose(\1)/g' * Fix missing atol/rtol, wrong shape, argument order. Remove redundant shape assertions
-
- 03 Apr, 2020 4 commits
- 02 Apr, 2020 1 commit
-
-
moto authored
-
- 01 Apr, 2020 1 commit
-
-
moto authored
-
- 30 Mar, 2020 2 commits
-
-
Vincent QB authored
* testing with sox only when sox is available. * use wav instead of mp3 for testing functions. * typo. * guard against not sox. * backends definition. * grouping backend functions into a separate file. * remove duplicated code. * requires sox. * replace by wav, requires sox. * require with scope. * undo alignment. * requires sox for these two, because of mp3. * no longer need first mp3. * cleaning. * new wav version of file. * flake8. * remove unnecessary load. * flake8. * lint. * lint. * revert formatting of file. * merging into common_utils. * docstring. * rename to common_utils.
-
moto authored
-
- 24 Mar, 2020 1 commit
-
-
Tomás Osório authored
* Add Vol with gain_type amplitude * add gain in db and add tests * add gain_type "power" and tests * add functional DB_to_amplitude * simplify * remove functional * improve docstring * add to documentation
-
- 23 Mar, 2020 1 commit
-
-
Tomás Osório authored
-
- 10 Mar, 2020 2 commits
-
-
Tomás Osório authored
-
Tomás Osório authored
* add basics for Fade * add fade possibilities: at start, end or both * add different types of fade * add docstrings, add overriding possibility * remove unnecessary logic * correct typing * agnostic to batch size or n_channels * add batch test to Fade * add transform to options * add test_script_module * add coherency with test batch * remove extra step for waveform_length * update docstring * add test to compare fade with sox * change name of fade_shape * update test fade vs sox with new nomenclature for fade_shape * add Documentation Co-authored-by:Vincent QB <vincentqb@users.noreply.github.com>
-
- 28 Feb, 2020 1 commit
-
-
moto authored
* Inverse Mel Scale Implementation * Inverse Mel Scale Docs * Better working version. * GPU fix * These shouldn't go on git.. * Even better one, but does not support JITability. * Remove JITability test * Flake8 * n_stft is a must * minor clean up of initialization * Add librosa consistency test This PR follows up #366 and adds test for `InverseMelScale` (and `MelScale`) for librosa compatibility. For `MelScale` compatibility test; 1. Generate spectrogram 2. Feed the spectrogram to `torchaudio.transforms.MelScale` instance 3. Feed the spectrogram to `librosa.feature.melspectrogram` function. 4. Compare the result from 2 and 3 elementwise. Element-wise numerical comparison is possible because under the hood their implementations use the same algorith. For `InverseMelScale` compatibility test, it is more elaborated than that. 1. Generate the original spectrogram 2. Convert the original spectrogram to Mel scale using `torchaudio.transforms.MelScale` instance 3. Reconstruct spectrogram using torchaudio implementation 3.1. Feed the Mel spectrogram to `torchaudio.transforms.InverseMelScale` instance and get reconstructed spectrogram. 3.2. Compute the sum of element-wise P1 distance of the original spectrogram and that from 3.1. 4. Reconstruct spectrogram using librosa 4.1. Feed the Mel spectrogram to `librosa.feature.inverse.mel_to_stft` function and get reconstructed spectrogram. 4.2. Compute the sum of element-wise P1 distance of the original spectrogram and that from 4.1. (this is the reference.) 5. Check that resulting P1 distance are in a roughly same value range. Element-wise numerical comparison is not possible due to the difference algorithms used to compute the inverse. The reconstructed spectrograms can have some values vary in magnitude. Therefore the strategy here is to check that P1 distance (reconstruction loss) is not that different from the value obtained using `librosa`. For this purpose, threshold was empirically chosen ``` print('p1 dist (orig <-> ta):', torch.dist(spec_orig, spec_ta, p=1)) print('p1 dist (orig <-> lr):', torch.dist(spec_orig, spec_lr, p=1)) >>> p1 dist (orig <-> ta): tensor(1482.1917) >>> p1 dist (orig <-> lr): tensor(1420.7103) ``` This value can vary based on the length and the kind of the signal being processed, so it was handpicked. * Address review feedbacks * Support arbitrary batch dimensions. * Add batch test * Use view for batch * fix sgd * Use negative indices and update docstring * Update threshold Co-authored-by:Charles J.Y. Yoon <jaeyeun97@gmail.com>
-
- 24 Feb, 2020 1 commit
-
-
Vincent QB authored
-
- 14 Feb, 2020 1 commit
-
-
Vincent QB authored
-
- 22 Jan, 2020 1 commit
-
-
Vincent QB authored
-
- 13 Jan, 2020 2 commits
-
-
Vincent QB authored
* extend batch support closes #383 * function for batch test. * set seed. * adjust tolerance for griffinlim.
-
Vincent QB authored
* fix power of spectrogram. makes power a float. closes #389 * commenting out failing test. * change skip test logic for librosa. closes #373
-
- 26 Dec, 2019 2 commits
-
-
Oktai Tatanov authored
* test with jit. * test passed after adding annotation, and removing get_default_dtype * fix conversion error. * moving test to transform. * reverting to original test. * move type. * math.gcd added in python 3.5. Co-authored-by:Vincent QB <vincentqb@users.noreply.github.com>
-
Charles J.Y. Yoon authored
* Griffin-Lim Transformation Implementation * Griffin-Lim Docs * Remove f-string from backwards compatibility * iSTFT is now jit-able. * Comment changes * Functional Implementation & now jitable * flake8 * Doc & GPU Fix * Librosa comparison test * test directly griffinlim's output. tighter atol. * matching signature to docstring. Co-authored-by:Vincent QB <vincentqb@users.noreply.github.com>
-
- 18 Dec, 2019 1 commit
-
-
Vincent QB authored
Skip librosa consistency test. unittest need one-line skip condition.
-
- 21 Nov, 2019 1 commit
-
-
Vincent QB authored
* sync docs with functionals. * Adding transforms to documentations. Moving augmentations in transforms.
-
- 20 Nov, 2019 1 commit
-
-
Vincent QB authored
* nn.Module. * generalizing spectrogram test. * adding test to compile functionals. * add cuda/cpu compilation test. * adding transform test. * remove standalone jit file. * update mel scale. * remove script decorator. * apply to augmentations too.
-
- 18 Nov, 2019 2 commits
-
-
Vincent QB authored
* batching for transforms. * test for batching. * update readme.
-
Vincent QB authored
* STFT transform and function from #285 * merge options in existing functionality. * remove dimension 2 check. add test. * using ... * update spectrogram test.
-
- 19 Sep, 2019 1 commit
-
-
Vincent QB authored
* compute deltas. * multichannel, and random test. * documentation. * feedback. changing name of window to win_length. * passing padding mode.
-
- 20 Aug, 2019 1 commit
-
-
jamarshon authored
-
- 02 Aug, 2019 1 commit
-
-
Edward Z. Yang authored
- Apply __future__ imports uniformly (future division is the biggy, but absolute imports mattered too) - Hotfix use of tempfile.TemporaryDirectory using a BC library (DO NOT add this library as a dependency to torchaudio; it's only for testing) - Replace math.gcd with fractions.gcd - Fix a weird pytest collection bug involving parametrized tests - Turn on Python 2 and Python 3.7 in Travis. Signed-off-by:Edward Z. Yang <ezyang@fb.com>
-
- 30 Jul, 2019 1 commit
-
-
Edward Z. Yang authored
This makes it easier to test against an installed wheel, as the torchaudio folder is no longer preferentially picked up when you run a test module. I had to move all tests in subfolders into the top level test directory to make this work, since you can't access .. modules without mucking around with sys.path (which I don't want to do.) NB: this BREAKS the syntax where you can run a test by saying `python -m test.test`. Instead, do `python test/test.py` or use the pytest runner. Signed-off-by:Edward Z. Yang <ezyang@fb.com>
-
- 26 Jul, 2019 1 commit
-
-
jamarshon authored
-
- 24 Jul, 2019 3 commits
- 16 Jul, 2019 1 commit
-
-
jamarshon authored
-
- 10 Jul, 2019 1 commit
-
-
jamarshon authored
-
- 06 Jun, 2019 1 commit
-
-
jamarshon authored
-
- 24 May, 2019 1 commit
-
-
jamarshon authored
-