Skip to content
New issue

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

code2-6 遷移先の価値の計算について #72

Open
1 of 7 tasks
tamura-up opened this issue Jun 2, 2022 · 2 comments
Open
1 of 7 tasks

code2-6 遷移先の価値の計算について #72

tamura-up opened this issue Jun 2, 2022 · 2 comments
Labels
code New feature or request question Further information is requested

Comments

@tamura-up
Copy link

指摘事項

code2-6 遷移先の価値の計算について、

V[s] = max_reward

上記箇所において、V を更新してしまうと、同じ iteration 内の後続の V(s) の計算に影響がでてしまうと思います。
(V_{i+1}(s_k) の算出に、すでに計算済の s_j の価値 V_{i+1}(s_j) が反映される場合がある)

P.44 の式の通りの計算をするならば、
next_V[s] = max_reward として、iteration の最後で V を更新(V=next_V) のようにするなど、同一 iteration 内で V を更新しないようにすべきだと思いました。

指摘箇所

  • Day1: 強化学習の位置づけを知る
  • Day2: 強化学習の解法(1): 環境から計画を立てる
  • Day3: 強化学習の解法(2): 経験から計画を立てる
  • Day4: 強化学習に対するニューラルネットワークの適用
  • Day5: 強化学習の弱点
  • Day6: 強化学習の弱点を克服するための手法
  • Day7: 強化学習の活用領域

ページ番号: p45

実行環境

  • OS:
  • Python version:
  • pip freezeの実行結果 (下に添付)

エラー内容

(例外のメッセージ、ログ、画面ショットなどを添付)

@icoxfog417 icoxfog417 added the question Further information is requested label Jun 3, 2022
@icoxfog417
Copy link
Owner

@tanakanotarou2 さん、ご指摘ありがとうございます。V[s]を修正しているとV[next_state]の値が更新途中で変更されてしまうということですね。ご指摘の通り、更新後のVを別途変数として作成しておき最後に入れ替えるのが適切ですね。

@icoxfog417 icoxfog417 added the code New feature or request label Jun 4, 2022
@tamura-up
Copy link
Author

ご確認いただきありがとうございました。認識が合っていたようで安心しました。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants