## TensorFlow 笔记 转

AllenOR灵感

1.Tensorflow 数据类型

``````---------------------------------------------------------------
Data type (dtype)               Description
---------------------------------------------------------------

tf.float32                 32-bit floating point
tf.float64                 64-bit floating point
tf.int8                    8-bit signed integer
tf.int16                   16-bit signed integer
tf.int32                   32-bit signed integer
tf.int64                   64-bit signed integer
tf.uint8                   8-bit unsigned integer
tf.string                  String (as bytes array, not Unicode)
tf.bool                    Boolean
tf.complex64               Complex number, with 32-bit floating point real portion, and 32-bit floating point imaginary portion
tf.qint8                   8-bit signed integer (used in quantized Operations)
tf.qint32                  32-bit signed integer (used in quantized Operations)
tf.quint8                  8-bit unsigned integer (used in quantized Operations)``````

2.重载符号

TensorFlow重载了一些符号，使得表达更加清晰。

Unary operators

``````----------------------------------------------------------------------------------------
Operator               Related TensorFlow Operation
----------------------------------------------------------------------------------------

-x                        tf.neg()
~x                        tf.logical_not()
abs(x)                    tf.abs()``````

Binary operators

``````----------------------------------------------------------------------------------
Operator               Related TensorFlow Operation
-----------------------------------------------------------------------------------

x - y                            tf.sub()
x * y                            tf.mul()
x / y                            (Python 2) tf.div()
x / y                            (Python 3) tf.truediv()
x // y                           (Python 3) tf.floordiv()
x % y                            tf.mod()
x ** y                           tf.pow()
x < y                            tf.less()
x <=    y                        tf.less_equal()
x > y                            tf.greater()
x >= y                           tf.greater_equal()
x & y                            tf.logical_and()
x | y                            tf.logical_or()
x ^ y                            tf.logical_xor()``````

3.图和会话

``````# 一般我们写程序的时候，都会指定是哪个图
# 得到默认图
default_graph = tf.get_default_graph()
g = tf.Graph()

with g.as_default():
a = tf.constant(2)
b = tf.constant(4)

with default_graph.as_default():
aa = tf.constant(4)
bb = tf.constant(8)

sess = tf.Session(graph = g)
# 这个语句是对的，因为会话里面的图是g
print(sess.run(c))
# 这个语句是错误的，因为只有图g能执行，而图default_graph不行，因为不在会话里
print(sess.run(cc))``````

### AllenOR灵感

ImWiki
2018/05/16
0
0
GitHub超过2600星的TensorFlow教程，简洁清晰还不太难丨资源

2018/10/18
0
0

2018/04/21
0
0

ImWiki
2018/05/16
0
0
win10 安装 tensorflow 并运行helloworld

win10 安装 tensorflow 并运行helloworld 折腾了一下，在win10上成功安装tensorflow. 1 下载安装python,注意一定要是64位（比如python-3.5.1-amd64）的，建议直接下载.exe版本的，在安装的时...

2017/04/09
0
0

import javax.servlet.ServletException;import javax.servlet.annotation.WebServlet;import javax.servlet.http.Cookie;import javax.servlet.http.HttpServlet;import javax.serv......

gwl_

1
0

stars永恒

1
0

NotFound403

3
0
day22:

1、写一个getinterface.sh 脚本可以接受选项[i，I]，完成下面任务： 1）使用格式：getinterface.sh [-i interface | -I ip] 2）当用户使用-i选项时，显示指定网卡的IP地址；当用户使用-I选项...

2
0
Spring Cloud Alibaba基础教程：使用Nacos实现服务注册与发现

4
0