ugr-sail / sinergym

Gym environment for building simulation and control using reinforcement learning
https://ugr-sail.github.io/sinergym/
MIT License
134 stars 36 forks source link

[Bug]: WandB last episode log in SB3 algorithms #431

Closed AlejandroCN7 closed 2 months ago

AlejandroCN7 commented 2 months ago

Bug 🐛

When we train with SB3 and use the WandB wrapper, the summary metrics record an almost empty last episode. This is because SB3 algorithms can perform some extra timesteps depending on the algorithm. The learn method of the model does not allow to specify number of episodes, only timesteps, so it is unavoidable.

This worsens the experience with the platform, since the summary tables it generates can only show the last result, maximum or minimum. Being the last result useless.

This only happens with WandBLogger, CSVLogger does not have this problem at the moment.

Expected behavior

It is expected that episodes outside of those specified will not be recorded in WandB. For example, if 100 episodes are specified, to log those 100 and ignore 101.

:pencil: Please, don't forget to include more labels besides bug if it is necessary.