I am following this keras tutorial to construct a convolutional MNIST autoencoder. The decoder has a sigmoid activation function and the entire autoencoder is trained with binary_crossentropy loss. This makes sense to me if the pixel values are completely binary. However, I noticed that the digits are normalized between 0 and 1 and can take on values in the middle.
(x_train, _), (x_test, _) = mnist.load_data()
x_train = x_train.astype('float32') / 255.
x_test = x_test.astype('float32') / 255.
While majority of the pixels take on 0 or 1 values, often times the edges take on intermediate values (the greenish pixels in the example image above). Therefore, wouldn't relu or some other activation function be more appropriate? I've seen many tutorials use sigmoid and binary_crossentropy, so I feel like I must be misunderstanding why these were chosen.