Skip to content
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 optimizer weights to the model summary. #859

Merged
merged 5 commits into from
Sep 11, 2023

Conversation

qlzh727
Copy link
Member

@qlzh727 qlzh727 commented Sep 9, 2023

The sample output with optimizer weights is like below:

Model: "language_model"
┏━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━┓
┃ Layer (type)        ┃ Output Shape      ┃ Param # ┃ Connected to         ┃
┡━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━┩
│ padding_mask        │ (None, None)      │       0 │ -                    │
│ (InputLayer)        │                   │         │                      │
├─────────────────────┼───────────────────┼─────────┼──────────────────────┤
│ token_ids           │ (None, None)      │       0 │ -                    │
│ (InputLayer)        │                   │         │                      │
├─────────────────────┼───────────────────┼─────────┼──────────────────────┤
│ opt_backbone        │ (None, None,      │ 1,315,… │ padding_mask[0][0],  │
│ (OPTBackbone)       │ 2048)             │         │ token_ids[0][0]      │
├─────────────────────┼───────────────────┼─────────┼──────────────────────┤
│ token_embedding     │ (None, None,      │ 102,95… │ opt_backbone[0][0]   │
│ (ReversibleEmbeddi… │ 50272)            │         │                      │
└─────────────────────┴───────────────────┴─────────┴──────────────────────┘
 Total params: 3,947,261,954 (14.70 GB)
 Trainable params: 1,315,753,984 (4.90 GB)
 Non-trainable params: 0 (0.00 B)
 Optimizer params: 2,631,507,970 (9.80 GB)

@codecov
Copy link

codecov bot commented Sep 9, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.14% 🎉

Comparison is base (d0b53fd) 76.10% compared to head (1689287) 76.25%.
Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #859      +/-   ##
==========================================
+ Coverage   76.10%   76.25%   +0.14%     
==========================================
  Files         329      329              
  Lines       31270    31276       +6     
  Branches     6083     6084       +1     
==========================================
+ Hits        23799    23850      +51     
+ Misses       5871     5834      -37     
+ Partials     1600     1592       -8     
Flag Coverage Δ
keras_core 76.16% <100.00%> (+0.14%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
keras_core/utils/summary_utils.py 72.72% <100.00%> (+5.23%) ⬆️

... and 4 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@fchollet fchollet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR -- looks good! Please add a unit test.

@qlzh727
Copy link
Member Author

qlzh727 commented Sep 11, 2023

Thanks for the PR -- looks good! Please add a unit test.

Sure. Done.

Copy link
Member

@fchollet fchollet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@fchollet fchollet merged commit ab2ee38 into keras-team:main Sep 11, 2023
8 checks passed
@qlzh727 qlzh727 deleted the summary branch September 18, 2023 22:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants