From 93b3f84c4e04f8f887a10eefd00f32c1493a66d1 Mon Sep 17 00:00:00 2001 From: Joe Makepeace Date: Thu, 5 May 2022 04:54:03 +0100 Subject: [PATCH] Added training instructions to README.md --- README.md | 11 +++++++++++ evaluate.py | 4 ++-- train.py | 8 ++++---- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 225cab5..481bedf 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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 ``` diff --git a/evaluate.py b/evaluate.py index ff5f9bb..cb9e16b 100644 --- a/evaluate.py +++ b/evaluate.py @@ -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") diff --git a/train.py b/train.py index 8eecbfd..0804d93 100644 --- a/train.py +++ b/train.py @@ -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)")