Exemplo n.º 1
0
            "Initial TV: %f" %
            global_fitness_function.global_regularisation_term_set[-1])

    # Counters
    i = 0
    stagnation = 0
    number_of_mitosis = 0
    g_generation = 0

    # Run the evolutionary loop
    run_evolutionary_loop = True

    # Log the statistics
    last_proportion_of_good_flies = 0
    g_log_event = "Random initial population"
    logStatistics(optimiser.getNumberOfIndividuals())
    g_generation += 1

    if args.selection[0] == "threshold":
        selection_operator.max_iteration_reached_counter = -100

    addToFitnessCircularList()

    previous_gradient_global_fitness = None
    previous_gradient_TV = None
    previous_proportion_of_good_flies = 0

    while run_evolutionary_loop:

        # The max number of generations has not been reached
        if i < number_of_generation:
        logging.debug("Initial RMSE: %f" % global_fitness_function.global_error_term_set[-1]);
        logging.debug("Initial TV: %f" % global_fitness_function.global_regularisation_term_set[-1]);

    # Counters
    i = 0;
    stagnation = 0;
    number_of_mitosis = 0;
    g_iteration = 0;

    # Run the optimisation loop
    run_optimisation_loop = True;

    next_is_slautering = False;

    # Log the statistics
    g_log_event="Random initial population"; logStatistics(optimiser.getNumberOfIndividuals()); g_iteration += 1;

    global_fitness_before_mitosis = None;

    g_generation = 0;

    while run_optimisation_loop:

        # The max number of generations has not been reached
        if i < number_of_iterations:

            # Stagnation has been reached
            stagnation_reached = False;
            if stagnation >= args.max_stagnation_counter[0] and args.max_stagnation_counter[0] > 0:

                stagnation_reached = True;
        logging.debug(
            "Initial TV: %f" %
            global_fitness_function.global_regularisation_term_set[-1])

    # Counters
    i = 0
    stagnation = 0
    number_of_mitosis = 0
    g_generation = 0

    # Run the evolutionary loop
    run_evolutionary_loop = True

    # Log the statistics
    g_log_event = "Random initial population"
    logStatistics(optimiser.getNumberOfIndividuals())
    g_generation += 1

    while run_evolutionary_loop:

        # The max number of generations has not been reached
        if i < number_of_generation:

            # Stagnation has been reached
            if stagnation >= args.max_stagnation_counter[0]:

                # Exit the for loop
                run_evolutionary_loop = False

                # Log message
                if not isinstance(args.logging, NoneType):
    if not isinstance(args.logging, NoneType):
        logging.debug("Initial Global fitness: %f" % best_global_fitness);
        logging.debug("Initial RMSE: %f" % global_fitness_function.global_error_term_set[-1]);
        logging.debug("Initial TV: %f" % global_fitness_function.global_regularisation_term_set[-1]);

    # Counters
    i = 0;
    stagnation = 0;
    number_of_mitosis = 0;
    g_iteration = 0;

    # Run the optimisation loop
    run_optimisation_loop = True;

    # Log the statistics
    g_log_event="Random initial population"; logStatistics(optimiser.getNumberOfIndividuals()); g_iteration += 1;

    print(i, optimiser.best_solution.objective);

    while run_optimisation_loop:

        # The max number of generations has not been reached
        if i < number_of_iterations:

            # Stagnation has been reached
            if stagnation >= args.max_stagnation_counter[0] and args.max_stagnation_counter[0] > 0:

                # Exit the for loop
                run_optimisation_loop = False;

                # Log message