630aca5c7d9629c3714b244638dba81370a2ae89,deepchem/data/pytorch_datasets.py,_TorchNumpyDataset,__iter__,#_TorchNumpyDataset#,28
Before Change
if self.deterministic:
order = first_sample + np.arange(last_sample - first_sample)
else:
order = first_sample + np.random.permutation(last_sample - first_sample)
for i in order:
yield (self.numpy_dataset._X[i], self.numpy_dataset._y[i],
self.numpy_dataset._w[i], self.numpy_dataset._ids[i])
After Change
// Ensure that every worker will pick the same random order for each epoch.
random = np.random.RandomState(epoch)
order = random.permutation(n_samples)[first_sample:last_sample]
if self.batch_size is None:
for i in order:
yield (self.numpy_dataset._X[i], self.numpy_dataset._y[i],
self.numpy_dataset._w[i], self.numpy_dataset._ids[i])
else:
for i in range(0, len(order), self.batch_size):
indices = order[i:i + self.batch_size]
yield (self.numpy_dataset._X[indices], self.numpy_dataset._y[indices],
self.numpy_dataset._w[indices],
self.numpy_dataset._ids[indices])
class _TorchDiskDataset(torch.utils.data.IterableDataset): // type: ignore
def __init__(self,
disk_dataset: DiskDataset,
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 6
Instances Project Name: deepchem/deepchem
Commit Name: 630aca5c7d9629c3714b244638dba81370a2ae89
Time: 2020-08-19
Author: peastman@stanford.edu
File Name: deepchem/data/pytorch_datasets.py
Class Name: _TorchNumpyDataset
Method Name: __iter__
Project Name: deepchem/deepchem
Commit Name: 630aca5c7d9629c3714b244638dba81370a2ae89
Time: 2020-08-19
Author: peastman@stanford.edu
File Name: deepchem/data/pytorch_datasets.py
Class Name: _TorchImageDataset
Method Name: __iter__
Project Name: SheffieldML/GPy
Commit Name: 350497c72606f188f83b68588140f0058190559b
Time: 2013-04-16
Author: ibinbei@gmail.com
File Name: GPy/models/mrd.py
Class Name: MRD
Method Name: __init__