Minari icon indicating copy to clipboard operation
Minari copied to clipboard

[Proposal] Assertion error when obs and act is out of space, is this not too hard? Perhaps and warn instead?

Open jamartinh opened this issue 1 year ago • 2 comments

Hi, isn't it too hard to have an assertion error when observations or action are not contained in its defined spaces? Perhaps an option to disable or set error-level to ignore/warn/error?

https://github.com/Farama-Foundation/Minari/blob/e24113bf09b5b1769dafbaf6bb0b2c9b8eb9ffbe/minari/data_collector/data_collector.py#L198-L203

jamartinh avatar Dec 08 '23 12:12 jamartinh

The problem is that if the data is not in the space when you load it back you may encounter weird (and potentially silent!) errors. What is your use case for this?

younik avatar Dec 08 '23 17:12 younik

Well, I think you are right.

After all, box is box and it is well defined.

Perhaps in the future, we have in Gymnasium a multivariate normal space with its means and stds. (I usually add these to my state spaces for using normalizers)

I guess it is preferred to stick to a well-defined box as it is.

jamartinh avatar Dec 09 '23 12:12 jamartinh

After receiving multiple requests for this, we decide to remove the hard checks in favor of warnings in DataCollector. The expected behavior is still to fail when the data is not in the correct format (e.g. shape is different), but not for out-of-bounds value in Box space. Thanks @jamartinh for the issue

younik avatar May 26 '24 11:05 younik