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 库的更多相关文章

  1. (四) tensorflow笔记:常用函数说明

    tensorflow笔记系列: (一) tensorflow笔记:流程,概念和简单代码注释 (二) tensorflow笔记:多层CNN代码分析 (三) tensorflow笔记:多层LSTM代码分析 ...

  2. 《ORACLE数据库管理与开发》第三章学习之常用函数记录

    <ORACLE数据库管理与开发>第三章学习之常用函数记录 注:文章中的*代表所要操作的列名 1.lower(*)/upper(*),将此列下的值转为小写/大写 2.initcap(*):把 ...

  3. 深度学习原理与框架-图像补全(原理与代码) 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 ...

  4. 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 ...

  5. TensorFlow卷积网络常用函数参数详细总结

    卷积操作 tf.nn.conv2d(input, filter, strides, padding, use_cudnn_on_gpu=None, name=None) 除去name参数用以指定该操作 ...

  6. tensorflow 的 Batch Normalization 实现(tf.nn.moments、tf.nn.batch_normalization)

    tensorflow 在实现 Batch Normalization(各个网络层输出的归一化)时,主要用到以下两个 api: tf.nn.moments(x, axes, name=None, kee ...

  7. Oracle学习笔记——常用函数总结

    在平时写PL/SQL的时候,经常要用到很多系统自带的函数,而这些函数用起来非常好用,但是每次用完以后,就又忘到脑后了,为了加深自己的映象,以及对这些函数做一个全面的总结,就有了今天这篇文章. 首先这就 ...

  8. tensorflow笔记 :常用函数说明

    常用函数说明,梯度.产生变量等 http://blog.csdn.net/c2a2o2/article/details/69061539

  9. Java学习:常用函数接口

    常用函数接口 什么是函数式接口? 函数式接口,@FunctionalInterface,简称FI,简单的说,FI就是指仅含有一个抽象方法的接口,以@Functionalnterface标注 注意:这里 ...

随机推荐

  1. windows下配置mycat与常见问题解决

    mycat官网:http://www.mycat.org.cn/ wiki:https://github.com/MyCATApache/Mycat-Server/wiki MyCat使用Mysql的 ...

  2. c编程:僵尸吃大脑

    第一行输入一个正整数n 以下每一行输入僵尸已经吃了的大脑数量a,和需要生存必需要吃的大脑数量b.总共n行. 例子输入 3 4 5 3 3 4 3 例子输出 NO BRAINS MMM BRAINS M ...

  3. H5移动端IOS/Android兼容性总结,持续更新中…

    H5移动端IOS/Android兼容性总结,持续更新中… 1. IOS不识别日期 new Date("2018-07-01 08:00:00")在Android下正常显示可以直接进 ...

  4. Android Studio查看android源码

    Android Studio的默认版本在/Applications/Android Studio.app/Contents/info.plist中设置,默认没有1.8.如下: <key>J ...

  5. SoC编译HEX脚本(基于RISC-V的SoC)

    SoC编译HEX脚本(基于RISC-V的SoC) 脚本使用 ./compile hello 脚本:设置RISC-V工具链riscv_set_env ############## RISC-V #### ...

  6. 【LeetCode】【C++】Linked list cycle 2

    Given a linked list, return the node where the cycle begins. If there is no cycle, return null. Foll ...

  7. MAVEN Error: Using platform encoding (GBK actually) to copy filtered resources.....

    环境:Maven3.2.5+MyEclipse 2015CI 现象:在Maven编译过程中出现错误信息:Using platform encoding (GBK actually) to copy f ...

  8. [TypeStyle] Use TypeStyle keyframes to create CSS animations

    We cover CSS keyframes and how to create them using TypeStyle. We then show how to use the keyframes ...

  9. sublime课程3 emmet插件中的常用符号有哪些

    sublime课程3 emmet插件中的常用符号有哪些 一.总结 一句话总结:emmet插件中的符号和css选择器里面哪些符号的意思很像. 1.+是干嘛的? 组合 2.{}是干嘛的? 标签里面的inn ...

  10. wordpress-nas