摘要:
张量的变换 功能代码改变视图tf.reshape(x,shape)增加维度tf.expand_dims(x, axis)删除维度tf.squeeze(x, axis)交换维度tf.transpose(x, perm)复制数据tf.tile(x, multiples) 改变视图 tf.reshape( 阅读全文
posted @ 2020-08-22 18:47
kuanleung
阅读(49)
评论(0)
推荐(0)
摘要:
数据索引与切片 索引 通过随机数模拟输入x为 5张6 × 6大小的彩色图片, 张量表达为x[5,6,6,3]x[k][m][n][h] 与 x[k,m,n,h]表达方式等价 import tensorflow as tf x = tf.random.normal([5,6,6,3]) print(x 阅读全文
posted @ 2020-08-22 15:05
kuanleung
阅读(25)
评论(0)
推荐(0)
摘要:
张量的应用 标量 简单 向量 用于b向量的构建 矩阵 多个样本的计算 矩阵运算例子: import tensorflow as tf x = tf.random.normal([3,4]) #模拟3个样本4个特征的输入数据 w = tf.ones([4,3]) #权重 b = tf.zeros([3 阅读全文
posted @ 2020-08-22 14:38
kuanleung
阅读(14)
评论(0)
推荐(0)

浙公网安备 33010602011771号