I have a ndarray images of shape: (6000, 28, 28, 1). At first I calculate the max value for each row:
x1 = np.random.rand(6000, 28, 28, 1)
print(x1.shape)
x2 = np.max(x1, axis = (1,2))
print(x2.shape)
print(x2)
np.divide(x1, x2)
The shape of max_val is (6000,1)
Now I want to divide the images by its max value for each row, with something like:
np.divide(images, max_val)
But it returns an error: ValueError: operands could not be broadcast together with shapes (6000,28,28,1) (6000,1)
The returned shape would be shape (6000, 28, 28, 1) but the values for each row is divided by the corresponding max value.