Environment Setup#
This short notebook collects the practical setup notes for the implementation chapters. The goal is not to prescribe one exact environment, but to make sure that students can run the compact PyTorch notebooks without losing time to avoidable configuration issues during the course.
At minimum, students should have a working Python installation, Jupyter support, PyTorch, and torchvision. A CPU-only environment is sufficient for reading and understanding the notebooks, especially the toy and small-dataset examples. A GPU is helpful but not mandatory for the pedagogical versions included in this book.
Recommended Packages#
The implementation notebooks assume access to:
pythonjupytertorchtorchvisionmatplotlib
The book itself is built with Jupyter Book and the dependencies listed in requirements.txt, but students who only want to run the model notebooks do not necessarily need the full documentation toolchain.
If the goal is to build the book rather than only run the notebooks, install the project requirements inside the active environment with python -m pip install -r requirements.txt. In particular, the book configuration enables the sphinx_proof extension for theorem and proof blocks, so a partial Jupyter Book installation that omits sphinx-proof will fail during jupyter-book build ..
Practical Advice#
Before a live session, it is a good idea to test one small notebook end to end rather than only checking that imports succeed. For example, confirm that tensors can be allocated on the intended device, that FashionMNIST downloads correctly, and that plots render in the notebook interface. These small checks are often more informative than a package list alone.
For the documentation toolchain, a quick sanity check is to run python -c "import sphinx_proof" in the same environment where jupyter-book lives. If that import fails, the environment does not yet contain the full book-build dependencies even if jupyter-book itself is installed.
It is also worth remembering that the notebooks in this course are teaching notebooks rather than benchmark scripts. If training is slow on local hardware, students can reduce the number of epochs or steps and still learn the main concepts. The important thing is that the code path remains understandable and runnable.