【问题标题】:Adding information into a tensor in TensorFlow在 TensorFlow 中将信息添加到张量中
【发布时间】:2016-07-07 16:53:26
【问题描述】:

目前我有一个卷积和汇集图像的神经网络。然而,就在我创建密集连接层之前,我想添加一些信息。目前,我使用tf.reshape(image, [width * length * channels]) 将图像重塑为平面张量,但我想知道如何将几个tf.float32 值附加到张量的末尾?

【问题讨论】:

标签: python arrays neural-network tensorflow conv-neural-network


【解决方案1】:

您可以使用tf.reshape-1 重塑矢量:

tf.reshape(image, [-1])

并使用tf.concat 将新值作为张量附加:

tf.concat([image, new_val1, new_val2], 0)

这将返回一个由输入张量串联产生的张量。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-03-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-12-18
    • 2012-06-16
    • 1970-01-01
    相关资源
    最近更新 更多