I was playing around with autoencoders for mnist recently and this question appeared. "Is it possible to create a model with varying input shape but fixed output shape?"
Example:
Regularly decoder input will be e.g keras.layers.InputLayer(input_shape=(7, 7, 1))
, you will have some UpSampling
layers in the model to bring shape from (7,7,1)
up to (28, 28, 1)
.
But what if decoder Input has unspecified shape?
Imagine convolutional decoder with input layer keras.layers.InputLayer(input_shape=(None, None, 1))
. Input shapes for decoder maybe be different, however, decoder's output always has a fixed shape (28, 28, 1)
. How to build a model that will determine how to do UpSampling
depending on input shape it received?
editted: Let me know if this question does not make any sense. I will delete it;)