def add_noise(data: np.ndarray) -> np.ndarray: """Add (Gaussian) noise to a given data. """ image = data.array noise = np.random.normal(0, 0.3, size=np.shape(image)) data.add_attribute('noisy', image + noise, batch=True)