R Deep Learning Essentials

Book description

Implement neural network models in R 3.5 using TensorFlow, Keras, and MXNet

Key Features

  • Use R 3.5 for building deep learning models for computer vision and text
  • Apply deep learning techniques in cloud for large-scale processing
  • Build, train, and optimize neural network models on a range of datasets

Book Description

Deep learning is a powerful subset of machine learning that is very successful in domains such as computer vision and natural language processing (NLP). This second edition of R Deep Learning Essentials will open the gates for you to enter the world of neural networks by building powerful deep learning models using the R ecosystem.

This book will introduce you to the basic principles of deep learning and teach you to build a neural network model from scratch. As you make your way through the book, you will explore deep learning libraries, such as Keras, MXNet, and TensorFlow, and create interesting deep learning models for a variety of tasks and problems, including structured data, computer vision, text data, anomaly detection, and recommendation systems. You'll cover advanced topics, such as generative adversarial networks (GANs), transfer learning, and large-scale deep learning in the cloud. In the concluding chapters, you will learn about the theoretical concepts of deep learning projects, such as model optimization, overfitting, and data augmentation, together with other advanced topics.

By the end of this book, you will be fully prepared and able to implement deep learning concepts in your research work or projects.

What you will learn

  • Build shallow neural network prediction models
  • Prevent models from overfitting the data to improve generalizability
  • Explore techniques for finding the best hyperparameters for deep learning models
  • Create NLP models using Keras and TensorFlow in R
  • Use deep learning for computer vision tasks
  • Implement deep learning tasks, such as NLP, recommendation systems, and autoencoders

Who this book is for

This second edition of R Deep Learning Essentials is for aspiring data scientists, data analysts, machine learning developers, and deep learning enthusiasts who are well versed in machine learning concepts and are looking to explore the deep learning paradigm using R. Fundamental understanding of the R language is necessary to get the most out of this book.

