rlberry-py / rlberry

An easy-to-use reinforcement learning library for research and education.
https://rlberry-py.github.io/rlberry
MIT License
162 stars 30 forks source link

Stopping criterion utility #333

Open TimotheeMathieu opened 1 year ago

TimotheeMathieu commented 1 year ago

Implement a tool to stop the algorithm when some value (in the writer) go above some threshold. Typically for either early stopping or for stopping after a certain number of episodes.

riiswa commented 1 year ago

Should we modify the signature of the fit method to be somth likedef fit(self, budget=100, stop_callback: Callable[[Writer], bool]) ?

riiswa commented 1 year ago

I think there is not a simple way to solve this PR. Each agent have its own implementation of the fit method, so the early stopping criterion should be handled in each agents...

TimotheeMathieu commented 1 year ago

My idea was the following:

This should be sufficient, we don't need to have something automatic, we only need to make it simple to use and have it implmented in the rlberry agents.