more specific dummy data

This commit is contained in:
rromb 2022-06-05 19:21:22 +02:00
parent 2b39488d08
commit 64cc718ead
1 changed files with 16 additions and 0 deletions

View File

@ -16,3 +16,19 @@ class DummyData(Dataset):
letters = string.ascii_lowercase
y = ''.join(random.choice(string.ascii_lowercase) for i in range(10))
return {"jpg": x, "txt": y}
class DummyDataWithEmbeddings(Dataset):
def __init__(self, length, size, emb_size):
self.length = length
self.size = size
self.emb_size = emb_size
def __len__(self):
return self.length
def __getitem__(self, i):
x = np.random.randn(*self.size)
y = np.random.randn(*self.emb_size).astype(np.float32)
return {"jpg": x, "txt": y}