当前位置:网站首页>tf.reduce_mean() and tf.reduce_sum()
tf.reduce_mean() and tf.reduce_sum()
2022-08-11 07:51:00 【phac123】
Introduction
TF.reduce_mean() and tf.reduce_sum() are often used in TF to average and sum the specified dimensions of the specified tensor respectively.
# Calculates the mean of a tensor along the specified dimensiontf.reduce_mean (tensor name, axis=operation axis)# Calculate the sum of the tensor along the specified dimensiontf.reduce_sum (tensor name, axis=operation axis)
Code
import tensorflow as tfx = tf.constant([[1, 2, 3], [2, 2, 3]])print("x: ", x)print("mean of x: ", tf.reduce_mean(x))print("mean of x: ", tf.reduce_mean(x, axis = 0))print("mean of x: ", tf.reduce_mean(x, axis = 1))print("mean of x: ", tf.reduce_sum(x))print("sum of x: ", tf.reduce_sum(x, axis = 0))print("sum of x: ", tf.reduce_sum(x, axis = 1))
Which axis is specified, turn that dimension into 1 row/column/…
边栏推荐
- Pinduoduo API interface
- 语音信号处理:预处理【预加重、分帧、加窗】
- 年薪40W测试工程师成长之路,你在哪个阶段?
- Pico neo3 Unity打包设置
- 1096 大美数 (15 分)
- Pytorch模型转ONNX模型
- maxwell concept
- Redis source code-String: Redis String command, Redis String storage principle, three encoding types of Redis string, Redis String SDS source code analysis, Redis String application scenarios
- prometheus学习4Grafana监控mysql&blackbox了解
- 接入网、承载网、核心网是什么,交换机路由器是什么、这个和网络的协议有什么关系呢?
猜你喜欢
MindManager2022全新正式免费思维导图更新
go-grpc TSL认证 解决 transport: authentication handshake failed: x509 certificate relies on ... ...
项目1-PM2.5预测
When MySQL uses GROUP BY to group the query, the SELECT query field contains non-grouping fields
opencv实现数据增强(图片+标签)平移,翻转,缩放,旋转
1061 True or False (15 points)
详述 MIMIC护理人员信息表(十五)
进制转换间的那点事
公牛10-11德里克·罗斯最强赛季记录
1.2-误差来源
随机推荐
1056 Sum of Combinations (15 points)
STM32CUBEIDE(11)----输出PWM及修改PWM频率与占空比
1061 True or False (15 points)
3GPP LTE/NR信道模型
oracle19c does not support real-time synchronization parameters, do you guys have any good solutions?
tf.reduce_mean()与tf.reduce_sum()
Pytorch模型转ONNX模型
MySQL使用GROUP BY 分组查询时,SELECT 查询字段包含非分组字段
1046 划拳 (15 分)
3.2-分类-Logistic回归
基于FPGA的FIR滤波器的实现(4)— 串行结构FIR滤波器的FPGA代码实现
SQL sliding window
TF通过feature与label生成(特征,标签)集合,tf.data.Dataset.from_tensor_slices
Pico neo3在Unity中的交互操作
流式结构化数据计算语言的进化与新选择
1091 N-自守数 (15 分)
opencv实现数据增强(图片+标签)平移,翻转,缩放,旋转
Redis source code-String: Redis String command, Redis String storage principle, three encoding types of Redis string, Redis String SDS source code analysis, Redis String application scenarios
MindManager2022全新正式免费思维导图更新
TF中的One-hot