https://github.com/ashly1991/tensorboard-mnist-tf2
Visual debugging of an MNIST MLP with low-level TensorFlow 2 using tf.data + TensorBoard (scalars, histograms, images)
https://github.com/ashly1991/tensorboard-mnist-tf2
deep-learning gradient-tape jupyter-notebook machine-learning mnist reproducibility tensorboard tensorflow tf-data visualization
Last synced: 17 days ago
JSON representation
Visual debugging of an MNIST MLP with low-level TensorFlow 2 using tf.data + TensorBoard (scalars, histograms, images)
- Host: GitHub
- URL: https://github.com/ashly1991/tensorboard-mnist-tf2
- Owner: Ashly1991
- License: mit
- Created: 2025-09-23T12:24:18.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2025-09-23T13:13:28.000Z (8 months ago)
- Last Synced: 2025-09-23T14:42:42.583Z (8 months ago)
- Topics: deep-learning, gradient-tape, jupyter-notebook, machine-learning, mnist, reproducibility, tensorboard, tensorflow, tf-data, visualization
- Language: Jupyter Notebook
- Homepage:
- Size: 15.6 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Let the Tensors Board — Visual Debugging for MNIST (TensorFlow 2)
This project shows how to use **TensorBoard** to visualize and debug training of a low‑level TensorFlow 2 MLP on **MNIST**, while providing data via **`tf.data`**.
## Purpose
- Build a reproducible MNIST input pipeline with `tf.data` (shuffle → batch → repeat).
- Train a minimal MLP using `tf.GradientTape` and manual updates.
- Log to TensorBoard:
- **Scalars** (loss, accuracy, gradient norms),
- **Histograms** (weights/activations),
- **Images** (sample inputs & misclassifications),
to diagnose common problems such as vanishing/exploding gradients, bad initialization, or incorrect activations.
## Run locally
```bash
python -m venv .venv && source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -r requirements.txt
jupyter lab let-the-tensors-board.ipynb
```
During/after training, start TensorBoard in another terminal:
```bash
./tb_start.sh
# or:
tensorboard --logdir logs --port 6006
```
Then open http://localhost:6006/
## Notes
- No raw datasets are committed. The notebook uses `tf.keras.datasets` to download MNIST at runtime.
- Logs are written to `logs/`; figures can be saved to `figures/`.
- `fails/` is provided as a placeholder directory where you can place external “failure case” scripts (not included here).