Tensorflow RNN weight matrices initialization

前端 未结 3 1956
[愿得一人]
[愿得一人] 2020-12-28 23:39

I\'m using bidirectional_rnn with GRUCell but this is a general question regarding the RNN in Tensorflow.

I couldn\'t find how to initializ

3条回答
  •  离开以前
    2020-12-28 23:45

    The RNN models will create their variables with get_variable, and you can control the initialization by wrapping the code which creates those variables with a variable_scope and passing a default initializer to it. Unless the RNN specifies one explicitly (looking at the code, it doesn't), uniform_unit_scaling_initializer is used.

    You should also be able to share model weights by declaring the second model and passing reuse=True to its variable_scope. As long as the namespaces match up, the new model will get the same variables as the first model.

提交回复
热议问题