Just adding my two cents, but it could be really useful to write a helper function that accepts as an argument a keras/tensorflow model object and converts the architecture to the necessary data frame format needed to plot the neural network with ggplot. Allowing users to recycle their model object directly to form a plot would be appealing, I think.
An example pipeline could be:
model <-
keras_model_sequential() %>%
layer_dense(units = 12, input_shape = c(12)) %>%
layer_dense(units = 1)
model_architecture <- helper_function(model)
model_architecture %>%
ggplot(...)
Basically convert the below structure to a data.frame or tibble. I haven't though through the implementation much, just a random thought.
Model
________________________________________________________________
Layer (type) Output Shape Param #
================================================================
dense_1 (Dense) (None, 12) 156
________________________________________________________________
dense_2 (Dense) (None, 1) 13
================================================================
Total params: 169
Trainable params: 169
Non-trainable params: 0
________________________________________________________________