def __init__(self,
                 train_data,
                 valid_data,
                 test_data,
                 model,
                 algo,
                 state,
                 channel,
                 hooks=None,
                 reset=-1,
                 train_cost=False,
                 validate_postprocess=None):
        ###################
        # Step 0. Set parameters
        ###################
        self.train_data = train_data
        self.valid_data = valid_data
        self.test_data = test_data
        self.state = state
        self.channel = channel
        self.model = model
        self.algo = algo
        self.valid_id = 0
        self.old_cost = 1e21
        self.validate_postprocess = validate_postprocess
        self.patience = state['patience']

        self.train_cost = train_cost

        if hooks and not isinstance(hooks, (list, tuple)):
            hooks = [hooks]

        if self.state['validFreq'] < 0:
            self.state['validFreq'] = self.train_data.get_length()
            print 'Validation computed every', self.state['validFreq']
        elif self.state['validFreq'] > 0:
            print 'Validation computed every', self.state['validFreq']
        if self.state['trainFreq'] < 0:
            self.state['trainFreq'] = self.train_data.get_length()
            print 'Train frequency set to ', self.state['trainFreq']

        state['bvalidcost'] = 1e21
        for (pname, _) in model.properties:
            self.state[pname] = 1e20

        n_elems = state['loopIters'] // state['trainFreq'] + 1
        self.timings = {}
        for name in self.algo.return_names:
            self.timings[name] = numpy.zeros((n_elems,), dtype='float32')
        n_elems = state['loopIters'] // state['validFreq'] + 1
        for pname in model.valid_costs:
            self.state['valid'+pname] = 1e20
            self.state['test'+pname] = 1e20
            self.timings['fulltrain'+pname] = numpy.zeros((n_elems,),
                                                          dtype='float32')
            self.timings['valid'+pname] = numpy.zeros((n_elems,),
                                                      dtype='float32')
            self.timings['test'+pname] = numpy.zeros((n_elems,),
                                                     dtype='float32')
        if self.channel is not None:
            self.channel.save()

        self.hooks = hooks
        self.reset = reset

        self.start_time = time.time()
        self.batch_start_time = time.time()
Insert a new tag into the current one. The name can be either the
dataset/ETHPy150Open pascanur/GroundHog/groundhog/mainLoop.py/MainLoop.__init__--crossover with--dataset/ETHPy150Open pybrain/pybrain/pybrain/rl/environments/ode/tools/xmltools.py/XMLstruct.insert