paulgavrikov / visualkeras

Visualkeras is a Python package to help visualize Keras (either standalone or included in TensorFlow) neural network architectures. It allows easy styling to fit most needs. This module supports layered style architecture generation which is great for CNNs (Convolutional Neural Networks), and a graph style architecture, which works great for most models including plain feed-forward networks.
MIT License
582 stars 67 forks source link

[REQUEST] Option to display the output dimensions of the layers #43

Closed JoeSykesNHS closed 11 months ago

JoeSykesNHS commented 1 year ago

Describe the solution you'd like It would be nice if the graph could display the output sizes of the layers. This would then mean that the architecture would not need to also be saved using plot_model from keras.utils.

Describe alternatives you've considered The current alternative is to save the graph produced by visualkeras and also an architecture diagram produced by plot_model.

Additional context something similar to the image below, but just the dimension sizes. image

github-actions[bot] commented 11 months ago

Stale issue message

thegodone commented 1 month ago

Is this is possible now ? and how ?

Soontosh commented 1 month ago

@thegodone Yes, this is possible now. Take a look at the README for more information: https://github.com/paulgavrikov/visualkeras?tab=readme-ov-file#drawing-information-text

Doing this requires you to pass in a custom-made callable function. You should configure this function to return whatever information (as a string) that you'd like to be displayed under (or above) each layer.

You'll probably want to play around with the font, padding (mainly those two arguments, but others as well if needed) to get a professional looking output image.

Let me know if you have any more questions.