Neural networks in Golang?

Is there a library with which I can use neural networks (and ML algorithms) in Golang ?

Is anyone using Go for ML ? Any advice on how can I train a neural network on ~100Gb of data ?

1 Like

Hi @maykie ,

Thank you for the links. Can you tell me which one of these libraries is the industry standard for Golang and neural network ? Which one of these are being used by large companies in their machine learning projects ?

None

Golang is used mainly for networking and cloud and not for AI. I doubt if any big company is using Go as main codebase for neural networks.

Python is “industry standard” for AI.

I wonder why that is. Golang has great support for concurrent processing, it should be able to do the same python does, with an advantage in parallelization.

Might be related to the fact, that Python and NumPy have been used in DataScience already before Go has been seen on the TIOBE index the first time…

And also to the fact that python can do some operator overloading and you do not need to do method call gymnastics to add 2 fixed point or bigint numbers.

Later added libraries like tensorflow then delegate some work to the GPU intelligently.

Yes, you can use TF with Go as well, but not operator overloading. So the AI and DS folks can quickly prototype something using python that usually still remains readable, while with Go it gets far too verbose quickly.

1 Like

hi @NobbZ

Please give more details about " delegate some work to the GPU intelligently". What does it mean exactly ?

Can you write a program non-concurrently (designed for a single thread), and then it gets compiled, and that assembler/binary code gets send to the GPU and somehow the GPU parallelizes it ?

Why is it that when using a GPU, the code written in Go does not have an advantage over the code written in python (with regards to concurrency) ?

AI and DS mostly are geared around highly parallelizable floating point calculations.

Tensorflow can delegate those to the GPU if the GPU is capable, and will transparently fall back to the CPU with or without SIMD and other optimisations.

And as said, go can do so as well using tensorflow. That is not the difference.

The difference is that the python bindings are much older than the go bindings. And python allows for nicer syntax when writing those calculations.

In python you can just use the plus operator for adding 2 tensors, which you can’t in go.

For simple calculations just involving 2 or 3 variables that’s not a concern. Though once it gets more than that, using overloaded operators feels more natural to them.

And generally python is much more suitable for rapid prototyping as it doesn’t fail compilation on every unused variable.

2 Likes

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.