if (FALSE) {
library(keras)
py_require_legacy_keras()
input_shape <- c(28, 28, 1)
encoded_shape <- 2
n <- 2
model <- keras_model_sequential(
list(
layer_input(shape = input_shape),
layer_flatten(),
layer_dense(units = n),
layer_dense(units = params_size_independent_normal(encoded_shape)),
layer_independent_normal(event_shape = encoded_shape)
)
)
}
Run the code above in your browser using DataLab