LoginSignup
6
7

More than 5 years have passed since last update.

Tensorflow API: tf.truncated_normal

Posted at

概要

±2σの切断正規分布からランダムに取り出したテンソルを生成する。

truncated_normal(
    shape,
    mean=0.0,
    stddev=1.0,
    dtype=tf.float32,
    seed=None,
    name=None
)
  • shape: 戻り値のテンソルの次元 (1次元のintegerリストもしくはテンソルを指定)
  • mean: 生成する切断正規分布の平均値
  • stddev: 生成する切断正規分布の標準偏差
  • dtype: 戻り値のテンソルの型
  • seed: integerを指定すると、sessionが変わっても都度同じ値を抽出するようになる
  • name: operationの名前

使用例

ipython
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()
6
7
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
7