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)

RNN using Keras


In this section, we introduce an example using Keras. Keras is possibly the highest-level API for deep learning (again, at the time of writing, in this rapidly changing world of deep learning). This is very useful when you need to do production-ready models quite quickly, but is unfortunately sometimes not that great for learning, as everything is hidden away from you. Since, ideally, by the time you reach this section, an expert in recurrent neural networks, we can present you how to create a similar model. 

Before that, let's introduce a simple benchmark model. Something that comes to mind when we speak about the memory of a neural network is the following, well, what if I had sufficient storage to calculate the conditional probabilities and simulate text generation as a Markov process, where the state variable is the observed text? We will implement this benchmark model to see how it compares in text generation quality with recurrent neural networks.

A simple benchmark implementation...