当前位置:网站首页>TF中random.normal()与random.truncated_normal()
TF中random.normal()与random.truncated_normal()
2022-08-09 21:35:00 【phac123】
简述
TF中常用tf.random.normal()与tf.random.truncated_normal()方法来创建符合正态分布的Tensor.
它们两者的区别在于后者保证了随机生成数据的取值在(μ-2σ,μ+2σ)之间,如果生成的数据超过了这个范围,则重新进行生成.
μ: 均值, σ: 标准差
代码
import tensorflow as tf
d = tf.random.normal([2, 2], mean = 0.5, stddev = 1)
print("d: ", d)
e = tf.random.truncated_normal([2, 2], mean = 0.5, stddev = 1)
print("e: ", e)

边栏推荐
- Jensen (琴生) 不等式
- Puyuan Jingdian turned losses into profits in the first half of the year, and high-end products continued to develop!Are you optimistic about "Huawei" in the instrument industry?
- 题解:Edu Codeforces 109(div2)
- Cholesterol-PEG-Thiol,CLS-PEG-SH,胆固醇-聚乙二醇-巯基用于改善溶解度
- How to fix Windows 11 not finding files
- [Essay] To the friends of the 19th issue
- Skywalking系列学习之Trace Profiling源码分析
- 普源精电上半年扭亏为盈,高端产品持续发力!你看好仪器界“华为”吗?
- 【深度学习】pix2pix GAN理论及代码实现
- Beat the interviewer, the CURD system can also make technical content
猜你喜欢

编程时请选择正确的输入法,严格区分中英文

Puyuan Jingdian turned losses into profits in the first half of the year, and high-end products continued to develop!Are you optimistic about "Huawei" in the instrument industry?

Word第一页空白页怎么删除?删除Word第一页空白页方法教程

DSPE-PEG-Azide, DSPE-PEG-N3, phospholipid-polyethylene glycol-azide can react directly with DBCO

Cholesterol-PEG-Thiol, CLS-PEG-SH, Cholesterol-PEG-Sulfhydryl for improved solubility

Wps下划线怎么弄?Wps添加下划线的最全方法

DSPE-PEG-PDP, DSPE-PEG-OPSS, phospholipid-polyethylene glycol-mercaptopyridine reduce the immunogenicity of peptides

Number of daffodils within a thousand

What are the benefits of enterprise data integration?How do different industries solve the problem of data access?
6个规则去净化你的代码
随机推荐
SecureCRT强制卸载
抽象类 or 接口
Beat the interviewer, the CURD system can also make technical content
蓝牙模块的分类和对应的属性特点
单元测试
MySQL笔记-06 基础SQL操作
What to do if Windows 11 can't find Internet Explorer
An overall security understanding and method of cyberspace based on connection and security entropy
微软word怎么转换成pdf文件?微软word转换为pdf格式的方法
Word文档怎么输入无穷大符号∞
mysql配置参数详解[通俗易懂]
Characteristics and Development Prospects of Korea's Cyber Security System
【Efficient Tools】Remote Control Software ToDesk (Favorites)
MySQL慢查询的多个原因
字符串哈希(2014 SERC J题)
Next second data: the transformation of the modern data stack brought about by the integration of lake and warehouse has begun
kvm虚拟机出现启动不了,NOT available,PV大于分区
AI+医疗:使用神经网络进行医学影像识别分析
Ankerui supports Ethernet communication, profibus communication embedded energy meter APM guiding technical requirements-Susie Week
json事例