如何使用tensorflow在两个lstm之间分配重量?

时间:2018-03-09 09:33:24

标签: python tensorflow lstm

我想在两个lstm(或双向-lstm)之间共享权重。说,我定义了2个lstms:

with tf.variable_scope("lstm_1") as _scope:
    output_fw, output_state_fw = tf.nn.dynamic_rnn(cell = lstm_cell1,...)

with tf.variable_scope("lstm_2") as _scope:
        output_fw, output_state_fw = tf.nn.dynamic_rnn(cell = lstm_cell2,...)

如何在lstm_1lstm_2之间分享权重?如果让lstm_cell1=lstm_cell2,那该怎么办?如果没有,我该怎么办? THX。

0 个答案:

没有答案