Example #1
0
        "tr_cond": 'all_gains',
        "test_cond": 'all_gains',
        "n_hid": 500,
        "n_in": 50,
        "batch_size": 50,
        "stim_dur": 25,
        "delay_dur": 100,
        "resp_dur": 25,
        "kappa": 2.0,
        "spon_rate": 0.1,
        "tr_max_iter": 25001,
        "test_max_iter": 2501
    }

    # Build task generators
    generator, test_generator = build_generators(ExptDict)

    # Define the input and expected output variable
    input_var, target_var = T.tensor3s('input', 'target')

    # Build the model
    l_out, l_rec = build_model(input_var, ExptDict)

    # The generated output variable and the loss function
    if ExptDict["task"]["task_id"] in ['DE1', 'DE2', 'GDE2', 'VDE1', 'SINE']:
        pred_var = lasagne.layers.get_output(l_out)
    elif ExptDict["task"]["task_id"] in [
            'CD1', 'CD2', 'Harvey2012', 'Harvey2012Dynamic', 'Harvey2016',
            'COMP'
    ]:
        pred_var = T.clip(lasagne.layers.get_output(l_out), 1e-6, 1.0 - 1e-6)
    "tr_cond": 'all_gains',
    "test_cond": 'all_gains',
    "n_hid": 500,
    "n_in": 50,
    "batch_size": 50,
    "stim_dur": 25,
    "delay_dur": 100,
    "resp_dur": 25,
    "kappa": 2.0,
    "spon_rate": 0.1,
    "tr_max_iter": 25001,
    "test_max_iter": 2501
}

# Build task generators
generator_first, test_generator_first = build_generators(ExptDict)

# Define the input and expected output variable
input_var, target_var = T.tensor3s('input', 'target')

# Build the model
l_out, l_rec = build_model(input_var, ExptDict)

# The generated output variable and the loss function
if ExptDict["task"]["task_id"] in ['DE1', 'DE2', 'GDE2', 'VDE1', 'SINE']:
    pred_var = lasagne.layers.get_output(l_out)
elif ExptDict["task"]["task_id"] in [
        'CD1', 'CD2', 'Harvey2012', 'Harvey2012Dynamic', 'Harvey2016', 'COMP'
]:
    pred_var = T.clip(lasagne.layers.get_output(l_out), 1e-6, 1.0 - 1e-6)