Fork me on GitHub
#datavis
<
2015-12-24
>
meow00:12:57

OMG - most mathematicians cannot communicate for sh@t!!!

eggsyntax00:12:21

With non-mathematicians, or in general?

meow00:12:22

I get so tired of reading stuff written by them that relates to programming. Ugh!!!!

eggsyntax00:12:50

Curious to see the example that triggered that.

meow00:12:18

So much of what they write is utter nonsense hidden inside their pseudo-language

meow00:12:00

@eggsyntax: if it was limited to one or two examples that would be one thing. Over the past year I have read so many math-related texts that covered stuff I was coding. And when I then wrote the code I realized that the math texts were 95% bullshit.

meow00:12:49

Right now it is polygon mesh processing. Before that is was L-Systems and cellular automata.

meow00:12:43

Do any kind of google search on L-Systems and you will find stuff about the various kinds of systems: stochastic, parametric, context-sensitive, etc. all in capitalized letters like it was special. It can all be represented with functions that take arguments - no big deal. But they act like it is.

meow00:12:05

I think only about 1% of mathematical writing is of any value - the rest is crap. Not kidding.

eggsyntax00:12:36

Sure. You might enjoy some of the Mathbox author's presentations for an awesome counterexample, eg http://acko.net/blog/how-to-fold-a-julia-fractal/ I personally don't care for his writing on social issues at all, but his math & graphics presentations are pretty amazing.

eggsyntax00:12:13

He's not a mathematician proper, but a lot of his work is heavily math-based.

meow00:12:45

Yeah, it's nice to find someone worth reading, and they usually turn out to be good programmers as well.

mikera08:12:34

@Kephale if you are lucky you can get the JVM to do the right escape analysis and allocate small fixed size 3D vectors (like the vectorz Vector3) on the stack. In which case they are pretty cheap

kephale14:12:46

@mikera: I don’t quite get it, it looks like Vector3 in vectorz enumerates dimensions as x,y,z and then will translate to array vectors if you ask it to, if I’m not mistaken?

kephale14:12:56

@mikera: or are you saying that the conversion is pretty cheap? (where the case that i believe we are talking about is, handling matrices Nx3 and doing a bunch of lin alg on those, then swapping back to a renderer which always expect something like Vector3)

kephale14:12:34

relatedly, i’ll be gathering with a bunch of folks in germany in a few weeks to work on some code for GB/TB image analysis, and a few of these folks have different renderers (and a few are JOGL contributors)

kephale14:12:02

the main Vector3 implementations folks are using seem to be vecmath’s Vector3f and org.apache.commons.math3.geometry.euclidean.threed.Vector3D

kephale14:12:26

which upsets me, because the former is certainly being used on the JOGL side for rendering, and the latter is being used for a lot of mesh ops (because it has better math), but if you want to do work on meshes in real-time you’re paying unnecessary conversion overhead

mikera14:12:48

Yeah my point is that the conversion is very cheap, assuming escape analysis works. You can do the bulk of processing on a big Nx3 array, and only switch to Vector3 implementaions for the final render call

kephale14:12:50

(noting that most of the code is getting written in pure Java, but I’ll be writing Clojure wrappers) any thoughts on a way to consolidate (would be totally down for trying to convert people to vectorz)?

kephale14:12:04

ah, gotcha

mikera14:12:08

In some cases your renderer may accept double arrays directly, in which case you get a bonus :-)

kephale14:12:21

oh touche...

kephale14:12:44

sending over a native buffer, thats true

kephale14:12:48

perhaps the suggestion i’ll push for is to stop doing meshops on data encoded in Vector3’s and instead do it all in matrices

kephale14:12:18

converting JOGL’s Vector3’s sounds like a stretch anyway

kephale15:12:06

i’d expect some resistance though, since quite a few things are more intuitive to program with Vector3s as the variables

kephale15:12:19

but maybe that could be proven wrong….

mikera16:12:37

I think it really depends on use cases. For stuff like particle simulations, I'd definitely use matrices because there are so many identical computations and you get a huge benefit from matrix ops. If you are just storing the co-ordinates of a higher level scene object, Vector3 s are probably more convenient and performance will be fine

mikera16:12:58

I tried to write vectorz and core.matrix so that the two are fairly easy to convert between, e.g (add! x dx) will do the equivalent thing with both vectors and arrays

