首页 文章

Tensorflow中的循环卷积自动编码器

提问于
浏览
0

我试图在Tensorflow中构建一个循环卷积自动编码器,但是我无法将卷积自动编码器与循环层连接起来 .

根据我的理解,Tensorflow RNNCell接受形状输入(batch_size,time_steps,info_vector),但我的1D卷积层的输出形状为(batch_size,info_vector) . 有没有办法让tensorflow存储以前的信息向量 . 或者,我是否需要使用2D卷积,为输入添加额外的time_step维度,然后不在该维度上进行卷积?

1 回答

  • 0

    尝试扩展张量的维数:

    cnn_out = last_output_of_cnn # for example shape [32,10]
    cnn_out = tf.expand_dims(cnn_output, axis=-1) # new shape [32,10,1]
    

    您可以在RNN的第一层使用此功能,此处“timestep”为10 .

相关问题