readme + format

This commit is contained in:
Awni Hannun 2023-12-19 13:57:55 -08:00
parent f59a36f94d
commit f6835ebf4e
2 changed files with 5 additions and 3 deletions

View File

@ -1,8 +1,8 @@
# Training a Vision Transformer on SpeechCommands # Train a Keyword Spotting Transformer on Speech Commands
An example of training a Keyword Spotting Transformer[^1] on the Speech An example of training a Keyword Spotting Transformer[^1] on the Speech
Commands dataset[^2] with MLX. All supervised only configurations from the Commands dataset[^2] with MLX. All supervised only configurations from the
paper are available.The example also illustrates how to use [MLX paper are available. The example also illustrates how to use [MLX
Data](https://github.com/ml-explore/mlx-data) to load and process an audio Data](https://github.com/ml-explore/mlx-data) to load and process an audio
dataset. dataset.

View File

@ -146,7 +146,9 @@ def main(args):
) )
val_acc, val_throughput = test_epoch(model, val_data) val_acc, val_throughput = test_epoch(model, val_data)
print(f"Epoch: {epoch} | Val acc {val_acc.item():.3f} | Throughput: {val_throughput.item():.2f} samples/sec") print(
f"Epoch: {epoch} | Val acc {val_acc.item():.3f} | Throughput: {val_throughput.item():.2f} samples/sec"
)
if val_acc >= best_acc: if val_acc >= best_acc:
best_acc = val_acc best_acc = val_acc