-
Notifications
You must be signed in to change notification settings - Fork 19.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add assert statement to check model structure on model_visualization_test #20208
Add assert statement to check model structure on model_visualization_test #20208
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #20208 +/- ##
=======================================
Coverage 79.36% 79.37%
=======================================
Files 501 501
Lines 47380 47435 +55
Branches 8706 8710 +4
=======================================
+ Hits 37604 37652 +48
- Misses 8015 8020 +5
- Partials 1761 1763 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
model = keras.Model(inputs, outputs) | ||
|
||
edge_dict = get_edge_dict(model_to_dot(model)) | ||
|
||
assert edge_dict["input_1 (InputLayer)"] == "dense_3 (Dense)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Such statements should be made via self.assertEqual
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated the source code as your advice.
Additionally, I removed the main statement also, since, I think it can be replaced by just running ModelVisualizationTest class by pytest.
@fchollet Ok. After resoling this MR,I will look into that issue. Thanks. |
To verify the model's structure, I added a method that parses the model into a dictionary and included an assert statement to validate it.
Additionally, I assigned fixed names to each layer in the model to ensure consistency when referencing them.