IntelLabs / coach

Reinforcement Learning Coach by Intel AI Lab enables easy experimentation with state of the art Reinforcement Learning algorithms
https://intellabs.github.io/coach/
Apache License 2.0
2.33k stars 461 forks source link

Correct error type + order + error text #460

Open OGordon100 opened 4 years ago

OGordon100 commented 4 years ago

I see 2 issues with the ObservationStackingFilter object.

The current implementation checks that the input is less than 0, then checks that the input is a number. But if it's not a number, the checks that it is a number will never run. So when this check needs to be failed, the code has already failed earlier on, making it pointless.

Swapping the order fixes this. This should also be a TypeError, not a ValueError.

Secondly, there is no valid case for stacking 0 or 1 frames, so the code should assert >= 2, not >0