Skip to content
Snippets Groups Projects
Commit b021342b authored by Jannis's avatar Jannis
Browse files

work on 1D network class for Figure2

parent 67680d9f
No related branches found
No related tags found
1 merge request!1Add all necessary files for the multi-area model
......@@ -8,13 +8,14 @@ from multiarea_model.theory import Theory
from multiarea_model.theory_helpers import nu0_fb
from multiarea_model.default_params import single_neuron_dict, nested_update
from multiarea_model.multiarea_helpers import convert_syn_weight
from copy import copy
class network1D:
def __init__(self, params):
self.label = '1D'
self.params = {'input_params': params['input_params'],
'neuron_params': {'single_neuron_dict': single_neuron_dict},
'neuron_params': {'single_neuron_dict': copy(single_neuron_dict)},
'connection_params': {'replace_cc': None,
'replace_cc_input_source': None}
}
......@@ -23,23 +24,38 @@ class network1D:
self.structure = {'A': {'E'}}
self.structure_vec = ['A-E']
self.area_list = ['A']
self.K_matrix = np.array([[params['K'], params['K']]])
if 'K_stable' in params.keys():
self.K_matrix = np.array([[params['K_stable'], params['K']]])
else:
self.K_matrix = np.array([[params['K'], params['K']]])
self.W_matrix = np.array([[params['W'], params['W']]])
self.J_matrix = convert_syn_weight(self.W_matrix,
self.params['neuron_params']['single_neuron_dict'])
self.theory = Theory(self, {})
def Phi(self, rate):
mu, sigma = self.theory.mu_sigma(rate)
NP = self.params['neuron_params']['single_neuron_dict']
return list(map(lambda mu, sigma: nu0_fb(mu, sigma,
1.e-3*NP['tau_m'],
1.e-3*NP['tau_syn_ex'],
1.e-3*NP['t_ref'],
1.e-3 * NP['tau_m'],
1.e-3 * NP['tau_syn_ex'],
1.e-3 * NP['t_ref'],
NP['V_th'] - NP['E_L'],
NP['V_reset'] - NP['E_L']),
mu, sigma))
def Phi_noisefree(self, rate):
mu, sigma = self.theory.mu_sigma(rate)
NP = self.params['neuron_params']['single_neuron_dict']
th_shift = NP['V_th'] - NP['E_L']
if mu > th_shift:
T = 1e-3 * NP['tau_m'] * \
np.log(mu[0] / (mu[0] - th_shift))
return (1 / T)
else:
return 0.
def fsolve(self, rates_init):
def f(rate):
return self.Phi(rate) - rate
......@@ -63,19 +79,20 @@ class network2D:
self.structure = {'A': {'E1', 'E2'}}
self.structure_vec = ['A-E1', 'A-E2']
self.area_list = ['A']
self.K_matrix = np.array([[params['K'] / 2., params['K'] / 2., params['K']]])
self.K_matrix = np.array(
[[params['K'] / 2., params['K'] / 2., params['K']]])
self.W_matrix = np.array([[params['W'], params['W'], params['W']]])
self.J_matrix = convert_syn_weight(self.W_matrix,
self.params['neuron_params']['single_neuron_dict'])
self.theory = Theory(self, {})
def Phi(self, rate):
mu, sigma = self.theory.mu_sigma(rate)
NP = self.params['neuron_params']['single_neuron_dict']
return list(map(lambda mu, sigma: nu0_fb(mu, sigma,
1.e-3*NP['tau_m'],
1.e-3*NP['tau_syn_ex'],
1.e-3*NP['t_ref'],
1.e-3 * NP['tau_m'],
1.e-3 * NP['tau_syn_ex'],
1.e-3 * NP['t_ref'],
NP['V_th'] - NP['E_L'],
NP['V_reset'] - NP['E_L']),
mu, sigma))
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment