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
404 stars 59 forks source link

Fixed couple of errors and added new tests #380

Closed sampreet-arthi closed 3 years ago

sampreet-arthi commented 3 years ago

Fixes #321 and also solves the definition error in action_shape and obs_shape. There was an error that let OnPolicy Agents only solve either CartPole-v0 or Pendulum-v0 due to the differently defined action_shape

codecov[bot] commented 3 years ago

Codecov Report

Merging #380 into master will increase coverage by 0.04%. The diff coverage is 91.66%.

@@            Coverage Diff             @@
##           master     #380      +/-   ##
==========================================
+ Coverage   91.24%   91.28%   +0.04%     
==========================================
  Files          90       90              
  Lines        3802     3809       +7     
==========================================
+ Hits         3469     3477       +8     
+ Misses        333      332       -1     
Impacted Files Coverage Δ
genrl/environments/vec_env/vector_envs.py 93.05% <88.88%> (-0.43%) :arrow_down:
genrl/core/rollout_storage.py 89.62% <100.00%> (ø)
genrl/trainers/base.py 88.17% <100.00%> (+0.12%) :arrow_up:
genrl/agents/classical/sarsa/sarsa.py 96.15% <0.00%> (ø)
genrl/core/base.py 98.38% <0.00%> (+3.22%) :arrow_up:
sampreet-arthi commented 3 years ago

Also need to add more tests (especially for On Policy algos). This one should've been caught by the unit tests.