0

for example,we have different filter size and the number of feature map,and the number of convolutional layer are also different, the hidden units are more than input units,the specific code is as follows. I don't know if this is called convolutional auto-encoder, or it has to be decoded and encoded in the same way. I hope someone can help me answer this question. Thank you very much.

input_data = Input(shape=(1,128,3))
x = Conv2d(6,(1,1),padding='same')(input_data)
new_input_data = keras.layers.concatenate([input_data,x],axis=-1)
x = Conv2D(40,(1,6),activation='relu',padding='same')(new_input_data)
encoded = MaxPooling2D((1,2),padding='same')(x)

x = Conv2D(40,(1,6),activation='relu',padding='same')(encoded)
x = UpSampling2D((1,2))(x)
decoded = Conv2D(3,(1,6),activation='relu',padding='same')(x)

the change of channels :3-->6-->9-->40 40-->3

ohdoughnut
  • 75
  • 2
  • 2
  • 8
  • Architectures do not have to match to be an autoencoder. Autoencoder only means that the transformation is of form x->h->x, details of implementing encoding and decoding bit are up to the user. In particular this is a very typical approach in VAEs to have a relatively weak *decoder* so that we force model to truly use encoder well – lejlot Apr 08 '18 at 13:03
  • @lejlot Is the number of hidden layer units of convolution auto-encoder less than the number of input units? I saw on keras's blog that the example code is smaller.Can it be larger than that? – ohdoughnut Apr 08 '18 at 13:56
  • What do you mean by "unit" of a conv layer. A kernel? If so then indeed usually it will be smaller number, as otherwise the latent space will be gigantic. Essentially the output of the conv layer will be (up to padding/stride) WxHxK, where WxH is shape of the input and K is number of kernels, so if you put K=W*H, you will end up with quadratic amount of data wrt. input. In principle - it can be so big, there are no theoretical limits here. – lejlot Apr 08 '18 at 17:16
  • @ Thanks! The unit is the output of the conv, for example, the input is 128*3, the filter size of conv layer is 1*6, the number of feature map is 40, padding is same, and follow a maxpool layer, then the output is 64*40, the output is more than input, it is correct? – ohdoughnut Apr 09 '18 at 02:28

0 Answers0