【发布时间】:2018-05-22 22:25:58
【问题描述】:
我正在训练一个特征形状为 [3751,4] 的模型,我想使用 Tensorflow 中内置的 reshape 和 layer dense 函数来使输出标签的形状为 [1,6]。
现在我的模型中有两个隐藏层,它们将执行以下操作:
input_layer = tf.reshape(features["x"], [-1,11,11,31,4])
first_hidden_layer = tf.layers.dense(input_layer, 4, activation=tf.nn.relu)
second_hidden_layer = tf.layers.dense(first_hidden_layer, 5, activation=tf.nn.relu)
output_layer = tf.layers.dense(second_hidden_layer, 6)
所以现在我可以拥有 [?,11,11,31,6] 的 output_layer 形状。
如何进一步塑造训练节点集,以便最终将节点连接到形状 [1,6]?
【问题讨论】:
标签: python tensorflow machine-learning tensorflow-datasets