Skip to content

Commit

Permalink
Added training instructions to README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
MiscellaneousStuff committed May 5, 2022
1 parent e56304c commit 93b3f84
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,16 @@ git submodule init
git submodule update
```

## Train

To train an sEMG Silent Speech speech recognition model, use

```bash
python3 train.py \
--dataset_path "path_to_dataset.csv" \
--semg_train
```

## Evaluate

To evaluate the best trained model released with the report, run the
Expand All @@ -62,6 +72,7 @@ following code:
python3 evaluate.py \
--checkpoint_path "path_to_pretrained_model/ds2_DATASET_SILENT_SPEECH_EPOCHS_10_TEST_LOSS_1.8498832106590273_WER_0.6825681123095443" \
--dataset_path "path_to_dataset.csv" \
--print_top 10 \
--semg_eval
```

Expand Down
4 changes: 2 additions & 2 deletions evaluate.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@
FLAGS = flags.FLAGS
flags.DEFINE_string("checkpoint_path", None, "Path to the pre-trained DeepSpeech2 model")
flags.DEFINE_boolean("semg_eval", False, \
"(Optional) Evaluate an ASR model on predicted mel spectrograms from the transducer."
"(Optional) Evaluate an ASR model on predicted mel spectrograms from the transducer.\n"
"Otherwise evaluate the ground truth audio files.")
flags.DEFINE_integer("random_seed", 7, \
"(Optional) Set a different random seed if you train a different model."
"(Optional) Set a different random seed if you train a different model.\n"
"The models trained along with this release used a random seed of 7 by default.")
flags.DEFINE_string("dataset_path", None, \
"Path to *.csv file which defines the dataset to evaluate")
Expand Down
8 changes: 4 additions & 4 deletions train.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,16 @@
flags.DEFINE_integer("n_epochs", 100,\
"Recommended epochs is 200 for closed vocab and 100 for the others")
flags.DEFINE_integer("random_seed", 7, \
"(Optional) Set a different random seed if you train a different model."
"(Optional) Set a different random seed if you train a different model.\n"
"The models trained along with this release used a random seed of 7 by default.")
flags.DEFINE_boolean("semg_train", False, \
"(Optional) Train an ASR model on predicted mel spectrograms from the transducer."
"(Optional) Train an ASR model on predicted mel spectrograms from the transducer.\n"
"Otherwise train on the ground truth audio files.")
flags.DEFINE_boolean("silent_only", False, \
"(Optional) Transduction dataset only."
"(Optional) Transduction dataset only.\n"
"Train only on the mel spectrograms predicted from EMG signals during silent speech")
flags.DEFINE_boolean("voiced_only", False, \
"(Optional) Transduction dataset only."
"(Optional) Transduction dataset only.\n"
"Train only on the mel spectrograms predicted from EMG signals during vocalised speech")
flags.DEFINE_boolean("amp", False, \
"(Optional) Train using Automatic Mixed Precision (AMP)")
Expand Down

0 comments on commit 93b3f84

Please sign in to comment.