Esempio n. 1
0
def test_genome_store_states(genome, model):
    global activities
    loci = model.loci
    target = pd.TimeSeries()
    predictions = []
    test_iter = model.dataset.test_data_iterator()
    test_number = 1
    i = 0
    activities = []
    for (data_in, data_out) in test_iter():
        cln_data = data_in if model.cleaning_disabled else \
          model.clean_func(data_in, genome, loci, model.day)
        activities.append([])
        model_out = esn.feedback_with_external_input(
            cln_data, genome, loci, model.day, reservoir_hook=_state_monitor)
        error = model.error_func(model_out, data_out)
        print "Error for test at %s: %f" % (str(model_out.index[0]), error)
        test_number += 1
        target = target.combine_first(data_out)
        predictions.append(model_out)
        i += 1
        if i == 30:
            break
    return target, predictions
Esempio n. 2
0
def _esn_feedback_with_hook(data, genome, loci, prediction_steps):
    return esn.feedback_with_external_input(
        data, genome, loci, prediction_steps, reservoir_hook=_state_monitor)