Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/main/advanced_source/cpp_cuda_graphs/README.md
Views: 713
MNIST Example with the PyTorch C++ Frontend
This folder contains an example of training a computer vision model to recognize digits in images from the MNIST dataset, using the PyTorch C++ frontend.
The entire training code is contained in mnist.cpp
.
To build the code, run the following commands from your terminal:
where /path/to/libtorch
should be the path to the unzipped LibTorch distribution, which you can get from the PyTorch homepage.
Execute the compiled binary to train the model:
For running with CUDA Graphs add --use-train-graph
and/or --use-test-graph
for training and testing passes respectively.