Ejemplo n.º 1
0
        },
        # seed parameters
        # 'seeds': np.linspace(1234567890, 1234567899, 4),

        # cgp parameterisation
        'max_time': 40000,  # 82800s~23h
        'genome_params': {
            "n_inputs": 5,
        },
        'ea_params': {
            'n_processes': 4,
        },
        #'use_rxet_init': True,
    }

    params['md5_hash_sim_script'] = utils.md5_file(
        params['sim_script'])  # consistency check
    params['md5_hash_dependencies'] = [
        utils.md5_file(fn) for fn in params['dependencies']
    ]  # consistency check

    results_folder = 'optimized_run_time_12h'

    initial_seed_array = [
        1234567810, 1234567820, 1234567830, 1234567840, 1234567850, 1234567860,
        1234567870, 1234567880, 1234567890
    ]

    for use_drxeot_init in [True]:

        params['use_drxeot_init'] = use_drxeot_init
Ejemplo n.º 2
0
        # No. of trials per individual
        "n_trials": 8,
        # evo parameters
        "population_params": {"n_parents": 8, "mutation_rate": 0.05},
        "ea_params": {"n_offsprings": 8, "n_breeding": 8, "tournament_size": 1},
        "genome_params": {
            "n_inputs": 2,
            "n_outputs": 1,
            "n_columns": 5,
            "n_rows": 1,
            "levels_back": None,
        },
    },
}

params["md5_hash_sim_script"] = utils.md5_file(params["machine_params"]["sim_script"])

key = dicthash.generate_hash_from_dict(params, blacklist=[("gp_params", "max_generations")])

params["machine_params"]["workingdir"] = os.getcwd()
params["machine_params"]["outputdir"] = os.path.join(params["machine_params"]["workingdir"], key)

print("preparing job")
print(" ", params["machine_params"]["outputdir"])

utils.mkdirp(params["machine_params"]["outputdir"])
utils.write_json(params, f"{params['machine_params']['outputdir']}/params.json")
utils.create_jobfile(params["machine_params"])
utils.copy_file(params["machine_params"]["sim_script"], params["machine_params"]["outputdir"])
for fn in ["write_job.py", "sim_utils.py", "primitive_utils.py"]:
    utils.copy_file(fn, params["machine_params"]["outputdir"])
Ejemplo n.º 3
0
                "Div",
                "CustomConstantFloatOne",
                "CustomConstantFloatZeroPointOne",
                "CustomConstantFloatTen",
            ),
        },
        "ea_params": {
            "n_offsprings": 4,
            "n_breeding": 4,
            "tournament_size": 1,
            "n_processes": 8,
        },
        "evolve_params": {"max_generations": 500, "min_fitness": 300,},
    }
    params["md5_hash_sim_script"] = utils.md5_file(
        params["sim_script"]
    )  # consistency check

    key = dicthash.generate_hash_from_dict(params, blacklist=["wall_clock_limit"])

    params["outputdir"] = os.path.join(os.getcwd(), key)
    params["workingdir"] = os.getcwd()

    submit_job = False

    print("preparing job")
    print(" ", params["outputdir"])

    utils.mkdirp(params["outputdir"])
    utils.write_json(sim_params, os.path.join(params["outputdir"], "sim_params.json"))
    utils.write_json(params, os.path.join(params["outputdir"], "params.json"))
            "n_outputs": 1,
            "n_columns": 12,
            "n_rows": 1,
            "levels_back": None,
            "primitives": ("Add", "Sub", "Mul", "Div", "CustomConstantFloatOne"),
        },
        "ea_params": {
            "n_offsprings": 4,
            "n_breeding": 4,
            "tournament_size": 1,
            "n_processes": 8,
        },
        "evolve_params": {"max_generations": 1000, "min_fitness": 0.0,},
    }
    params["md5_hash_sim_script"] = utils.md5_file(
        params["sim_script"]
    )  # consistency check
    params["md5_hash_dependencies"] = [
        utils.md5_file(fn) for fn in params["dependencies"]
    ]  # consistency check

    key = dicthash.generate_hash_from_dict(params, blacklist=["wall_clock_limit"])

    params["outputdir"] = os.path.join(os.getcwd(), key)
    params["workingdir"] = os.getcwd()

    submit_job = False

    print("preparing job")
    print(" ", params["outputdir"])