Hands-On Deep Learning with R

Book description

Explore and implement deep learning to solve various real-world problems using modern R libraries such as TensorFlow, MXNet, H2O, and Deepnet

Key Features

  • Understand deep learning algorithms and architectures using R and determine which algorithm is best suited for a specific problem
  • Improve models using parameter tuning, feature engineering, and ensembling
  • Apply advanced neural network models such as deep autoencoders and generative adversarial networks (GANs) across different domains

Book Description

Deep learning enables efficient and accurate learning from a massive amount of data. This book will help you overcome a number of challenges using various deep learning algorithms and architectures with R programming.

This book starts with a brief overview of machine learning and deep learning and how to build your first neural network. You'll understand the architecture of various deep learning algorithms and their applicable fields, learn how to build deep learning models, optimize hyperparameters, and evaluate model performance. Various deep learning applications in image processing, natural language processing (NLP), recommendation systems, and predictive analytics will also be covered. Later chapters will show you how to tackle recognition problems such as image recognition and signal detection, programmatically summarize documents, conduct topic modeling, and forecast stock market prices. Toward the end of the book, you will learn the common applications of GANs and how to build a face generation model using them. Finally, you'll get to grips with using reinforcement learning and deep reinforcement learning to solve various real-world problems.

By the end of this deep learning book, you will be able to build and deploy your own deep learning applications using appropriate frameworks and algorithms.

What you will learn

  • Design a feedforward neural network to see how the activation function computes an output
  • Create an image recognition model using convolutional neural networks (CNNs)
  • Prepare data, decide hidden layers and neurons and train your model with the backpropagation algorithm
  • Apply text cleaning techniques to remove uninformative text using NLP
  • Build, train, and evaluate a GAN model for face generation
  • Understand the concept and implementation of reinforcement learning in R

Who this book is for

This book is for data scientists, machine learning engineers, and deep learning developers who are familiar with machine learning and are looking to enhance their knowledge of deep learning using practical examples. Anyone interested in increasing the efficiency of their machine learning applications and exploring various options in R will also find this book useful. Basic knowledge of machine learning techniques and working knowledge of the R programming language is expected.

Publisher resources

Download Example Code

Table of contents

  1. Title Page
  2. Copyright and Credits
    1. Hands-On Deep Learning with R
  3. Dedication
  4. About Packt
    1. Why subscribe?
  5. Contributors
    1. About the authors
    2. About the reviewers
    3. Packt is searching for authors like you
  6. 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
  7. Section 1: Deep Learning Basics
  8. Machine Learning Basics
    1. An overview of machine learning
    2. Preparing data for modeling
      1. Handling missing values
    3. Training a model on prepared data
      1. Train and test data
      2. Choosing an algorithm
    4. Evaluating model results
      1. Machine learning metrics
    5. Improving model results
    6. Reviewing different algorithms
    7. Summary
  9. Setting Up R for Deep Learning
    1. Technical requirements
    2. Installing the packages
      1. Installing ReinforcementLearning
      2. Installing RBM
      3. Installing Keras
      4. Installing H2O
      5. Installing MXNet
    3. Preparing a sample dataset
    4. Exploring Keras
      1. Available functions
      2. A Keras example
    5. Exploring MXNet
      1. Available functions
      2. Getting started with MXNet
    6. Exploring H2O
      1. Available functions
      2. An H2O example
    7. Exploring ReinforcementLearning and RBM
      1. Reinforcement learning example
      2. An RBM example
    8. Comparing the deep learning libraries
    9. Summary
  10. Artificial Neural Networks
    1. Technical requirements
    2. Contrasting deep learning with machine learning
    3. Comparing neural networks and the human brain
    4. Utilizing bias and activation functions within hidden layers
    5. Surveying activation functions
      1. Exploring the sigmoid function
      2. Investigating the hyperbolic tangent function
      3. Plotting the rectified linear units activation function
      4. Calculating the Leaky ReLU activation function
      5. Defining the swish activation function
        1. Predicting class likelihood with softmax
    6. Creating a feedforward network
      1. Writing a neural network with Base R
      2. Creating a model with Wisconsin cancer data
    7. Augmenting our neural network with backpropagation
    8. Summary
  11. Section 2: Deep Learning Applications
  12. CNNs for Image Recognition
    1. Technical requirements
    2. Image recognition with shallow nets
    3. Image recognition with convolutional neural networks
      1. Optimizers
      2. Loss functions
      3. Evaluation metrics
    4. Enhancing the model with additional layers
    5. Choosing the most appropriate activation function
    6. Selecting optimal epochs using dropout and early stopping
    7. Summary
  13. Multilayer Perceptron for Signal Detection
    1. Technical requirements
    2. Understanding multilayer perceptrons
    3. Preparing and preprocessing data
    4. Deciding on the hidden layers and neurons
    5. Training and evaluating the model
    6. Summary
  14. Neural Collaborative Filtering Using Embeddings
    1. Technical requirements
    2. Introducing recommender systems
    3. Collaborative filtering with neural networks
    4. Exploring embeddings
    5. Preparing, preprocessing, and exploring data
    6. Performing exploratory data analysis
    7. Creating user and item embeddings
    8. Building and training a neural recommender system
    9. Evaluating results and tuning hyperparameters
      1. Hyperparameter tuning
      2. Adding dropout layers
      3. Adjusting for user-item bias
    10. Summary
  15. Deep Learning for Natural Language Processing
    1. Formatting data using tokenization
    2. Cleaning text to remove noise
    3. Applying word embeddings to increase usable data
    4. Clustering data into topic groups
    5. Summarizing documents using model results
    6. Creating an RBM
    7. Defining the Gibbs sampling rate
    8. Speeding up sampling with contrastive divergence
    9. Computing free energy for model evaluation
    10. Stacking RBMs to create a deep belief network
    11. Summary
  16. Long Short-Term Memory Networks for Stock Forecasting
    1. Technical requirements
    2. Understanding common methods for stock market prediction
    3. Preparing and preprocessing data
    4. Configuring a data generator
    5. Training and evaluating the model
    6. Tuning hyperparameters to improve performance
    7. Summary
  17. Generative Adversarial Networks for Faces
    1. Technical requirements
    2. An overview of GANs
    3. Defining the generator model
    4. Defining the discriminator model
    5. Preparing and preprocessing a dataset
      1. Loading the libraries and data files
      2. Resizing our images
      3. Merging arrays
    6. Training and evaluating the model
      1. Defining the GAN model
      2. Passing data to the GAN model
      3. Training the GAN model
        1. Generating random images
        2. Selecting real images
        3. Combining real and fake images
        4. Creating target labels
        5. Passing input to the discriminator model
        6. Updating the row selector
        7. Evaluating the model
    7. Summary
  18. Section 3: Reinforcement Learning
  19. Reinforcement Learning for Gaming
    1. Technical requirements
    2. Understanding the concept of reinforcement learning
    3. Preparing and processing data
    4. Configuring the reinforcement agent
    5. Tuning hyperparameters
    6. Summary
  20. Deep Q-Learning for Maze Solving
    1. Technical requirements
    2. Creating an environment for reinforcement learning
    3. Defining an agent to perform actions
    4. Building a deep Q-learning model
    5. Running the experiment
    6. Improving performance with policy functions
    7. Summary
  21. Other Books You May Enjoy
    1. Leave a review - let other readers know what you think

Product information

  • Title: Hands-On Deep Learning with R
  • Author(s): Michael Pawlus, Rodger Devine
  • Release date: April 2020
  • Publisher(s): Packt Publishing
  • ISBN: 9781788996839