import tensorflow as tf
from tensorflow.keras import layers
from tensorflow.keras import initializers

# Create a zeros initializer
initializer = tf.keras.initializers.Zeros()

# Create a Dense layer with 3 units and the zero initializer for the kernel weights
layer = tf.keras.layers.Dense(3, kernel_initializer=initializer)

# Build the layer to initialize it (requires specifying input shape)
layer.build((None, 4))  # Example input shape, batch size is None (unknown), 4 features

# Print the kernel (weights) of the Dense layer
print("Kernel Weights (Layer's weights initialized to Zeros):")
print(layer.get_weights()[0])  # The weights are the first element in the list returned by get_weights()

# Optionally, you can also print the biases (second element in get_weights())
print("Bias Weights (initialized by default):")
print(layer.get_weights()[1])  # The biases are the second element in the list
