harpertoken commited on
Commit
f5c0b94
·
verified ·
1 Parent(s): 9827775

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +6 -0
README.md CHANGED
@@ -48,6 +48,12 @@ print(model.predict_label(waveform))
48
 
49
  `predict_label` takes 16,000 float samples at 16 kHz and returns the command word. Clips shorter than a second are zero-padded and longer ones truncated, matching training exactly. Needs `torch`, `torchaudio` for the mel transform, and `transformers`.
50
 
 
 
 
 
 
 
51
  ## Training
52
 
53
  Canonical Speech Commands v0.02 via torchaudio, restricted to the ten command words (34,472 train clips after the test split is removed, 4,074 test). Torchaudio's own loader needed torchcodec, whose native library would not load on the training machine, so waveforms were read with scipy and the mel transform uses torchaudio's pure-torch `MelSpectrogram`. An earlier hand-rolled mel filterbank trained to chance (loss stuck at ln 10), which is why the dependency is there.
 
48
 
49
  `predict_label` takes 16,000 float samples at 16 kHz and returns the command word. Clips shorter than a second are zero-padded and longer ones truncated, matching training exactly. Needs `torch`, `torchaudio` for the mel transform, and `transformers`.
50
 
51
+ ## Predictions
52
+
53
+ ![First test clips of three words, with model predictions on their log-mel inputs](tone_grid.png)
54
+
55
+ The first test clip of three words in `testing_list.txt` order, shown as the 64-bin log-mel spectrograms the model actually classifies, with the predicted word, the true word, and the file. All three are correct, which is what the selection rule produced rather than a curated set; overall test accuracy is 0.9116, so roughly one in twelve predictions elsewhere is wrong.
56
+
57
  ## Training
58
 
59
  Canonical Speech Commands v0.02 via torchaudio, restricted to the ten command words (34,472 train clips after the test split is removed, 4,074 test). Torchaudio's own loader needed torchcodec, whose native library would not load on the training machine, so waveforms were read with scipy and the mel transform uses torchaudio's pure-torch `MelSpectrogram`. An earlier hand-rolled mel filterbank trained to chance (loss stuck at ln 10), which is why the dependency is there.