Data generation using truncated positive distribution of TensorFlow

Source: Internet
Author: User

the so-called truncated normal distribution is based on the standard normal distribution (Gaussian distribution) on the basis of the limit, so that the generated data in a certain range. For example, the data generated by the standard normal distribution are negative infinity to positive infinity, but the data generated by the truncated normal distribution is within this range (standard deviation of mean-twice times, mean + twice times standard deviation).

Import TensorFlow as tf
c = tf.truncated_normal (shape=[12,10], mean=100, stddev=1) with
TF. Session () as Sess:
	print (Sess.run (c))

Output Result:

[[  99.91983795   98.71269226   99.35746002  101.02975464  100.63500977]
 [101.92388153   99.10471344   99.77385712  100.06600952   99.75480652]
 [  99.94233704  100.22845459   99.16555023  101.3265686    99.82016754]
 [100.27728271   99.2677002   100.80665588   99.7434845   100.93345642]
 [  99.00519562  100.91706848  100.16968536   99.20123291   99.35009766]
 [  98.85636902  100.11727142  100.32691193  100.59256744   99.72653961]
 [  99.51020813   98.99095917   99.38573456   99.34537506  100.68587494]
 [  99.56321716   99.81674194  100.38961029  100.29162598   98.17160034]
 [101.67827606  101.01641083  100.11600494  100.59056091   99.62102509]
 [  98.12446594   99.39179993   99.95746613   99.32868195  100.14764404]]

Where mean is the mean and StdDev is the variance


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.