
Tensorflow
PoemK
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Tensorflow reduce_sum()
tf.reduce_sum(arg1,arg2) 对arg1进行求和,消去维度arg2。 arg1:待处理数据 arg2: 如果为空,那么对数据中所有元素求和; 否则,代表消去的维度。 print(tf.reduce_sum( [[1, 2, 3],[1, 2, 3]] ) ) print(tf.reduce_sum( [[1, 2, 3],[1, 2, 3]],0 ) ) #消去第0维,即对...原创 2019-02-07 20:04:56 · 365 阅读 · 0 评论 -
Tensorflow官方教程笔记--Eager execution basics
import tensorflow as tf print(tf.add(1, 2)) print(tf.add([1, 2], [3, 4])) print(tf.square(5)) print(tf.reduce_sum([1, 2, 3])) print(tf.encode_base64("hello world")) print(tf.square(2) + tf.square(3)) ...原创 2019-02-07 21:05:21 · 2329 阅读 · 0 评论 -
Tensorflow官方教程笔记--Automatic differentiation and gradient tape
import tensorflow as tf import numpy as np tf.enable_eager_execution() #这句得在程序开始执行前写 x = tf.ones((2, 2)) with tf.GradientTape() as t: t.watch(x) y = tf.reduce_sum(x) z = tf.multiply(y, y) pri...原创 2019-02-08 12:20:04 · 1408 阅读 · 2 评论 -
Tensorflow 教程笔记---Custom training basics
import tensorflow as tf tf.enable_eager_execution() Variable operator x = tf.zeros([10, 10]) x += 2 # This is equivalent to x = x + 2, which does not mutate the original # value of x print(...原创 2019-02-08 13:54:45 · 798 阅读 · 0 评论 -
Tensorflow 教程笔记---Custom layers
import tensorflow as tf tf.enable_eager_execution() Layers: common sets of useful operations # In the tf.keras.layers package, layers are objects. To construct a layer, # simply construct the object...原创 2019-02-09 21:42:06 · 2281 阅读 · 0 评论