5a. Reinforcement Training - Blocked vs Motion 強化式學習法 (被阻了/撞牆了vs 行走中)

學習目標 :
在這一個單元,會為大家介紹一種高階的AI 學習法 - 強化式學習法。
學習內容 :
- 透過正確設定奬勵(和懲罰)機制,機械人可以自學得到智力。
- 實驗的目標是要訓練機械人可以在四方形的埸地內不停地走動。
所需準備 :
材料: | Parameter 參數 : “使用Demo參數 “Blocked vs Motion” |
|
Racing Circuit | 場地大小不限 |
導入 demo parameter 「Blocked vs Motion」 :

在工具欄中選擇「parameters」再按「load demo parameters」 。
在「Reinforcement Learning」中選擇「Blocked vs Motion」
1. 手動編輯網絡 (Manual Edit)

停止選用「learning」並開啟「manual edit」

- 試將綠色「Motion」連至向前 , 紅色 「blocked」連至轉向
- 啟用「self-drive」觀察「Reward」與「Level」的變化
Reward : 機械人向前為 100 , 被阻、轉向為 - 50
Level : 過去1分鐘 Reward 的平均值
* 它有智能嗎 ?
2. 沒有學習 (No Learning)

停止選用「manual edit」並按下「reset learning」 ,
然後按「self-drive」
AlphAI 怎樣行動 ? Reward 跟 Level 的數值是 ?
⇒ 不停自轉 , 2個數值都保持在 35
3. 強化式學習 (Reinforcement Learning)

停止選用「manual edit」並按下「reset learning」 ,
選用「learning」然後按「self-drive」
3b . 觀察學習
留意 AlphAI 行動跟 Reward 及 Level 的關係
⇒ AlphAI 在一段時間後會「滿足」現在的 Level 跟 Reward 不再提升 , 例如 : 35 , 保持自轉
⇒ 這樣的學習好嗎 ? 可以更好嗎 ?
4. 強化式學習 (with exploration 探索)

按下「reset learning」 , 增加選用「exploration」 , 然後按「self-drive」
4b. 觀察學習

留意 AlphAI 行動跟 Reward 及 Level 的關係
⇒ AlphAI 會出現隨機的 Output (探索時會變成藍色)
- Level 最後的數值會較高 , 但花的時間會較長
- 試觀察 Weight 與選擇 Output 的關係
- 它會撞牆嗎 ? 為何 ?
總結 :
- 強化式學習法(機械人自學)的原理是透過奬勵和懲罰去鼓勵機械人去做對某些動作。
- 機械人會去改變它的行為從而獲取最高的累積的平均獎勵分數。
- 向前行走得越快越多,會得到更多奬勵。
- 相反,停頓或向後行,就會被懲罰(被扣分)。
- 要將等級提升,機械人要盡力向前行,同時間要減少停頓或向後行。