当前位置:网站首页>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)

边栏推荐
猜你喜欢

PMP daily practice | didn't lost a 8.9 (including agile + multi-select)

安科瑞无线物联网智能电表ADW300指导性技术要求-Susie 周

数据集成API如何成为企业数字化转型的关键?

What are the benefits of enterprise data integration?How do different industries solve the problem of data access?

How to fix Windows 11 not finding files

定投的基金

Access control knowledge

cadence中复制一部分PCB到另一个PCB中去

URL Protocol web page to open the application

筑牢安全防线 鹤壁经济技术开发区开展安全生产培训
随机推荐
Problems with compiling SIP with QGIS
下秒数据:湖仓一体带来的现代数据堆栈变革开始了
gmail+mtalk配合打免费网络电话。
字节二面问的MySQL,差点没答好
字符串哈希(2014 SERC J题)
【stack】【queue】【priority_queue】【deque】详解
Endpoint mode for NetCore routing
一种基于连接和安全熵的网络空间整体安全认识和方法
Definition and Basic Operations of Linear Tables
knn到底咋回事?
[Graphic and textual] How to reinstall Win7 system
Reverse Analysis of Unknown Cryptographic Protocol Based on Network Data Flow
【Efficient Tools】Remote Control Software ToDesk (Favorites)
什么是源文件?
Wps下划线怎么弄?Wps添加下划线的最全方法
编程语言中,取余和取模的区别
小黑leetcode清爽雨天之旅,刚吃完宇飞牛肉面、麻辣烫和啤酒:112. 路径总和
Word第一页空白页怎么删除?删除Word第一页空白页方法教程
蓝牙模块有哪些种类?BLE低功耗蓝牙模块有什么特点?
场效应管Mosfet之雷卯Leiditech对应英飞凌Infineon