From 3656cb85627614876d4196be6f6dc212c14456da Mon Sep 17 00:00:00 2001 From: Janis Lesinskis Date: Wed, 5 Sep 2018 15:39:37 +1000 Subject: [PATCH 1/3] Added keras to install dependencies --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index 10c2859..3f26cda 100644 --- a/setup.py +++ b/setup.py @@ -25,6 +25,7 @@ 'python-speech-features==0.6', 'scipy==1.0.0', 'tensorflow==1.4.1', + 'keras==2.2.2', 'scikit-learn==0.19.1', 'pympi-ling==1.69', 'pydub==0.20.0', From 8168b95fa80105036f521d8e3087ea6cf56c7f9a Mon Sep 17 00:00:00 2001 From: Janis Lesinskis Date: Wed, 5 Sep 2018 23:37:32 +1000 Subject: [PATCH 2/3] Stub model with Keras --- persephone/keras_model.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 persephone/keras_model.py diff --git a/persephone/keras_model.py b/persephone/keras_model.py new file mode 100644 index 0000000..223fe35 --- /dev/null +++ b/persephone/keras_model.py @@ -0,0 +1,21 @@ +import keras + +class RNN_CTC_model: + """Defines a RNN CTC model with Keras""" + + def __init__(self, exp_dir: str, corpus_reader, num_layers: int = 3, + hidden_size: int=250, beam_width: int = 100, + decoding_merge_repeated: bool = True) -> None: + """Initialize a new model + + Arguments: + exp_dir: Path that the experiment directory is located at + corpus_reader: `CorpusReader` object that provides access to the corpus + this model is being trained on. + num_layers: number of layers in the network + hidden_size: the size, in nodes, of the hidden layers + beam_width: size of the beam width (used for the decoding) + decoding_merge_repeated: A flag to toggle behavior of repeating characters + if true "a b b b b c" becomes "a b c" + """ + raise NotImplementedError \ No newline at end of file From 89216b39ab887de2faabb999dd9648163340eec9 Mon Sep 17 00:00:00 2001 From: Janis Date: Sun, 9 Sep 2018 17:57:10 +1000 Subject: [PATCH 3/3] Clean up docstring --- persephone/keras_model.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/persephone/keras_model.py b/persephone/keras_model.py index 223fe35..5c9402c 100644 --- a/persephone/keras_model.py +++ b/persephone/keras_model.py @@ -1,7 +1,9 @@ import keras class RNN_CTC_model: - """Defines a RNN CTC model with Keras""" + """ An acoustic model with a LSTM/CTC architecture. + + Uses Keras to define the model""" def __init__(self, exp_dir: str, corpus_reader, num_layers: int = 3, hidden_size: int=250, beam_width: int = 100,