如何在Tensorflow中使用conv1d_transpose? [英] How to use the conv1d_transpose in Tensorflow?
本文介绍了如何在Tensorflow中使用conv1d_transpose?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
conv1d_transpose
尚未在Tensorflow的稳定版本中提供,但实现可用
The conv1d_transpose
is not yet in the stable version of Tensorflow, but an implementation is available on github
我想创建一个一维反卷积网络.输入的形状为[-1, 256, 16]
,输出的形状应为[-1,1024,8]
.内核的大小为5,步幅为4.
I would like to create a 1D deconvolution network. The shape of the input is [-1, 256, 16]
and the output should be [-1,1024,8]
. The kernel's size is 5 and the stride is 4.
我尝试使用此功能构建一维卷积层:
I tried to build a 1D convolutional layer with this function:
(output_depth, input_depth) = (8, 16)
kernel_width = 7
f_shape = [kernel_width, output_depth, input_depth]
layer_1_filter = tf.Variable(tf.random_normal(f_shape))
layer_1 = tf_exp.conv1d_transpose(
x,
layer_1_filter,
[-1,1024,8],
stride=4, padding="VALID"
)
layer_1
的形状为TensorShape([Dimension(None), Dimension(None), Dimension(None)])
,但应为[-1,1024,8]
我怎么了?如何在Tensorflow中实现一维反卷积?
What do I wrong? How is it possible to implement 1D deconvolution in Tensorflow?