Numpy

I have a neural network that I wrote I Python, I'm using numpy for the matrix multiplications, it's slow when I'm training with images. Would I get faster results if I implement the whole thing in c ?

Attached: download (1).jpg (357x141, 9K)

Other urls found in this thread:

en.wikipedia.org/wiki/Cython
cython.org/
github.com/victorqribeiro/MLP/blob/master/python/MLP.py
github.com/victorqribeiro/MLP/blob/master/python/MLP.py?ts=2
twitter.com/NSFWRedditGif

obviously yes you retard

Yes, but probably not a lot faster.

en.wikipedia.org/wiki/Cython
cython.org/

Attached: Cython-logo.svg.png (330x147, 13K)

I heard once numpy is almost all c, if it's true, it won't make a lot of difference, will it?

Thanks, I'll take a look

with your C? don't make me laugh

What are you stupid? Just use tensor flow or pytorch.

this.

this. easiest.

Neural Network are slow to train to begin with. Honestly, the best way to train is to use Tensor Flow / Keras and enable CUDA with NVIDIA. Writing it from scratch is good for leaning but not practical. Learn the theory, write it from scratch once or twice, and move on.

nah, just compile it with cython. done before bed tonight. maybe significant performance improvement. good time investment if original design is sound.

Why people like you exists?

Bitch, I have written code to do matrix multiplications in parallel on the GPU

if the whole net is a big fat concatenation of numpy manipulations, then reimplementing it on C would make about 0 to 5% faster, hardly worth the hassle.

If you are cheating using python's for loops and what, then the equivalent C code would be like 20 folds faster.

GEMM libraries already exists for C. Just use those

here's the code:

github.com/victorqribeiro/MLP/blob/master/python/MLP.py

yes
you might be able to use pypy and improve your speed without bothering to switch though

Loops and logic are slow

Use numba fag.

tensorflow running on cuda cores. any other suggestion is just down right silly

>code with reddit spacing
i've seen it all.

I don't have a GPU, I'm a poor fag

I'm also learning neural networks, after I have a better grasp of things, I'll probably use one of those libraries.

github.com/victorqribeiro/MLP/blob/master/python/MLP.py?ts=2

Better now?