def validate(self):
        dataset = self._dataset
        trainer = self._trainer
        n_folds = self._n_folds
        l = dataset.getLength()
        inp = dataset.getField("input")
        tar = dataset.getField("target")
        indim = dataset.indim
        outdim = dataset.outdim
        assert l > n_folds

        perms = array_split(permutation(l), n_folds)

        perf = 0.
        for i in range(n_folds):
            # determine train indices
            train_perms_idxs = list(range(n_folds))
            train_perms_idxs.pop(i)
            temp_list = []
            for train_perms_idx in train_perms_idxs:
                temp_list.append(perms[ train_perms_idx ])
            train_idxs = concatenate(temp_list)

            # determine test indices
            test_idxs = perms[i]

            # train
            #print("training iteration", i)
            train_ds = SupervisedDataSet(indim, outdim)
            train_ds.setField("input"  , inp[train_idxs])
            train_ds.setField("target" , tar[train_idxs])
            trainer = copy.deepcopy(self._trainer)
            trainer.setData(train_ds)
            if not self._max_epochs:
                trainer.train()
            else:
                trainer.trainEpochs(self._max_epochs)

            # test
            #print("testing iteration", i)
            test_ds = SupervisedDataSet(indim, outdim)
            test_ds.setField("input"  , inp[test_idxs])
            test_ds.setField("target" , tar[test_idxs])
#            perf += self.getPerformance( trainer.module, dataset )
            perf += self._calculatePerformance(trainer.module, test_ds)

        perf /= n_folds
        return perf

#    def getPerformance( self, module, dataset ):
#        inp    = dataset.getField("input")
#        tar    = dataset.getField("target")
#        indim  = module.indim
#        outdim = module.outdim

#        def forward(inp):
#            out = empty(outdim)
#            module._forwardImplementation(inp,out)
#            return out

#        out = apply_along_axis(forward,1,inp)
#        return self._calculatePerformance(out,tar)
#        return self._calculatePerformance(module, dataset)
The main method of this class. It runs the crossvalidation process
dataset/ETHPy150Open pybrain/pybrain/pybrain/tools/validation.py/CrossValidator.validate