Query regarding (.output_shape) parameters used in CNN model
The output shape in a 2D convolutional layer depends on :


The input size W, H
The filter size F
The padding P
The stride S
The number of filters or depth D


Here, in your model, W=3, H=4, F=2, P=0 (default padding in Keras), S=1 (default stride in Keras), D=128 as you defined it.

The transformation is defined by the mathematical convolution operation, giving you an output shape as:

$\frac{W−F+2P}{S} + 1$

This output shape shows how your input reacts (in terms of size) when convolved with your 128 filters one by one.