Exemplo n.º 1
0
def build_l4():
    if not os.path.exists('output/network/VisL4'):
        os.makedirs('output/network/VisL4')

    net = NetworkBuilder("V1/L4")
    net.add_nodes(node_type_id=0, pop_name='excitatory', params_file='excitatory_pop.json')
    net.add_nodes(node_type_id=1, pop_name='inhibitory', params_file='inhibitory_pop.json')

    net.connect(target={'pop_name': 'excitatory'}, source={'pop_name': 'inhibitory'},
                edge_params={'weight': -0.001, 'delay': 0.002, 'nsyns': 2, 'params_file': 'ExcToInh.json'})

    net.connect(target={'pop_name': 'inhibitory'}, source={'pop_name': 'excitatory'},
                edge_params={'weight': 0.001, 'delay': 0.002, 'nsyns': 5, 'params_file': 'ExcToInh.json'})

    net.save_types(filename='output/network/VisL4/node_types.csv',
                   columns=['node_type_id', 'pop_name', 'params_file'])

    net.save_edge_types('output/network/VisL4/edge_types.csv',
                        opt_columns=['weight', 'delay', 'nsyns', 'params_file'])
Exemplo n.º 2
0
def build_lgn():
    if not os.path.exists('output/network/LGN'):
        os.makedirs('output/network/LGN')

    net = NetworkBuilder("LGN")
    net.add_nodes(N=3000, node_type_id='tON_001', ei='e', location='LGN', pop_name='tON_001', params_file='filter_pop.json')
    net.add_nodes(N=3000, node_type_id='tOFF_001', ei='e', location='LGN', pop_name='tOFF_001', params_file='filter_pop.json')
    net.add_nodes(N=3000, node_type_id='tONOFF_001', ei='e', location='LGN', pop_name='tONOFF_001',
                  params_file='filter_pop.json')

    net.save_cells(filename='output/network/LGN/nodes.csv',
                   columns=['node_id', 'node_type_id'])
    net.save_types(filename='output/network/LGN/node_types.csv',
                   columns=['node_type_id', 'ei', 'location', 'pop_name', 'params_file'])

    net.connect(target={'pop_name': 'excitatory'},
                edge_params={'weight': 0.0015, 'delay': 0.002, 'params_file': 'ExcToExc.json', 'nsyns': 10})

    net.connect(target={'pop_name': 'inhibitory'},
                edge_params={'weight': 0.0019, 'delay': 0.002, 'params_file': 'ExcToInh.json', 'nsyns': 12})

    net.save_edge_types('output/network/LGN/edge_types.csv',
                        opt_columns=['weight', 'delay', 'nsyns', 'params_file'])
