e8c1297dd6196fb486bfe7c6721041ff50ee1a47,matchzoo/models/drmm.py,DRMM,build,#DRMM#,40
Before Change
// shape = [B, L, D]
embed_query = embedding(query)
// shape = [B, L]
atten_mask = K.any(K.not_equal(query, self._params["mask_value"]),
axis=-1, keepdims=True)
atten_mask = K.cast(atten_mask, K.floatx())
atten_mask = K.expand_dims(atten_mask, axis=2)
// shape = [B, L, D]
attention_probs = self.attention_layer(embed_query, atten_mask)
// Process right input.
// shape = [B, L, 1]
dense_output = self._make_multi_layer_perceptron_layer()(match_hist)
// shape = [B, 1, 1]
dot_score = keras.layers.Dot(axes=[1, 1])(
[attention_probs, dense_output])
flatten_score = keras.layers.Flatten()(dot_score)
x_out = self._make_output_layer()(flatten_score)
self._backend = keras.Model(inputs=[query, match_hist], outputs=x_out)
@classmethod
After Change
// shape = [B, L, D]
embed_query = embedding(query)
// shape = [B, L]
atten_mask = K.not_equal(query, self._params["mask_value"])
// shape = [B, L]
atten_mask = K.cast(atten_mask, K.floatx())
// shape = [B, L, D]
atten_mask = K.expand_dims(atten_mask, axis=2)
// shape = [B, L, D]
attention_probs = self.attention_layer(embed_query, atten_mask)
// Process right input.
// shape = [B, L, 1]
dense_output = self._make_multi_layer_perceptron_layer()(match_hist)
// shape = [B, 1, 1]
dot_score = keras.layers.Dot(axes=[1, 1])(
[attention_probs, dense_output])
flatten_score = keras.layers.Flatten()(dot_score)
x_out = self._make_output_layer()(flatten_score)
self._backend = keras.Model(inputs=[query, match_hist], outputs=x_out)
@classmethod
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 5
Instances
Project Name: NTMC-Community/MatchZoo
Commit Name: e8c1297dd6196fb486bfe7c6721041ff50ee1a47
Time: 2019-02-02
Author: 450458747@qq.com
File Name: matchzoo/models/drmm.py
Class Name: DRMM
Method Name: build
Project Name: NTMC-Community/MatchZoo
Commit Name: e8c1297dd6196fb486bfe7c6721041ff50ee1a47
Time: 2019-02-02
Author: 450458747@qq.com
File Name: matchzoo/models/drmmtks.py
Class Name: DRMMTKS
Method Name: build
Project Name: NTMC-Community/MatchZoo
Commit Name: 3fa83577e0c28725e44ef3774e29e56f357cd046
Time: 2019-02-24
Author: 450458747@qq.com
File Name: matchzoo/models/drmm.py
Class Name: DRMM
Method Name: build