Skip to content

Commit 9b01415

Browse files
authored
Example using multiple hidden layers (#79)
1 parent b0a5684 commit 9b01415

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

R/mlp-fit.R

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
#' @param hidden_units An integer for the number of hidden units, or a vector
3434
#' of integers. If a vector of integers, the model will have `length(hidden_units)`
3535
#' layers each with `hidden_units[i]` hidden units.
36-
#' @param activation A character vector for the activation function )such as
36+
#' @param activation A character vector for the activation function (such as
3737
#' "relu", "tanh", "sigmoid", and so on). See [brulee_activations()] for
3838
#' a list of possible values. If `hidden_units` is a vector, `activation`
3939
#' can be a character vector with length equals to `length(hidden_units)`
@@ -185,6 +185,15 @@
185185
#' bind_cols(ames_test) %>%
186186
#' rmse(Sale_Price, .pred)
187187
#'
188+
#' # Using multiple hidden layers and activation functions
189+
#' set.seed(2)
190+
#' hidden_fit <- brulee_mlp(ames_rec, data = ames_train,
191+
#' hidden_units = c(15L, 17L), activation = c("relu", "elu"),
192+
#' dropout = 0.05, rate_schedule = "cyclic", step_size = 4)
193+
#'
194+
#' predict(hidden_fit, ames_test) %>%
195+
#' bind_cols(ames_test) %>%
196+
#' rmse(Sale_Price, .pred)
188197
#'
189198
#' # ------------------------------------------------------------------------------
190199
#' # classification

0 commit comments

Comments
 (0)