in supervised_reptile/omniglot.py [0:0]
def sample(self, num_images):
"""
Sample images (as numpy arrays) from the class.
Returns:
A sequence of 28x28 numpy arrays.
Each pixel ranges from 0 to 1.
"""
names = [f for f in os.listdir(self.dir_path) if f.endswith('.png')]
random.shuffle(names)
images = []
for name in names[:num_images]:
images.append(self._read_image(os.path.join(self.dir_path, name)))
return images