深度学习的框架,我们熟知的有caffe,torch和convnet。最近,Google又搞了一个TensorFlow,已经开源:http://www.tensorflow.org/。据说,谷歌的深度学习研究人员都在用TensorFlow,未来也将在机器学习产品中继续使用。那么,作为小码农的我需要紧跟时代的步伐啊,探索一下这个新家伙。

本博文分为两个部分,第一个部分介绍TensorFlow的安装,第二部分探索一下TensorFlow的基本使用知识。

一. TensorFlow的安装

个人觉得TensorFlow的安装比前几个框架的安装简单。小码农我的系统是Ubuntu15.04,这里介绍一下Ubuntu下安装TensorFlow的方法,代码如下:


<span style="font-size:14px;"># For CPU-only version
$ pip install https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.5.0-cp27-none-linux_x86_64.whl

# For GPU-enabled version (only install this version if you have the CUDA sdk installed)
$ pip install https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.5.0-cp27-none-linux_x86_64.whl</span>

需要注意的是系统已经安装好python,假如使用的GPU,还需要把GPU的驱动安装好。GPU驱动安装可参考:http://blog.csdn.net/helei001/article/details/46950853

如果你是其他的系统,请参考网页:http://www.tensorflow.org/get_started/os_setup.md

二. TensorFlow的基本使用

TensorFlow的使用与python的运算库一样,负责与硬件打交道的是session,用来驱动GPU或者CPU。话不多说,上代码:

<span style="font-size:14px;">import tensorflow as tf
# The value returned by the constructor represents the output of the Constant op.
matrix1 = tf.constant([[3., 3.]])

# Create another Constant that produces a 2x1 matrix.
matrix2 = tf.constant([[2.],[2.]])
product = tf.matmul(matrix1, matrix2)
sess = tf.Session()
result = sess.run(product)
print result

# Close the Session when we're done.
sess.close()</span>

参考链接:

http://www.tensorflow.org/get_started

推荐资料:

[1] first-contact-with-tensorflow

[2] http://learningtensorflow.com/

[3] https://hackerlists.com/tensorflow-resources/

最新文章

  1. ES5语法
  2. nancy中视图呈现 Html.Partial(RenderPage的替代品)
  3. Angular从0到1:function(下)
  4. JAVA - JAVA编译运行过程
  5. w3m常用快捷键
  6. BaiduMap Search List
  7. 消息框用法MessageBox
  8. 【EasyUI】Combobox的联动和onChange/onSelect事件绑定
  9. MVVM模式中WPF数据的完全绑定
  10. rowid结构浅析
  11. Python源代码剖析笔记3-Python运行原理初探
  12. dede织梦怎么修改description的字数
  13. 【NOIP2004】【CJOJ1703】【洛谷1092】虫食算
  14. ubuntu 16.04 安装 ssh
  15. angualr Material Icons
  16. CSS3性能体验
  17. matlab生成滤波器系数组
  18. JMS学习(二)之ActiveMQ
  19. Oracle 将另外一张表的列更新到本表的列
  20. 2018.10.22 cogs2471. [EZOI 2016]源氏的数学课(线段树)

热门文章

  1. Log4j使用详解
  2. combobox数据绑定
  3. select动态绑定vue.js
  4. 41. First Missing Positive(困难, 用到 counting sort 方法)
  5. python--ftp服务器(pyftpdlib)
  6. Swift中的可选协议和方法的历史渊源
  7. Xcode Organizational Identifiers
  8. mysql字符集,insert,update,delete,select
  9. [lua]luasocket.c:20:17: fatal error: lua.h: No such file or directory
  10. 有n个数,输出其中所有和为s的k个数的组合。