icoxfog417 / baby-steps-of-rl-ja

Pythonで学ぶ強化学習 -入門から実践まで- サンプルコード
Apache License 2.0
429 stars 260 forks source link

IRL/environment.pyを実行した際のテストが失敗する #32

Closed funwarioisii closed 4 years ago

funwarioisii commented 5 years ago

指摘事項

IRL/environment.pyを実行した際にtest_gridが実行され,GridWorldEnvクラスが正常に動作するかの確認がされていると思います

Grid左下を開始地点とし,左上の終了地点を目指していますが,終了地点に到達した際にd(おそらくdoneの意?)がfalseのままなので,テストが失敗しています

具体的には以下のリンク箇所です

https://github.com/icoxfog417/baby-steps-of-rl-ja/blob/f21735d933b05af3e6f5e99497eea86e50a842c6/IRL/environment.py#L186

指摘箇所

ページ番号: p 254

実行環境

absl-py==0.7.1
alabaster==0.7.12
appnope==0.1.0
asn1crypto==0.24.0
astor==0.7.1
attrs==19.1.0
Babel==2.7.0
backcall==0.1.0
bleach==3.1.0
certifi==2019.6.16
cffi==1.12.3
chardet==3.0.4
Click==7.0
cryptography==2.7
cycler==0.10.0
decorator==4.4.0
defusedxml==0.6.0
docutils==0.14
entrypoints==0.3
flake8==3.7.7
Flask==1.0.3
future==0.17.1
gast==0.2.2
google-pasta==0.1.7
grpcio==1.16.1
gym==0.10.9
-e git+https://github.com/lusob/gym-ple.git@df11bc8566b22011f635f4f74331fbc79fb3a9de#egg=gym_ple
h5py==2.8.0
idna==2.8
imagesize==1.1.0
ipykernel==5.1.1
ipython==7.5.0
ipython-genutils==0.2.0
ipywidgets==7.4.2
itsdangerous==1.1.0
jedi==0.13.3
Jinja2==2.10.1
joblib==0.13.2
jsonschema==3.0.1
jupyter==1.0.0
jupyter-client==5.2.4
jupyter-console==6.0.0
jupyter-core==4.4.0
jupyterlab==0.35.5
jupyterlab-server==0.2.0
Keras-Applications==1.0.8
Keras-Preprocessing==1.1.0
kiwisolver==1.1.0
Markdown==3.1.1
MarkupSafe==1.1.1
matplotlib==3.0.1
mccabe==0.6.1
mistune==0.8.4
mkl-fft==1.0.12
mkl-random==1.0.2
mkl-service==2.0.2
mock==3.0.5
nbconvert==5.5.0
nbformat==4.4.0
notebook==5.7.8
numpy==1.15.4
packaging==19.0
pandas==0.23.4
pandocfilters==1.4.2
parso==0.4.0
pexpect==4.7.0
pickleshare==0.7.5
Pillow==6.0.0
-e git+https://github.com/ntasfi/PyGame-Learning-Environment.git@3dbe79dc0c35559bb441b9359948aabf9bb3d331#egg=ple
prometheus-client==0.6.0
prompt-toolkit==2.0.9
protobuf==3.8.0
ptyprocess==0.6.0
pycodestyle==2.5.0
pycparser==2.19
pyflakes==2.1.1
pygame==1.9.4
pyglet==1.3.2
Pygments==2.4.2
pyOpenSSL==19.0.0
pyparsing==2.4.0
pyrsistent==0.14.11
PySocks==1.7.0
python-dateutil==2.8.0
pytz==2019.1
pyzmq==18.0.0
qtconsole==4.5.1
requests==2.22.0
scikit-learn==0.20.0
scipy==1.1.0
Send2Trash==1.5.0
six==1.12.0
snowballstemmer==1.2.1
Sphinx==2.1.0
sphinxcontrib-applehelp==1.0.1
sphinxcontrib-devhelp==1.0.1
sphinxcontrib-htmlhelp==1.0.2
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.2
sphinxcontrib-serializinghtml==1.1.3
tb-nightly==1.14.0a20190603
tensorboard==1.13.1
tensorflow==2.0.0b1
tensorflow-estimator==1.13.0
termcolor==1.1.0
terminado==0.8.2
testpath==0.4.2
tf-estimator-nightly==1.14.0.dev2019060501
tornado==6.0.2
tqdm==4.28.1
traitlets==4.3.2
urllib3==1.24.2
wcwidth==0.1.7
webencodings==0.5.1
Werkzeug==0.15.4
widgetsnbextension==3.4.2
wrapt==1.11.2

エラー内容

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

python IRL/environment.py                                                                                              ✘ 1
Traceback (most recent call last):
  File "IRL/environment.py", line 189, in <module>
    test_grid()
  File "IRL/environment.py", line 186, in test_grid
    assert d, "Agent should reache the goal"
AssertionError: Agent should reache the goal
icoxfog417 commented 4 years ago

修正しました。最終状態における推定報酬をプロットする都合上、最終状態で何らかの行動をしてからdoneするように実装しています。