def before_training_exp(self, strategy, num_workers=0, shuffle=True, **kwargs):
        """
        Random retrieval from a class-balanced memory.
        Dataloader builds batches containing examples from both memories and
        the training dataset.
        This implementation requires the use of early stopping, otherwise the
        entire memory will be iterated.
        """
        if len(self.storage_policy.buffer) == 0:
            return
        self.it_cnt = 0
        strategy.dataloader = ReplayDataLoader(
            strategy.adapted_dataset,
            self.storage_policy.buffer,
            oversample_small_tasks=False,
            num_workers=num_workers,
            batch_size=strategy.train_mb_size,
            batch_size_mem=strategy.train_mb_size,
            shuffle=shuffle,
        )

        Random retrieval from a class-balanced memory.
        Dataloader builds batches containing examples from both memories and
        the training dataset.
        This implementation requires the use of early stopping, otherwise the
        entire memory will be iterated.
        
avalanche/training/plugins/cope.py