b68db1aaf6abe4d2cea8321cc6f1564228dd60f5,deepchem/models/tensorgraph/models/seqtoseq.py,SeqToSeq,predict_from_sequences,#SeqToSeq#Any#Any#,226
Before Change
result = []
with self._get_tf("Graph").as_default():
for batch in self._batch_elements(sequences):
feed_dict = {}
feed_dict[self._features] = self._create_input_array(batch)
feed_dict[self._gather_indices] = [(i, len(batch[i])
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))
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 20
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: 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
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: _generate_batches
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