Re: [問題] 深度學習(deep learning)出問題
本來用推文的,但越推越長,所以簡單回文好了.沒仔細搞懂你的
程式碼,但看到幾點問題:
1.正常的情況下,如果你要做的是分類器,你的output應該是softmax,
而不是用sigmoid,這不是正常會採用的輸出層修正.如果要搞懂
softmax,你最好也花點時間搞懂cross entropy.如果你要做的是回
歸器,一般會用均方差.(但我不懂為啥你的程式的loss定義的是
平均差? 除非正負號對誤差有意義,不然這很少用.你最好確定一下)
2.新版的tensorflow,已經把initialize_all_variabel改成
tf.global_variables_initializer,你的範例有點舊了.
3.一般來說,多層感知器(也就是最簡單的全連結神經網路)我們不會
去設定太多層,通常設個一兩層就夠了.如果你覺得結果不好,先試
試看把節點加多,而不是把層加厚.這會讓你的模型簡單一些.如果
還是不好,我們再試試看增加層數.不要一股腦地就就出很多層的
結構.這樣不僅難以分析,也很容易造成過擬合.
4.一個好的機器學習模型,不是不停地增加複雜度,讓問題可以被擬
合的越準越好,而是設計出一個模型,用最低程度的複雜度來回答
出問題最好.因為真實場景下的資料是不會盡如人意的,過於複雜
的模型除了浪費資源外,你也不容易修正模型.所以一看到問題就
先給他來個10層,20層不是好事.
5.看的出來你對機器學習還有神經網路不太懂,其實對於初學者,我是
不推薦一開始就從tensorflow上手的,我建議你應該先學scikit learn
跟Keras. scikit learn集成了很多機器學習的模型,你會比較了解
"分類,迴歸,聚類(clustering),降維"這機器學習中的四大基本觀念.
然後你再進到神經網路裡面,你會發現神經網路看似複雜,其實也就
是換個手段來處理上面這四大類問題而已.本質上差異不大.
6.如果你開始要進到神經網路了,我建議你可以先試著從Keras上手,
Keras是基於tensorflow的高階API,他是以模型導向的方式讓你建
構神經網路.而且Keras已經被收錄到tensorflow中了,之後應該會
從contrib中移到正式的架構內. 從Keras下手可以先幫助你了解
模型,再去深究tensorflow的語法.
如果你對機器學習的模型一無所知就想透過學tensorflow來理解
機器模型,是很容易吃鱉的,模型一個沒搞懂就先被他複雜的架構
給淹沒了(其實我甚至覺得tensorflow根本就是設計來做後端,他
本來就不該拿來做前端使用,你有需要每次開車都先從組裝輪子
開始?).這就像是你想學開車,你該做的事情是先去上駕訓班,而不
是去學汽車組裝.這不是不行,但那是等你有一天把車玩精了,想
改車的時候在做的事情.
說了這麼多,還是想講一點,機器學習的本質,核心,是那些一個一個
的模型,模型懂了,其實用哪套東西實作反而是次要的了.
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 73.90.201.243
※ 文章網址: https://www.ptt.cc/bbs/Python/M.1506020401.A.D48.html
推
09/22 03:08, , 1F
09/22 03:08, 1F
→
09/22 03:08, , 2F
09/22 03:08, 2F
※ 編輯: pipidog (73.90.201.243), 09/22/2017 03:54:38
推
09/22 11:01, , 3F
09/22 11:01, 3F
推
09/22 14:49, , 4F
09/22 14:49, 4F
推
09/22 15:45, , 5F
09/22 15:45, 5F
→
09/22 15:47, , 6F
09/22 15:47, 6F
→
09/22 15:49, , 7F
09/22 15:49, 7F
→
09/22 15:50, , 8F
09/22 15:50, 8F
→
09/22 15:52, , 9F
09/22 15:52, 9F
→
09/22 15:53, , 10F
09/22 15:53, 10F
→
09/22 15:55, , 11F
09/22 15:55, 11F
→
09/22 20:23, , 12F
09/22 20:23, 12F
→
09/22 20:24, , 13F
09/22 20:24, 13F
→
09/22 20:26, , 14F
09/22 20:26, 14F
推
09/22 20:42, , 15F
09/22 20:42, 15F
→
09/22 20:44, , 16F
09/22 20:44, 16F
推
09/22 20:47, , 17F
09/22 20:47, 17F
→
09/22 20:49, , 18F
09/22 20:49, 18F
推
09/22 20:58, , 19F
09/22 20:58, 19F
→
09/22 20:59, , 20F
09/22 20:59, 20F
→
09/22 21:02, , 21F
09/22 21:02, 21F
推
09/22 21:06, , 22F
09/22 21:06, 22F
→
09/22 21:07, , 23F
09/22 21:07, 23F
→
09/22 21:08, , 24F
09/22 21:08, 24F
→
09/22 21:09, , 25F
09/22 21:09, 25F
→
09/22 21:10, , 26F
09/22 21:10, 26F
推
09/22 21:10, , 27F
09/22 21:10, 27F
→
09/22 21:13, , 28F
09/22 21:13, 28F
→
09/22 21:14, , 29F
09/22 21:14, 29F
推
09/22 21:15, , 30F
09/22 21:15, 30F
→
09/22 21:15, , 31F
09/22 21:15, 31F
→
09/22 21:16, , 32F
09/22 21:16, 32F
→
09/22 21:16, , 33F
09/22 21:16, 33F
推
09/22 21:25, , 34F
09/22 21:25, 34F
→
09/22 21:26, , 35F
09/22 21:26, 35F
→
09/22 21:27, , 36F
09/22 21:27, 36F
推
09/22 21:32, , 37F
09/22 21:32, 37F
→
09/22 21:33, , 38F
09/22 21:33, 38F
推
09/22 22:52, , 39F
09/22 22:52, 39F
→
09/22 22:52, , 40F
09/22 22:52, 40F
推
09/22 22:53, , 41F
09/22 22:53, 41F
→
09/22 22:53, , 42F
09/22 22:53, 42F
→
09/22 22:54, , 43F
09/22 22:54, 43F
→
09/22 22:55, , 44F
09/22 22:55, 44F
推
09/22 22:55, , 45F
09/22 22:55, 45F
→
09/22 22:56, , 46F
09/22 22:56, 46F
推
09/22 22:59, , 47F
09/22 22:59, 47F
推
09/22 23:00, , 48F
09/22 23:00, 48F
推
09/22 23:03, , 49F
09/22 23:03, 49F
→
09/22 23:04, , 50F
09/22 23:04, 50F
→
09/22 23:05, , 51F
09/22 23:05, 51F
推
09/22 23:05, , 52F
09/22 23:05, 52F
→
09/22 23:07, , 53F
09/22 23:07, 53F
推
09/22 23:07, , 54F
09/22 23:07, 54F
→
09/22 23:08, , 55F
09/22 23:08, 55F
→
09/22 23:09, , 56F
09/22 23:09, 56F
推
09/22 23:13, , 57F
09/22 23:13, 57F
推
09/22 23:15, , 58F
09/22 23:15, 58F
→
09/22 23:16, , 59F
09/22 23:16, 59F
→
09/22 23:16, , 60F
09/22 23:16, 60F
推
09/22 23:17, , 61F
09/22 23:17, 61F
→
09/22 23:17, , 62F
09/22 23:17, 62F
推
09/22 23:21, , 63F
09/22 23:21, 63F
推
09/22 23:28, , 64F
09/22 23:28, 64F
→
09/22 23:30, , 65F
09/22 23:30, 65F
→
09/22 23:32, , 66F
09/22 23:32, 66F
→
09/22 23:33, , 67F
09/22 23:33, 67F
→
09/22 23:35, , 68F
09/22 23:35, 68F
→
09/22 23:36, , 69F
09/22 23:36, 69F
推
09/22 23:37, , 70F
09/22 23:37, 70F
→
09/22 23:37, , 71F
09/22 23:37, 71F
→
09/22 23:37, , 72F
09/22 23:37, 72F
→
09/22 23:38, , 73F
09/22 23:38, 73F
→
09/22 23:39, , 74F
09/22 23:39, 74F
→
09/22 23:39, , 75F
09/22 23:39, 75F
→
09/22 23:39, , 76F
09/22 23:39, 76F
→
09/22 23:41, , 77F
09/22 23:41, 77F
推
09/22 23:43, , 78F
09/22 23:43, 78F
推
09/22 23:51, , 79F
09/22 23:51, 79F
→
09/22 23:51, , 80F
09/22 23:51, 80F
推
09/22 23:54, , 81F
09/22 23:54, 81F
→
09/22 23:54, , 82F
09/22 23:54, 82F
→
09/22 23:55, , 83F
09/22 23:55, 83F
→
09/22 23:56, , 84F
09/22 23:56, 84F
→
09/22 23:56, , 85F
09/22 23:56, 85F
推
09/22 23:56, , 86F
09/22 23:56, 86F
推
09/22 23:58, , 87F
09/22 23:58, 87F
→
09/22 23:58, , 88F
09/22 23:58, 88F
→
09/23 00:00, , 89F
09/23 00:00, 89F
→
09/23 00:01, , 90F
09/23 00:01, 90F
推
09/23 00:03, , 91F
09/23 00:03, 91F
→
09/23 00:04, , 92F
09/23 00:04, 92F
推
09/23 10:02, , 93F
09/23 10:02, 93F
→
09/23 10:02, , 94F
09/23 10:02, 94F
推
09/23 10:17, , 95F
09/23 10:17, 95F
推
09/23 13:26, , 96F
09/23 13:26, 96F
→
09/23 13:26, , 97F
09/23 13:26, 97F
推
09/23 13:30, , 98F
09/23 13:30, 98F
討論串 (同標題文章)
完整討論串 (本文為第 2 之 3 篇):
Python 近期熱門文章
PTT數位生活區 即時熱門文章