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

Grid search

For more information on tuning hyper-parameters, see Bengio, Y. (2012), particularly Section 3, Hyperparameters, which discusses the selection and characteristics of various hyper-parameters. Aside from manual trial and error, two other approaches for improving hyper-parameters are grid searches and random searches. In a grid search, several values for hyper-parameters are specified and all possible combinations are tried. This is perhaps easiest to see. In R, we can use the expand.grid() function to create all possible combinations of variables:

expand.grid( layers=c(1,4), lr=c(0.01,0.1,0.5,1.0), l1=c(0.1,0.5))   layers    lr   l11       1  0.01  0.12       4  0.01  0.13       1  0.10  0.14       4  0.10  0.15       1  0.50  0.16       4  0.50  0.17       1  1.00  0.18       4  1.00  0.19 1 0.01 ...
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