美文网首页我爱编程
TensorFlow学习笔记1

TensorFlow学习笔记1

作者: HBU_DAVID | 来源:发表于2018-04-13 13:34 被阅读21次

GPU版安装好了,总会出莫名其妙的错误,还是驾驭不了。
作为初学者,还是不在这里浪费时间了,老老实实换回CPU版。


TF基本概念:

Tensor、graph、Session、Variable、feed 、fetch

张量 Tensor:多维数组

图 (graph)来表示计算任务.
会话 (Session)的上下文 (context)中执行图.
张量 (Tensor)表示数据.
通过变量 (Variable)维护状态.
使用feed和fetch可以为任意的操作(arbitrary operation) 赋值或者从其中获取数据.


TF常用函数:

https://www.cnblogs.com/wuzhitj/p/6298004.html

  • tf.placeholder()
  • tf.Variable()
  • tf.constant()
  • tf.Session() tf.InteractiveSession()
  • tf.global_variables_initializer()

  • tf.add()
  • tf.subtract()
  • tf.multiply()
  • tf.div()

  • tf.cast()
  • tf.zeros()

  • tf.assign()
  • tf.nn.softmax()
  • tf.argmax()
  • tf.reduce_sum()
  • tf.reduce_mean()

以上函数搞清楚了再继续看代码,不然真的是各种晕。
https://github.com/HBU/Jupyter/blob/master/TensorFlowManual/1.3%20%E5%9F%BA%E6%9C%AC%E7%94%A8%E6%B3%95.ipynb
https://github.com/HBU/Jupyter/blob/master/TensorFlowManual/2.3%20MNIST%20%E5%85%A5%E9%97%A8.ipynb
这两组代码是入门基础。

相关文章

网友评论

    本文标题:TensorFlow学习笔记1

    本文链接:https://www.haomeiwen.com/subject/yseckftx.html