TensorFlow 学习(七) — 常用函数 api、tf.nn 库
0. 四则运算
- 平方:tf.square(),开方:tf.sqrt()
- tf.add()、tf.sub()、tf.mul()、tf.div()、tf.mod()、tf.abs()、tf.neg()
1. 简单数理统计
Rn→R(从矢量到标量),意味着一种约简(reduce)。
- 均值:tf.reduce_mean,求和:tf.reduce_sum
- stddev = tf.sqrt(tf.reduce_mean(tf.square(var - mean)))
- 最大最小(极值):tf.reduce_max/tf.reduce_min
2. 初始化子(initializer)
- tf.zeros_initializer()
- tf.ones_initializer()
- tf.constant_initializer()
- tf.constant_initializer(0.) ⇒ float
- tf.constant_initializer(0, dtype=tf.int64)
- tf.random_normal_initializer()
与 tf.global_variable_initializer() 所不同的是,以上这些返回的是对象(<tensorflow.python.ops.init_ops.Constant/RandomNormal/Ones/Zeros at 0xXXX>),而 tf.global_variable_initializer() 返回的则是一种 tf.Operation(<tf.Operation 'init_N' type=NoOp>),
3. 矩阵矢量运算
- tf.diag、tf.transpose、tf.matmul、
- tf.matrix_determinant(方阵行列式)、tf.matrix_inverse(方阵求逆)
4. tf.nn
softmax + cross entropy:
tf.nn.softmax_cross_entropy_with_logits(logits, labels) ⇒ tf.reduce_mean()
TensorFlow 学习(七) — 常用函数 api、tf.nn 库的更多相关文章
- (四) tensorflow笔记:常用函数说明
tensorflow笔记系列: (一) tensorflow笔记:流程,概念和简单代码注释 (二) tensorflow笔记:多层CNN代码分析 (三) tensorflow笔记:多层LSTM代码分析 ...
- 《ORACLE数据库管理与开发》第三章学习之常用函数记录
<ORACLE数据库管理与开发>第三章学习之常用函数记录 注:文章中的*代表所要操作的列名 1.lower(*)/upper(*),将此列下的值转为小写/大写 2.initcap(*):把 ...
- 深度学习原理与框架-图像补全(原理与代码) 1.tf.nn.moments(求平均值和标准差) 2.tf.control_dependencies(先执行内部操作) 3.tf.cond(判别执行前或后函数) 4.tf.nn.atrous_conv2d 5.tf.nn.conv2d_transpose(反卷积) 7.tf.train.get_checkpoint_state(判断sess是否存在
1. tf.nn.moments(x, axes=[0, 1, 2]) # 对前三个维度求平均值和标准差,结果为最后一个维度,即对每个feature_map求平均值和标准差 参数说明:x为输入的fe ...
- TensorFlow中的L2正则化函数:tf.nn.l2_loss()与tf.contrib.layers.l2_regularizerd()的用法与异同
tf.nn.l2_loss()与tf.contrib.layers.l2_regularizerd()都是TensorFlow中的L2正则化函数,tf.contrib.layers.l2_regula ...
- TensorFlow卷积网络常用函数参数详细总结
卷积操作 tf.nn.conv2d(input, filter, strides, padding, use_cudnn_on_gpu=None, name=None) 除去name参数用以指定该操作 ...
- tensorflow 的 Batch Normalization 实现(tf.nn.moments、tf.nn.batch_normalization)
tensorflow 在实现 Batch Normalization(各个网络层输出的归一化)时,主要用到以下两个 api: tf.nn.moments(x, axes, name=None, kee ...
- Oracle学习笔记——常用函数总结
在平时写PL/SQL的时候,经常要用到很多系统自带的函数,而这些函数用起来非常好用,但是每次用完以后,就又忘到脑后了,为了加深自己的映象,以及对这些函数做一个全面的总结,就有了今天这篇文章. 首先这就 ...
- tensorflow笔记 :常用函数说明
常用函数说明,梯度.产生变量等 http://blog.csdn.net/c2a2o2/article/details/69061539
- Java学习:常用函数接口
常用函数接口 什么是函数式接口? 函数式接口,@FunctionalInterface,简称FI,简单的说,FI就是指仅含有一个抽象方法的接口,以@Functionalnterface标注 注意:这里 ...
随机推荐
- [D3] Add hovercard
The way to add hovercard is Append a div with class 'hovercard' in the tick function, positioning th ...
- php字符串函数分类总结
php字符串函数分类总结 一.总结 explode str_split str_word_count strtolower 二.php字符串函数分类总结 php内置了98个字符串函数(除了基于正 ...
- Javascript和jquery事件--鼠标事件的小结
1.鼠标事件的主要事件应该是mouseup, mousedown, mousewheel, mousemove, mouseover, moveout. <1>其中mouseup和mous ...
- 【Codeforces Round #433 (Div. 1) B】Jury Meeting
[链接]h在这里写链接 [题意] 有n个人,它们都要在某一时刻开始,全都到达0位置,然后维持最少k个时间单位,然后再全都回到原来的位置; 第i个人初始的位置是i. 且一共有m班航班. 每一班航班,要么 ...
- 算法学习笔记(六) 二叉树和图遍历—深搜 DFS 与广搜 BFS
图的深搜与广搜 复习下二叉树.图的深搜与广搜. 从图的遍历说起.图的遍历方法有两种:深度优先遍历(Depth First Search), 广度优先遍历(Breadth First Search),其 ...
- Android实现主动连接蓝牙耳机
在Android程序中可以实现自动扫描蓝牙.配对蓝牙.建立数据通道. 蓝牙分不同类型,可以参考(http://gqdy365.iteye.com/admin/blogs/2229304) 可以入下面方 ...
- 简介及环境搭建跑通Hello
简介及环境搭建跑通Hello Spring Spring是一个开放源代码的设计层面框架,他解决的是业务逻辑层和其他各层的松耦合问题,因此它将面向接口的编程思想贯穿整个系统应用.是为了解决企业应用程序开 ...
- 《JavaScript高级程序设计》笔记——第一章到第三章
2019年,新年伊始,我打算好好重读一下<JavaScript高级程序设计>这本前端必备经典书.每天半小时. 以下内容摘自<JavaScript高级程序设计> 2019-2-1 ...
- 9.13 Binder系统_Java实现_内部机制_Server端
logcat TestServer:* TestClient:* HelloService:* *:S &CLASSPATH=/mnt/android_fs/TestServer.jar ap ...
- [TypeScript] Using Assertion to Convert Types in TypeScript
Sometimes the compiler needs help figuring out a type. In this lesson we learn how to help out the c ...