'EINs': eins, 'IINs': iins }, edges=[('PCs/Op_exc_syn/r', 'EINs/Op_exc_syn/r_exc', None, { 'weight': 13.5 }), ('EINs/Op_exc_syn/r', 'PCs/Op_exc_syn/r_exc', None, { 'weight': 0.8 * 13.5 }), ('PCs/Op_exc_syn/r', 'IINs/Op_inh_syn/r_exc', None, { 'weight': 0.25 * 13.5 }), ('IINs/Op_inh_syn/r', 'PCs/Op_exc_syn/r_inh', None, { 'weight': 1.75 * 13.5 })]) jrc_ir = jrc_template.apply() dt = 1e-3 # integration step size in s dts = 1e-2 # variable storage sub-sampling step size in s T = 42. jrc = ComputeGraph(jrc_ir, vectorization="nodes", dt=dt, backend='numpy', name='JRC', build_in_place=False) w_ein_pc = np.linspace(0.5, 2, 10) * 0.8 * 13.5 w_iin_pc = np.linspace(0.5, 2, 10) * 1.75 * 13.5
""" Edges are defined by a list with four entries (1/2/3/4): 1) The source variable (PC/PRO/m_out refers to variable m_out in operator PRO of node PC) / 2) The target variable / 3) An edge template with additional operators (null means no particular edge template is used) 4) A dictionary of variables and values that are specific to this edge""" circuit = CircuitTemplate( name="JRC", nodes={'IIN': iin, 'EIN': ein, 'PC': pc}, edges = [ \ ["PC/PRO/m_out", "IIN/RPO_e/m_in", None, {'weight': 33.75}], ["PC/PRO/m_out", "EIN/RPO_e/m_in", None, {'weight': 135.}], ["EIN/PRO/m_out", "PC/RPO_e_pc/m_in", None, {'weight': 108.}], ["IIN/PRO/m_out", "PC/RPO_i/m_in", None, {'weight': 33.75}]], path=None) # Instantiate (apply) circuit circuit = circuit.apply() # # --------------------------------------------------- # # Visualise the network # # --------------------------------------------------- # pos = nx.spring_layout(circuit.graph) # nx.draw_shell(circuit.graph, with_labels=True, node_size=2000, arrowsize=30) # plt.show() # --------------------------------------------------- # Run simulation # --------------------------------------------------- # Setup backend T, dt = 10.0, 0.001 compute_graph = circuit.compile(vectorization="nodes", dt=dt, backend="numpy")