张量流中GRUCell的bias_initializer的默认值是多少?

时间:2017-06-29 12:19:32

标签: python-3.x tensorflow deep-learning

GRUCell提供了使用bias_initializer初始化偏差的选项,该偏置设置为“无”。但是,根据https://stackoverflow.com/a/43284391/7730199,默认值实际上不是'None',而是'glorot_uniform_initializer'。那个讨论发生在kernel_initializer的上下文中。这同样适用于GRUCell的bias_initializer吗?

此外,GRUCell中偏差的最佳初始化是什么?

1 个答案:

答案 0 :(得分:0)

显然它是不变的:

 def call(self, inputs, state):
    """Gated recurrent unit (GRU) with nunits cells."""
    if self._gate_linear is None:
      bias_ones = self._bias_initializer
      if self._bias_initializer is None:
        bias_ones = init_ops.constant_initializer(1.0, dtype=inputs.dtype)

来自https://github.com/tensorflow/tensorflow/blob/c646af1957197a9be0feb5e928af46e29da688ea/tensorflow/python/ops/rnn_cell_impl.py#L313