|
33 | 33 | #' @param hidden_units An integer for the number of hidden units, or a vector |
34 | 34 | #' of integers. If a vector of integers, the model will have `length(hidden_units)` |
35 | 35 | #' 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 |
37 | 37 | #' "relu", "tanh", "sigmoid", and so on). See [brulee_activations()] for |
38 | 38 | #' a list of possible values. If `hidden_units` is a vector, `activation` |
39 | 39 | #' can be a character vector with length equals to `length(hidden_units)` |
|
185 | 185 | #' bind_cols(ames_test) %>% |
186 | 186 | #' rmse(Sale_Price, .pred) |
187 | 187 | #' |
| 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) |
188 | 197 | #' |
189 | 198 | #' # ------------------------------------------------------------------------------ |
190 | 199 | #' # classification |
|
0 commit comments