2fd10474faf8b1c519d00d1215956f417cea01ed,batchflow/models/tf/encoder_decoder.py,EncoderDecoder,body,#Any#Any#Any#,133
Before Change
encoder_outputs = cls.encoder(inputs, **encoder, **kwargs)
// Bottleneck: working with compressed representation
x = cls.embedding(encoder_outputs[-1], **embedding, **kwargs)
encoder_outputs.append(x)
// Decoder: transition up
x = cls.decoder(encoder_outputs, **decoder, **kwargs)
After Change
kwargs = cls.fill_params("body", **kwargs)
encoder = kwargs.pop("encoder")
embedding_common = kwargs.pop("embedding_common")
embedding_order = kwargs.pop("embedding_order") or [name for name in kwargs
if "embedding" in name]
decoder = kwargs.pop("decoder")
with tf.variable_scope(name):
// Encoder: transition down
encoder_args = {**kwargs, **encoder}
encoder_outputs = cls.encoder(inputs, name="encoder", **encoder_args)
x = encoder_outputs[-1]
// Bottleneck: working with compressed representation via multiple steps of processing
for embedding_name in embedding_order:
embedding_args = kwargs.pop(embedding_name)
if embedding_args:
embedding_args = {**kwargs, **embedding_common, **embedding_args}
x = cls.embedding(x, name=embedding_name, **embedding_args)
encoder_outputs.append(x)
// Decoder: transition up
decoder_args = {**kwargs, **decoder}
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 5
Instances
Project Name: analysiscenter/batchflow
Commit Name: 2fd10474faf8b1c519d00d1215956f417cea01ed
Time: 2019-07-04
Author: Tsimfer.SA@gazprom-neft.ru
File Name: batchflow/models/tf/encoder_decoder.py
Class Name: EncoderDecoder
Method Name: body
Project Name: stanfordnlp/stanza
Commit Name: db7b74579181f9cbae3583f447d83148714a1c3d
Time: 2020-06-15
Author: horatio@gmail.com
File Name: stanza/models/classifiers/cnn_classifier.py
Class Name: CNNClassifier
Method Name: forward
Project Name: analysiscenter/batchflow
Commit Name: 4c50261df4847bdfd7c8067307e8532f96d04104
Time: 2019-08-02
Author: Tsimfer.SA@gazprom-neft.ru
File Name: batchflow/models/torch/encoder_decoder.py
Class Name: EncoderDecoder
Method Name: body