Exemplo n.º 1
0
def steels_basic_experiment_GG(inc_category_treshold=0.95, classifier=None, 
			environments=None, interaction_type="GG", beta=1., context_size=4,
			agents=None, dump_freq=50, alpha=0.1, sigma=1., num_iter=1000,
															topology=None):

	environments = def_value(environments, {})
	classifier, classif_arg = SteelsClassifier, []
	#agents = [Agent(SteelsAgentStateWithLexicon(classifier()), SimpleSensor())\

	# FIX THIS !!
	classif_arg = def_value(classif_arg, [])
	for agent in agents:
		agent.set_state(SteelsAgentStateWithLexicon(classifier(*classif_arg)))
		agent.set_sensor(SimpleSensor())
		agent.set_fitness_measure("DG", metrics.get_DS_fitness())
		agent.set_fitness_measure("GG", metrics.get_CS_fitness())
	
	AdaptiveNetwork.def_alpha = float(alpha)
	AdaptiveNetwork.def_beta = float(beta)
	ReactiveUnit.def_sigma = float(sigma)
	DiscriminationGame.def_inc_category_treshold = float(inc_category_treshold)
	
	return steels_uniwersal_basic_experiment(num_iter, agents, environments, 
						GuessingGame(None, context_size), topology = topology, 
						dump_freq = dump_freq)
Exemplo n.º 2
0
def steels_basic_experiment_DG(inc_category_treshold=0.95,
                               classifier=None,
                               environments=None,
                               interaction_type="DG",
                               beta=1.,
                               context_size=4,
                               agents=None,
                               dump_freq=50,
                               alpha=0.1,
                               sigma=1.,
                               num_iter=1000,
                               topology=None,
                               stimuli=None):

    environments = def_value(environments, {})
    classifier, classif_arg = SteelsClassifier, []

    # FIX THIS !!
    for agent in agents:
        agent.set_state(SteelsAgentState(classifier(*classif_arg)))
        agent.set_sensor(SimpleSensor())
        agent.set_fitness_measure("DG", metrics.get_DS_fitness())

    AdaptiveNetwork.def_alpha = float(alpha)
    AdaptiveNetwork.def_beta = float(beta)
    ReactiveUnit.def_sigma = float(sigma)
    DiscriminationGame.def_inc_category_treshold = float(inc_category_treshold)

    return steels_uniwersal_basic_experiment(num_iter,
                                             agents,
                                             environments,
                                             DiscriminationGame(context_size),
                                             topology=topology,
                                             dump_freq=dump_freq,
                                             stimuli=stimuli)
Exemplo n.º 3
0
def steels_basic_experiment_DG(inc_category_treshold=0.95, classifier=None,
        interaction_type="DG", beta=1., context_size=4, stimuli=None,
        agents=None, dump_freq=50, alpha=0.1, sigma=1., num_iter=1000,
        topology=None):

    classifier, classif_arg = SteelsClassifier, []

    # FIX THIS !!
    for agent in agents:
        agent.set_state(SteelsAgentState(classifier(*classif_arg)))
        agent.set_sensor(SimpleSensor())
        agent.set_fitness_measure("DG", metrics.get_DS_fitness())

    AdaptiveNetwork.def_alpha = float(alpha)
    AdaptiveNetwork.def_beta = float(beta)
    ReactiveUnit.def_sigma = float(sigma)
    DiscriminationGame.def_inc_category_treshold = float(inc_category_treshold)

    return steels_uniwersal_basic_experiment(num_iter, agents,
        DiscriminationGame(context_size), topology=topology,
            dump_freq=dump_freq, stimuli=stimuli)