关于tf.nn.conv1d及其相应的转置操作

时间:2018-01-17 23:47:44

标签: tensorflow

在最新的tensorflow版本中,2D解卷积操作有tf.nn.conv2d_transpose。但是,tf.nn.conv1d没有相应的1D反卷积操作。如何对1D数据进行反卷积?

1 个答案:

答案 0 :(得分:1)

嗯,self.instance = cls(*args, **kwargs) File "<string>", line 15, in __init__ TypeError: super(type, obj): obj must be an instance or subtype of type 实际上是conv1d conv2dnn_ops.py.conv1d州:

in_height=1

因此,Internally, this op reshapes the input tensors and invokes `tf.nn.conv2d`. For example, if `data_format` does not start with "NC", a tensor of shape [batch, in_width, in_channels] is reshaped to [batch, 1, in_width, in_channels], and the filter is reshaped to [1, filter_width, in_channels, out_channels]. The result is then reshaped back to [batch, out_width, out_channels] \(where out_width is a function of the stride and padding as in conv2d\) and returned to the caller. 可以完成这项工作。