takuseno / d3rlpy

An offline deep reinforcement learning library
https://takuseno.github.io/d3rlpy
MIT License
1.32k stars 243 forks source link

[QUESTION] Adding a new algorithm to d3rlpy #389

Closed spsingh37 closed 6 months ago

spsingh37 commented 6 months ago

Hi,

I'm trying to integrate a model-based RL algorithm to the d3rlpy library but couldn't find any documentation to know where & how to begin. Would really appreciate if you could please point me where to look and maybe the specific steps?

takuseno commented 6 months ago

Currently, there is no documentation for users to implement their own algorithms yet. I'd love to make one though... One thing I can propose is to directly modify base RL algorithms. For example, if your new algorithm is based on SAC, I suggest you to directly edit these files: https://github.com/takuseno/d3rlpy/blob/cb2f771adeac06b26a010f112a218e2eef99f028/d3rlpy/algos/qlearning/sac.py#L29

https://github.com/takuseno/d3rlpy/blob/cb2f771adeac06b26a010f112a218e2eef99f028/d3rlpy/algos/qlearning/torch/sac_impl.py#L49

https://github.com/takuseno/d3rlpy/blob/cb2f771adeac06b26a010f112a218e2eef99f028/d3rlpy/algos/qlearning/torch/ddpg_impl.py#L49

takuseno commented 6 months ago

I have added an example to create your own algorithm: https://github.com/takuseno/d3rlpy/blob/master/examples/custom_algo.py

Once you implement your own algorithm, you can leverage all functionalities that d3rlpy provides.

takuseno commented 6 months ago

Please let me close this issue because this is the best thing I can provide for now.