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] Mix 3D and 2D #40

Closed cosminmarina closed 1 year ago

cosminmarina commented 1 year ago

Hi!

I use this package since some time and I love it. In one of my last projects I had to visualize and show to others my Keras model, but for the sake of clarity, I needed to mix 3D and 2D projection for some specific layers.

In local, I changed the layered.py file to solve my problem and add this new functionality. So now, with my change, the layered_view method has a new parameter called index_2D. This is a list (empty by default) which, in case of draw_volume=True (default), the indexed specified in this list will be drawn in 2D.

Also, I add the docstring of the parameter following the standard of the function.

So now this happen:

visualkeras.layered_view(model, legend=True, font=font, one_dim_orientation='y', index_2D=[16], max_xy=100)

encoder

I has wondering if this could be useful to others? If yes, I will push a new branch with the change and make a Pull Request.

github-actions[bot] commented 1 year ago

Stale issue message