The Glorot uniform initializer, also called Xavier uniform initializer.

Inherits From: VarianceScaling, Initializer

Also available via the shortcut function tf.keras.initializers.glorot_uniform.

Draws samples from a uniform distribution within [-limit, limit], where limit = sqrt(6 / (fan_in + fan_out)) (fan_in is the number of input units in the weight tensor and fan_out is the number of output units).


# Standalone usage:
initializer = tf.keras.initializers.GlorotUniform()
values = initializer(shape=(2, 2))
# Usage in a Keras layer:
initializer = tf.keras.initializers.GlorotUniform()
layer = tf.keras.layers.Dense(3, kernel_initializer=initializer)

seed A Python integer. An initializer created with a given seed will always produce the same random tensor for a given shape and dtype.


Glorot et al., 2010 (pdf)