Unofficial TensorFlow implementation of the Keyword Spotting Transformer model
Keyword Spotting Transformer
This is the unofficial TensorFlow implementation of the Keyword Spotting Transformer model. This model is used to train on the 35 words speech command dataset
Paper : Keyword Transformer: A Self-Attention Model for Keyword Spotting
Model architecture
Download the dataset
To download the dataset use the following command
wget https://storage.googleapis.com/download.tensorflow.org/data/speech_commands_v0.02.tar.gz
mkdir data
mv ./speech_commands_v0.02.tar.gz ./data
cd ./data
tar -xf ./speech_commands_v0.02.tar.gz
cd ../
Setup virtual environment
virtualenv -p python3 venv
source ./venv/bin/activate
Install dependencies
pip install -r requirements.txt
Training the model
To train the model run this command
python3 train.py --data_dir ${Path to data directory}
--logdir ${Path to log directory}
--num_layers ${Number of sequential encoder layers}
--d_model