我正在实现卷积自动编码器,并且在为卷积层(解码器(找到正确的形状时遇到了严重的困难。到目前为止,我的编码器看起来像
('convolution', num_outputs=256, kernel_size=48, stride=2, padding="SAME")
('convolution', num_outputs=256, kernel_size=7, stride=1, padding="SAME" )
('convolution', num_outputs=256, kernel_size=7, stride=1, padding="SAME" )
('convolution', num_outputs=256, kernel_size=7, stride=1, padding="SAME" )
('convolution', num_outputs=256, kernel_size=7, stride=1, padding="SAME" )
('convolution', num_outputs=256, kernel_size=7, stride=1, padding="SAME" )
('convolution', num_outputs=256, kernel_size=7, stride=1, padding="SAME" )
('convolution', num_outputs=256, kernel_size=7, stride=1, padding="SAME" )
('convolution', num_outputs=256, kernel_size=32, stride=1, padding="SAME" )
现在,在解码器中,我试图将其恢复。使用:
('convolution_transpose', num_outputs=256, kernel_size=32, stride=2, padding="SAME")
('convolution_transpose', num_outputs=256, kernel_size=7, stride=1, padding="SAME" )
('convolution_transpose', num_outputs=256, kernel_size=7, stride=1, padding="SAME" )
('convolution_transpose', num_outputs=256, kernel_size=7, stride=1, padding="SAME" )
('convolution_transpose', num_outputs=256, kernel_size=7, stride=1, padding="SAME" )
('convolution_transpose', num_outputs=256, kernel_size=7, stride=1, padding="SAME" )
('convolution_transpose', num_outputs=256, kernel_size=7, stride=1, padding="SAME" )
('convolution_transpose', num_outputs=256, kernel_size=7, stride=1, padding="SAME" )
('convolution_transpose', num_outputs=256, kernel_size=48, stride=2, padding="SAME" )
('convolution_transpose', num_outputs=1, kernel_size=48, stride=2, padding="SAME" )
我无法复制输入的大小。
Input Size: (10, 161, 1800, 1)
Output Size: (10, 3600, 1024, 1)
对解码器层的正确设置的想法有什么想法?
不确定您使用的是什么平台或您要完成的操作,但是您的输入大小应该由卷积层排除,否则您的输入将被填充(或裁剪(。除此之外,在TensorFlow上,以下工作:
tf.layers.conv2d(in,256,3,2,'SAME',activation=tf.nn.relu)
tf.layers.conv2d_transpose(in,256,3,2,'SAME',activation=tf.nn.relu)
其中256是特征的数量,3是内核大小(3x3(,而2是步幅。