Spaces:
Sleeping
Sleeping
Update README.md
Browse files
README.md
CHANGED
|
@@ -9,4 +9,80 @@ app_file: app.py
|
|
| 9 |
pinned: false
|
| 10 |
---
|
| 11 |
|
| 12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
pinned: false
|
| 10 |
---
|
| 11 |
|
| 12 |
+
# AST Training Dashboard - HuggingFace Space
|
| 13 |
+
|
| 14 |
+
Interactive dashboard for training models with Adaptive Sparse Training (AST).
|
| 15 |
+
|
| 16 |
+
## Features
|
| 17 |
+
|
| 18 |
+
- π **Live Training**: Watch your model train in real-time
|
| 19 |
+
- π **Energy Tracking**: See energy savings as you train
|
| 20 |
+
- π― **Model Card Generation**: Auto-generate HuggingFace model cards
|
| 21 |
+
- β‘ **60-70% Energy Savings**: Train faster with minimal accuracy loss
|
| 22 |
+
|
| 23 |
+
## Quick Start
|
| 24 |
+
|
| 25 |
+
### Deploy to HuggingFace Spaces
|
| 26 |
+
|
| 27 |
+
1. Create new Space at https://huggingface.co/spaces
|
| 28 |
+
2. Choose **Gradio** as SDK
|
| 29 |
+
3. Upload files from this directory:
|
| 30 |
+
- `app.py`
|
| 31 |
+
- `requirements.txt`
|
| 32 |
+
- `README.md`
|
| 33 |
+
4. Space will auto-deploy!
|
| 34 |
+
|
| 35 |
+
### Run Locally
|
| 36 |
+
|
| 37 |
+
```bash
|
| 38 |
+
cd hf_space
|
| 39 |
+
pip install -r requirements.txt
|
| 40 |
+
python app.py
|
| 41 |
+
```
|
| 42 |
+
|
| 43 |
+
Then open http://localhost:7860
|
| 44 |
+
|
| 45 |
+
## Usage
|
| 46 |
+
|
| 47 |
+
1. **Select Model**: Choose from ResNet18, EfficientNet, MobileNet
|
| 48 |
+
2. **Set Activation Rate**: Lower = more energy savings (0.35 recommended)
|
| 49 |
+
3. **Choose Epochs**: 30-50 epochs for good results
|
| 50 |
+
4. **Start Training**: Click "Start Training" and watch live metrics
|
| 51 |
+
5. **Get Model Card**: Copy auto-generated card for HuggingFace Hub
|
| 52 |
+
|
| 53 |
+
## Example Results
|
| 54 |
+
|
| 55 |
+
Training ResNet18 on CIFAR-10 with AST (activation_rate=0.35):
|
| 56 |
+
|
| 57 |
+
- **Accuracy**: 92.1% (vs 92.3% baseline)
|
| 58 |
+
- **Energy Savings**: 65%
|
| 59 |
+
- **Training Time**: 2.8h (vs 7.2h baseline)
|
| 60 |
+
|
| 61 |
+
## About AST
|
| 62 |
+
|
| 63 |
+
Adaptive Sparse Training (AST) automatically selects the most important training samples
|
| 64 |
+
per batch, reducing compute by 60-70% while maintaining accuracy.
|
| 65 |
+
|
| 66 |
+
**How it works:**
|
| 67 |
+
1. Computes significance score (loss + entropy) for each sample
|
| 68 |
+
2. PI controller dynamically adjusts selection threshold
|
| 69 |
+
3. Only backpropagates through "hard" samples
|
| 70 |
+
4. Result: Same accuracy, way less compute
|
| 71 |
+
|
| 72 |
+
## Links
|
| 73 |
+
|
| 74 |
+
- π¦ [PyPI Package](https://pypi.org/project/adaptive-sparse-training/)
|
| 75 |
+
- π [GitHub](https://github.com/oluwafemidiakhoa/adaptive-sparse-training)
|
| 76 |
+
- π [Full Documentation](https://github.com/oluwafemidiakhoa/adaptive-sparse-training#readme)
|
| 77 |
+
|
| 78 |
+
## Citation
|
| 79 |
+
|
| 80 |
+
```bibtex
|
| 81 |
+
@software{adaptive_sparse_training,
|
| 82 |
+
title={Adaptive Sparse Training},
|
| 83 |
+
author={Idiakhoa, Oluwafemi},
|
| 84 |
+
year={2024},
|
| 85 |
+
url={https://github.com/oluwafemidiakhoa/adaptive-sparse-training}
|
| 86 |
+
}
|
| 87 |
+
```
|
| 88 |
+
|