- TensorFlow 2.0 Quick Start Guide
- Tony Holdroyd
- 67字
- 2021-06-24 16:02:05
Finding the mean across rows
Find the mean across rows (that is, reduce columns) with this:
tf.reduce_mean(input_tensor=numbers, axis=1) # [ (4. + 5. )/2 , (7. + 3. )/2] = [4.5, 5]
The output will be as follows:
<tf.Tensor: id=64, shape=(2,), dtype=float32, numpy=array([4.5, 5. ], dtype=float32)>
When keepdims is True, the reduced axis is retained with a length of 1:
tf.reduce_mean(input_tensor=numbers, axis=1, keepdims=True)
The output is as follows:
([[4.5], [5]]) (2 rows, 1 column)
推薦閱讀
- Word 2000、Excel 2000、PowerPoint 2000上機指導(dǎo)與練習(xí)
- Design for the Future
- 輕松學(xué)Java Web開發(fā)
- Practical Data Wrangling
- Dreamweaver CS3網(wǎng)頁設(shè)計50例
- 輕松學(xué)Java
- 機器人創(chuàng)新實訓(xùn)教程
- 統(tǒng)計策略搜索強化學(xué)習(xí)方法及應(yīng)用
- 新手學(xué)電腦快速入門
- PowerMill 2020五軸數(shù)控加工編程應(yīng)用實例
- 貫通開源Web圖形與報表技術(shù)全集
- Data Analysis with R(Second Edition)
- Eclipse RCP應(yīng)用系統(tǒng)開發(fā)方法與實戰(zhàn)
- Mastercam X5應(yīng)用技能基本功特訓(xùn)
- 這樣用Word!