LoginSignup
4
1

More than 3 years have passed since last update.

ML-AgentsのSetRewardとAddRewardの違い

Last updated at Posted at 2019-05-31

はじめに

強化学習で用いられるML-AgentsのSetRewardメソッドとAddRewardメソッドの違いについて調べてみました。

実行環境

Unity 2019.1.4f1

ML-Agents 0.8.1

説明

SetReward : 現在のステップの報酬量を設定します。もし同じステップにSetRewardを何度も呼び出した場合は最後のものだけが有効になります。

AddReward : 現在のステップの報酬量を調整します。

SetReward(0.3f);      // normal step reward 0.3
if (gotBonus)
    AddReward(0.1f);  //   adjust reward to 0.4
else if (gotPenalty)
    AddReward(-0.1f); //   adjust reward to 0.2
if (reachedGoal)
    SetReward(1.0f);  // reset step reward to 1.0

参考

4
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
1