Book Image

Hands-On Deep Learning with R

By : Michael Pawlus, Rodger Devine
Book Image

Hands-On Deep Learning with R

By: Michael Pawlus, Rodger Devine

Overview of this book

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.
Table of Contents (16 chapters)
1
Section 1: Deep Learning Basics
5
Section 2: Deep Learning Applications
12
Section 3: Reinforcement Learning

To get the most out of this book

We assume you are comfortable and have a working familiarity with downloading and installing software on your computer, including R and additional R library packages from CRAN or GitHub. We also assume some baseline familiarity with independently troubleshooting and resolving packaging dependencies (as needed) based on R Studio console output. You will need a version of R and R Studio installed on your computer—the latest version, if possible.

All code examples have been tested using R version 3.6.3 on macOS X 10.11 (El Capitan) and higher. This code should work with future version releases, too, although this may require some of the deep learning R software packages listed in Chapter 2Setting Up R for Deep Learning, to be updated.

Hardware/software covered in the book

OS requirements

64-bit for Intel Mac

macOS X 10.11 (El Capitan) and higher

R version 3.6.3 

macOS X 10.11 (El Capitan) and higher

R Studio Desktop 1.2.5033 (Orange Blossom 330255dd)

R version 3.0.1+

 

Once you have installed R (https://www.r-project.org) and R Studio Desktop (https://rstudio.com/products/rstudio/download/) on your computer, you should be ready to install the additional deep learning software packages outlined in Chapter 2, Setting Up R for Deep Learning.

If you are using the digital version of this book, we advise you to type the code yourself or access the code via the GitHub repository (link available in the next section). Doing so will help you avoid any potential errors related to the copying and pasting of code.

Download the example code files

You can download the example code files for this book from your account at www.packt.com. If you purchased this book elsewhere, you can visit www.packtpub.com/support and register to have the files emailed directly to you.

You can download the code files by following these steps:

  1. Log in or register at www.packt.com.
  2. Select the Support tab.
  3. Click on Code Downloads.
  4. Enter the name of the book in the Search box and follow the onscreen instructions.

Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:

  • WinRAR/7-Zip for Windows
  • Zipeg/iZip/UnRarX for Mac
  • 7-Zip/PeaZip for Linux

The code bundle for the book is also hosted on GitHub at https://github.com/PacktPublishing/Hands-on-Deep-Learning-with-RIn case there's an update to the code, it will be updated on the existing GitHub repository.

We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Download the color images

Conventions used

There are a number of text conventions used throughout this book.

CodeInText: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: "The linear_fits function is then used again to draw one more line."

A block of code is set as follows:

linear_fits <- function(w, to_add = TRUE, line_type = 1) {curve(-w[1] / w[2] * x - w[3] / w[2], xlim = c(-1, 2), ylim = c(-1, 2), col = "black",lty = line_type, lwd = 2, xlab = "Input Value A", ylab = "Input Value B", add = to_add)}

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

results <- softmax(c(2,3,6,9))
results

[1] 0.0008658387 0.0023535935 0.0472731888 0.9495073791

Bold: Indicates a new term, an important word, or words that you see on screen. For example, words in menus or dialog boxes appear in the text like this. Here is an example: "One potential problem with ReLU is known as dying ReLU, where, since the function assigns a zero value to all negative values, signals can get dropped completely before reaching the output node."

Warnings or important notes appear like this.
Tips and tricks appear like this.