这是indexloc提供的服务,不要输入任何密码
Skip to content

Trainer refactor : flexible logger #295

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

Merged
merged 14 commits into from
Feb 24, 2021
Merged

Conversation

ChenDRAG
Copy link
Collaborator

This is the 4th commit of 6 commits mentioned in #274, which features refactor of trainer to fix #161. You can check #274 for more detail.
To avoid large commit as in #280, I will do this in 2 pr. first(#293 ) focus on some definition change of trainer to make it more friendly to use and be consistent with typical usage in research papers. Second pr focus on refactor of logging method to solve bug of nan reward and log interval. After these two pr, hopefully fundamental change of tianshou/data is finished. We then can concentrate on building benchmarks of tianshou finally.
This is the second pr.

This pr also fixes the bug that 'rew' is nan in tqdm visualization.

Not finished yet, lacking test and docs update. Open to discussion

@codecov-io
Copy link

codecov-io commented Feb 22, 2021

Codecov Report

Merging #295 (de2ecaf) into dev (e99e1b0) will decrease coverage by 0.05%.
The diff coverage is 96.07%.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev     #295      +/-   ##
==========================================
- Coverage   93.94%   93.89%   -0.06%     
==========================================
  Files          45       47       +2     
  Lines        3202     3241      +39     
==========================================
+ Hits         3008     3043      +35     
- Misses        194      198       +4     
Flag Coverage Δ
unittests 93.89% <96.07%> (-0.06%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
tianshou/data/buffer.py 93.29% <ø> (-0.02%) ⬇️
tianshou/data/collector.py 94.89% <ø> (ø)
tianshou/utils/log_tools.py 93.22% <93.22%> (-6.78%) ⬇️
tianshou/policy/base.py 76.80% <100.00%> (ø)
tianshou/trainer/offline.py 100.00% <100.00%> (ø)
tianshou/trainer/offpolicy.py 100.00% <100.00%> (ø)
tianshou/trainer/onpolicy.py 97.01% <100.00%> (-0.05%) ⬇️
tianshou/trainer/utils.py 100.00% <100.00%> (ø)
tianshou/utils/__init__.py 100.00% <100.00%> (ø)
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e99e1b0...de2ecaf. Read the comment docs.

@ChenDRAG
Copy link
Collaborator Author

Ready I think

@ChenDRAG ChenDRAG merged commit f0129c9 into thu-ml:dev Feb 24, 2021
Trinkle23897 pushed a commit that referenced this pull request Feb 24, 2021
This PR focus on refactor of logging method to solve bug of nan reward and log interval. After these two pr, hopefully fundamental change of tianshou/data is finished. We then can concentrate on building benchmarks of tianshou finally.

Things changed:

1. trainer now accepts logger (BasicLogger or LazyLogger) instead of writer;
2. remove utils.SummaryWriter;
@Trinkle23897 Trinkle23897 linked an issue Apr 21, 2021 that may be closed by this pull request
BFAnas pushed a commit to BFAnas/tianshou that referenced this pull request May 5, 2024
This PR focus on refactor of logging method to solve bug of nan reward and log interval. After these two pr, hopefully fundamental change of tianshou/data is finished. We then can concentrate on building benchmarks of tianshou finally.

Things changed:

1. trainer now accepts logger (BasicLogger or LazyLogger) instead of writer;
2. remove utils.SummaryWriter;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Plans of releasing mujoco benchmark with ddpg/sac/td3 on Tianshou
3 participants