Tensorflow 中的默认变量初始化器是什么? [英] What is the default variable initializer in Tensorflow?
问题描述
tf.get_variable()
在没有任何初始化器规范的情况下调用时使用的默认变量初始化方法是什么?文档只是说无".
What is the default method of variable initialization used when tf.get_variable()
is called without any specification for the initializer? The Docs just says 'None'.
推荐答案
来自文档:
如果初始化器是None
(默认),则将使用在变量作用域中传递的默认初始化器.如果那个也是 None
,则将使用 glorot_uniform_initializer
.
If initializer is
None
(the default), the default initializer passed in the variable scope will be used. If that one isNone
too, aglorot_uniform_initializer
will be used.
_initializeglorot>
函数从均匀分布中初始化值.
The glorot_uniform_initializer
function initializes values from a uniform distribution.
这个函数被记录为:
Glorot 统一初始化器,也称为 Xavier 统一初始化器.
The Glorot uniform initializer, also called Xavier uniform initializer.
它从 [-limit, limit] 内的均匀分布中抽取样本,
其中 limit
是 sqrt(6/(fan_in + fan_out))
其中 fan_in
是权重张量中的输入单元数fan_out
是权重张量中输出单元的数量.
It draws samples from a uniform distribution within [-limit, limit],
where limit
is sqrt(6 / (fan_in + fan_out))
where fan_in
is the number of input units in the weight tensor
and fan_out
is the number of output units in the weight tensor.
参考:http://jmlr.org/proceedings/papers/v9/glorot10a/glorot10a.pdf
这篇关于Tensorflow 中的默认变量初始化器是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!