An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

README

          

# LibTorch Examples [WIP]


MacOSX (Clang 12.0)
Linux (Cuda 11)
Linux (gcc 9.3)


build-failing
build-failing
build-failing

## 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


  1. cd build

  2. ./libtorch-examples/linear-regression/linear-regression







Logistic Regression


  1. cd ./build/libtorch-examples/logistic-regression

  2. ./logistic-regression







Multi-Layered Perceptron


  1. cd ./build/libtorch-examples/multi-layered-perceptron

  2. ./multi-layered-perceptron







Convolutional Neural Network


  1. cd ./build/libtorch-examples/convnet

  2. ./convnet