MCPcopy Create free account
hub / github.com/PaddlePaddle/Paddle / RandomDataset

Class RandomDataset

python/paddle/distributed/launch/plugins/test.py:34–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32
33# define a random dataset
34class RandomDataset(Dataset):
35 def __init__(self, num_samples):
36 self.num_samples = num_samples
37
38 def __getitem__(self, idx):
39 image = np.random.random([3, 224, 224]).astype('float32')
40 label = np.random.randint(0, class_dim - 1, (1,)).astype('int64')
41 return image, label
42
43 def __len__(self):
44 return self.num_samples
45
46
47def optimizer_setting(parameter_list=None):

Callers 1

train_resnetFunction · 0.70

Calls

no outgoing calls

Tested by 1

train_resnetFunction · 0.56