https://github.com/soumik12345/libtorch-examples
Basic Deep Learning examples using LibTorch C++ frontend
https://github.com/soumik12345/libtorch-examples
cpp deep-learning libtorch torch
Last synced: 7 months ago
JSON representation
Basic Deep Learning examples using LibTorch C++ frontend
- Host: GitHub
- URL: https://github.com/soumik12345/libtorch-examples
- Owner: soumik12345
- Created: 2021-06-24T19:43:17.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2021-07-10T11:29:11.000Z (almost 5 years ago)
- Last Synced: 2025-05-12T13:13:01.155Z (about 1 year ago)
- Topics: cpp, deep-learning, libtorch, torch
- Language: C++
- Homepage:
- Size: 67.4 KB
- Stars: 7
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# LibTorch Examples [WIP]
MacOSX (Clang 12.0)
Linux (Cuda 11)
Linux (gcc 9.3)
## Instructions
### Build and Compile
1. `git clone https://github.com/soumik12345/libtorch-examples --recursive`
2. `cmake -DINSTALL_TORCH=true -DCUDA=true -DINSTALL_PYTHON_DEPENDENCIES=true -DDOWNLOAD_MNIST=true ../`
- `-DINSTALL_TORCH` -> Automatically download and install libtorch during build.
- `-DCUDA` -> Download GPU Version of LibTorch.
- `-DINSTALL_PYTHON_DEPENDENCIES` -> Install Python Dependencies during build.
- `-DDOWNLOAD_MNIST` -> Download the MNIST Dataset during build.
3. `make`
### Run Executables
Implementation
Run Instructions
MNIST
CIFAR10
Linear Regression
cd build
./libtorch-examples/linear-regression/linear-regression
❌
❌
Logistic Regression
cd ./build/libtorch-examples/logistic-regression
./logistic-regression
✅
⏲
Multi-Layered Perceptron
cd ./build/libtorch-examples/multi-layered-perceptron
./multi-layered-perceptron
✅
⏲
Convolutional Neural Network
cd ./build/libtorch-examples/convnet
./convnet
✅
⏲