Table of contents

  1. Title Page
  2. Copyright and Credits
    1. R Deep Learning Essentials Second Edition
  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. Download the color images
      3. Conventions used
    4. Get in touch
      1. Reviews
  6. Getting Started with Deep Learning
    1. What is deep learning?
    2. A conceptual overview of neural networks
      1. Neural networks as an extension of linear regression
      2. Neural networks as a network of memory cells
    3. Deep neural networks
    4. Some common myths about deep learning
    5. Setting up your R environment
      1. Deep learning frameworks for R
        1. MXNet
        2. Keras
      2. Do I need a GPU (and what is it, anyway)?
      3. Setting up reproducible results
    6. Summary
  7. Training a Prediction Model
    1. Neural networks in R
      1. Building neural network models
      2. Generating predictions from a neural network
    2. The problem of overfitting data – the consequences explained
    3. Use case – building and applying a neural network
    4. Summary
  8. Deep Learning Fundamentals
    1. Building neural networks from scratch in R
      1. Neural network web application
      2. Neural network code
      3. Back to deep learning
        1. The symbol, X, y, and ctx parameters
        2. The num.round and begin.round parameters
        3. The optimizer parameter
        4. The initializer parameter
        5. The eval.metric and eval.data parameters
        6. The epoch.end.callback parameter
        7. The array.batch.size parameter
    2. Using regularization to overcome overfitting
      1. L1 penalty
        1. L1 penalty in action
      2. L2 penalty
        1. L2 penalty in action
        2. Weight decay (L2 penalty in neural networks)
      3. Ensembles and model-averaging
    3. Use case – improving out-of-sample model performance using dropout
    4. Summary
  9. Training Deep Prediction Models
    1. Getting started with deep feedforward neural networks
    2. Activation functions
    3. Introduction to the MXNet deep learning library
      1. Deep learning layers
      2. Building a deep learning model
    4. Use case – using MXNet for classification and regression
      1. Data download and exploration
      2. Preparing the data for our models
      3. The binary classification model
      4. The regression model
      5. Improving the binary classification model
      6. The unreasonable effectiveness of data
    5. Summary
  10. Image Classification Using Convolutional Neural Networks
    1. CNNs
    2. Convolutional layers
      1. Pooling layers
      2. Dropout
      3. Flatten layers, dense layers, and softmax
    3. Image classification using the MXNet library
      1. Base model (no convolutional layers)
      2. LeNet
      3. Classification using the fashion MNIST dataset
    4. References/further reading
    5. Summary
  11. Tuning and Optimizing Models
    1. Evaluation metrics and evaluating performance
      1. Types of evaluation metric
      2. Evaluating performance
    2. Data preparation
      1. Different data distributions
      2. Data partition between training, test, and validation sets
      3. Standardization
      4. Data leakage
    3. Data augmentation
      1. Using data augmentation to increase the training data
        1. Test time augmentation
      2. Using data augmentation in deep learning libraries
    4. Tuning hyperparameters
      1. Grid search
      2. Random search
    5. Use case—using LIME for interpretability
      1. Model interpretability with LIME
    6. Summary
  12. Natural Language Processing Using Deep Learning
    1. Document classification
      1. The Reuters dataset
      2. Traditional text classification
      3. Deep learning text classification
      4. Word vectors
      5. Comparing traditional text classification and deep learning
    2. Advanced deep learning text classification
      1. 1D convolutional neural network model
      2. Recurrent neural network model
      3. Long short term memory model
      4. Gated Recurrent Units model
      5. Bidirectional LSTM model
      6. Stacked bidirectional model
      7. Bidirectional with 1D convolutional neural network model
      8. Comparing the deep learning NLP architectures
    3. Summary
  13. Deep Learning Models Using TensorFlow in R
    1. Introduction to the TensorFlow library
      1. Using TensorBoard to visualize deep learning networks
    2. TensorFlow models
      1. Linear regression using TensorFlow
      2. Convolutional neural networks using TensorFlow
    3. TensorFlow estimators and TensorFlow runs packages
      1. TensorFlow estimators
      2. TensorFlow runs package
    4. Summary
  14. Anomaly Detection and Recommendation Systems
    1. What is unsupervised learning?
    2. How do auto-encoders work?
      1. Regularized auto-encoders
        1. Penalized auto-encoders
        2. Denoising auto-encoders
    3. Training an auto-encoder in R
      1. Accessing the features of the auto-encoder model
    4. Using auto-encoders for anomaly detection
    5. Use case – collaborative filtering
      1. Preparing the data
      2. Building a collaborative filtering model
      3. Building a deep learning collaborative filtering model
      4. Applying the deep learning model to a business problem
    6. Summary
  15. Running Deep Learning Models in the Cloud
    1. Setting up a local computer for deep learning
      1. How do I know if my model is training on a GPU?
    2. Using AWS for deep learning
      1. A brief introduction to AWS
      2. Creating a deep learning GPU instance in AWS
      3. Creating a deep learning AMI in AWS
    3. Using Azure for deep learning
    4. Using Google Cloud for deep learning
    5. Using Paperspace for deep learning
    6. Summary
  16. The Next Level in Deep Learning
    1. Image classification models
      1. Building a complete image classification solution
        1. Creating the image data
        2. Building the deep learning model
        3. Using the saved deep learning model
      2. The ImageNet dataset
      3. Loading an existing model
      4. Transfer learning
    2. Deploying TensorFlow models
    3. Other deep learning topics
      1. Generative adversarial networks
      2. Reinforcement learning
    4. Additional deep learning resources
    5. Summary
  17. Other Books You May Enjoy
    1. Leave a review - let other readers know what you think

Product information

  • Title: R Deep Learning Essentials
  • Author(s): Mark Hodnett, Joshua F. Wiley
  • Release date: August 2018
  • Publisher(s): Packt Publishing
  • ISBN: 9781788992893