Skip to Content
R Deep Learning Cookbook
book

R Deep Learning Cookbook

by PKS Prakash, Achyutuni Sri Krishna Rao
August 2017
Intermediate to advanced
288 pages
8h 6m
English
Packt Publishing
Content preview from R Deep Learning Cookbook

How to do it...

  1. The MNIST dataset is used to demonstrate the concept of sparse decomposition. The MNIST dataset uses handwritten digits. It is downloaded from the tensorflow dataset library. The dataset consists of handwritten images of 28 x 28 pixels. It consists of 55,000 training examples, 10,000 test examples, and 5,000 test examples. The dataset can be downloaded from the tensorflow library using the following script:
library(tensorflow)datasets <- tf$contrib$learn$datasetsmnist <- datasets$mnist$read_data_sets("MNIST-data", one_hot = TRUE) 
  1. For computational simplicity, the MNIST image size is reduced from 28 x 28 pixels to 16 x 16 pixels using the following function:
# Function to reduce image sizereduceImage<-function(actds, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Deep Learning with R Cookbook

Deep Learning with R Cookbook

Swarna Gupta, Rehan Ali Ansari, Dipayan Sarkar
The Deep Learning with Keras Workshop

The Deep Learning with Keras Workshop

Matthew Moocarme, Mahla Abdolahnejad, Ritesh Bhagwat
Deep Learning for Chest Radiographs

Deep Learning for Chest Radiographs

Yashvi Chandola, Jitendra Virmani, H.S Bhadauria, Papendra Kumar

Publisher Resources

ISBN: 9781787121089Supplemental Content