Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: Embedding Deep Learning models into your Slides using R (rpubs.com)
42 points by javierluraschi on Feb 4, 2018 | hide | past | web | favorite | 13 comments

This is a neat R hack; unfortunately, it is indeed a hack, which makes it tricky for conventional use cases.

The tensorflow and keras R packages are interesting and have similar parity to the Python APIs (since the packages translate the commands to Python), but using them requires a more functional approach than working with R/tidyverse. And hopefully you don’t hit a bug, as the extra layer makes debugging more difficult. (In contrast, sparklyr, an R interface to Spark, fits well into a dplyr ETL, although that’s more due to the nature of Spark DataFrames)

The tricks used in the explainer slides don’t take much advantage of the R ecosystem, unfortunately. (And I say that as someone who is very vested in the R ecosystem, but still switch to Python for anything deep learning)

Are you referring to the 'keras' R package as a hack? From your comment, it rather sounds like a disagreement in design principles, not a hack.

If you are referring to the act of mixing "rmarkdown, keras and kerasjs" to run deep learning models inside a slide as a hack, that would make much more sense.

Could you please clarify?

The latter, which is compounded by the nature of the former.

A lot of us post hacks under 'SHOW HN'. I honestly don't even know what's the practical application of using deep learning models within one's slides, take it for whats worth.

What is more interesting to me is that one can pull together this demo pretty easily using all the new tools that have just been made available in R. Those tools are much more interesting than this post.

Regarding, 'which is compounded by the nature of the former', the argument from the comment seems to be that creating a layer of something makes things worse, this is not necessarily the case. Abstraction layers are one of the most powerful and reliable tools in software engineering. For instance, I would much rather write a layer of C++ code that wraps assembly code. Others can choose to create layers over C++ and so on, it's all good.

Interesting, I’ve found tidyverse to be quite functional in style...

You can see all the slides under rpubs.com/jluraschi/deploying-tensorflow-rstudio-conf

Worth mentioning that this model uses a simple feedforward network with a few dense layers trained over the MNIST dataset; therefore, digit recognition classification is not very accurate.

My trackpad handwriting isn't the most legible, but apparently everything came out as being a "6."

This model is based on MNIST and trained over a few dense layers, there are much better ways to train this model. It would be interesting to build a web app that allows collection of a dataset of drawn digits over an HTML canvas that we can later train with a more sophisticated model, but that stretches a bit further than the time I have available.

Firefox: Grinds to a halt after my 2nd or 3rd attempt, but recognises each one I (sort of, as it stuttered) drew accurately.

Chrome: Stayed smooth but did not recognise a single digit correctly.

Not sure what causes either of these problems :(

Cool, very impressive!

Especially since Javier threw it together shortly before presenting it live at a conference.

I wonder which numbers he demonstrated. All straight vertical lines are strongly marked 8 for me and all very 2 looking curves with a straight line at the bottom are clearly "3".

I had to look at the MNIST images and then try to draw the digits in the same way, the easiest ones are zero and one.

Applications are open for YC Summer 2019

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact