随笔分类 -  Tensorflow基础入门

摘要:张量的变换 功能代码改变视图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 阅读(51) 评论(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)
摘要:创建张量 综述: 功能代码利用数组、列表对象创建张量tf.constant与tf.convert_to_tensor创建纯0 或纯 1 张量tf.zeros()和tf.ones()按照现有张量创建纯0 或纯 1 张量tf.zeros_like, tf.ones_like创建自定义纯数字张量tf.fi 阅读全文
posted @ 2020-08-21 15:13 kuanleung 阅读(54) 评论(0) 推荐(0)
摘要:数据类型 tensorflow的基础是数据类型,依赖特有的函数进行创建,此部分介绍与演示创建最基础常用的数据类型 数值类型、 字符串类型和布尔类型 数值类型 标量 0,1,2,3,4,5 创建标量实例: import tensorflow as tf a = tf.constant(1.2) b = 阅读全文
posted @ 2020-08-21 13:54 kuanleung 阅读(50) 评论(0) 推荐(0)
摘要:安装Tensorflow 自动安装: pip install tensorflow -i https://pypi.douban.com/simple 速度最快的镜像 https://pypi.tuna.tsinghua.edu.cn/simple 镜像站点汇总 https://blog.csdn. 阅读全文
posted @ 2020-08-20 18:19 kuanleung 阅读(8) 评论(0) 推荐(0)
摘要:tensorflow镜像地址: https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/tensorflow/ 点击进入 tensorflow镜像站点 阅读全文
posted @ 2020-08-20 17:40 kuanleung 阅读(9) 评论(0) 推荐(0)
摘要:一、站点 (一)企业站 网易:http://mirrors.163.com/搜狐:http://mirrors.sohu.com/(Ubuntu旧发行版同步被冻结,不同步Ubuntu新发行版,Ubuntu源同步正常)阿里云:http://mirrors.aliyun.com/(部分镜像同步延迟超过1 阅读全文
posted @ 2020-08-20 11:08 kuanleung 阅读(14) 评论(0) 推荐(0)
摘要:tensorflow中文笔记 另一本学习笔记 https://github.com/dragen1860/Deep-Learning-with-TensorFlow-book 中文tensorflow 书籍文件 阅读全文
posted @ 2020-07-20 19:58 kuanleung 阅读(8) 评论(0) 推荐(0)