3008753be172bc0bae88aa14b00ce860233c3416,official/nlp/tasks/utils.py,,get_encoder_from_hub,#,24
Before Change
hub_layer = hub.KerasLayer(hub_module, trainable=True)
pooled_output, sequence_output = hub_layer(
[input_word_ids, input_mask, input_type_ids])
return tf.keras.Model(
inputs=[input_word_ids, input_mask, input_type_ids],
outputs=[sequence_output, pooled_output])
def predict(predict_step_fn: Callable[[Any], Any],
aggregate_fn: Callable[[Any, Any], Any], dataset: tf.data.Dataset):
After Change
logging.info("Use the new hub module with dict as input/output.")
output_dict = hub_layer(dict_input)
return tf.keras.Model(inputs=dict_input, outputs=output_dict)
def predict(predict_step_fn: Callable[[Any], Any],
aggregate_fn: Callable[[Any, Any], Any], dataset: tf.data.Dataset):
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
Instances
Project Name: tensorflow/models
Commit Name: 3008753be172bc0bae88aa14b00ce860233c3416
Time: 2020-09-26
Author: chendouble@google.com
File Name: official/nlp/tasks/utils.py
Class Name:
Method Name: get_encoder_from_hub
Project Name: explosion/thinc
Commit Name: 5dccee984b2c25f6508947d3731b8934296ff4c5
Time: 2020-01-04
Author: honnibal+gh@gmail.com
File Name: thinc/layers/lstm.py
Class Name:
Method Name: LSTM_step
Project Name: XifengGuo/CapsNet-Keras
Commit Name: 37f599f61067cc6947c9bf783eace05227c0f450
Time: 2017-11-13
Author: guoxifeng1990@163.com
File Name: capsulenet.py
Class Name:
Method Name: CapsNet