kephale17:12:10

@mikera: well a lot of the discussions i’m involved in are about meshops, which i’d argue are something of a grey area there. lots of identical operations, but sometimes you need to go Nx3 -> (N+M)x3, and sometimes you might just be drilling down and expanding from a single initial set of Vector3s (like subdivision of faces type of stuff)

kephale17:12:45

that is really the main use case that is in mind with all of this

kephale17:12:56

but fine, i’ll swap my particle sims over to core.matrix 😉

kephale17:12:44

oh, @eggsyntax have you poked at landofquil from this year’s clojurecup?

kephale17:12:36

err more importantly, i saw someone bootstrap their rendering system with CLJS, so its fully in-browser with no serverside stuff

eggsyntax17:12:43

I took a quick look. Very cool simple_smile. I did a lot of Processing for years, and I’ve played with Quil, so it wasn’t worth going through the examples in detail, but I was impressed as hell that they pulled that off simple_smile

kephale17:12:13

i’m just thinking cljs-mathbox + codemirrror + bootstrapped cljs for a full in-browser deal

eggsyntax17:12:37

For our project, we have to have serverside stuff, so we’re unlikely to go that direction…

kephale17:12:43

aha, gotcha

eggsyntax17:12:48

But not because of the graphics side of it, by any means.

kephale17:12:02

ya you just have tons of data on the backend

eggsyntax17:12:18

Yep. That kind of setup would be badass, though simple_smile

eggsyntax17:12:52

Be great for live-demoing MB simple_smile

kephale17:12:26

im teaching a machine learning course in the spring, and the thought of being able to demo ML algorithms live (plus getting students up and running with no installation) is incredibly appealing

eggsyntax17:12:08

Oh shit, totally simple_smile

eggsyntax17:12:38

Has someone done a cljs wrapper for codemirror? That’d be handy simple_smile

eggsyntax17:12:03

If you were inspired to implement that, I suspect the MB author would be really psyched to use it.

kephale17:12:04

i havent quite figured out how folks are doing it, but there are some git repos up that at least have compiled working demos

kephale17:12:17

i mean i’d go straight to clojurescript, but yeah

kephale17:12:41

okey, might have some questions coming your way about that then

meow17:12:09

I looked into wrapping codemirror using cljs in order to do repl stuff in devcards.

mikera17:12:52

@kephale I am working on a Clojure machine learning library with Jeff Rose and his company... Might be too early for your uses but it is going to be pretty awesome

meow17:12:54

Was about a month ago or so.

eggsyntax17:12:19

Hasn’t someone done an in-browser REPL already?

kephale17:12:42

there’s your codemirror + 3D rendering

meow17:12:29

What I found was a variety of initial attempts at repl in the browser, but nothing rock solid. And I wanted it to work in devcards with omnext.

kephale17:12:03

@mikera: ooo, hopefully more idiomatic than clj-ml? I definitely just call Weka directly these days. any particular algorithms you’re targeting?

meow17:12:12

I didn't find anything that I could easily incorporate into my own projects.

meow17:12:46

Kept hoping someone else would do it.

meow17:12:51

Maybe they have by now.

kephale17:12:24

@eggsyntax: BTW, the thought is really just to smoosh that threejs-cljs-playground with cljs-mathbox-example to convince myself that it will work, and move on from there

kephale17:12:41

@mikera: also, is it going to be CLJS friendly?

eggsyntax17:12:50

Totally, that makes sense!

mikera17:12:20

Neural network / deeplearning stuff mostly. But should be extensible to other algos

kephale17:12:52

ah ok, which would be good to be written by a matrix wizard such as yourself

mikera17:12:55

Based on core.matrix, so should be portable to cljs once the core.matrix cljs support is complete

kephale17:12:24

oh cool, i’d seen the CLJS issue on core.matrix, but wasn’t aware of how much of a push there was for that

mikera18:12:38

You can check out the core.matrix cljs stuff here

mikera18:12:09

Would appreciate any testing / sanity checking, I'm not really a cljs expert but I think Jeff has done a pretty impressive job

kephale19:12:53

ooo, will do, that would definitely be useful for demoing ML stuff (noting that the neural net/deep learning part of the course comes at the end of the spring)

kephale19:12:06

hey @eggsyntax i’ve run into a thing. does mathbox do some global stuff when it is loaded (specifically to the threeJS variables)?

kephale19:12:36

given that i’m splicing cljs-mathbox into that threejs codemirror demo

kephale19:12:43

just doing a require of [cljs-mathbox.mathbox :as mb]

kephale19:12:55

seems to modify the existing threeJS render

eggsyntax19:12:53

Oh, at load time? Not that I recall, but I haven’t dug into that part of the MB internals. But lemme go verify that I’m not doing it at the cljs level.

kephale19:12:55

like, i thiiiink it is actually still working, but just taking control of the viewport and BG color

eggsyntax20:12:14

It certainly does that at instance-creation time.

kephale20:12:31

at one point i was able to see the edge of that sine curve, but i’m whittling it down, and it seems like when that require is called, it is at least setting background color

kephale20:12:45

and resizing the viewport

kephale20:12:13

yeah your stuff looks fine

kephale20:12:38

i think it is [cljsjs.mathbox] that is doing something globally

kephale20:12:48

was just wondering if you’d run into that, i can try to track it down

eggsyntax20:12:23

Yeah, I just double-checked that as well & I’m sure it’s not at the cljs-mathbox level. But yeah, it could be at the MB level.

eggsyntax20:12:37

Which would be annoying 😛

eggsyntax20:12:58

Have to afk for a bit, back within 30 or so.

eggsyntax20:12:37

Not anything I can do today, but if MB itself is doing something globally, it should be visible in https://github.com/unconed/MathBox.js/blob/legacy/build/MathBox-core.js

eggsyntax20:12:26

Also, if it is, I might be able to prevent it by delaying by delaying the require until instance creation time.

kephale20:12:22

yeah i’m poking at undoing that clearcolor and camera init stuff

kephale20:12:37

no rush or anything, im just having fun

eggsyntax20:12:38

If you want to try delaying the require, I can test that here & send you a patch if you want. Of course, you’d have to switch to a local copy of MB to try it (instead of requiring from clojars), but that’s quite easy using checkouts: http://stackoverflow.com/a/7411652

kephale20:12:28

mmm ❤️ checkouts

kephale20:12:36

wasnt aware it worked for JS source too

eggsyntax20:12:00

I’m assuming so, but could be wrong.

kephale20:12:22

but it isnt a biggie, ill eventually figure out how to override that initialization stuff, and have to get an idea about that anyway

kephale21:12:05

arrr actually checkouts requires a project.clj

eggsyntax21:12:50

You don’t have one? How are you requiring it?

eggsyntax21:12:00

Is this a Boot thing? 😉

kephale21:12:40

oh no, i mean for Mathbox.js

kephale21:12:57

the project being checked out needs a project.clj

eggsyntax21:12:21

Oh, I meant a local copy of cljs-mathbox.

kephale21:12:42

oh i get it

eggsyntax21:12:10

That said, you might be able to do it with mathbox on cljsjs. https://cljsjs.github.io/

eggsyntax21:12:58

Hmm, you’d have to do a local checkout of the whole cljsjs repo, but that’s nbd.

eggsyntax21:12:26

No, sorry, I’m mistaken — that doesn’t have a project.clj either, only a build.boot.

eggsyntax21:12:20

But again, I just meant checking out cljs-mathbox locally — wouldn’t let you dig into the MB internals, but you could do the dependency locally and then delay the require in there.

kephale21:12:11

i think it would probably be useful to just figure out how to get at the threejs variables from mathbox

kephale21:12:36

since there will be a need to modify the overlay/renderer to fit the codemirror pane anyway

eggsyntax21:12:42

If you really want to do the Mathbox.js dependency, locally though, I know how you could do that (it’s what I did before I put it on cljsjs.

kephale21:12:53

no not really

kephale21:12:59

i just want the threejs variables : P

eggsyntax21:12:38

Yeah, you ought to be able to do that just in your own code by getting them on your MB instance.

kephale21:12:59

mmm, there is a bit of cljs learning curve going on here too 😉

eggsyntax21:12:07

& just use the JS interop functions. ie (.-theDesiredProperty my-instance) and (.theDesiredMethod my-instance).

kephale21:12:25

oh - for property, there we go

kephale21:12:26

thank yoU!

eggsyntax21:12:23

Totally! Coming from clj, I remember losing a couple of hours trying to figure out why the hell (.theDesiredProperty my-instance) wasn’t working… 😡