pytorch / rl

A modular, primitive-first, python-first PyTorch library for Reinforcement Learning.
https://pytorch.org/rl
MIT License
2.19k stars 289 forks source link

[Feature Request] DQN Loss importance sampling #955

Open monney opened 1 year ago

monney commented 1 year ago

Motivation

I believe the current DQN Losses don't apply importance sampling weights. This is almost always applied when using a PER Buffer.

Solution

The PER buffer outputs "_weight" in info, this if in inputTensorDict, could be applied at time of loss calculation

Alternatives

element-wise loss could be returned with any transforms or weighting to be applied later on

Checklist

vmoens commented 1 year ago

I will take a look into this thanks for sharing!

monney commented 1 year ago

Thank you!