Execute a single model iteration

        :return: Iteration_id, Incremental node status (dictionary node->status)
552038
def iteration(self, node_status=True):
        
        self.clean_initial_status(self.available_statuses.values())
        actual_status = {node: nstatus for node, nstatus in future.utils.iteritems(self.status)}

        if self.actual_iteration == 0:
            self.actual_iteration += 1
            delta, node_count, status_delta = self.status_delta(actual_status)
            if node_status:
                return {"iteration": 0, "status": actual_status.copy(),
                        "node_count": node_count.copy(), "status_delta": status_delta.copy()}
            else:
                return {"iteration": 0, "status": {},
                        "node_count": node_count.copy(), "status_delta": status_delta.copy()}

        for u in self.graph.nodes():
            u_status = self.status[u]
            for i in range(0, self.compartment_progressive):

                if u_status == self.available_statuses[self.compartment[i][0]]:
                    rule = self.compartment[i][2]
                    test = rule.execute(node=u, graph=self.graph, status=self.status,
                                        status_map=self.available_statuses, params=self.params)
                    if test:
                        actual_status[u] = self.available_statuses[self.compartment[i][1]]
                        break

        delta, node_count, status_delta = self.status_delta(actual_status)
        self.status = actual_status
        self.actual_iteration += 1

        if node_status:
            return {"iteration": self.actual_iteration - 1, "status": delta.copy(),
                    "node_count": node_count.copy(), "status_delta": status_delta.copy()}
        else:
            return {"iteration": self.actual_iteration - 1, "status": {},
                    "node_count": node_count.copy(), "status_delta": status_delta.copy()}
675900
def run_one_iteration(parameters, score)
	  	self.run_one_mating_iteration(parameters, score) if @currently_mating == true
	    @current = {:parameters => parameters, :score => score}
	    # update best score?
	    self.update_best?
	    # push new parameter set into generation
	    @currently_mating = @generation_handler.add_new_individual(@current)
	    if @currently_mating == true
	    	# begin mating process
	    	# empty current population
	    	@generation_handler.population_array = []
	    	selected_to_mate = @mating_handler.select_mating_population(@generation_handler.archive_array)
	    	self.get_children_to_score(selected_to_mate)
	    	@children_to_score.pop[:parameters]
	    else
	    	# get next parameter set to score
	    	self.random_parameter_set
	    end
	  end
641472
def index_iterator(self):
        
        idx = 0  # index
        while idx < self.number_intervals:
            new_idx = yield idx
            idx += 1
            if new_idx:
                idx = new_idx - 1
131291
def run(self):
        
        self._runtime_initialize()

        if len(self._flattened_nodes) == 0:
            logger.warning("WARNING: Nothing to do. Try checking your model "
                           "configs and model specification args")
            return []
        else:
            logger.info("")

        selected_uids = frozenset(n.unique_id for n in self._flattened_nodes)
        result = self.execute_with_hooks(selected_uids)

        result.write(self.result_path())

        self.task_end_messages(result.results)
        return result.results
511770
def iterate(node)
      return unless node.is_a?(AST::Node)

      before    = :"on_#{node.type}"
      after     = :"after_#{node.type}"
      skip_node = catch :skip_child_nodes do
        execute_callback(before, node)
      end

      if skip_node != node
        node.children.each do |child|
          iterate(child) if child.is_a?(AST::Node)
        end
      end

      execute_callback(after, node)
    end
1313458
def on_backward_end(self, iteration:int, **kwargs)->None:
        ""
        if iteration == 0: return
        self._update_batches_if_needed()
        if iteration % self.stats_iters == 0: self._write_model_stats(iteration=iteration)
1013185
def create(self, iterations: int = 1) -> List[JSON]:
        
        return [self.schema() for _ in range(iterations)]
865876
def iterations(self, parameter):
        """"""
        return numpy.arange(0, self.last_iteration(parameter), self.thinned_by)
1366303
def run_iteration
      param_key = @current_params.to_s
      result = nil
      # lookup the result if possible
      if @scores.key? param_key
        result = @scores[param_key]
      else
        # create temp dir
        curdir = Dir.pwd
        Dir.chdir(self.create_tempdir) unless Settings.instance.no_tempdirs
        # run the target
        raw_output = @target.run @current_params.merge(@options)
        # evaluate with objectives
        result = @objective.run_for_output(raw_output, @threads, nil)
        @iteration_count += 1
        self.print_progress(@iteration_count, @current_params, result, @best)
        @scores[@current_params.to_s] = result
        self.cleanup
        Dir.chdir(curdir) unless Settings.instance.no_tempdirs
      end
      # get next steps from optimiser
      @current_params = @algorithm.run_one_iteration(@current_params, result)
    end
