The primary professional hat I wear is as a data science consultant working with machine learning in a variety of problem domains. Due to my academic past in computer science and applied statistics, my development environment of choice today is typically R. Lately however, Python is taking the lead position for working with deep learning workloads, so that’s why I took special notice of this ODSC West 2018 talk “Deep Learning in R with Keras,” presented by Gabriela de Queiroz, Senior Developer Advocate at IBM (Center for Open Source Data & AI). Gabriela is also Founder of the R-Ladies group. With Keras on top of R, I can get a little more mileage out of my R experience.
[Related Article: Building a Custom Convolutional Neural Network in Keras]
For those of you still making the transition to deep learning, Keras is an open-source neural network library written in Python and capable of running on top of TensorFlow, Microsoft Cognitive Toolkit (CNTK), or Theano. It was designed to enable simple and fast prototyping and experimentation with deep neural networks, and focuses on being user-friendly, modular, and extensible. Keras supports both convolutional networks and recurrent networks, and runs seamlessly on both CPUs and GPUs.
At the same time, R has a rich history as an open-source statistical computing project and is a mainstay of data science. This talk introduces you to using Keras from within R, highlighting the packages and supporting tools (and some unique tools) available that make R an excellent option for deep learning. Gabriela does a good job explaining why you might want to do deep learning with R and use the Keras framework (as opposed to say MXNet). She does a deeper dive on tools like tfruns for tracking and visualizing training runs, and also saving, loading models using HDF5 format where the resulting file contains weight values, the model’s configuration, and the optimizer’s configuration. Also covered at some level of detail is tfdeploy for data engineers deploying TensorFlow models in R that are worked out by data scientists. For example, you might want to deploy the model to Google Cloud ML.
The main attraction of the talk is its coverage of the main R packages and supporting tools (tfruns, and tfdeploy) that enable the TensorFlow API. Through a series of examples, you will learn how to use Keras, how to run, track, compare and visualize models and finally, how to share your models and reports without leaving the RStudio IDE (set of integrated tools designed to help you be more productive with R).
This is an important talk to consume for any data scientist using the R environment as it addresses the current trend toward deep learning workflows. If you’re new to deep learning, but have long-term experience using R, then this talk is a good way to gain an introduction to this popular framework. To take a deeper dive into how to take advantage of the Keras deep learning framework from R, check out Gabriela’s compelling talk from ODSC West 2018.
[Related Article: Getting to Know Keras for New Data Scientists]
Key Takeaways:
- Keras is a popular framework for doing deep learning through the TensorFlow API
- Keras supports both convolutional networks and recurrent networks, and runs seamlessly on both CPUs and GPUs
- Now you can use Keras directly from RStudio
- The tfruns tool is available to test models
- The tfdeploy tool is available to deploy models