uncomplicate

whilo 2017-10-11T11:23:03.000066Z

@blueberry I would love to have proper support for convolutions (CNNs) when you work on tensor support. Nvidia has CUDNN as a particular offering for deep-learning people, but it would be really cool to offer something that also works on AMD cards and with OpenCL (open-source).

whilo 2017-10-11T11:24:08.000239Z

Let me know if I can help.

2017-10-11T12:36:30.000206Z

I plan to do this, but probably only as a part of paid consultancy service. OTOH, who knows...

zirmite 2017-10-11T12:50:00.000083Z

I’d like to try and port a python/pymc3 model over to Bayadera to try that library out. Where’s the best source for Bayadera documentation?

2017-10-11T12:53:16.000279Z

https://github.com/uncomplicate/bayadera/tree/master/test/clojure/uncomplicate/bayadera/examples/ in conjunction with the book Doing Bayesian Data Analysis 2nd ed.

πŸ‘ 1
whilo 2017-10-11T16:23:10.000551Z

Hmm, I know a lot of people in optimization and very few of them are dealing with kernels for parallel processors and are willing to go that far. I agree that "low-level" is a relative and often misused perception, but when I deal with mathematics exploratively I definitely don't want to write CL code at the same time. I am willing to do so to improve my slow code though and build better primitives occasionally. I think you are right though that neanderthal should not provide too much false convenience, so maybe I will write these "higher-level" functions in a separate library then.

whilo 2017-10-11T16:23:58.000051Z

signum is fairly basic though, not sure whether it is a good idea not to have it.

whilo 2017-10-11T16:25:34.000236Z

I have just trained the first toy NN with autograd and neanderthal (through the core.matrix wrapper for now).

2017-10-11T16:26:18.000448Z

πŸ™‚

whilo 2017-10-11T16:27:17.000311Z

Thinking about it, I should definitely try ClojureCL for the convolutional stuff.

whilo 2017-10-11T16:28:31.000610Z

@blueberry Have you thought about exporting a Java API? I think your audience would be much larger on the JVM in general, than just Clojure. It would also probably bring quite a few people to Clojure if they see that it can be used that well for high-performance code.

2017-10-11T16:31:11.000152Z

I did, but I only have two hands, the day only lasts so many hours, and I have my "real" job to do too. So, there are only two things that make me add functionality: 1) I need it or like it 2) Someone pays me enough money to do it (and it's still kinda interesting)

2017-10-11T16:31:23.000461Z

Java API falls into category 2 πŸ™‚

2017-10-11T16:32:11.000421Z

I'd prefer to use the time to do something that is missing to uncomplicate than to work on stuff for imaginary users

2017-10-11T16:32:38.000015Z

Especially when it is unlikely that those users are going to become my customers anytime soon

2017-10-11T16:33:01.000501Z

OTOH, I'd love if someone else (you?) created that Java API! πŸ™‚

whilo 2017-10-11T16:40:47.000093Z

Hehe, I know the hours problem too well. Actually I should work on my master thesis about Bayesian GANs and probabilistic programming. I do this at the moment to prepare for a proper optimization toolbox for my needs in Clojure so I can hopefully get away of Python. The Java API was not interesting for me, since I do almost everything that I can in Clojure, but I thought there might be customers in Java/Scala/Kotlin-Land, since the general library landscape on the JVM is rather high-level and not really nice for scientific computing. uncomplicate on the otherhand provides something unique and really nice low-level primitives to do the things on the JVM people normally use other environments for. I don't know about the market size though and whether it will pay off. It depends on how large the Java API surface needs to be, I guess.

2017-10-11T16:42:08.000066Z

There are many of them, but making them pay for software is a tough task...

whilo 2017-10-11T16:47:46.000646Z

I see. You could make the Java API proprietary.

whilo 2017-10-11T16:49:14.000528Z

Licence fees are still by far the biggest income source, I think. I am a proponent of open-source, but it sucks that there is no income model.

2017-10-11T16:50:11.000196Z

Sure, but getting developers to use such libraries is difficult if you are not Microsoft or Oracle.

2017-10-11T16:50:31.000117Z

It's much better IMO to create something and sell it to non-programmers.

2017-10-11T16:50:57.000428Z

Or to sell service/consulting.

whilo 2017-10-11T16:51:21.000592Z

That is also true!

2017-10-11T16:51:35.000209Z

Programming tools are bad business and have been for the last two/three decades.

whilo 2017-10-11T16:51:44.000253Z

Even Oracle and Microsoft have difficulties in selling stuff to programmers.

2017-10-11T16:52:56.000475Z

You see that I give all kind of cool uncomplicate libraries for free, and it is still hard to convince people to try to use it.

2017-10-11T16:54:20.000224Z

Linear algebra has been free for 100 years, it is forced on students in university, and they still refuse to make effort to learn it πŸ™‚

whilo 2017-10-11T16:57:06.000397Z

Hehe ^^

whilo 2017-10-11T16:57:36.000495Z

Right. Your audience is not very big, that is true.

whilo 2017-10-11T16:58:10.000341Z

Or for that sake, our audience. I am not working on the same technical level like you, but I have similar problems.

whilo 2017-10-11T16:58:26.000552Z

I think machine-learning is sellable right now, though.

whilo 2017-10-11T16:59:28.000606Z

It is insane, I will be teaching assistant from next week on and 120 students signed up for the lecture, with a waiting list for another 20. It started with 60 free slots and was already full 6 weeks before the lecture starts.

2017-10-11T16:59:31.000151Z

Yes, but not the tools. The final product/service. Currently more as hyped fog, but there is and will be space for working solutions.

whilo 2017-10-11T16:59:41.000102Z

Yes.

whilo 2017-10-11T17:00:26.000285Z

But data scientists are often not really good programmers. There are some solutions in this space also, like Microsoft R integration into SQL server, where you can sell stuff to the people doing the programming.

2017-10-11T17:00:44.000217Z

You can try to sell πŸ™‚

whilo 2017-10-11T17:01:36.000325Z

Not as a teaching assistant. Maybe I can let Clojure slip a bit, but the Prof. is a C++/Python guy.

2017-10-11T17:02:28.000185Z

Everyone and their grandmother is interested in AI now due to the hype. The problem is the majority underestimates the task and overestimates their ability or willingness to put up the work.

2017-10-11T17:02:38.000159Z

Damn prof++ πŸ™‚

whilo 2017-10-11T17:02:44.000215Z

Hehe ^^

whilo 2017-10-11T17:03:02.000434Z

Yes, that is the case in general for most trendy things I have heard.

whilo 2017-10-11T17:03:16.000096Z

On the other hand I don't think AI will be short-lived this time.

2017-10-11T17:04:11.000619Z

I'm kinda grateful for the DL hype though, because it distracts the competition from other ML/AI approaches (like the Bayesian stuff) πŸ™‚

2017-10-11T17:04:56.000437Z

That gives us some time to brush up our ml-foo.

whilo 2017-10-11T17:05:02.000068Z

Agreed πŸ™‚.

whilo 2017-10-11T17:05:33.000493Z

Although Bayesian is hard to sell even to ML people. Uncertainties are not always helpful and it is not that obvious.

whilo 2017-10-11T17:06:03.000058Z

On the other hand deep learning can be nicely integrated (that is what my friend and colleage and me are working on most of the time).

whilo 2017-10-11T17:06:27.000063Z

But we are the lonely Bayesians here at the research group.

2017-10-11T17:07:40.000009Z

About the autience: I had 30.000 users reading 50.000 pages this year (not including the filtered spam traffic)

2017-10-11T17:07:44.000249Z

Not that bad

whilo 2017-10-11T17:07:52.000269Z

I have found some OpenCL literature to convolution, not sure how appropriate it is: https://www.evl.uic.edu/kreda/gpu/image-convolution/

2017-10-11T17:07:58.000355Z

Of course, it's mainly due to HN, but still

whilo 2017-10-11T17:08:09.000442Z

Interesting.

2017-10-11T17:09:08.000272Z

And it is only on the blog, excluting the documentation of the projects which should be another 10-15.000

2017-10-11T17:12:09.000343Z

I've just looked. I underestimated the projects traffic. Almost 25.000 users, 40.000 pageviews

whilo 2017-10-11T17:12:32.000268Z

Hmm, I think Clojure is in a very good spot for large scale optimization in combination with neanderthal, autograd and different sampling methods in Anglican or Bayadera. But first I need to be able to incorporate standard neural network architectures more easily. Cortex is not cutting it for me and core.matrix without neanderthal is not good enough to build fast optimizers for Bayesian inference. You are right about that. I think we can integrate it anyway, though.

2017-10-11T17:13:35.000235Z

Did you do some benchmarks?

whilo 2017-10-11T17:14:27.000187Z

Only to verify that the operations that I need from neanderthal are not slowed down by the core.matrix protocols (matrix multiplication, matrix initialization and inplace scaled additions).

whilo 2017-10-11T17:14:55.000473Z

I have to do more to verify that it is optimal, but writing a fast core.matrix backend for everything is not my goal atm. Having autograd is.

2017-10-11T17:15:39.000287Z

Meaning: did you measure other core.matrix backends? Maybe they are not slow/slower for the kind of task that you need.

whilo 2017-10-11T17:17:24.000416Z

Hopefully they are not too bad for general deep learning stuff. This would make the autograd more generally useful, e.g. with nd4j + dl4j and enterprisey architectures like that, but I really like to have access to the lower levels as well and only the uncomplicate libraries provide this in Clojure land. Most other stuff I have seen in the past for OpenCL programming etc. were quickly abandoned and not really exhaustive.

whilo 2017-10-11T17:18:06.000361Z

I have to think about the convolutions for example, I don't think that building them on top of core.matrix primitives will cut it.

2017-10-11T17:18:11.000420Z

hd4j is rather slow for non-large matrices

2017-10-11T17:18:29.000118Z

nd4j with mkl backend...

whilo 2017-10-11T17:18:56.000066Z

hmm, ok. This was my best bet before you built the neanderthal.

whilo 2017-10-11T17:19:28.000320Z

I am not familiar with all the other Java matrix libraries, only clatrix and jblas. But they were too slow 3 years ago compared to Python+theano.

whilo 2017-10-11T17:19:40.000396Z

Which distracted me from doing optimization in Clojure.

2017-10-11T17:19:58.000066Z

Does neanderthal work ok for you so far on that front?

whilo 2017-10-11T17:20:11.000053Z

I have not done comparisons to pytorch yet.

whilo 2017-10-11T17:20:26.000194Z

I guess this is not too easy, since pytorch does not use mkl, I think.

whilo 2017-10-11T17:20:57.000606Z

I have to compile it, I think.

whilo 2017-10-11T17:21:27.000382Z

But in general I really like it.

whilo 2017-10-11T17:22:45.000688Z

The only thing that would be nice on the JVM would be to have some control over heap layout, I guess. This is what Julia provides and low-level people miss in Java. You cannot really control that you don't miss the cache most of the time. As long as I stay inside of neanderthal I should be fine though.

whilo 2017-10-11T17:23:30.000300Z

But I have never actually benchmarked the JVM in that regard, I guess it is smart enough to avoid cache misses in most cases. It is just not controllable.

2017-10-11T17:24:06.000212Z

Neanderthal takes care of the cache for you for the functions it provides. If you want to control the cache for your custom stuff, use ClojureCL.

whilo 2017-10-11T17:24:22.000341Z

Ok.

2017-10-11T17:25:43.000547Z

But I am not sure how you can control that with Julia either. CPU cache should be a pretty automatic thing. You "control" it by re-using the locations that you suppose should be in the cache?

whilo 2017-10-11T17:26:45.000124Z

I mean that objects are allocated in a certain order that you know are optimal. I think the CLR allows this for value types. The JVM can basically relocate objects during GC.

2017-10-11T17:27:14.000182Z

Oh, that...

whilo 2017-10-11T17:27:19.000419Z

In general that things are located together in memory.

2017-10-11T17:27:51.000610Z

Neanderthal data structure are optimized in that way as much as possible.

2017-10-11T17:28:07.000657Z

GC won't move them.

whilo 2017-10-11T17:28:27.000271Z

Yes, it just something that is not optimal in Java-land for optimization people. Julia is dealing with this.

whilo 2017-10-11T17:28:52.000443Z

Other than that I am not sure why yet another runtime is necessary, but there are smart optimization people in Julia land.

2017-10-11T17:29:20.000269Z

That's fine. However, that's why I created ClojureCL. It does not work only on the GPU. You can program CPUs with it.

whilo 2017-10-11T17:29:30.000250Z

I think I will go home now and be back online later.

whilo 2017-10-11T17:29:41.000734Z

Yes, I really like that!

whilo 2017-10-11T17:29:54.000635Z

Do you have some ideas of how to do image convolutions with ClojureCL?

whilo 2017-10-11T17:30:01.000018Z

or convolutions in general.

whilo 2017-10-11T17:30:20.000286Z

convolutional neural networks work well in many settings, not just images btw.

whilo 2017-10-11T17:32:36.000459Z

Will be back later.

2017-10-11T17:34:22.000455Z

I didn't look into that...

2017-10-11T17:35:10.000661Z

Maybe it would be easy, maybe not. But I don't think you can reach cuDNN performance by doing it half-time (or at all :)

whilo 2017-10-11T19:10:00.000110Z

Probably not. Yes.