46f1762899806ed7128b85fe58edd671ea5b9b85,matchzoo/inputs/point_generator.py,PointGenerator,get_batch_generator,#PointGenerator#,70
Before Change
return X1, X1_len, X2, X2_len, Y, ID_pairs
def get_batch_generator(self):
if self.is_train:
while True:
X1, X1_len, X2, X2_len, Y, ID_pairs = self.get_batch()
if self.config["use_dpool"]:
yield ({"query": X1, "query_len": X1_len, "doc": X2, "doc_len": X2_len, "dpool_index": DynamicMaxPooling.dynamic_pooling_index(X1_len, X2_len, self.config["text1_maxlen"], self.config["text2_maxlen"])}, Y)
else:
yield ({"query": X1, "query_len": X1_len, "doc": X2, "doc_len": X2_len}, Y)
else:
while self.point + self.batch_size <= self.total_rel_num:
X1, X1_len, X2, X2_len, Y, ID_pairs = self.get_batch(randomly = False)
if self.config["use_dpool"]:
yield ({"query": X1, "query_len": X1_len, "doc": X2, "doc_len": X2_len, "dpool_index": DynamicMaxPooling.dynamic_pooling_index(X1_len, X2_len, self.config["text1_maxlen"], self.config["text2_maxlen"]), "ID":ID_pairs}, Y)
else:
yield ({"query": X1, "query_len": X1_len, "doc": X2, "doc_len": X2_len, "ID":ID_pairs}, Y)
def reset(self):
self.point = 0
class Triletter_PointGenerator(object):
After Change
return X1, X1_len, X2, X2_len, Y, ID_pairs
def get_batch_generator(self):
while True:
sample = self.get_batch()
if not sample:
break
X1, X1_len, X2, X2_len, Y, ID_pairs = sample
if self.config["use_dpool"]:
yield ({"query": X1, "query_len": X1_len, "doc": X2, "doc_len": X2_len, "dpool_index": DynamicMaxPooling.dynamic_pooling_index(X1_len, X2_len, self.config["text1_maxlen"], self.config["text2_maxlen"]), "ID":ID_pairs}, Y)
else:
yield ({"query": X1, "query_len": X1_len, "doc": X2, "doc_len": X2_len, "ID":ID_pairs}, Y)
def reset(self):
self.point = 0
class Triletter_PointGenerator(object):
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 31
Instances
Project Name: NTMC-Community/MatchZoo
Commit Name: 46f1762899806ed7128b85fe58edd671ea5b9b85
Time: 2018-04-11
Author: fanyixing111@hotmail.com
File Name: matchzoo/inputs/point_generator.py
Class Name: PointGenerator
Method Name: get_batch_generator
Project Name: NTMC-Community/MatchZoo
Commit Name: 46f1762899806ed7128b85fe58edd671ea5b9b85
Time: 2018-04-11
Author: fanyixing111@hotmail.com
File Name: matchzoo/inputs/point_generator.py
Class Name: PointGenerator
Method Name: get_batch_generator
Project Name: NTMC-Community/MatchZoo
Commit Name: 46f1762899806ed7128b85fe58edd671ea5b9b85
Time: 2018-04-11
Author: fanyixing111@hotmail.com
File Name: matchzoo/inputs/point_generator.py
Class Name: DRMM_PointGenerator
Method Name: get_batch_generator
Project Name: NTMC-Community/MatchZoo
Commit Name: 46f1762899806ed7128b85fe58edd671ea5b9b85
Time: 2018-04-11
Author: fanyixing111@hotmail.com
File Name: matchzoo/inputs/point_generator.py
Class Name: Triletter_PointGenerator
Method Name: get_batch_generator