SforAiDl / genrl

A PyTorch reinforcement learning library for generalizable and reproducible algorithm implementations with an aim to improve accessibility in RL
https://genrl.readthedocs.io
MIT License
403 stars 59 forks source link

Off Policy Trainer refactoring #287

Closed sampreet-arthi closed 4 years ago

sampreet-arthi commented 4 years ago

Refactored the Off Policy Trainer to reduce code complexity and readability. Let me know if this looks good.

lgtm-com[bot] commented 4 years ago

This pull request introduces 1 alert when merging 1c5e490bbc9ee35b45616b14dec5f7ac30eb8ffc into 5ed0a452d59363c2b5dbd7d4d05879f0717526d3 - view on LGTM.com

new alerts:

sampreet-arthi commented 4 years ago

Can be merged after #289

codecov[bot] commented 4 years ago

Codecov Report

Merging #287 into master will decrease coverage by 0.02%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #287      +/-   ##
==========================================
- Coverage   89.65%   89.63%   -0.03%     
==========================================
  Files          87       87              
  Lines        3752     3754       +2     
==========================================
+ Hits         3364     3365       +1     
- Misses        388      389       +1     
Impacted Files Coverage Δ
genrl/environments/vec_env/vector_envs.py 92.30% <ø> (-0.16%) :arrow_down:
genrl/trainers/onpolicy.py 92.00% <ø> (ø)
genrl/trainers/offpolicy.py 92.18% <100.00%> (+0.66%) :arrow_up:
genrl/agents/classical/sarsa/sarsa.py 96.15% <0.00%> (-3.85%) :arrow_down: