当前位置:网站首页>tf.truncated_ Normal() usage
tf.truncated_ Normal() usage
2022-07-26 03:22:00 【phac123】
sketch
tf.truncated_normal(shape, mean=0.0, stddev=1.0,
dtype=tf.float32, seed=None, name=None)
- This function produces a normal distribution ; This is a truncated function that produces a normal distribution , The resulting values follow a normal distribution with a specified mean and standard deviation , let me put it another way , If the difference between the generated value and the mean value is greater than twice the standard deviation, it will be discarded and re selected ; This function is compared with random data generated by general normal distribution , The difference between the random number generated by this function and the mean value will not exceed twice the standard deviation , But other general functions are possible .
- shape: Represents the dimension of the generated tensor
- mean: mean value
- stddev: Standard deviation
- dtype: Type of output
- seed: An integer , After setting , The random number generated each time is the same
- name: The name of the operation
Besides : In the curve of normal distribution :
Horizontal axis interval (μ-σ,μ+σ) The area inside is 68.268949%
Horizontal axis interval (μ-2σ,μ+2σ) The area inside is 95.449974%
Horizontal axis interval (μ-3σ,μ+3σ) The area inside is 99.730020%
X Fall in the (μ-3σ,μ+3σ) The probability is less than three thousandths , In practical problems, it is often thought that the corresponding event will not happen , Basically, you can put the interval (μ-3σ,μ+3σ) As a random variable X The actual possible value range , This is called the normal distribution "3σ" principle .
stay tf.truncated_normal If X The value of is in the interval (μ-2σ,μ+2σ) Otherwise, choose again . This ensures that the generated values are near the mean .
example
import tensorflow._api.v2.compat.v1 as tf
tf.disable_v2_behavior()
c = tf.truncated_normal(shape = [3,3],mean = 0 , stddev = 1)
with tf.Session() as sess:
print(sess.run(c))
Output :
''' [[-0.04338798 0.9103105 -1.0928041 ] [ 0.1483252 -0.11247149 -1.2393879 ] [ 0.5323354 0.946114 -0.66076565]] '''
边栏推荐
- Unknown-Aware Object Detection:Learning What You Don’t Know from Videos in the Wild(CVPR 2022)
- Looking at the next step of BAIC bluevale through the 8billion fund-raising, product upgrading and building core capabilities are the key words
- 2022-07-21 第四小组 多态
- Jsd-2204-cool shark Mall (Management Commodity module) -day02
- ELS modify cursor, modify Icon
- Dataframe sorting: datetime format splitting; Delete a specific line; Group integration.
- 了解预加载和懒加载、学会缓动动画
- [noip2001 popularization group] packing problem
- ES6 set and map
- Service gateway (zuul)
猜你喜欢

There are a group of students in the class who have got the test results in Chinese and mathematics. Please select the students whose total score is the first
![[experience sharing] strong recommendation - screenshot gadget FastStone capture (FSC)](/img/d1/143192f55295ce338af1ee04dd8ba8.png)
[experience sharing] strong recommendation - screenshot gadget FastStone capture (FSC)

Looking at the next step of BAIC bluevale through the 8billion fund-raising, product upgrading and building core capabilities are the key words
![[untitled]](/img/6f/a2cd98af7a8de469e5311422b48afe.png)
[untitled]

Canvas -- draw text -- modification of pie chart

班级里有一群学生考试结果出来了,考了语文和数学两门,请筛选出总分是第一的同学

【数学建模-规划模型总结】| MATLAB求解

Matlab simulation of vertical handover between MTD SCDMA and TD LTE dual networks

Derivation of linear regression principle

Unknown-Aware Object Detection:Learning What You Don’t Know from Videos in the Wild(CVPR 2022)
随机推荐
[experience sharing] strong recommendation - screenshot gadget FastStone capture (FSC)
Looking at the next step of BAIC bluevale through the 8billion fund-raising, product upgrading and building core capabilities are the key words
2022-07-21 group 4 polymorphism
78. 子集
Offline data warehouse from 0 to 1 - phase I resource purchase configuration
snownlp库各功能及用法
Derivation of linear regression principle
els 修改光标、修改图标
论文精读-YOLOv1:You Only Look Once:Unified, Real-Time Object Detection
PXE高效批量网络装机
Illustration leetcode - 5. Longest palindrome substring (difficulty: medium)
班级里有一群学生考试结果出来了,考了语文和数学两门,请筛选出总分是第一的同学
离线数据仓库从0到1-阶段二软件安装
Performance comparison of ext4, NTFS, XFS, Btrfs, ZFS, f2fs and ReiserFS
Use eventlog analyzer for log forensics analysis
[STL]优先级队列priority_queue
dataframe整理:datetime格式分拆;删除特定行;分组整合。
[noip2001 popularization group] packing problem
Canvas -- draw curve -- wall clock, pie chart, five pointed star
Matlab simulation of vertical handover between MTD SCDMA and TD LTE dual networks