Commit 4f0956b
authored
Fix reward scaler when run on varied episode lengths (#455)
When calling `fit` with a reward scaler on a dataset with varied episode lengths,
the following error would be thrown in the `fit_with_trajectory_slicer` method:
```
ValueError: setting an array element with a sequence. The requested array has an
inhomogeneous shape after 1 dimensions.
```
This commit fixes the issue by flattening the rewards before calculating the mean and std.1 parent 8418d92 commit 4f0956b
1 file changed
+3
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
297 | 297 | | |
298 | 298 | | |
299 | 299 | | |
300 | | - | |
301 | | - | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
302 | 303 | | |
303 | 304 | | |
304 | 305 | | |
| |||
0 commit comments