Neural network code

While the web application is useful to see the output of the neural network, we can also run the code for the neural network to really see how it works. The code in Chapter3/nnet.R allows us to do just that. This code has the same hyper-parameters as in the web application; this file allows you to run the neural network from the RStudio IDE. The following is the code that loads the data and sets the initial hyper-parameters for the neural network:

source("nnet_functions.R")data_sel <- "bulls_eye"........####################### neural network ######################hidden <- 3epochs <- 3000lr <- 0.5activation_ftn <- "sigmoid"df <- getData(data_sel) # from nnet_functionsX <- as.matrix(df[,1:2])Y <- as.matrix(df$Y)n_x=ncol(X) ...

Get Deep Learning with R for Beginners now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.