Commit a54d0812 authored by Anthony Larcher's avatar Anthony Larcher
Browse files

seq2seq

parent ff9f4e53
......@@ -61,4 +61,4 @@ __maintainer__ = "Sylvain Meignier"
__email__ = "sylvain.meignierr@univ-lemans.fr"
__status__ = "Production"
__docformat__ = 'reStructuredText'
__version__ = "0.1.4.5"
__version__ = "0.1.4.6"
......@@ -128,18 +128,23 @@ class BLSTM(nn.Module):
x = torch.sigmoid(self.output(x))
return x
class SeqToSeq(nn.Module):
def __init__(self):
self.model = BLSTM(input_size=1,
self.preprocessor = PreNet(sample_rate=16000,
windows_duration=0.2,
frame_shift=0.01
self.sequence_model = BLSTM(input_size=1,
lstm_1=64,
lstm_2=40,
linear_1=40,
linear_2=10)
def forward(self, input):
x = self.preprocessor(input)
output = self.sequence_model(x)
return output
class VAD_RNN:
"""
......
......@@ -78,7 +78,7 @@ def load_wav_segment(wav_file_name, idx, duration, seg_shift, framerate=16000):
win_shift=int(framerate * seg_shift),
context=(0, 0),
pad='zeros')
return tmp[idx]
return tmp[idx], len(signal)
def mdtm_to_label(mdtm_filename,
......
......@@ -27,7 +27,7 @@ setup(
version=get_s4d_version(),
author='Sylvain MEIGNIER',
author_email='s4d@univ-lemans.fr',
packages=['s4d', 's4d.alien', 's4d.clustering', 's4d.gui'],
packages=['s4d', 's4d.alien', 's4d.clustering', 's4d.gui', 's4d.nnet'],
url='https://projets-lium.univ-lemans.fr/s4d/',
download_url='http://pypi.python.org/pypi/s4d/',
license='LGPL',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment