tf.keras.initializers.Zeros

Initializer that generates tensors initialized to 0.

Inherits From: Initializer

Used in the notebooks

Used in the tutorials

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

Examples:

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

Methods

from_config

View source