Skip to Content
R Deep Learning Essentials - Second Edition
book

R Deep Learning Essentials - Second Edition

by Mark Hodnett, Joshua F. Wiley
August 2018
Intermediate to advanced
378 pages
9h 9m
English
Packt Publishing
Content preview from R Deep Learning Essentials - Second Edition

Flatten layers, dense layers, and softmax

After applying multiple convolutional layers, the resulting data structure is a multi-dimensional matrix (or tensor). We must transform this into a matrix that is in the shape of the required output. For example, if our classification task has 10 classes (for example, 10 for the MNIST example), we need the output of the model to be a 1 x 10 matrix. We do this by taking the results of our convolutional and max-pooling layers and using a Flatten layer to reshape the data. The last layer should have the same number of nodes as the number of classes we wish to predict for. If our task is binary classification, the activation function in our last layer will be sigmoid. If our task is binary classification, ...

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

R Deep Learning Cookbook

R Deep Learning Cookbook

PKS Prakash, Achyutuni Sri Krishna Rao
Hands-On Deep Learning with R

Hands-On Deep Learning with R

Rodger Devine, Michael Pawlus
R: Unleash Machine Learning Techniques

R: Unleash Machine Learning Techniques

Raghav Bali, Dipanjan Sarkar, Brett Lantz, Cory Lesmeister
Deep Learning with R Cookbook

Deep Learning with R Cookbook

Swarna Gupta, Rehan Ali Ansari, Dipayan Sarkar

Publisher Resources

ISBN: 9781788992893Supplemental Content