b68db1aaf6abe4d2cea8321cc6f1564228dd60f5,deepchem/models/tensorgraph/models/seqtoseq.py,SeqToSeq,predict_from_sequences,#SeqToSeq#Any#Any#,226
Before Change
if i < len(batch) else 0)
for i in range(self.batch_size)]
feed_dict[self._training_placeholder] = 0.0
for initial, zero in zip(self.rnn_initial_states, self.rnn_zero_states):
feed_dict[initial] = zero
probs = self.session.run(self.output, feed_dict=feed_dict)
for i in range(len(batch)):
result.append(self._beam_search(probs[i], beam_width))
return result
After Change
result = []
for batch in self._batch_elements(sequences):
features = self._create_input_array(batch)
indices = np.array([(i, len(batch[i]) if i < len(batch) else 0)
for i in range(self.batch_size)])
probs = self.predict_on_generator([[(features, indices,
self.get_global_step()), None,
None]])
for i in range(len(batch)):
result.append(self._beam_search(probs[i], beam_width))
return result
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 9
Instances
Project Name: deepchem/deepchem
Commit Name: b68db1aaf6abe4d2cea8321cc6f1564228dd60f5
Time: 2019-05-31
Author: peastman@stanford.edu
File Name: deepchem/models/tensorgraph/models/seqtoseq.py
Class Name: SeqToSeq
Method Name: predict_from_sequences
Project Name: matplotlib/matplotlib
Commit Name: 34b8eb46e5de6b760bc131e461755042716e259d
Time: 2018-02-07
Author: story645@gmail.com
File Name: lib/matplotlib/category.py
Class Name: StrCategoryConverter
Method Name: convert
Project Name: deepchem/deepchem
Commit Name: b68db1aaf6abe4d2cea8321cc6f1564228dd60f5
Time: 2019-05-31
Author: peastman@stanford.edu
File Name: deepchem/models/tensorgraph/models/seqtoseq.py
Class Name: SeqToSeq
Method Name: predict_embeddings