MCPcopy Create free account
hub / github.com/apache/singa / glorot_uniform

Function glorot_uniform

python/singa/initializer.py:115–129  ·  view source on GitHub ↗

Glorot uniform initializer, also called Xavier uniform initializer. 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 out

(t)

Source from the content-addressed store, hash-verified

113
114
115def glorot_uniform(t):
116 """Glorot uniform initializer, also called Xavier uniform initializer.
117
118 It draws samples from a uniform distribution within [-limit, limit]
119 where `limit` is `sqrt(6 / (fan_in + fan_out))`
120 where `fan_in` is the number of input units in the weight tensor
121 and `fan_out` is the number of output units in the weight tensor.
122
123 # Arguments
124 t(Tensor):the tensor to be filled in.
125 # References
126 - [Understanding the difficulty of training deep feedforward neural
127 networks](http://jmlr.org/proceedings/papers/v9/glorot10a/glorot10a.pdf)
128 """
129 _random_fill(t, scale=1., mode='fan_avg', distribution='uniform')
130
131
132def he_normal(t):

Callers

nothing calls this directly

Calls 1

_random_fillFunction · 0.85

Tested by

no test coverage detected