
人工智障
亦散亦聚
蜗牛爬坡,等待被晒死的那一天!
展开
-
tensorflow中tf.InteractiveSession()和tf.Session()的区别
tf.Session() .Session() 通常要结合 .run() 才能执行 tensorflow 中的相关运算。 例如: sess = tf.Session() x = 1 y = 2 z = tf.add(x, y) result = sess.run(z) print(result) 利用tf.Session生成的句柄sess进行操作 tf.InteractiveSessio...原创 2018-10-16 16:47:40 · 749 阅读 · 0 评论 -
tensorflow学习笔记(一)
基础 .constant: 生成一个常量类型的张量 .Session: 生成一个可运算的会话句柄 .InteractiveSession(): 等价于 sess = tf.Session(), 但是结果的运行会有所不同 InteractiveSession():使用这个需要在运行函数后 .eval(), 才会得到结果 ...原创 2018-10-21 22:03:56 · 371 阅读 · 0 评论 -
tensorflow学习笔记(二)
矩阵运算 .transpose(X): 矩阵转置运算 .matmul(X, Y): 矩阵乘法 X * Y .matrix_determinant(X): 求矩阵行列式 .matrix_inverse(X): 求矩阵的逆 .matrix_solve(X, [[m], [n], [p], [q]]):求以矩阵 X 为系数矩阵,m、n、p、q 为常数的解...原创 2024-07-08 07:55:28 · 204 阅读 · 1 评论 -
tensorflow学习笔记(三)
张量的约简(Reduction) .reduce_prod: 对矩阵的每一行元素进行累乘 .reduce_min: 取矩阵每一行最小的元素 .reduce_max: 取矩阵每一行最大的元素 .reduce_mean: 求矩阵每一行之和的算术平均值 .reduce_sum: 对矩阵的每一行求和 .reduce_logsumexp: 对矩阵的每一行做 log(sum(exp(每行的元素))) 处...原创 2024-07-08 07:55:35 · 158 阅读 · 1 评论