plot_model {ttgsea} | R Documentation |
You are allowed to create a visualization of your model architecture. This architecture displays the information about the name, input shape, and output shape of layers in a flowchart.
plot_model(x)
x |
deep learning model |
plot for the model architecture
Dongmin Jung
purrr::map, purrr::map_chr, purrr::pluck, purrr::imap_dfr, DiagrammeR::grViz
library(reticulate) if (keras::is_keras_available() & reticulate::py_available()) { inputs1 <- layer_input(shape = c(1000)) inputs2 <- layer_input(shape = c(1000)) predictions1 <- inputs1 %>% layer_dense(units = 128, activation = 'relu') %>% layer_dense(units = 64, activation = 'relu') %>% layer_dense(units = 32, activation = 'softmax') predictions2 <- inputs2 %>% layer_dense(units = 128, activation = 'relu') %>% layer_dense(units = 64, activation = 'relu') %>% layer_dense(units = 32, activation = 'softmax') combined <- layer_concatenate(c(predictions1, predictions2)) %>% layer_dense(units = 16, activation = 'softmax') model <- keras_model(inputs = c(inputs1, inputs2), outputs = combined) plot_model(model) }