tf.sign和tf.reduce_sum
来源:互联网 发布:论文数据库 编辑:程序博客网 时间:2024/05/22 04:51
tf.sign和tf.reduce_sum
tensorflow中两个经常用到的操作,理解的不是很透彻,故在此做标记:
关于reduce_sum的维度问题也容易让人迷惑,特找来好用的图示,一看即懂:
为了加深影响,给出简单code
import numpy as npimport tensorflow as tfinputs = [[1,0,2],[3,2,4]]inputs = np.array(inputs)A = tf.sign(inputs)B = tf.reduce_sum(A, reduction_indices=1)with tf.Session() as sess: print(sess.run(A)) print(sess.run(B))
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
执行结果如下:
参考资料:
https://www.zhihu.com/question/51325408?from=profile_question_card
http://blog.csdn.net/lenbow/article/details/52152766
阅读全文
0 0
- tf.sign和tf.reduce_sum
- tf.sign和tf.reduce_sum
- tensorflow:tf.reduce_mean()和tf.reduce_sum()
- tensorflow API:tf.reduce_sum
- tf.sign()
- tf.reduce_sum理解(小记)
- tf.reduce_sum (API r1.3)
- tf.reduce_sum tensorflow维度上的操作
- 第二篇 对tf.reduce_sum的理解
- TF
- tf
- [tensorflow] which dimension to reduce in tf.reduce_sum()
- 理解TF和TF-IDF
- tf.get_variable 和tf.variable_scope
- tf.arg_max和tf.argmax
- tf.get_variable 和tf.variable_scope
- tf.get_variable 和tf.variable_scope
- tf 深入Time和TF
- 51nod 1705 七星剑
- Fingo开发者大赛奖金发放,哈视奇等团队共享 10万美金
- 电脑安装多个版本的jdk解决方法
- LeetCode
- mysql远程客户端无法连接,修改配置文件
- tf.sign和tf.reduce_sum
- 【PSOC4】入门学习笔记6——电容触摸滑条控制LED灯
- 1333: 找罪犯
- 未来与AI
- iOS几个小知识点的总结
- cookie乱码问题
- java安全
- Python异常处理
- STC-ISP下载失败的原因小结