Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Make Keras model #196

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions persephone/keras_model.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import keras

class RNN_CTC_model:
""" 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,
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
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
'nltk==3.2.5',
'numpy==1.15.0',
'python-speech-features==0.6',
'keras==2.2.2',
'scipy==1.1.0',
'tensorflow==1.10.0',
'scikit-learn==0.19.1',
Expand Down