CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!
CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!
Path: blob/main/advanced_source/cpp_cuda_graphs/README.md
Views: 494
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.