https://www.tensorflow.org/api_docs/python/tf/truncated_normal
Generate a tensor randomly extracted from the truncated normal distribution of ± 2σ.
truncated_normal(
shape,
mean=0.0,
stddev=1.0,
dtype=tf.float32,
seed=None,
name=None
)
import tensorflow as tf
x = tf.truncated_normal(shape=[2, 2], mean=0.0, stddev=1.0, dtype=tf.float32)
with tf.Session() as sess:
x.eval()
Recommended Posts