I'm starting to implement a barebones version of pytorch in Go. The primary motivation is:<p>1. I want to better learn Pytorch and how it works so what better way than to just re-implement some of its core features.<p>2. I write mainly in Go and haven't come across a lot of ML support in Go<p>3. I'd rather have a Go ML service instead of spinning up additional infrastructure to just support a python ML service in my Go projects<p>4. Go's static typing, native concurrency (avoid GIL problem in python), efficient memory management, single binary deployment and more make it a better interface compared to python IMO<p>Knowing the Pytorch is mainly implemented in c++ and c under the covers, I'm not expecting any performance gains by porting it to Go. But still, will be interesting to see how it compares.<p>Check it out below and let me know your thoughts!<p>https://github.com/evisdrenova/gotorch
Wow, this is an amazing idea! I wish I had time to contribute but I'm maxed out. I love Go and I always tell people (everybody who will listen) that one should always use a statically typed, strongly typed language for production code.
Have you seen the gorgonia repos?<p><a href="https://github.com/gorgonia/agogo">https://github.com/gorgonia/agogo</a><p>They basically went a similar route and had to implement all kinds of data types and GPU code to be able to train their alphago model.<p>In go, the biggest pitfall I'd imagine is memory management because you cannot influence the GC. So I'd build up everything with as many references from the start, and integrate it with the pperf tools to be able to benchmark it