How myay/binarizedneuralnetworks-training works
BNN-Training trains and evaluates binary neural networks on FashionMNIST. The principal workflow in run_fashion.py loads the dataset, selects a CNN or fully connected model and CPU or CUDA binarization, then trains and tests the model across epochs. Model layers apply quantized weights and activations; the CUDA option delegates binarization to the extension. The README also documents CPU-only operation and both model choices. The CUDA kernel implementation and some runtime details were not sampled, so only documented or directly evidenced links are shown.
Main entry points: run_fashion.py Train and evaluate · QuantizedNN.py Quantized layers · BNNmodels.py CNN model · binarizePM1.cpp CUDA binding
Components 11
Training workflow
- Train and evaluate
run_fashion.py
FashionMNIST data
- FashionMNIST
- Data loaders
run_fashion.py
Network models
- CNN model
code/python/BNNmodels.py - Fully connected model
code/python/BNNmodels.py
Quantization
- Quantized layers
code/python/QuantizedNN.py - Quantization selector
run_fashion.py - CPU binarization
run_fashion.py - CUDA binding
code/cuda/binarizationPM1/binarizePM1.cpp
Other components
- Training user
- PyTorch runtime
Connections 13
- Training user → Train and evaluate: starts training
- Train and evaluate → FashionMNIST: downloads and loads
- Train and evaluate → Data loaders: builds loaders
- Data loaders → Train and evaluate: supplies batches
- Train and evaluate → CNN model: selects CNN
- Train and evaluate → Fully connected model: selects FC model
- Train and evaluate → Quantization selector: selects binarizer
- Train and evaluate → PyTorch runtime: uses training runtime
- CNN model → Quantized layers: uses quantized layers
- Fully connected model → Quantized layers: uses quantized layers
- Quantized layers → Quantization selector: quantizes weights and activations
- Quantization selector → CPU binarization: uses CPU option
- Quantization selector → CUDA binding: calls CUDA option