Defined in File node_initializers.cpp
glorotUniform(bool fanIn = false, bool fanOut = false, float scale = 1.f)¶
Initialize tensor with random numbers from Glorot uniform distribution.
The Glorot uniform, also called Xavier uniform, is designed to keep the scale of the gradients roughly the same in all layers. This function offers three variants (modes). The values of the tensor is sampled from Uniform(-x*scale, x*scale):
when fanIn=false and fanOut=false (by default): x = sqrt(6 / (in + out))
when fanIn=true and fanOut=false (fanIn mode): x = sqrt(3 / in)
when fanIn=false and fanOut=false (fanOut mode): x = sqrt(3 / out) where
inis the number of input units in the tensor,
outis the number of output units.
scaleis used to change the range of Uniform distribution.