【发布时间】:2017-03-19 17:41:06
【问题描述】:
我想在 tensorflow 中的两个张量上运行相同的 RNN。我当前的解决方案如下所示:
cell = tf.nn.rnn_cell.GRUCell(cell_size)
with tf.variable_scope("encoder", reuse=None):
out1 = tf.nn.dynamic_rnn(cell, tensor1, dtype=tf.float32)
with tf.variable_scope("encoder", reuse=True):
out2 = tf.nn.dynamic_rnn(cell, tensor2, dtype=tf.float32)
这是确保两个 RNN 操作之间权重共享的最佳方式吗?
【问题讨论】:
标签: tensorflow