美文网首页我爱编程深度学习
TensorFlow小项目实践 & 自己搭建神经网络

TensorFlow小项目实践 & 自己搭建神经网络

作者: lv_dl | 来源:发表于2018-01-18 14:56 被阅读0次

TF 是谷歌的开源软件库~【后续更新中】

day1.16

注意1:

~输出结果切记不要忘记此语句:sess= tf.Session()  【开启会话】

~变量可以先设置好初始化方式,但是真正初始化是要输入以下语句:

sess.run(tf.global_variables_initializer())

技巧1:

从numpy数组到tf张量,和从tf张量到numpy数组课相互操作,通过调用eval()函数会返回numpy对象,等价于Session.run(tensor_to_eval)

技巧2:

tf.Operation.type   返回操作的类型(如MatMul)

tf.Operation.inputs  返回表示操作的数日张量对象列表

tf.Graph.get_operations()  返回计算图中的操作列表

tf.Graph.version  返回计算图的版本信息

技巧3:

tensorboard使用 

tensorboard -h

tensorboard [-h] [--logdir LOGDIR] [--debug [DEBUG]] [--nodebug] [--host HOST] [--port PORT]

day1.20

* 无监督学习需要自动探索信息是怎样组成的,并视别数据中的不同结构/ 从给定的数据集中找到感兴趣的模式。

* k均值,常见的聚类算法/ 将数据集分割为k个不相交的组或者簇,每个簇的指标就是该组所有成员的均值。

* k最近邻(knn),简单而经典,只看周边,且假装知道所有。

* matplotlib绘图/ 例如:更多:http://matplotlib.org/



* scikit-learn 基于python编程语言的开源机器学习库。http://scikit-learn .org/stable/datasets/

* 函数名的坑(sub -subtract)

day 2.03

【代码百度云链接:链接:https://pan.baidu.com/s/1smsBmJb 密码:bnjh】

一、环境搭建(tf1.6, py3.6)

1、pip3 install--upgrade tensorflow

2、gpu:pip install--upgradetensorflow-gpu

3、报错:[Error importing tensorflow. Unless you are using bazel,you should not try to import tensorflow from its source directory;please exit the tensorflow source tree, and relaunch your python interpreter from there.]

解决:下载安装 Windows 的 Microsoft Visual C++ 2015 redistributable update 3 64 bit

二、结构、会话等学习

1、结构

2、会话

3、变量

4、tensorboard

运行脚本文件,生成‘logs’ 文件夹,打开cmd,进入logs目录文件夹,

输入:tensorboard --logdir=logs

再google打开:http://DESKTOP-ABDOQC9:6006

5、搭建cnn处理mnist

6、save network

相关文章

网友评论

    本文标题:TensorFlow小项目实践 & 自己搭建神经网络

    本文链接:https://www.haomeiwen.com/subject/viysoxtx.html