随笔分类 - 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=()
阅读全文
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,
阅读全文
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
阅读全文
浙公网安备 33010602011771号