I have a set of 120x120 input images with 3 channels. I want to build a basic CNN to predict the value of each pixel. I have 2 doubts. One is regarding the last layer - should be a Dense layer, or a Conv2D?
model_CNN4 = keras.models.Sequential([
Conv2D(32, (3, 3), input_shape=[pixel, pixel, 3]),
BatchNormalization(),
LeakyReLU(alpha=0.1), # You can adjust the alpha parameter for the leaky ReLU
MaxPooling2D(),
Conv2D(64, (2, 2)),
BatchNormalization(),
LeakyReLU(alpha=0.1),
MaxPooling2D(),
Conv2D(64, (2, 2)),
LeakyReLU(alpha=0.1),
Flatten(),
Dense(200),
BatchNormalization(),
LeakyReLU(alpha=0.1),
Dense(pixel * pixel, activation='linear')
])
The other question is, assuming it is correct - or rather, that makes sense, it only runs if my y_train is of shape:
y_train shape : [number of samples, 120*120]
But shouldn't it be instead?:
y_train shape: [number of samples, 120,120,1]
Thanks