Exemplo n.º 1
0
def synthetic_seq_to_seq_runner(individual, reca_config):
    reCA_problem = reCA.ReCAProblem(
        p.open_data_interpreter("seq_to_seq_synth"))
    reCA_config = reCA.ReCAConfig()
    reCA_rule_scheme = reCA.ReCAruleConfig(non_uniform_list=individual.phenotype.non_uniform_config)
    reCA_config.set_random_mapping_config(ca_rule_scheme=reCA_rule_scheme,
                                          N=reCA_problem.input_size, R=reca_config.get("R"), C=reca_config.get("C"), I=reca_config.get("I"),
                                          classifier=reca_config.get("classifier"),
                                          time_transition=reca_config.get("time_transition"),
                                          mapping_permutations=reca_config.get("do_mappings"))
    reCA_system = reCA.ReCASystem()

    reCA_system.set_problem(reCA_problem)
    reCA_system.set_config(reCA_config)
    reCA_system.initialize_rc()
    reCA_system.tackle_ReCA_problem()

    reCA_out = reCA_system.test_on_problem()
    return reCA_out
Exemplo n.º 2
0
def five_bit_and_density_runner(individual, reca_config):
    reCA_problem = reCA.ReCAProblem(
        p.open_data_interpreter("5bit_density",
                                distractor_period=reca_config.get("distractor_period"),
                                training_ex=reca_config.get("training_ex"),
                                testing_ex=reca_config.get("testing_ex")))
    reCA_config = reCA.ReCAConfig()
    reCA_rule_scheme = reCA.ReCAruleConfig(non_uniform_list=individual.phenotype.non_uniform_config)
    reCA_config.set_random_mapping_config(ca_rule_scheme=reCA_rule_scheme,
                                          N=reCA_problem.input_size, R=reca_config.get("R"), C=reca_config.get("C"), I=reca_config.get("I"),
                                          classifier=reca_config.get("classifier"),
                                          time_transition=reca_config.get("time_transition"),
                                          mapping_permutations=reca_config.get("do_mappings"))
    reCA_system = reCA.ReCASystem()

    reCA_system.set_problem(reCA_problem)
    reCA_system.set_config(reCA_config)
    reCA_system.initialize_rc()
    reCA_system.tackle_ReCA_problem()

    reCA_out = reCA_system.test_on_problem()
    return reCA_out
Exemplo n.º 3
0
def japanese_vowels_runner(individual, reca_config):
    reCA_problem = reCA.ReCAProblem(
        p.open_data_interpreter("japanese_vowels", training_ex=reca_config.get("training_ex"),
                                testing_ex=reca_config.get("testing_ex"), binarization_resolution=reca_config.get("B")))
    reCA_config = reCA.ReCAConfig()
    reCA_rule_scheme = reCA.ReCAruleConfig(non_uniform_list=individual.phenotype.non_uniform_config)
    reCA_config.set_random_mapping_config(ca_rule_scheme=reCA_rule_scheme,
                                          N=reCA_problem.input_size,
                                          R=reca_config.get("R"),
                                          C=reca_config.get("C"),
                                          I=reca_config.get("I"),
                                          classifier=reca_config.get("classifier"),
                                          time_transition=reca_config.get("time_transition"),
                                          mapping_permutations=reca_config.get("do_mappings"))
    reCA_system = reCA.ReCASystem()

    reCA_system.set_problem(reCA_problem)
    reCA_system.set_config(reCA_config)
    reCA_system.initialize_rc()
    reCA_system.tackle_ReCA_problem()

    reCA_out = reCA_system.test_on_problem()
    return  reCA_out