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)

RNNs from scratch in R


The purpose of this section is to show you how you can implement recurrent neural networks from bare bones in R. This is perhaps not the optimal solution for a number of reasons, but it is a great way to get started in deep learning. 

There are many plug and play frameworks like H2O, MXNet, TensorFlow, or Keras, that have compatibility with R. Our goal is to focus on the understanding of the algorithm rather than a particular API, although we will include an example using Keras. This is for two reasons, at the time of writing, the compatibility with R suffers from growing pains and we encountered many errors and issues with the different packages. On the other hand, even the stable versions of such packages have ever-changing APIs. We will focus on this section in building a very simple recurrent neural network from scratch, using simple tools from R.

We will start from the beginning, with a super-quick introduction to R6 classes in R using the example of the perceptron...