Problem: The logging strategy class takes no consideration of the current batch id.
Desired outcome: It can be desirable to log information based on the batch_id (typically with the formula batch_id%logging_step) when dealing with large data types such as images.
Proposed Solution: in this PR, this issue is addressed by passing to the self.game() call in the train_epoch and eval methods an additional int which is the batch_id. Moreover a filtering pass had been added inside the from_iterable method of the Interaction class. This filtering is based on a new method is_empty that checks if the current interaction is empty.
Downsides: the introduction of this new batch_id parameter probably breaks the compatibility with most game() calls. On the other side, compatibility can be enforced again by simply adding an empty argument inside each game forward method.
Problem: The logging strategy class takes no consideration of the current batch id.
Desired outcome: It can be desirable to log information based on the batch_id (typically with the formula
batch_id%logging_step
) when dealing with large data types such as images.Proposed Solution: in this PR, this issue is addressed by passing to the
self.game()
call in thetrain_epoch
andeval
methods an additional int which is thebatch_id
. Moreover a filtering pass had been added inside thefrom_iterable
method of theInteraction
class. This filtering is based on a new methodis_empty
that checks if the current interaction is empty.Downsides: the introduction of this new
batch_id
parameter probably breaks the compatibility with mostgame()
calls. On the other side, compatibility can be enforced again by simply adding an empty argument inside each game forward method.