config_optimizer | R Documentation |
Helps you create custom optimizer for dnn
. It is recommended to set learning rate in dnn
.
config_optimizer(
type = c("adam", "adadelta", "adagrad", "rmsprop", "rprop", "sgd"),
verbose = FALSE,
...
)
type |
character string defining which optimizer should be used. See Details. |
verbose |
If TRUE, additional information about scheduler will be printed to console |
... |
additional arguments to be passed to optimizer. See Details. |
different optimizer need different variables, this function will tell you how the variables are set. For more information see the corresponding functions:
adam: optim_adam
adadelta: optim_adadelta
adagrad: optim_adagrad
rmsprop: optim_rmsprop
rprop: optim_rprop
sgd: optim_sgd
object of class cito_optim to give to dnn
if(torch::torch_is_installed()){
library(cito)
# create optimizer object
opt <- config_optimizer(type = "adagrad",
lr_decay = 1e-04,
weight_decay = 0.1,
verbose = TRUE)
# Build and train Network
nn.fit<- dnn(Sepal.Length~., data = datasets::iris, optimizer = opt)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.