mirror of
https://github.com/ml-explore/mlx-examples.git
synced 2025-08-30 02:53:41 +08:00
readme + format
This commit is contained in:
parent
f59a36f94d
commit
f6835ebf4e
@ -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.
|
||||||
|
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user