We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
英文版:Little things about data massage for neural network
在設計類神經網絡時,有大約四處地方可供調控,從而令學習更有效。
這次實驗集中處理對輸入數據及預期輸出的調控。要令反向傳播學習(backpropagation learning)更易達成,我們需要將輸入數據標準化(standardization),以及將預期輸出進行重新縮放(rescaling)。
x' = ( x - x.mean() ) / x.var() y = ( y - y.min() ) / ( y.max() - y.min() )
輸入數據的標準化可以幫助穩定權重及偏權的調整,而預期輸出的數值應該遷就激勵函數(activation function)而作出調整。
以下是我們的類神經網絡要學習的數據。 y = cos(x1) * cos(x2) 以下是我們的類神經網絡。
m = Sequential() m.add( Dense( 16, input_dim=1, init='glorot_normal', activation='relu' ) ) m.add( Dense( 1, init='glorot_normal', activation='relu' ) ) m.compile( loss='mse', optimizer='adam' )
下圖是在訓練類神經網絡時所記錄的權重及偏權的調整和整體損失分數(total loss)。 權重調整 偏權調整 整體損失分數 我們的類神經網絡在訓練後的輸出跟預期輸出相似。 類神經網絡的輸出(綠);預期輸出(藍) 相反地,如果輸入數據沒有標準化,我們可以看出權重及偏權的調整比之前的不那麼平均,從而可能導致網絡中輸出神經元的飽和(saturation)。 權重調整 偏權調整 整體損失分數 我們的類神經網絡在訓練後的輸出仍未能跟預期輸出相似。 類神經網絡的輸出(綠);預期輸出(藍)
VC,軟件工程師,閒餘學習類神經網絡 學習筆記記錄於 http://www.medium.com/vclab
The text was updated successfully, but these errors were encountered:
No branches or pull requests
英文版:Little things about data massage for neural network
調控
在設計類神經網絡時,有大約四處地方可供調控,從而令學習更有效。
對數據的調控
這次實驗集中處理對輸入數據及預期輸出的調控。要令反向傳播學習(backpropagation learning)更易達成,我們需要將輸入數據標準化(standardization),以及將預期輸出進行重新縮放(rescaling)。
輸入數據的標準化可以幫助穩定權重及偏權的調整,而預期輸出的數值應該遷就激勵函數(activation function)而作出調整。
實驗結果
以下是我們的類神經網絡要學習的數據。
![1-fit-cosine](https://camo.githubusercontent.com/81d11c1d484c77f6389e7182cde7f4ab63571aa0328cab5be660156f68ebf5ae/68747470733a2f2f63646e2d696d616765732d312e6d656469756d2e636f6d2f6d61782f313630302f312a4974627a6d656a2d4563546f425f68343654496f74412e706e67)
y = cos(x1) * cos(x2)
以下是我們的類神經網絡。
下圖是在訓練類神經網絡時所記錄的權重及偏權的調整和整體損失分數(total loss)。
![2-fit-cosine](https://camo.githubusercontent.com/8d44b32c158d1a56a4ae77a7280103447225476c9385d7987557aa69200cc155/68747470733a2f2f63646e2d696d616765732d312e6d656469756d2e636f6d2f6d61782f313630302f312a72744c6766693578596c6a50506674397972666665772e706e67)
![3-fit-cosine](https://camo.githubusercontent.com/6a286b792a3d5c3181a4e33546dc847ea3d681086f7f5154fa7999c1d0e6e8f2/68747470733a2f2f63646e2d696d616765732d312e6d656469756d2e636f6d2f6d61782f313630302f312a464947506e2d4849526a75627759632d664d73306c412e706e67)
![4-fit-cosine](https://camo.githubusercontent.com/524cc2d3fc833581d1737ab8bd2ba6432fce2f7b4b4b18979de9733d3d71406e/68747470733a2f2f63646e2d696d616765732d312e6d656469756d2e636f6d2f6d61782f313630302f312a6a50634a7a353952705f496a387143797743774a75672e706e67)
![5-fit-cosine](https://camo.githubusercontent.com/9d458b7b373a1b4912843d306290cf563216027ff6088bb7ca23f498d66400f0/68747470733a2f2f63646e2d696d616765732d312e6d656469756d2e636f6d2f6d61782f313630302f312a79535843694a4b5565302d576d2d6c58534b4f6a50412e706e67)
![6-fit-cosine](https://camo.githubusercontent.com/ab97ad7294623e14cd6ad84259163efd1f61c5d3ec09ddee409f25434d9e0143/68747470733a2f2f63646e2d696d616765732d312e6d656469756d2e636f6d2f6d61782f313630302f312a6271744434514766574951557a47332d4e36494f6d412e706e67)
![7-fit-cosine](https://camo.githubusercontent.com/d43592df2b69a9a27e79c1fd573851eacfc6186ca0412a357dc5f7e97a4eebb9/68747470733a2f2f63646e2d696d616765732d312e6d656469756d2e636f6d2f6d61782f313630302f312a7268487a784136306651576934437559484e6d6135672e706e67)
![8-fit-cosine](https://camo.githubusercontent.com/6789c36d5e73aff666c1f09587e3002f1c6838f92dc9d46c4d4731fd0bb835df/68747470733a2f2f63646e2d696d616765732d312e6d656469756d2e636f6d2f6d61782f313630302f312a2d73705f55676d2d694d72687a55712d616f6c5967412e706e67)
![9-fit-cosine](https://camo.githubusercontent.com/2c491270fbb7ebbf39a60f83c4872f9c5b54fca258a8589590567efc9c7debdf/68747470733a2f2f63646e2d696d616765732d312e6d656469756d2e636f6d2f6d61782f313630302f312a6f36305a6344323046326536757170644f6b30716d772e706e67)
權重調整
偏權調整
整體損失分數
我們的類神經網絡在訓練後的輸出跟預期輸出相似。
類神經網絡的輸出(綠);預期輸出(藍)
相反地,如果輸入數據沒有標準化,我們可以看出權重及偏權的調整比之前的不那麼平均,從而可能導致網絡中輸出神經元的飽和(saturation)。
權重調整
偏權調整
整體損失分數
我們的類神經網絡在訓練後的輸出仍未能跟預期輸出相似。
類神經網絡的輸出(綠);預期輸出(藍)
參考
關於筆者
VC,軟件工程師,閒餘學習類神經網絡
學習筆記記錄於 http://www.medium.com/vclab
The text was updated successfully, but these errors were encountered: