3 ms·
I've been learning about neural networks lately and implemented mines in golang. The biggest problem I had was that python is not chosen randomly: neural networ
by oelmekki 10y ago
I've been learning about neural networks lately and implemented mines in golang. The biggest problem I had was that python is not chosen randomly: neural networks scientists use it because of numpy.
Most importantly, numpy makes it really easy to deal with matrices (~ array of arrays). You just make operations on them as if they were classic numbers (so, you can do `a + b`, where both a and b are matrices).
While translating it into other languages not having numpy is indeed possible, expect a bit of intellectual gymnastic.
I don't know which language you targeted, but for those who wish to use golang, I made this matrix library: https://github.com/oelmekki/matrix https://github.com/oelmekki/matrix
EDIT: oh, btw. I'm initially a ruby dev. I've learnt python just enough to be able to understand NNs code, that was easy (took me an afternoon). I won't pretend this makes me a python developer, but learning just enough to translate code in an other langage is straightforward.
- iamcreasy 10y agoI plan to use Java since that's what I am mostly familiar with. I googled a bit and I think there are couple[1] of Java libraries to handle n dimensional array. Lets hope it will work out. [1] http://nd4j.org/ http://nd4j.org/
- oelmekki 10y agoIt seems like nd4j has everything you need. Just remember, when seeing calls to the `np.dot()` function in python's numpy that it is the "dot product" operation on matrix, which is also known as standard mathematical matrix multiplication, which in turn nd4j is calling `mmul` ("matrix multiplication", in "Linear Algebra Operations" section). When numpy is using the * operator between two matrices, it basically just does a cell by cell multiplication ie: result_matrix[x][y] = matrix1[x][y] * matrix2[x][y]