Two weeks ago, rstudio::conf 2018 was held in San Diego. We had 1,100 people attend the soldout event. In this post, I summarize my experience of the talks on the topic of deep learning with R, including the keynote by J.J. Allaire.
Keynote
The keynote on the second day was J.J. Allaire discussing “Machine Learning with Tensorflow and R”. In this talk, J.J. took us on a tour of how to use TensorFlow with R. He started with the basics, e.g., what is a tensor (it’s an array), and explained how the tensors “flow” in a computation graph in the TensorFlow
library. The tensorflow
package in R is an interface to the TensorFlow
library, meaning you can access the full power of TensorFlow directly from R.
For several years, there has been a great deal of hype about deep learning, with multiple libraries (primarily written in Python and C++). Of these libraries, TensorFlow seems to get the dominant share of interest. R has always been a language that excels in its ability to interact with other languages, including Fortran, C++, and now Python. With the release of the tensorflow
package, R users can make full use of all of the functions in TensorFlow.
Advances in deep learning, including algorithms, GPU computing, and availability of large data sets, have combined for the enormous success of deep learning in many fields. This includes nearhumanlevel performance in the fields of image classification, speech recognition, and machine translation, to name a few.
However, J.J. points out that TensorFlow is quite a lowlevel mathematical library, and that most practitioners would benefit from writing their neural network code using keras
, a package that exposes a highlevel API. Keras supports multiple back ends, including TensorFlow, CNTK and Theano. You can find out more at the keras
package page.
J.J. concluded his talk by demonstrating several ways to deploy a keras
or tensorflow
model, including publishing to RStudio Connect.
To find out more about J.J.’s talk, you can watch the keynote video or view the slides. You can also download the keras
cheat sheet.
Other talks
Following the keynote, the conference split into several tracks. I attended the session1: “interop”, which focused on interoperability between R and several deeplearning frameworks, including deployment options.

The first talk in this session was by Michael Quinn from Google. Michael discussed “largescale machine learning using TensorFlow, BigQuery and Cloud ML”. Once you have a
keras
ortensorflow
model, you can deploy this to Google Cloud Machine Learning (Cloud ML). What I find interesting about this is that Cloud ML is a service designed for machine learning. Using this service, you can deploy models without having to stand up a virtual machine first. You can do this deployment using R code with thecloudml
package 
The next talk was by Javier Luraschi from RStudio, who spoke about “Deploying TensorFlow models with
tfdeploy
”. Thetfdeploy
package exposes a unified way to deploy models to several platforms, including TensorFlow Serving, Cloud ML, and RStudio Connect. Javier made his talk available as slides as well as code. 
The final presentation was by Ali Zaid from Microsoft, who talked about “Reinforcement learning in Minecraft with CNTKR”. Ali showed how he trained a deeplearning model to control an agent in Minecraft, the popular online game. In his experiment, he taught the agent to navigate a maze, as well as understand the some natural language, e.g., “Pick up the red flowers”. He used the
CNTKR
package, which wraps the Microsoft Cognitive Toolkit (CNTK).
Conclusion
In conclusion, I’ll quote directly from J.J. Allaire’s keynote, in which he describes the key takeaways:

TensorFlow is a new generalpurpose numericalcomputing library with lots to offer the R community.

Deep learning has made great progress and will likely increase in importance in various fields in the coming years.

R now has a great set of APIs and supporting tools for using TensorFlow and doing deep learning.
Rbloggers.com offers daily email updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...