Giter Site home page Giter Site logo

sdpkjc / abcdrl Goto Github PK

View Code? Open in Web Editor NEW
38.0 38.0 1.0 8.11 MB

Modular Single-file Reinfocement Learning Algorithms Library

Home Page: http://docs.abcdrl.xyz

License: Other

Dockerfile 0.93% Python 99.07%
deep-learning deep-reinforcement-learning machine-learning python pytorch reinfocement-learning

abcdrl's People

Contributors

bh6pel avatar dependabot[bot] avatar sdpkjc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

abcdrl's Issues

🗺️ Roadmap

v0.2.0

v0.3.0

  • Unit tests
  • Overhaul buffer
  • Implemented by JAX (faster abcdrl)

Future

  • ppo_atari
  • sac_atari
  • redq
  • drqv2_dmc
  • MARL Algs | MADDPG?
  • Offline RL Algs | CQL?

[Feature Request] Update wandb logger

Description

wandb/wandb#5008 completes support for gymnasium env monitoring.

Suggested Solution

Update wandb version to v0.13.11, and modify our custom logger to use the monitor provided by wandb directly. This will simplify the code and provide its robustness.

This adjustment might fix the #70 bug.

Alternatives

No response

Additional Context

No response

Checklist

  • I have checked that there is no similar issue in the repo

[Bug]: optimize_memory_usage error in ReplayBuffer of dqn_atari fail

Description

  1. In dqn_atari_torch and dqn_atari_tf, the optimize_memory_usage option is set to false by default. It should be set to true.
  2. After I changed the code to set it to true, I noticed that the performance was abnormal.

To Reproduce

Relevant log output / Error message

No response

System Info

No response

Checklist

  • I have checked that there is no similar issue in the repo
  • I have read the documentation
  • I have provided a minimal working example to reproduce the bug
  • I've used the markdown code blocks for both code and stack traces.

Additional context

if self.size != self.buffer_size:
    idxs = np.random.choice(self.size, size=batch_size, replace=True)

➡️

if self.size != self.buffer_size:
    idxs = np.random.choice(self.size - 1, size=batch_size, replace=True)

With that change, we might be able to fix the problem and wait for testing.

Prepare for v0.1.0

  • Support wandb tag in script #10
  • Issues & Pull requests Template #13
  • Licence Ref #15
  • Wrapper overhaul #16
  • Add mypy type-hint check in pre-commit #17
  • Scripts and examples overhaul #20
  • DQN in Atari env #25
  • Benchmark #33
  • tutorial of run and modify alg #52

[Bug]: capture_video fault in mujoco env with gymnasium0.27.0

Description

SCR-20230113-nkk

Left video on gymnasium0.27.0, Right video on gymnasium0.26.3

To Reproduce

python abcdrl/ddpg_torch.py --track True --capture-video True

Relevant log output / Error message

No response

System Info

No response

Checklist

  • I have checked that there is no similar issue in the repo
  • I have read the documentation
  • I have provided a minimal working example to reproduce the bug
  • I've used the markdown code blocks for both code and stack traces.

Additional context

No response

[Bug]: Didn't stop, When enable capture_video

Description

The training stops while capturing videos and the experiment gets stuck.

This is because the video_recorder of Gymnasium is not close. Maybe this is a bug in the gym, so we can consider closing it manually for now.

To Reproduce

Exec this cmd:

python abcdrl/dqn.py  --num-envs 2  --learning-starts 8 --buffer-size 10 --batch-size 4 --total-timesteps 30  --capture-video True

output:

{'log_type': 'collect', 'sample_step': 24, 'logs': {'episodic_length': 12, 'episodic_return': 12.0}}
Moviepy - Building video /Users/zhaoyanxiao/Dev/abcdrl/videos/CartPole-v1__dqn/rl-video-episode-0.mp4.
Moviepy - Writing video /Users/zhaoyanxiao/Dev/abcdrl/videos/CartPole-v1__dqn/rl-video-episode-0.mp4

Moviepy - Done !
Moviepy - video ready /Users/zhaoyanxiao/Dev/abcdrl/videos/CartPole-v1__dqn/rl-video-episode-0.mp4
{'log_type': 'collect', 'sample_step': 26, 'logs': {'episodic_length': 13, 'episodic_return': 13.0}}
# Didn't stop

Relevant log output / Error message

No response

System Info

No response

Checklist

  • I have checked that there is no similar issue in the repo
  • I have read the documentation
  • I have provided a minimal working example to reproduce the bug
  • I've used the markdown code blocks for both code and stack traces.

Additional context

No response

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.