Repository navigation
Checkpoint and Reproducibility
flowchart LR
subgraph TrainingSession["Training session"]
Model["TransformerClassifier trainable weights"]
Meta["Configuration + epoch + best validation score"]
Frozen["Tokenizer + frozen embedding matrix"]
end
Model --> File["best_transformer_static_emb.pt"]
Meta --> File
Frozen -.->|"NOT packaged in checkpoint"| File
File --> Restore["Reconstruct model and load state_dict"]
External["Reacquire matching tokenizer + embedding weights"] --> Restore
Restore --> Eval["Classification / test evaluation"]
Default output: transformer_checkpoints/best_transformer_static_emb.pt, configurable using --output.
The saved dictionary includes model_state, best_validation_accuracy, epoch, d_model, n_heads, n_layers, max_len, num_classes, dropout, use_sdpa, tokenizer_id.
- The real-data MiniLM tokenizer.
- The frozen MiniLM token embedding matrix.
- Raw Yelp reviews or datasets.
- AdamW optimizer state or a training-resume scheduler state.
A downstream inference/evaluation program must reconstruct the same architecture and supply tokenizer + embedding weights consistent with the checkpoint metadata. The script itself reloads the best checkpoint during the same process, when these dependencies are still available in memory.
Do not commit generated .pt checkpoints by default; they can be large and could contain information from private training data in other projects. Review dataset and model licenses separately before redistribution. The included .gitignore excludes checkpoint files and local environments.
Home · HLD · LLD · CLI · Validation This project is licensed under the Apache License, Version 2.0.© 2026 Sudhanshu Shukla · Licensed under the Apache License, Version 2.0.