【发布时间】:2016-09-14 14:32:01
【问题描述】:
我正在使用张量流
在双向部分我希望实现一个合理的分析,我看到的所有例子都是从序列到一种。我想要一个一对一的网络。
依次是这个部分
def BiRNN(x, weights, biases):
#...some code...
return tf.matmul(outputs[-1], weights['out']) + biases['out']
pred = BiRNN(x, weights, biases)
cost = tf.reduce_mean(tf.nn.softmax_cross_entropy_with_logits(pred, y))
optimizer = tf.train.AdamOptimizer(learning_rate=learning_rate).minimize(cost)
但我想要这样的一对一:
def BiRNN(x, weights, biases):
#...some code...
for re in range(n_steps):
outputs[re] = tf.matmul(outputs[re], weights['out']) + biases['out']
outputs=tf.pack(outputs)
return[outputs]
pred = BiRNN(x, weights, biases)
cost = tf.reduce_mean(tf.pow(pred - y, 2))
optimizer = tf.train.AdamOptimizer(learning_rate=learning_rate).minimize(cost)
但我不确定这样做的正确方法
谁能指出我正确的方向?
【问题讨论】:
标签: tensorflow recurrent-neural-network lstm