3a0ed9fe4d5097397c62b3827c260d0c2aff4fe4,src/gluonnlp/models/roberta.py,RobertaModel,hybrid_forward,#RobertaModel#Any#Any#Any#,233
Before Change
def hybrid_forward(self, F, tokens, valid_length):
x = self.tokens_embed(tokens)
if self.pos_embed_type:
positional_embedding = self.pos_embed(F.npx.arange_like(x, axis=1))
positional_embedding = F.np.expand_dims(positional_embedding, axis=0)
x = x + positional_embedding
if self.embed_ln:
x = self.embed_ln(x)
x = self.embed_dropout(x)
inner_states = self.encoder(x, valid_length)
After Change
bias_initializer=bias_initializer)
def hybrid_forward(self, F, tokens, valid_length):
outputs = []
embedding = self.get_initial_embedding(F, tokens)
contextual_embeddings, additional_outputs = self.encoder(embedding, valid_length)
outputs.append(contextual_embeddings)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 5
Instances
Project Name: dmlc/gluon-nlp
Commit Name: 3a0ed9fe4d5097397c62b3827c260d0c2aff4fe4
Time: 2020-07-20
Author: 37728728+ZheyuYe@users.noreply.github.com
File Name: src/gluonnlp/models/roberta.py
Class Name: RobertaModel
Method Name: hybrid_forward
Project Name: keras-team/keras
Commit Name: 523e24e8acf8ecc6d6b31e78cdc6e4c3967bbbdb
Time: 2016-02-07
Author: francois.chollet@gmail.com
File Name: keras/backend/theano_backend.py
Class Name:
Method Name: rnn
Project Name: keras-team/keras
Commit Name: 5a8f346e64cb432a445002230246ee042dbc278b
Time: 2018-11-05
Author: andhus@kth.se
File Name: keras/backend/theano_backend.py
Class Name:
Method Name: rnn