## Example for deep learning for glm models
set.seed(101)
### define model layers
model = dNNmodel(units = c(4, 3, 1), activation = c("elu", "sigmoid", "sigmoid"),
input_shape = 3)
x = matrix(runif(15), nrow = 5, ncol = 3)
y = exp(x[, 1] + rnorm(5))
fit = deepGlm(y ~ x, model, family = "gaussian")
Run the code above in your browser using DataLab