feat: Add layered architecture visualization#22780
Open
AlanPonnachan wants to merge 2 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces layered_view, a new visualization tool for Keras models that renders architecture diagrams using aggdraw and Pillow. The implementation includes lazy loading for dependencies and comprehensive tests. Feedback focuses on ensuring the visualization accurately represents non-linear model topologies, adhering to Keras API design guidelines regarding argument count and docstring formatting (including missing Arguments and Example sections), improving error message clarity for unbuilt models, and using more robust introspection for the text_callable argument.
Contributor
Author
|
@hertschuh Could you please take a look at this? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR introduces
keras.visualization.layered_view(), a new built-in visualization feature that renders Keras models as highly customizable 3D isometric block diagrams. This provides an "at a glance" understanding of model architectures, complementing the existing 2Dplot_modelutility.Related issue #21421.
Usage Example
Example outputs
Default 3D View with funnels

2D Flat Mode

3D View without Funnels

Adding a Legend

Custom Text

Custom Color Map and Spacing

Contributor Agreement