TF 是谷歌的開源軟件庫~【后續(xù)更新中】
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
* 無監(jiān)督學習需要自動探索信息是怎樣組成的,并視別數據中的不同結構/ 從給定的數據集中找到感興趣的模式。
* 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】
一、環(huán)境搭建(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