https://github.com/elefthei/webtorch
A Deep Learning HTTP server based on nginx
https://github.com/elefthei/webtorch
Last synced: 4 months ago
JSON representation
A Deep Learning HTTP server based on nginx
- Host: GitHub
- URL: https://github.com/elefthei/webtorch
- Owner: elefthei
- License: gpl-3.0
- Created: 2017-09-05T02:42:14.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2018-09-10T18:04:40.000Z (almost 8 years ago)
- Last Synced: 2025-07-22T14:46:48.490Z (12 months ago)
- Language: Lua
- Homepage:
- Size: 83 KB
- Stars: 5
- Watchers: 1
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://travis-ci.org/elefthei/WebTorch) [](https://github.com/elefthei/WebTorch/issues)

WebTorch takes advantage of the versatile LuaJIT compiler to bring together Nginx and Torch, creating an equivalent system to Tensorflow serve, but based on a RESTful API instead of protobuf. Multiple data formats are supported (tensors, images etc.)
## Building WebTorch container
Building (docker/nvidia-docker):
```
docker build -t webtorch .
```
## Running WebTorch container
Running daemon(docker/nvidia-docker):
```
docker run -p 3000:3000 -d webtorch
```
Running in debug(docker/nvidia-docker):
```
docker run -p 3000:3000 -it webtorch
```
## Usage:
### GET /v1/train
Will train the XOR neural network with a single random (input1, input2) sample.
```
$ curl http://localhost:3000/v1/train
```
### POST /v1/train
*Body*: 2D serialized Torch tensor (see `benchmarks/script/train.lua` for example)
Will train the XOR neural network with a serialized 2D Torch tensor sample.
```
$ wrk -t12 -c400 -d30s -s benchmarks/scripts/train.lua http://localhost:3000/v1/train
```
### GET /v1/output
Will get the result of the trained XOR network on (0.5, 0.5)
```
$ curl http://localhost:3000/v1/output
```