Counting 1,361 Big Data & Machine Learning Frameworks, Toolsets, and Examples...
Suggestion? Feedback? Tweet @stkim1

Last Commit
Mar. 24, 2017
Sep. 21, 2016


Join the chat at Build Status

What if we combine Functional Programming and Deep Learning?

As we all know, a neural network is just a computable math expression (and hence a program).

Can we add 'ordinary' programming construct to a 'neural network', like branch, loop, pair, sum, list, and function?

Of course, I must still be able to train the network.

Yes! I had add all the above construct, and I am planning to add more (stream, tree, map, set, for example).

They all had their own special gradient structure to propagate loss accordingly.

However, in the end of the day, what is updated is only container of double (or other representation of real). Having those construct only make you right networks easier, but does not offer fundamentally different learning capability.

The full list of features implemented can be seen here

Can we make the language typed so we can detect error before we train the network?

Yes and No. I am able to type most stuff, but I am having trouble adding higher kinded type, so it is somewhat limited. I need a bit help here.

Can we make the language modular and extensible so all people can write all sorts of Chuck Norris move into the language?

Yes Yes Yes! The whole language is structured in a way very similar to finally tagless, and object algebra.

So, it is possible to add new operation/constructor, and still retain type safety.

In fact, there isn't even a core language! All feature(function, double, back propagation, pretty printing) is added as ordinary plugin so you can extend/subset the language as you can wish.

Patchouli Go!

You should read the blog before anything.

We have an annotated example on how to use our code. More documentation is coming up.

Another good starting point is here.

If you want to look into the code base, it is necessary to understand Finally Tagless


Q: How is the speed?

A: Unoptimized. This is more of a proof of concept that we can use function in neural network, than something that can get you good kaggle score right off the shelf.

Q: Why does this work theoretically?


Q: What does this have to do with Yang Bo's DeepLearning.scala?

A: We work on a prototype for 2-3 months, and split apart.

Q: You seems to have a space in FAQ.

A: I like it that way.

Q: What are you currently working on?

A: I am trying to formalize a core subset of the language, to demonstrate what does derivative in our context mean (and why it is correct).

Thank You Sir

This is heavily inspired by Neural Networks, Types, and Functional Programming, and my colleague, Yang Bo