727587
def next(self):
    ''''''

    # if iteration has not begun, begin it.
    if not self._iterator:
      self.__iter__()

    next = self._iterator.next()
    if next is not StopIteration:
      self._returned_inc(next)
    return next
666148
def num_model_per_iteration(self):
        
        model_per_iter = ctypes.c_int(0)
        _safe_call(_LIB.LGBM_BoosterNumModelPerIteration(
            self.handle,
            ctypes.byref(model_per_iter)))
        return model_per_iter.value
613639
private void findParameters(int iterations) {
    double prevLL = 0.0;
    double currLL = 0.0;
    display("Performing " + iterations + " iterations.\n");
    for (int i = 1; i <= iterations; i++) {
      if (i < 10)
        display("  " + i + ":  ");
      else if (i < 100)
        display(" " + i + ":  ");
      else
        display(i + ":  ");
      currLL = nextIteration();
      if (i > 1) {
        if (prevLL > currLL) {
          System.err.println("Model Diverging: loglikelihood decreased");
          break;
        }
        if (currLL - prevLL < LLThreshold) {
          break;
        }
      }
      prevLL = currLL;
    }

    // kill a bunch of these big objects now that we don't need them
    observedExpects = null;
    modelExpects = null;
    numTimesEventsSeen = null;
    contexts = null;
  }
234262
def run(self):
        
        iterations = 0
        queue = self.queue.tick()
        while True:
            try:
                next(queue)
            except StopIteration:
                break

            iterations += 1
            sleep(self.sleep_time)
        return iterations
1195465
def iteration(self, node_status=True):
        
        self.clean_initial_status(self.available_statuses.values())
        actual_status = {node: nstatus for node, nstatus in future.utils.iteritems(self.status)}

        if self.actual_iteration == 0:
            self.actual_iteration += 1
            delta, node_count, status_delta = self.status_delta(actual_status)
            if node_status:
                return {"iteration": 0, "status": actual_status.copy(),
                        "node_count": node_count.copy(), "status_delta": status_delta.copy()}
            else:
                return {"iteration": 0, "status": {},
                        "node_count": node_count.copy(), "status_delta": status_delta.copy()}

        for u in self.graph.nodes():
            if self.status[u] != 1:
                continue

            neighbors = list(self.graph.neighbors(u))  # neighbors and successors (in DiGraph) produce the same result

            # Standard threshold
            if len(neighbors) > 0:
                threshold = 1.0/len(neighbors)

                for v in neighbors:
                    if actual_status[v] == 0:
                        key = (u, v)

                        # Individual specified thresholds
                        if 'threshold' in self.params['edges']:
                            if key in self.params['edges']['threshold']:
                                threshold = self.params['edges']['threshold'][key]
                            elif (v, u) in self.params['edges']['threshold'] and not nx.is_directed(self.graph):
                                threshold = self.params['edges']['threshold'][(v, u)]

                        flip = np.random.random_sample()
                        if flip <= threshold:
                            actual_status[v] = 1

            actual_status[u] = 2

        delta, node_count, status_delta = self.status_delta(actual_status)
        self.status = actual_status
        self.actual_iteration += 1

        if node_status:
            return {"iteration": self.actual_iteration - 1, "status": delta.copy(),
                    "node_count": node_count.copy(), "status_delta": status_delta.copy()}
        else:
            return {"iteration": self.actual_iteration - 1, "status": {},
                    "node_count": node_count.copy(), "status_delta": status_delta.copy()}
188871
def iterate(self):
        
        if not self._inLoop:
            raise RuntimeError('run loop not started')
        elif self._driverLoop:
            raise RuntimeError('iterate not valid in driver run loop')
        self.proxy.iterate()
1328802
def do_execute(self):
        
        generator = datagen.DataGenerator.make_copy(self.resolve_option("setup"))
        generator.dataset_format = generator.define_data_format()
        if bool(self.resolve_option("incremental")) and generator.single_mode_flag:
            for i in range(generator.num_examples_act):
                self._output.append(Token(generator.generate_example()))
        else:
            data = generator.generate_examples()
            self._output.append(Token(data))
        return None
446341
def refresh(self):
        
        self._pre_action_check('refresh')
        if hasattr(self, 'id'):
            request = self.cypher("MATCH (n) WHERE id(n)={self}"
                                            " RETURN n")[0]
            if not request or not request[0]:
                raise self.__class__.DoesNotExist("Can't refresh non existent node")
            node = self.inflate(request[0][0])
            for key, val in node.__properties__.items():
                setattr(self, key, val)
        else:
            raise ValueError("Can't refresh unsaved node")