这是indexloc提供的服务,不要输入任何密码
Skip to content

Suggestion: Custom Collector in the high-level API #1256

@RolandStolz

Description

@RolandStolz

I have spent roughly a year now doing RL research with tianshou and have been really enjoying the library.

Especially the high-level API saves a lot of tedious boiler plate code.
However, when doing custom implementations, I often come across this one annoying limitation: It's not possible to change the Collector class for the AgentFactory.
Defining a custom Collector in my experience, has a lot of use cases (e.g., modifying actions sent to the environment, or logging custom statistics additional to reward and length).
Using the custom Collector in the low-level API is straight forward, but the previously-mentioned limitation prohibits the usage in the high-level API.

I believe a simple addition to the ExperimentBuilder and AgentFactory that allows setting a custom Collector class would make the high-level API much more flexible. One could, for instance, add the method ExperimentBuilder.with_collector_class (or something similar) to the ExperimentBuilder.

What do you developers think about this suggestion? If you think it's a good idea, I can also create a merge request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions