uncomplicate

whilo 2017-10-10T19:06:00.000250Z

The math operations in uncomplicate.neanderthal.math are supposed to work with fmap, I think. Wouldn't it be beneficial to do them on device, e.g. GPU?

whilo 2017-10-10T19:09:48.000213Z

Basically a neural network graph will be matrix-matrix multiplications + point-wise non-linearities. If I do them with fmap, I will implicitly copy the intermediary results to the CPU on each layer, right?

2017-10-10T19:12:54.000214Z

That's what's comming in 0.17.0. There will be vectorized equivalents for all math functions on CPU & GPU for all different types of vectors and matrices

2017-10-10T19:14:39.000296Z

fmap works only with Clojure functions, of course, since GPU kernels cannot meaningfully implement IFn

2017-10-10T19:15:18.000509Z

the namespace that you're interested in is vect-math

whilo 2017-10-10T19:16:34.000587Z

got it.

2017-10-10T19:16:46.000608Z

Now, if you need some mathematical function that is not in math (and thus vector-math) you'd have to implement the kernel yourself (relatively easy with clojurecuda/clojurecl)

2017-10-10T19:17:58.000063Z

The current snapshot has implementations for vectors and GE matrices on CPU. Other types of matrices and GPU is on the TODO, but should be available soon.

whilo 2017-10-10T19:24:45.000028Z

Ok, perfect.

whilo 2017-10-10T19:39:37.000443Z

It does not support GE matrices for me, only vectors:

whilo 2017-10-10T19:46:58.000551Z

As an exercise I have reactivated the core.matrix backend of @mikera and made it work with the current master branch and with the high-perf. BLAS routines for dense matrices. I think the autograd code could work with this core.matrix backend without major performance penalties compared to direct usage of neanderthal, since it only needs a small subset of neanderthal's routines, but some things that core.matrix provides, like automatic broadcasting.

whilo 2017-10-10T19:47:46.000304Z

Broadcasting and reshaping (common ops in scientific computation languages like Python, Matlab or Julia) will be expensive right? I could copy into a new matrix, but usually these other languages provide a view on the data. Don't know how they do it, do you have any suggestions?

whilo 2017-10-10T20:11:06.000170Z

@blueberry Thanks!

2017-10-10T20:16:05.000397Z

untested (yet!)

2017-10-10T20:16:24.000120Z

@whilo untested

whilo 2017-10-10T20:16:32.000120Z

Seems to work. core.matrix tests pass.

whilo 2017-10-10T20:16:44.000252Z

(an my manual tests)

2017-10-10T20:16:47.000459Z

I meant the vector-math engine

whilo 2017-10-10T20:17:10.000058Z

I have just added it with your commit for Vector and Matrix.

2017-10-10T20:17:13.000261Z

Old stuff, of course, passes the tests

2017-10-10T20:17:25.000058Z

?

2017-10-10T20:17:34.000310Z

what did you add?

whilo 2017-10-10T20:17:47.000214Z

vm/pow vm/mul vm/div etc.

2017-10-10T20:18:14.000532Z

Those have been there and have the tests.

2017-10-10T20:19:02.000168Z

But the matrix implementation of those functions do not. They work generally, but there might be a few bugs to fix.

whilo 2017-10-10T20:19:38.000403Z

Ok.

whilo 2017-10-10T20:38:03.000392Z

What is the prefered way to add a scalar to vector/matrix?

2017-10-10T20:40:58.000415Z

`(linear-frac a 3.3)

2017-10-10T20:41:24.000071Z

(linear-frac a 3.3)

whilo 2017-10-10T20:43:47.000375Z

Thanks!

whilo 2017-10-10T21:03:58.000276Z

The sign function and elementwise <,> and = (+ eps) would be nice.

whilo 2017-10-10T21:04:44.000094Z

Just as a note, I can try to do it, but I guess you have a list of missing features where things like this can be tracked, so they don't get lost.

2017-10-10T21:12:16.000614Z

open an issue on github

2017-10-10T21:12:44.000036Z

= + eps is already in math, f=

2017-10-10T21:13:00.000307Z

you also have f&lt;, f&gt; etc

whilo 2017-10-10T21:14:43.000448Z

Yes, but they are for usage with fluokitten. I think it would be nice to have something on device. And max would also be cool for ReLU activations.

whilo 2017-10-10T21:15:15.000048Z

I would like to select only positive entries in a vector for example.

whilo 2017-10-10T21:15:43.000091Z

I will open an issue.

whilo 2017-10-10T22:30:54.000041Z

https://github.com/whilo/denisovan

👍 1
whilo 2017-10-10T22:31:08.000135Z

Good night 🙂.