Description Usage Arguments Details Value Examples
View source: R/py_dropout_model.R
Wrapper for python function. Model requires fixed training mode (else dropout turned off automatically during testing and changing dropout rate has no effect)
1 | py_dropout_model(model, dropout = 0.1)
|
model |
Keras model, required |
dropout |
new dropout rate |
Currently requires python warnings wrapper to suppress tensorflow warning
Keras model
1 2 3 4 5 6 7 8 9 10 11 12 13 | # Load Model with permanently activated dropout and generate test data
model <- keras::load_model_hdf5(
system.file("tinytest_data/simple_rnn_dropout.hdf5", package = "tsRNN")
)
test <- array(runif(18, 0.1, 3), dim = c(6L, 2L, 1L))
# 1. Deactivate dropout for testing
model_01 <- py_dropout_model(model, 0)
model_01(test)
# 2. Change dropout level
model_02 <- py_dropout_model(model, 0.8)
model_02(test)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.