这里,我们主要了解cpu版本的tensorflow 选择的安装方法为: cmd 中 执行 pip install tensorflow
- 遇到的坑:如果电脑中没有Microsoft Visual Studio 2015-2019的话, 安装结束后 ,在import的时候会报错
- 安装成功检测: 在cmd中输入 pip install tensorflow 出现一系列的 Requirement already satisfied:... 随后进入python解释器,试着import tensorflow as tf, 如果没有报错,即安装成功!
下面就进入每天的学习把! (每一天的代码里都会有我自己详细的注释,自己查阅资料的笔记,以及自己的思考等...)
- 为了方便不同平台的使用者,每天的代码都会以.ipynb的格式和.py的格式上传。
day1 : 读取fashion_mnist的数据集
- 首先介绍一下Fashion MNIST数据集,它是7万张灰度图像组成,可以分成10个类别.每个灰度图像都是28*28像素的图像.我们将使用其中的6万张进行训练网络,另外的1万张来评估准确率.
- 他是为了后面的利用tensorflow进行该数据集的基本分类问题来做准备
day2 : 对fashion_mnist建模并对其进行图像分类测试
- 根据day1的数据,来建立预测模型,完成了第一个模型的建立。 并进行对测试集的准确率测试。
day3 : 对fashion_mnist数据集进行归一化处理
- 对fashion_mnist数据集进行归一化处理, 对归一化之后的数据集进行归一化建模, 对比和没有归一化数据建立的模型, 发现准确率有了一定程度的提升。所以,对于数据集进行归一化处理还是相当有必要的。
day4 : 回调函数的使用
- 建立之前的模型的时候,调用Keras.callbacksAPI里的方法(ModelCheckpoint, EarlyStopping , TensorBoard)
- 还有其他的方法,可以参考中文文档 https://keras.io/zh/callbacks/#_1
- 对于tensorboard 的调用, 可以见day4 里的三张截图, 打开步骤: 在callbacks所在的根目录下,进行cmd命令的调用,然后 输入tensorboard --logdir callbacks, 调用以后 输入(我这里)localhost:6006
day5 : 实现简单的深度神经网络
- 基于之前的数据集,建立最简单的深度神经网络
- 使用for _ in range(20) 建立20层神经网络, 使用relu 和 softmax 的激活函数
day6 : 实站批归一化、激活函数、dropout
- 对之前的模型,进行数据的批归一化、激活函数的更改尝试、以及dropout的使用,dropout的使用是为了缓解过拟合现象
day7 : 实现回归模型
- 引用新的数据集,也是keras.datasets里的加利福利亚的房价数据
day8 : 实现Wide&Deep模型
- 使用之前回归模型的房价数据
- wide&deep ---函数API实现
- subclass ---子类API实现
- multi-input , multi-output ---多输入, 多输出实现