def setup(self, trainers):
        for k, trainer in enumerate(trainers):
            if self.save_path is not None and self.save_folds:
                path, ext = os.path.splitext(self.save_path)
                save_path = path + '-{}'.format(k) + ext
            else:
                save_path = None
            if self.tag_key is not None:
                tag_key = '{}-{}'.format(self.tag_key, k)
            else:
                tag_key = None
            extension = MonitorBasedSaveBest(
                self.channel_name, save_path=save_path, store_best_model=True,
                higher_is_better=self.higher_is_better, tag_key=tag_key)
            trainer.extensions.append(extension)
Add tracking to all trainers.
dataset/ETHPy150Open lisa-lab/pylearn2/pylearn2/cross_validation/train_cv_extensions.py/MonitorBasedSaveBestCV.setup