GoTorch
GoTorch reimplements PyTorch high-level APIs, including modules and functionals, in idiomatic Go. Thus enables deep learning programming in Go and Go+. This project is in its very early stage.
Easy Switch
Writing deep learning systems in Go is as efficiently as in Python. The DCGAN training programs in GoTorch and PyTorch call similar APIs, have similar program structure, and have a similar number of lines. Go+ has a syntax similar to Python. The Go+ compiler translates Go+ programs into Go source programs. It is a joy to write Go+ programs that calls Go packages like GoTorch.
We have a plan of a translator that migrates existing PyTorch models in Python into GoTorch.
Benefits
-
Higher runtime efficiency. Go programs run as efficiently as C++.
-
Training and prediction in the same language. No longer training in Python and online prediction in C++. All in Go/Go+. No TensorFlow graphs or PyTorch tracing.
-
Same data processing code for training and prediction. No need to Wrap OpenCV functions into TensorFlow operators in C++ for prediction and Python for training.
-
Supports many machine learning paradigms., including adversarial, reinforcement, and imitation learning -- those we cannot split into training and prediction.
-
Same program for edge and cloud. GoTorch programs compile and run on phones and self-driving cars as they do on servers and desktops.
The Tech Stack
GoTorch works with the following open-source communities to form Go+Torch.
- the Go+ community,
- the PyTorch community, and
- the TensorFlow XLA ecosystem.
The following figure reveals the stack of technologies.
Go+ applications # users write DL applications in Go+,
β # whose syntax is as concise as Python
[Go+ compiler]
β
Go source code -β GoTorch -β libtorch -β pytorch/xla -β XLA ops
β
[Go compiler]
β
executable binary # x86_64, ARM, CUDA, TPU
# Linux, macOS, Android, iOS