def on_save(self, trainers):
        if self.save_path is None:
            return
        models = []
        for trainer in trainers:
            for extension in trainer.extensions:
                if isinstance(extension, MonitorBasedSaveBest):
                    models.append(extension.best_model)
                    break
        assert len(models) == len(trainers)
        try:
            for trainer in trainers:
                trainer.dataset._serialization_guard = SerializationGuard()
                serial.save(self.save_path, models, on_overwrite='backup')
        finally:
            for trainer in trainers:
                trainer.dataset._serialization_guard = None
Save best model from each cross-validation fold.
dataset/ETHPy150Open lisa-lab/pylearn2/pylearn2/cross_validation/train_cv_extensions.py/MonitorBasedSaveBestCV.on_save