示例#1
0
PP_to_GCs = np.array(PP_to_GCs)

BC_indices = np.arange(24)
start_idc = np.array(((start_idc / 2000.0) * 24), dtype=int)

PP_to_BCs = []
for x in start_idc:
    curr_idc = np.concatenate((BC_indices[x:24], BC_indices[0:x]))
    PP_to_BCs.append(
        np.random.choice(curr_idc, size=1, replace=False, p=pdf_bc))

PP_to_BCs = np.array(PP_to_BCs)

# Generate temporal patterns for the 100 PP inputs
np.random.seed(seed)
temporal_patterns = inhom_poiss(rate=args.poiss_rate)

# Start the runs of the model
for run in runs:
    nw = net_tunedrev.TunedNetwork(seed,
                                   temporal_patterns[0 + run:24 + run],
                                   PP_to_GCs[0 + run:24 + run],
                                   PP_to_BCs[0 + run:24 + run],
                                   pp_weight=args.pp_weight)

    # Attach voltage recordings to all cells
    nw.populations[0].voltage_recording(range(2000))
    nw.populations[1].voltage_recording(range(60))
    nw.populations[2].voltage_recording(range(24))
    nw.populations[3].voltage_recording(range(24))
    # Run the model
示例#2
0
PP_to_GCs = np.array(PP_to_GCs)
# Generate the PP -> BC mapping as above
BC_indices = np.arange(24)
start_idc = np.array(((start_idc / 2000.0) * 24), dtype=int)

PP_to_BCs = []
for x in start_idc:
    curr_idc = np.concatenate((BC_indices[x:24], BC_indices[0:x]))
    PP_to_BCs.append(
        np.random.choice(curr_idc, size=1, replace=False, p=pdf_bc))

PP_to_BCs = np.array(PP_to_BCs)

# Generate temporal patterns for the 100 PP inputs
np.random.seed(seed)
temporal_patterns = inhom_poiss(rate=30)

# Start the runs of the model
for run in runs:
    nw = net_tunedrev.TunedNetwork(seed, temporal_patterns[0 + run:24 + run],
                                   PP_to_GCs[0 + run:24 + run],
                                   PP_to_BCs[0 + run:24 + run])

    # Attach voltage recordings to all cells
    nw.populations[0].voltage_recording(range(2000))
    nw.populations[1].voltage_recording(range(60))
    nw.populations[2].voltage_recording(range(24))
    nw.populations[3].voltage_recording(range(24))
    # Run the model
    """Initialization for -2000 to -100"""
    h.cvode.active(0)
             "C:\\Users\\daniel\\Repos\\nrnmech.dll",
             ("C:\\Users\\Holger\\danielm\\models_dentate\\"
              "dentate_gyrus_Santhakumar2005_and_Yim_patterns\\"
              "dentategyrusnet2005\\nrnmech.dll"),
             ("C:\\Users\\Daniel\\repos\\"
              "dentate_gyrus_Santhakumar2005_and_Yim_patterns\\"
              "dentategyrusnet2005\\nrnmech.dll")]
for x in dll_files:
    if os.path.isfile(x):
        dll_dir = x
print("DLL loaded from: " + str(dll_dir))
h.nrn_load_dll(dll_dir)

# Generate temporal patterns for the 100 PP inputs
np.random.seed(10000)
temporal_patterns = inhom_poiss()

# Generate the PP -> GC mapping so that each GC receives inputs from 20/400
# randomly chosen PP inputs
innervation_pattern_gc = np.array(
    [np.random.choice(400, 20, replace=False) for x in range(2000)])
innervation_pattern_gc = innervation_pattern_gc.swapaxes(0, 1)

PP_to_GCs = []
for x in range(0, 400):
    PP_to_GCs.append(np.argwhere(innervation_pattern_gc == x)[:, 1])

PP_to_GCs = np.array(PP_to_GCs)

# Generate the PP -> BC mapping as above
innervation_pattern_bc = np.array(
示例#4
0
    PP_to_GCs = np.array(PP_to_GCs)

    BC_indices = np.arange(24)
    start_idc = np.array(((start_idc / 2000.0) * 24), dtype=int)

    PP_to_BCs = []
    for x in start_idc:
        curr_idc = np.concatenate((BC_indices[x:24], BC_indices[0:x]))
        PP_to_BCs.append(
            np.random.choice(curr_idc, size=1, replace=False, p=pdf_bc))

    PP_to_BCs = np.array(PP_to_BCs)

    # Generate temporal patterns for the 100 PP inputs
    np.random.seed(input_seed)
    temporal_patterns = inhom_poiss(rate=input_freq)

    seed_input_vectors = []
    seed_output_vectors = []
    seed_input_time_stamps = []
    seed_output_time_stamps = []
    # Start the runs of the model
    for run in runs:
        print("Run: " + str(run))
        nw = net_tunedrevdecaysdelayspeaknorm_linux.TunedNetwork(
            seed, temporal_patterns[0 + run:24 + run],
            PP_to_GCs[0 + run:24 + run], PP_to_BCs[0 + run:24 + run], bc_decay,
            hc_decay, bc_delay, hc_delay, gc_weight, bc_weight, hc_weight)

        # Run the model
        """Initialization for -2000 to -100"""
示例#5
0
PP_to_GCs = np.array(PP_to_GCs)
# Generate the PP -> BC mapping as above
BC_indices = np.arange(24)
start_idc = np.array(((start_idc / 2000.0) * 24), dtype=int)

PP_to_BCs = []
for x in start_idc:
    curr_idc = np.concatenate((BC_indices[x:24], BC_indices[0:x]))
    PP_to_BCs.append(
        np.random.choice(curr_idc, size=1, replace=False, p=pdf_bc))

PP_to_BCs = np.array(PP_to_BCs)

# Generate temporal patterns for the 100 PP inputs
np.random.seed(10000)
patterns_temp = inhom_poiss()
temporal_patterns = []
for x in range(patterns_temp.shape[0]):
    curr_patterns = np.array([])
    for y in range(5):
        curr_patterns = np.concatenate(
            (curr_patterns,
             patterns_temp[x][patterns_temp[x] < 100] + (100.0 * y)))
    temporal_patterns.append(curr_patterns)

temporal_patterns = np.array(temporal_patterns)

# Start the runs of the model
for run in runs:
    nw = net_tunedrev.TunedNetwork(10000, temporal_patterns[0 + run:24 + run],
                                   PP_to_GCs[0 + run:24 + run],