Fork me on GitHub
#off-topic
<
2017-01-06
>
qqq03:01:44

@henrique.alves : auto differentiation is really nice, but TF really shines at GPU, multi GPU, builtin in optimizers (SGD, Adam, RMSProp), etc ...

qqq03:01:04

without those things, one can't realistically train deep neural nets in clojure

henrique.alves03:01:10

TF is actually a lot of things (including a client-server model for distributed computing), but one of those "things" is just a way to declare a computational graph and compute gradients w/ https://en.wikipedia.org/wiki/Automatic_differentiation#Reverse_accumulation

henrique.alves03:01:33

after that, plugging into a quasi-newton optimizer is a separate thing

henrique.alves03:01:04

that said, TF API is really sad w/ it's variables and placeholders. manipulating the formula symbolically in lisp would allow some nice things (including composition, which falls apart on TF)

qqq04:01:53

@henrique.alves : completely agree on the variable / placeholder / formula manipulation

qqq04:01:23

@henrique.alves : unfortunately, I feel that keras, in doing away with the vars, goes too far

qqq04:01:38

what I really want is to say: everything is a float32 or an int, infer it from type checking

qqq04:01:45

and matrix size -- well, infer those too

qqq04:01:00

there's no reason why TF code should be so much longer than the LaTeX of the math formulas

qqq04:01:13

the math formulas clearly contain enough info, so the rest should just be inferred

henrique.alves04:01:55

keras is an API for building models more than an API to define a function to be optimized

henrique.alves04:01:05

it's already at a higher-level

qqq04:01:39

in my limited experience with keras, it feels like the main op I could do was "add layers"

qqq04:01:53

but often, I want more flexibility than that

henrique.alves04:01:58

yes. keras is the equivalent of scikit-learn's pipelining/essembling methods

henrique.alves04:01:47

difference is that instead of pipelining some estimator, you add a "layer" which is some activation function to be evaluated on TF

henrique.alves04:01:34

in the end a NN and a bunch of complex estimators piped together are not very different, besides the fact you can back-propagate on the first one (currently)

qqq04:01:59

I've worked through quite a few TF examples; what can we realistically do about "clj DSL for describing functions for TF to optimize" ?

qqq04:01:23

I've love to be able to describe the computational graph in CLJ DSL, then hit some key, and have it translated into Python/TF and optimized on my GPU

qqq04:01:28

that'd be amazing

alexstokes04:01:16

is anyone working on this bc it sounds awesome?

qqq04:01:36

i'll contribute two lines

(defmacro dsl->tf [& body]
...
)

qqq04:01:03

maybe start with the MNIST example

qqq04:01:02

1. that looks very cool 2. what about things that are not TF though, for example, many TF examples uses numpy to generate data; and the MNIST example calls python-learning-libraries to get the data

qqq04:01:18

it seems like a java->tf approach loses alot of the libraries that numpy + python/learning provides

qqq04:01:50

[I don't know the correct answer; I'm merely thinkng outloud.]

henrique.alves04:01:54

TF doesn't use numpy arrays natively

qqq04:01:07

no, but I often use numpy to construct stuff the TF feed_dict uses

qqq04:01:21

let me pull up some sample TF code I have

henrique.alves04:01:51

I know what you mean... but I'm saying TF is not coupled to numpy, it has it's own type representation for matrices anyway https://github.com/tensorflow/tensorflow/blob/master/tensorflow/java/src/main/java/org/tensorflow/Tensor.java#L36

henrique.alves04:01:03

the Python API deals w/ casting from numpy -> tensor

qqq04:01:27

it seems that for practical ML, having numpy / other learninb libraries around is very useful

qqq04:01:48

how would the clj/java/tf setup work?

qqq04:01:54

I think I'm misunderstanding what you are suggesting.

henrique.alves04:01:56

these numpy.asarray literals are copied to another object before evaluation anyway, that's what I mean

henrique.alves04:01:37

or rather, "unpacked" from the PyObj to the native C++ TF type

qqq04:01:05

sure; but say you're doing a practical ML problem, under the "dsl->python tf" approach, it is: 1. write some data input code in python 2. write some clj dsl for describing computation graph / how to optimize 3. run compiler, which does "dsl -> python tf" and merges the two codes, and runs it on the GPU It's not clear how doing "clj -> tensorflow via java" simplifies any of this

qqq04:01:59

I should describe the workflow differently as this:

qqq04:01:31

1. in python, wriite code to input data 2. in clojure dsl, write code to describe computation graph / which optimizer to use 3. run some wrangler, whhich compiles the clojure dsl to python tf code, merges the code together, and runs it on a GPU

qqq04:01:38

^^ what's the work flow I have in mind

henrique.alves04:01:18

well, w/ the Java API you don't really need Python, not even to ingest data

qqq04:01:48

