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

Set default name of Bert instance to "backbone" #397

Merged
merged 4 commits into from
Oct 20, 2022

Conversation

jbischof
Copy link
Contributor

@jbischof jbischof commented Oct 19, 2022

Current default name is "bert", which looks pretty funny in the layers of a task model (see below).

Having "bert_classifier" as the default for a BertClassifier looks pretty good though.

classifier = keras_nlp.models.BertClassifier(
    "bert_tiny_uncased_en",
    num_classes=2,
)
classifier.summary()
>>>
Model: "bert_classifier"
__________________________________________________________________________________________________
 Layer (type)                   Output Shape         Param #     Connected to                     
==================================================================================================
 padding_mask (InputLayer)      [(None, None)]       0           []                               
                                                                                                  
 segment_ids (InputLayer)       [(None, None)]       0           []                               
                                                                                                  
 token_ids (InputLayer)         [(None, None)]       0           []                               
                                                                                                  
 bert (Bert)                    {'sequence_output':  4385920     ['padding_mask[0][0]',           
                                 (None, None, 128),               'segment_ids[0][0]',            
                                 'pooled_output': (               'token_ids[0][0]']              
                                None, 128)}                                                       
                                                                                                  
 logits (Dense)                 (None, 2)            258         ['bert[0][0]']                   
                                                                                                  
==================================================================================================
Total params: 4,386,178
Trainable params: 4,386,178
Non-trainable params: 0

@jbischof jbischof changed the title Set default name of Bert instance to encoder Set default name of Bert instance to "encoder" Oct 19, 2022
@jbischof jbischof requested a review from mattdangerw October 19, 2022 21:19
@jbischof jbischof changed the title Set default name of Bert instance to "encoder" Set default name of Bert instance to "backbone" Oct 20, 2022
Copy link
Member

@mattdangerw mattdangerw left a comment

Choose a reason for hiding this comment

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

Thanks!

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