more specific dummy data
This commit is contained in:
parent
2b39488d08
commit
64cc718ead
1 changed files with 16 additions and 0 deletions
|
@ -16,3 +16,19 @@ class DummyData(Dataset):
|
||||||
letters = string.ascii_lowercase
|
letters = string.ascii_lowercase
|
||||||
y = ''.join(random.choice(string.ascii_lowercase) for i in range(10))
|
y = ''.join(random.choice(string.ascii_lowercase) for i in range(10))
|
||||||
return {"jpg": x, "txt": y}
|
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}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue