-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Take on an explicit dependency on pytorch
- Loading branch information
1 parent
e7171cc
commit b57cf9a
Showing
13 changed files
with
404 additions
and
571 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,7 @@ requests | |
tornado==4.5.3 | ||
pysoundfile | ||
matplotlib | ||
intervaltree | ||
intervaltree | ||
numpy==1.12.1 | ||
scipy==0.19 | ||
torch==0.3.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,14 @@ | ||
import unittest2 | ||
|
||
try: | ||
from dct_transform import DctTransform | ||
import torch | ||
from torch.autograd import Variable | ||
except ImportError: | ||
DctTransform = None | ||
from dct_transform import DctTransform | ||
import torch | ||
from torch.autograd import Variable | ||
from zounds.spectral import HanningWindowingFunc | ||
|
||
|
||
class DctTransformTests(unittest2.TestCase): | ||
def setUp(self): | ||
if DctTransform is None: | ||
self.skipTest('PyTorch is not available') | ||
|
||
def test_can_do_short_time_dct_transform(self): | ||
t = torch.FloatTensor(3, 1, 512) | ||
v = Variable(t) | ||
dct_trasform = DctTransform() | ||
stdct = dct_trasform.short_time_dct(v, 128, 64) | ||
stdct = dct_trasform.short_time_dct(v, 128, 64, HanningWindowingFunc()) | ||
self.assertEqual((3, 128, 7), tuple(stdct.shape)) |
Oops, something went wrong.