This PR adds a new method for getting actions from an env's observation and info. This is useful for standard inference and stands in contrast to batch-based methods that are currently used in training and evaluation. Without this, users have to do some kind of gymnastics to actually perform inference with a trained policy. I have also added a test for the new method. In future PRs, this method should be included in the examples (in the the "watch" section). To add this required improving multiple typing things and, importantly, _simplifying the signature of `forward` in many policies!_ This is a **breaking change**, but it will likely affect no users. The `input` parameter of forward was a rather hacky mechanism, I believe it is good that it's gone now. It will also help with #948 . The main functional change is the addition of `compute_action` to `BasePolicy`. Other minor changes: - improvements in typing - updated PR and Issue templates - Improved handling of `max_action_num` Closes #981
604 B
604 B
- I have added the correct label(s) to this Pull Request or linked the relevant issue(s)
- I have provided a description of the changes in this Pull Request
- I have added documentation for my changes
- If applicable, I have added tests to cover my changes.
- I have reformatted the code using
poe format
- I have checked style and types with
poe lint
andpoe type-check
- (Optional) I ran tests locally with
poe test
(or a subset of them withpoe test-reduced
) ,and they pass - (Optional) I have tested that documentation builds correctly with
poe doc-build