随笔分类 -  9DNN库

1.3 tensorflow2.0 常用函数
摘要:with tf.GradientTape() as tape: w = tf.Variable(tf.constant(3.0)) loss = tf.pow(w,2) grad = tape.gradient(loss,w) print(grad) #tf.Tensor(6.0, shape=() 阅读全文
posted @ 2020-07-21 17:42 知否知否, 阅读(108) 评论(0) 推荐(0)
1.2 tensorflow2.0 常用函数
摘要:a #<tf.Tensor: shape=(4, 2), dtype=float32, numpy= array([[ 0.491424 , 0.6428182 ], [ 2.247138 , 0.2008341 ], [ 0.93056387, 0.01603121], [ 0.33425295, 阅读全文
posted @ 2020-07-21 16:57 知否知否, 阅读(234) 评论(0) 推荐(0)
1.1tensorflow2.0 张量
摘要:a = tf.constant([1,5],dtype=tf.int64) b = np.arange(0,5) c = tf.convert_to_tensor(b) d = tf.ones([3,4]) e = tf.random.normal([3,3]) f = tf.random.trun 阅读全文
posted @ 2020-07-21 16:30 知否知否, 阅读(122) 评论(0) 推荐(0)