nvalchemi.training.distillation.EvictionPolicy#

class nvalchemi.training.distillation.EvictionPolicy(*args, **kwargs)[source]#

Choose which frames leave a ReplayBuffer that is over capacity.

ReplayBuffer.extend() calls the policy after appending the admitted frames. The policy receives the whole resident batch, the admitted frames on their own, and the capacity. The resident batch is ordered oldest first, with the frames just admitted last. Both batches are read-only. The policy returns integer indices into the resident batch to drop, at least as many as the number of frames over capacity. FIFO is the reference implementation. A recency-based, quality-ranked, or prioritized policy reads whatever field it ranks on.

select(buffer, incoming, capacity)[source]#

Return the indices into buffer to drop so that it fits capacity.

Parameters:
Return type:

_DropIndices