Tensorflow中的默认变量初始值设定项是什么? [英] What is the default variable initializer in Tensorflow?

查看:284
本文介绍了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 is None too, a glorot_uniform_initializer will be used.

glorot_uniform_initializer 函数根据均匀分布初始化值.

The glorot_uniform_initializer function initializes values from a uniform distribution.

该函数记录为:

Glorot统一初始化器,也称为Xavier统一初始化器.

The Glorot uniform initializer, also called Xavier uniform initializer.

它从[-极限,极限]内的均匀分布中抽取样本,
其中limitsqrt(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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