true; but you would have to rewrite (1) any input routines and (2) any numpy routines you wanted to use

qqq04:01:27

(PS, I would love to be proved wrong and use a pure java solution -- I don't love python -- I just don't see a way to get rid of it)

henrique.alves04:01:28

data ingestion is just vectorizing some arbitrary stream into an efficient dense/sparse matrix format... there's nothing special about this

henrique.alves04:01:42

for one example

qqq04:01:18

true; but reading MNISt / Cifar10 data, in python, is just "import this learning library; use 2 lines of code" -- I'm not sure if Java learning libraries are that good yet

qqq04:01:27

I don't know if the Java library support are at this level yet.

henrique.alves04:01:54

there's nothing special about this besides the fact they package MINST dataset inside this example package

qqq04:01:17

agreed, but python has so many things already packaged

qqq04:01:36

name any standard library dataset, it's probably packaged in python; name any standard library, there's probably a pylearn / numpy implementation

qqq04:01:49

I don't know if Java has this level of support from the machine learning community.

henrique.alves04:01:03

you don't need to lecture me - I work w/ financial models in Python (and R) all day

henrique.alves04:01:13

and no, Python doesn't have all, sometimes we have to fallback to R

qqq04:01:48

I mean no offense; I'm trying to understand why you are recommending using Java instead of leveraging all the libraries Python supports.

qqq04:01:04

And yes, I agree, R probably has more statistical models.

henrique.alves04:01:27

my company already relies on Clojure/JVM heavily, so that would be nice, for one. second, Python packaging/deploy story is awful compared to shipping JARs. being able to use TF and side-stepping this would also be nice

qqq04:01:22

How well does deeplearning4j work? Could fill in as "python's vast ML support" ?

henrique.alves04:01:52

there's not much to leverage from the Python ecosystem when you're using only TF though - usually your entire model will be defined in it instead of mixing-matching w/ sklearn, and numpy doesn't matter

qqq04:01:24

I agree, for pure TF model, java would be a better approach.

henrique.alves04:01:27

the same is not true if you rely on sklearn which is really much better than the rest (Weka, etc)

henrique.alves04:01:17

Spark has http://spark.apache.org/docs/latest/ml-guide.html which can be interesting, although some models benchmark poorly against the equivalent on sklearn

qqq04:01:03

Spark is out of my budget. I'm a hobbyist 1 or 2 GPU ... not someone using a cluster.

henrique.alves04:01:34

Spark can be useful for massaging data, even if you run w/ one worker

henrique.alves04:01:56

and having many CPUs is orthogonal to GPU

qqq04:01:36

It does sound like in your case, pure Java makes sense, if all your inputting is via Spark, rather than python, and you want to deploy on machines that already have JVM.

qqq04:01:35

I'm hoping we'll go from 0 to 2 libraries. 🙂

henrique.alves04:01:20

