Book Image

R Deep Learning Projects

Book Image

R Deep Learning Projects

Overview of this book

R is a popular programming language used by statisticians and mathematicians for statistical analysis, and is popularly used for deep learning. Deep Learning, as we all know, is one of the trending topics today, and is finding practical applications in a lot of domains. This book demonstrates end-to-end implementations of five real-world projects on popular topics in deep learning such as handwritten digit recognition, traffic light detection, fraud detection, text generation, and sentiment analysis. You'll learn how to train effective neural networks in R—including convolutional neural networks, recurrent neural networks, and LSTMs—and apply them in practical scenarios. The book also highlights how neural networks can be trained using GPU capabilities. You will use popular R libraries and packages—such as MXNetR, H2O, deepnet, and more—to implement the projects. By the end of this book, you will have a better understanding of deep learning concepts and techniques and how to use them in a practical setting.
Table of Contents (11 chapters)

Getting ready


In this chapter, we will introduce keras and tensorflow for R. keras is a model-level building, in that it provides a high-level interface to quickly develop deep learning models. Instead of implementing low-level operations such as convolutions and tensor products, it relies on Theano, TensorFlow or CNTK in the backend, and according to the development team, more backends would be supported in the future. 

Why do you need a backend? Well, if the computation becomes more complicated, which is often the case in deep learning, you need to use different computation methods (known as computation graphs) and hardware (GPUs). For instructional purposes, all our sample codes run without GPU. 

Installing Keras and TensorFlow for R

As per the official documentation, you can install Keras simply with:

devtools::install_github("rstudio/keras")

The Keras R interface uses tensorflow as a backend engine by default. To install both the core keras library and tensorflow, then do:

library(keras)...