data.buffer.middleware.staleness_check¶
staleness_check¶
staleness_check¶
- ding.data.buffer.middleware.staleness_check.staleness_check(buffer_: Buffer, max_staleness: int = inf) Callable [source]¶
- Overview:
This middleware aims to check staleness before each sample operation, staleness = train_iter_sample_data - train_iter_data_collected, means how old/off-policy the data is, If data’s staleness is greater(>) than max_staleness, this data will be removed from buffer as soon as possible.
- Arguments:
max_staleness (
int
): The maximum legal span between the time of collecting and time of sampling.