一、TensorFlow学习入门

下载

  1. Python3.5.x,https://www.python.org/downloads/release/python-352/
  2. 设置python全局变量
  3. 验证python版本,python --version
  4. 下载tensorflow,pip3 install --upgrade tensorflow,公司网络,安装未发现问题。
  5. GPU版本暂时略。
  6. 验证TF安装成功。
import tensorflow as tf

hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
print(sess.run(hello))
  1. 运行查看输出
    b'Hello, TensorFlow!'

简介

TensorFlow provides multiple APIs. The lowest level API--TensorFlow Core-- provides you with complete programming control. We recommend TensorFlow Core for machine learning researchers and others who require fine levels of control over their models. The higher level APIs are built on top of TensorFlow Core. These higher level APIs are typically easier to learn and use than TensorFlow Core. In addition, the higher level APIs make repetitive tasks easier and more consistent between different users. A high-level API like tf.contrib.learn helps you manage data sets, estimators, training and inference. Note that a few of the high-level TensorFlow APIs--those whose method names contain contrib-- are still in development. It is possible that some contrib methods will change or become obsolete in subsequent TensorFlow releases.

这段话是什么意思

  1. TensorFlow提供了很多API。
  2. 最底层的API是TensorFlow Core,这个库给你提供了全部的编程控制接口。
  3. 高级接口是在TensorFlow Core基础上构建的。
  4. 简单来说,这些高级接口非常的容易学习、掌握和运用。

什么是张量(Tensors)

  1. 张量是TensorFlow数据的中央单元。
  2. 一个张量包含一系列的原始数据。
  3. 这些原始数据组装进一个任意维度数组里。
  4. 阶层(Rank),是一个张量的维度。

例子

3 # 0阶层,形状[ ]
[1., 2., 3.] # 1阶层张量,形状[3]
[[1., 2., 3.], [4., 5., 6.]] # 2阶层张量,是一个两行三列的矩阵[2, 3]
[[[1., 2., 3.]], [[4., 5., 6.]] # 3阶张量,形如[2, 1, 3]
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • Effective TensorFlow Table of Contents TensorFlow Basics ...
    法布雷加嘻阅读 584评论 0 1
  • 参加这个工作坊的目的,改变自己的沟通模式,能和孩子,父母,爱人发展好的关系。 第一天的收获,对pe...
    我是吕彦凝阅读 379评论 0 0
  • 暖心的早上。很开心今天早上收到了爱巴巴友们满满的爱,温暖的早安,特别暖~ 早上我们上了很高大上的审计实验课,一流的...
    吨吨儿阅读 638评论 0 0
  • 这几天乔任梁去世不仅成为娱乐圈的一颗炸弹,也成为大众茶余饭后的娱乐。有人震惊,有人悲伤,但也有人在调笑和戏谑…… ...
    芳草幽兰阅读 374评论 0 0
  • 时常迷上一首诗 入境入情 也拟几笔淡墨闲描 可以忘了眼前繁华或萧条 亦可听不到耳边车马喧嚣 心情于韵脚处顿挫抑扬 ...
    柏莲华阅读 438评论 0 5