TensorFlow 2.0 Beta is available Learn more

tf.glorot_uniform_initializer

View source on GitHub

Class glorot_uniform_initializer

The Glorot uniform initializer, also called Xavier uniform initializer.

Inherits From: variance_scaling

Aliases:

  • Class tf.compat.v1.glorot_uniform_initializer
  • Class tf.compat.v1.initializers.glorot_uniform
  • Class tf.compat.v1.keras.initializers.glorot_uniform
  • Class tf.initializers.glorot_uniform
  • Class tf.keras.initializers.glorot_uniform

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.

Args:

  • seed: A Python integer. Used to create random seeds. See tf.compat.v1.set_random_seed for behavior.
  • dtype: Default data type, used if no dtype argument is provided when calling the initializer. Only floating point types are supported.

References:

Glorot et al., 2010 (pdf)

__init__

View source

__init__(
    seed=None,
    dtype=tf.dtypes.float32
)

DEPRECATED FUNCTION ARGUMENTS

Methods

__call__

View source

__call__(
    shape,
    dtype=None,
    partition_info=None
)

from_config

View source

from_config(
    cls,
    config
)

Instantiates an initializer from a configuration dictionary.

Example:

initializer = RandomUniform(-1, 1)
config = initializer.get_config()
initializer = RandomUniform.from_config(config)

Args:

  • config: A Python dictionary. It will typically be the output of get_config.

Returns:

An Initializer instance.

get_config

View source

get_config()