all in all, Python feels like a liability nowadays (unless you're Google), so being able to leverage TF from other platforms would be good

henrique.alves04:01:49

and on top of Clojure, even better

henrique.alves04:01:06

the quality of some (heavily used) Python libraries is dubious too. after getting a bug on how numpy computed the median of a vector I don't take the environment as a clear winner anymore

qqq04:01:44

I will admit this: I have never deployed a ML model that works in industry.

qqq04:01:52

And I suspect, if I had, my opinions might be different.

qqq04:01:08

Though as a hobbyist, a "sorta working library" is often good enough, since real $$$ isn't relying on it.

henrique.alves04:01:51

as an anecdote, the median bug could easily cost some millions and shutdown the company, since imputing a missing variable w/ it's median is a common imputation method for financial models

henrique.alves04:01:35

that could skew the distribution and make "bad" clients look like "good" clients and go unnoticed, easily

henrique.alves04:01:38

these things are tricky

qqq04:01:00

which industry is this? statistical arbitrage?

qqq04:01:03

if I was in the finance industry, I'd probably also be really pissed off at hobbyist code that works 90% of the time, and the other 10% of the time results in lossing mllions of dollars

qqq04:01:31

I now see why you so heavily value TF andplace so little value on "existing library support"

henrique.alves04:01:03

there is some talk (I now forget from which conference) where the speaker asked the audience "How many of you have built at least one predictive model?", and the entire room raises hands

henrique.alves04:01:24

then he asks "How many of you have used any in production", and a couple raises hands

henrique.alves04:01:19

there's a big gap between having something w/ predictive power and having something w/ predictive power that is correct, tested, monitored and scales

henrique.alves05:01:03

it's a space that's ripe for some actual software eng. discipline - most progress so far has been based on marginal improvements on R^2 or some error metric at the expense of everything else. researchers don't have to make trade-offs to publish a paper

danielgrosse08:01:02

In a new project, how much time do you invest in planning and conception? Do you tinker with prototypes and convert them into a finished product, or do you use them only for planning? Which tools can you recommend for the conception process?

borkdude09:01:03

Can someone request this feed? It says I’m blocked, but I think it’s global: http://www.health.harvard.edu/blog/feed

gklijs09:01:22

I first got blocked, after a refresh I did get the feed

borkdude09:01:22

With wget I do seem to get the feed

borkdude09:01:46

@gklijs Are you my old Finalist colleague btw? Nice to see you are also interested in Clojure 🙂

gklijs09:01:03

yes, read something about it the summer, have a clojure/clojurescript application to play around with, but for work it’s hippo atm

gklijs09:01:41

Just registered, should be able to make it on a saterday

wallydrag10:01:29

@borkdude any idea who is organising dutch clojure day. I submitted a talk but have no idea on its status 😕

borkdude10:01:50

@wallydrag I’m not involved, but you could try #clojure-nl

baptiste-from-paris13:01:51

hello guys, where should I ask questions about software architecture ?

malch13:01:31

@baptiste-from-paris I believe this channel is ok, or you could try #architecture

baptiste-from-paris13:01:09

let’s try here ^^

baptiste-from-paris13:01:16

So I have to build a messaging system used for dispatching requests on different servers (using specific rules)

baptiste-from-paris13:01:24

My question : does someone have readings, recommandations on good resources for choosing a specific queue service (RabbitMQ, HornetQ, 0MQ …)

gklijs13:01:06

One of the things you might want to take into account is if you want to have multiple consumers of the messages and/or if you want to know if a message has been consumed. Kafka is great for scalability, and decoupling consumers and producers. But because of this you have to do a lot of work if a producer wants to know if a message has been consumed yet.

baptiste-from-paris13:01:44

ok, and something smaller maybe ?

baptiste-from-paris13:01:49

it’s a simple archi

gklijs13:01:27

I only have experience with Kafka, and a bit with IBM mq, so can’t really give good recommendations one something smaller, but I heard good things about RabbitMQ, and you also mention it as the first one, so maybe you can do a poc with it, to see if it covers your needs?

baptiste-from-paris13:01:44

ok ok, need to find a comparison somewhere

baptiste-from-paris13:01:50

between all of the vendors

dexter13:01:57

rabbit is good and more functional than any of the other ones I've come across if your throughput needs are relatively small. I'd avoid 0MQ just because it's very low level and not persistent. You use 0 for ephemeral things like RPC and things where you really want to be light. It's basically point to point. Kafka is more about huge volume it's relatively slow on a message by message basis but it can handle trillions per second if setup right. ActiveMQ is another option, again lots of options but i'd say rabbit is strictly superior. It's faster, easier to manage, more reliable and can handle more volume. I mostly tend to go for kafka + rabbit as between the two you can do most patterns well.

dexter13:01:53

There are more vendor specific ones too but I discount those out of hand for binding me to a vendor.

dexter13:01:04

http://queues.io/ has a good list of most and some comparisons

baptiste-from-paris13:01:15

any good lib with clojure ?

dexter13:01:59

i used http://clojurerabbitmq.info/ and have been quite happy with it

dexter13:01:34

doesn't support everything but so far I've yet to have it not do what I needed

dexter14:01:00

Kafka has a nice clojure lib too, but I'm not sure that's the right tech choice for you

baptiste-from-paris14:01:39

thx a lot for your help

baptiste-from-paris14:01:49

i’ll take a look at everything

baptiste-from-paris14:01:47

have you heard of this one ?

schmee14:01:59

baptiste-from-paris I haven’t used langohr, but I’ve used Monger a bit and it seemed to have really high quality

schmee14:01:11

since they are both run by ClojureWerkz I would expect the same to be true of Langohr

dexter17:01:49

@baptiste-from-paris that is the one I linked 😛

fellshard19:01:07

Odd ideas - generating data from an Avro schema? Would an integration with Avro be appropriate for clojure.spec? Humm. Would have to look around to see if the intended use for each lines up.

ejelome20:01:03

can anyone of the admins please enable the ALL UNREADS preference? https://get.slack.help/hc/en-us/articles/226410907-View-all-your-unread-messages

juhoteperi20:01:47

@ejelome The option is on your own preferences

ejelome20:01:48

fun times 😄

qqq21:01:05

can an mod please create a GAE channel?

qqq21:01:10

I need somewhere to vent my clojure/GAE frustration

gdeer8121:01:22

What would you call it if you wanted to put a bug bounty on an issue but it's not really a bug it's just research/poc? feature bounty doesn't sound as cool. Research reward?

sveri21:01:43

I am not a mod...but I did so: #gae

arilewis22:01:59

Hi, my name is Ari and I run a newsletter called Developer to CTO. It's a weekly newsletter that provides career advice to software developers. You can check it out at http://clktech.io.