O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

R Deep Learning Projects

Book Description

5 real-world projects to help you master deep learning concepts

About This Book

  • Master the different deep learning paradigms and build real-world projects related to text generation, sentiment analysis, fraud detection, and more
  • Get to grips with R's impressive range of Deep Learning libraries and frameworks such as deepnet, MXNetR, Tensorflow, H2O, Keras, and text2vec
  • Practical projects that show you how to implement different neural networks with helpful tips, tricks, and best practices

Who This Book Is For

Machine learning professionals and data scientists looking to master deep learning by implementing practical projects in R will find this book a useful resource. A knowledge of R programming and the basic concepts of deep learning is required to get the best out of this book.

What You Will Learn

  • Instrument Deep Learning models with packages such as deepnet, MXNetR, Tensorflow, H2O, Keras, and text2vec
  • Apply neural networks to perform handwritten digit recognition using MXNet
  • Get the knack of CNN models, Neural Network API, Keras, and TensorFlow for traffic sign classification
  • Implement credit card fraud detection with Autoencoders
  • Master reconstructing images using variational autoencoders
  • Wade through sentiment analysis from movie reviews
  • Run from past to future and vice versa with bidirectional Long Short-Term Memory (LSTM) networks
  • Understand the applications of Autoencoder Neural Networks in clustering and dimensionality reduction

In Detail

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.

Style and approach

This book's unique, learn-as-you-do approach ensures the reader builds on his understanding of deep learning progressively with each project. This book is designed in such a way that implementing each project will empower you with a unique skillset and enable you to implement the next project more confidently.

Downloading the example code for this book You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you.

Table of Contents

  1. Title Page
  2. Copyright and Credits
    1. R Deep Learning Projects
  3. Packt Upsell
    1. Why subscribe?
    2. PacktPub.com
  4. Contributors
    1. About the authors
    2. About the reviewer
    3. Packt is searching for authors like you
  5. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
      1. Download the example code files
      2. Conventions used
    4. Get in touch
      1. Reviews
  6. Handwritten Digit Recognition Using Convolutional Neural Networks
    1. What is deep learning and why do we need it?
      1. What makes deep learning special?
      2. What are the applications of deep learning?
    2. Handwritten digit recognition using CNNs
      1. Get started with exploring MNIST
      2. First attempt – logistic regression
      3. Going from logistic regression to single-layer neural networks
      4. Adding more hidden layers to the networks
      5. Extracting richer representation with CNNs
    3. Summary
  7. Traffic Sign Recognition for Intelligent Vehicles
    1. How is deep learning applied in self-driving cars?
      1. How does deep learning become a state-of-the-art solution?
    2. Traffic sign recognition using CNN
      1. Getting started with exploring GTSRB
      2. First solution – convolutional neural networks using MXNet
      3. Trying something new – CNNs using Keras with TensorFlow
      4. Reducing overfitting with dropout
    3. Dealing with a small training set – data augmentation
    4. Reviewing methods to prevent overfitting in CNNs
    5. Summary
  8. Fraud Detection with Autoencoders
    1. Getting ready
      1. Installing Keras and TensorFlow for R
      2. Installing H2O
    2. Our first examples
      1. A simple 2D example
      2. Autoencoders and MNIST
      3. Outlier detection in MNIST
    3. Credit card fraud detection with autoencoders
      1. Exploratory data analysis
      2. The autoencoder approach – Keras
      3. Fraud detection with H2O
      4. Exercises
    4. Variational Autoencoders
      1. Image reconstruction using VAEs
      2. Outlier detection in MNIST
    5. Text fraud detection
      1. From unstructured text data to a matrix
      2. From text to matrix representation — the Enron dataset
      3. Autoencoder on the matrix representation
      4. Exercises
    6. Summary
  9. Text Generation Using Recurrent Neural Networks
    1. What is so exciting about recurrent neural networks?
      1. But what is a recurrent neural network, really?
      2. LSTM and GRU networks
        1. LSTM
        2. GRU
    2. RNNs from scratch in R
      1. Classes in R with R6
        1. Perceptron as an R6 class
        2. Logistic regression
        3. Multi-layer perceptron
      2. Implementing a RNN
        1. Implementation as an R6 class
        2. Implementation without R6
        3. RNN without derivatives — the cross-entropy method
    3. RNN using Keras
      1. A simple benchmark implementation
      2. Generating new text from old
      3. Exercises
    4. Summary
  10. Sentiment Analysis with Word Embeddings
    1. Warm-up – data exploration
      1. Working with tidy text
      2. The more, the merrier – calculating n-grams instead of single words
    2. Bag of words benchmark
      1. Preparing the data
      2. Implementing a benchmark – logistic regression 
      3. Exercises
    3. Word embeddings
      1. word2vec
      2. GloVe
    4. Sentiment analysis from movie reviews
      1. Data preprocessing
      2. From words to vectors
      3. Sentiment extraction
      4. The importance of data cleansing
      5. Vector embeddings and neural networks
      6. Bi-directional LSTM networks
      7. Other LSTM architectures
      8. Exercises
    5. Mining sentiment from Twitter
      1. Connecting to the Twitter API
      2. Building our model
        1. Exploratory data analysis
        2. Using a trained model
    6. Summary
  11. Other Books You May Enjoy
    1. Leave a review - let other readers know what you think