Exemplo n.º 3
0
def build_l4():
    if not os.path.exists('output/network/VisL4'):
        os.makedirs('output/network/VisL4')

    net = NetworkBuilder("V1/L4")
    net.add_nodes(N=2,
                  pop_name='Scnn1a',
                  node_type_id='395830185',
                  position='points',
                  position_params={
                      'location': [(28.753, -364.868, -161.705),
                                   (48.753, -344.868, -141.705)]
                  },
                  array_params={"tuning_angle": [0.0, 25.0]},
                  location='VisL4',
                  ei='e',
                  gaba_synapse='y',
                  params_file='472363762_point.json',
                  model_type='iaf_psc_alpha')

    net.add_nodes(N=2,
                  pop_name='Rorb',
                  node_type_id='314804042',
                  position='points',
                  position_params={
                      'location': [(241.092, -349.263, 146.916),
                                   (201.092, -399.263, 126.916)]
                  },
                  array_params={"tuning_angle": [50.0, 75.0]},
                  location='VisL4',
                  ei='e',
                  gaba_synapse='y',
                  params_file='473863510_point.json',
                  model_type='iaf_psc_alpha')

    net.add_nodes(N=2,
                  pop_name='Nr5a1',
                  node_type_id='318808427',
                  position='points',
                  position_params={
                      'location': [(320.498, -351.259, 20.273),
                                   (310.498, -371.259, 10.273)]
                  },
                  array_params={"tuning_angle": [100.0, 125.0]},
                  location='VisL4',
                  ei='e',
                  gaba_synapse='y',
                  params_file='473863035_point.json',
                  model_type='iaf_psc_alpha')

    net.add_nodes(N=2,
                  pop_name='PV1',
                  node_type_id='330080937',
                  position='points',
                  position_params={
                      'location': [(122.373, -352.417, -216.748),
                                   (102.373, -342.417, -206.748)]
                  },
                  array_params={'tuning_angle': ['NA', 'NA']},
                  location='VisL4',
                  ei='i',
                  gaba_synapse='y',
                  params_file='472912177_fit.json',
                  model_type='iaf_psc_alpha')

    net.add_nodes(N=2,
                  pop_name='PV2',
                  node_type_id='318331342',
                  position='points',
                  position_params={
                      'location': [(350.321, -372.535, -18.282),
                                   (360.321, -371.535, -12.282)]
                  },
                  array_params={'tuning_angle': ['NA', 'NA']},
                  location='VisL4',
                  ei='i',
                  gaba_synapse='y',
                  params_file='473862421_point.json',
                  model_type='iaf_psc_alpha')

    net.add_nodes(N=2,
                  pop_name='LIF_exc',
                  node_type_id='100000101',
                  position='points',
                  position_params={
                      'location': [(-243.04, -342.352, -665.666),
                                   (-233.04, -332.352, -675.666)]
                  },
                  array_params={'tuning_angle': ['NA', 'NA']},
                  location='VisL4',
                  ei='e',
                  gaba_synapse='n',
                  params_file='IntFire1_exc_1.json',
                  model_type='iaf_psc_alpha')

    net.add_nodes(N=2,
                  pop_name='LIF_inh',
                  node_type_id='100000102',
                  position='points',
                  position_params={
                      'location': [(211.04, -321.333, -631.593),
                                   (218.04, -327.333, -635.593)]
                  },
                  array_params={'tuning_angle': [150.0, 175.0]},
                  location='VisL4',
                  ei='i',
                  gaba_synapse='n',
                  params_file='IntFire1_inh_1.json',
                  model_type='iaf_psc_alpha')

    print("Setting connections...")
    net.connect(source={'ei': 'i'},
                target={
                    'ei': 'i',
                    'gaba_synapse': 'y'
                },
                connector=lambda trg, src: 5,
                edge_params={
                    'weight_max': -1.8,
                    'weight_function': 'wmax',
                    'delay': 2.0,
                    'params_file': 'InhToInh.json',
                    'synapse_model': 'static_synapse'
                })

    net.connect(source={'ei': 'i'},
                target={
                    'ei': 'e',
                    'gaba_synapse': 'y'
                },
                connector=lambda trg, src: 5,
                edge_params={
                    'weight_max': -12.6,
                    'weight_function': 'wmax',
                    'delay': 2.0,
                    'params_file': 'InhToExc.json',
                    'synapse_model': 'static_synapse'
                })

    net.connect(source={'ei': 'i'},
                target={'pop_name': 'LIF_inh'},
                connector=lambda trg, src: 5,
                edge_params={
                    'weight_max': -1.125,
                    'weight_function': 'wmax',
                    'delay': 2.0,
                    'params_file': 'InhToInh.json',
                    'synapse_model': 'static_synapse'
                })

    net.connect(source={'ei': 'i'},
                target={'pop_name': 'LIF_exc'},
                connector=lambda trg, src: 5,
                edge_params={
                    'weight_max': -6.3,
                    'weight_function': 'wmax',
                    'delay': 2.0,
                    'params_file': 'ExcToInh.json',
                    'synapse_model': 'static_synapse'
                })

    net.connect(source={'ei': 'e'},
                target={'pop_name': 'PV1'},
                connector=lambda trg, src: 5,
                edge_params={
                    'weight_max': 7.7,
                    'weight_function': 'wmax',
                    'delay': 2.0,
                    'params_file': 'ExcToInh.json',
                    'synapse_model': 'static_synapse'
                })

    net.connect(source={'ei': 'e'},
                target={'pop_name': 'PV2'},
                connector=lambda trg, src: 5,
                edge_params={
                    'weight_max': 5.4,
                    'weight_function': 'wmax',
                    'delay': 2.0,
                    'params_file': 'ExcToInh.json',
                    'synapse_model': 'static_synapse'
                })

    net.connect(source={'ei': 'e'},
                target={'pop_name': 'LIF_inh'},
                connector=lambda trg, src: 5,
                edge_params={
                    'weight_max': 3.44,
                    'weight_function': 'wmax',
                    'delay': 2.0,
                    'params_file': 'ExcToInh.json',
                    'synapse_model': 'static_synapse'
                })

    print("Generating E-to-E connections.")
    net.connect(source={'ei': 'e'},
                target={'pop_name': 'Scnn1a'},
                connector=lambda trg, src: 5,
                edge_params={
                    'weight_max': 8.448,
                    'weight_function': 'gaussianLL',
                    'weight_sigma': 50.0,
                    'delay': 2.0,
                    'params_file': 'ExcToExc.json',
                    'synapse_model': 'static_synapse'
                })

    net.connect(source={'ei': 'e'},
                target={'pop_name': 'Rorb'},
                connector=lambda trg, src: 5,
                edge_params={
                    'weight_max': 4.292,
                    'weight_function': 'gaussianLL',
                    'weight_sigma': 50.0,
                    'delay': 2.0,
                    'params_file': 'ExcToExc.json',
                    'synapse_model': 'static_synapse'
                })

    net.connect(source={'ei': 'e'},
                target={'pop_name': 'Nr5a1'},
                connector=lambda trg, src: 5,
                edge_params={
                    'weight_max': 5.184,
                    'weight_function': 'gaussianLL',
                    'weight_sigma': 50.0,
                    'delay': 2.0,
                    'params_file': 'ExcToExc.json',
                    'synapse_model': 'static_synapse'
                })

    net.connect(source={'ei': 'e'},
                target={'pop_name': 'LIF_exc'},
                connector=lambda trg, src: 5,
                edge_params={
                    'weight_max': 1.995,
                    'weight_function': 'gaussianLL',
                    'weight_sigma': 50.0,
                    'delay': 2.0,
                    'params_file': 'ExcToExc.json',
                    'synapse_model': 'static_synapse'
                })

    net.build()
    net.save_cells(
        filename='output/network/VisL4/nodes.csv',
        columns=['node_id', 'node_type_id', 'position', 'tuning_angle'],
        position_labels=['x', 'y', 'z'])

    net.save_types(filename='output/network/VisL4/node_types.csv',
                   columns=[
                       'node_type_id', 'pop_name', 'ei', 'gaba_synapse',
                       'location', 'model_type', 'params_file'
                   ])

    net.save_edge_types('output/network/VisL4/edge_types.csv',
                        opt_columns=[
                            'weight_max', 'weight_function', 'weight_sigma',
                            'delay', 'params_file', 'synapse_model'
                        ])
    net.save_edges(filename='output/network/VisL4/edges.h5')
    return net