add dendritic low pass filter
This commit is contained in:
		
							parent
							
								
									7fda8d65f1
								
							
						
					
					
						commit
						b7da40ffd3
					
				| @ -23,7 +23,8 @@ class LifacNoiseModel(AbstractModel): | |||||||
|                       "tau_a": 0.1, |                       "tau_a": 0.1, | ||||||
|                       "a_zero": 2, |                       "a_zero": 2, | ||||||
|                       "noise_strength": 0.05, |                       "noise_strength": 0.05, | ||||||
|                       "step_size": 0.00005} |                       "step_size": 0.00005, | ||||||
|  |                       "dend_tau": 0.001} | ||||||
| 
 | 
 | ||||||
|     def __init__(self, params: dict = None): |     def __init__(self, params: dict = None): | ||||||
|         super().__init__(params) |         super().__init__(params) | ||||||
| @ -103,9 +104,10 @@ class LifacNoiseModel(AbstractModel): | |||||||
|         mem_tau = self.parameters["mem_tau"] |         mem_tau = self.parameters["mem_tau"] | ||||||
|         noise_strength = self.parameters["noise_strength"] |         noise_strength = self.parameters["noise_strength"] | ||||||
|         input_scaling = self.parameters["input_scaling"] |         input_scaling = self.parameters["input_scaling"] | ||||||
|  |         dend_tau = self.parameters["dend_tau"] | ||||||
| 
 | 
 | ||||||
|         rectified_stimulus = rectify_stimulus_array(stimulus.as_array(time_start, total_time_s, step_size)) |         rectified_stimulus = rectify_stimulus_array(stimulus.as_array(time_start, total_time_s, step_size)) | ||||||
|         parameters = np.array([v_zero, a_zero, step_size, threshold, v_base, delta_a, tau_a, v_offset, mem_tau, noise_strength, time_start, input_scaling]) |         parameters = np.array([v_zero, a_zero, step_size, threshold, v_base, delta_a, tau_a, v_offset, mem_tau, noise_strength, time_start, input_scaling, dend_tau]) | ||||||
| 
 | 
 | ||||||
|         voltage_trace, adaption, spiketimes = simulate_fast(rectified_stimulus, total_time_s, parameters) |         voltage_trace, adaption, spiketimes = simulate_fast(rectified_stimulus, total_time_s, parameters) | ||||||
| 
 | 
 | ||||||
| @ -333,21 +335,25 @@ def simulate_fast(rectified_stimulus_array, total_time_s, parameters: np.ndarray | |||||||
|     noise_strength = parameters[9] |     noise_strength = parameters[9] | ||||||
|     time_start = parameters[10] |     time_start = parameters[10] | ||||||
|     input_scaling = parameters[11] |     input_scaling = parameters[11] | ||||||
|  |     dend_tau = parameters[12] | ||||||
| 
 | 
 | ||||||
|     time = np.arange(time_start, total_time_s, step_size) |     time = np.arange(time_start, total_time_s, step_size) | ||||||
|     length = len(time) |     length = len(time) | ||||||
|     output_voltage = np.zeros(length) |     output_voltage = np.zeros(length) | ||||||
|     adaption = np.zeros(length) |     adaption = np.zeros(length) | ||||||
|  |     input_voltage = np.zeros(length) | ||||||
| 
 | 
 | ||||||
|     spiketimes = [] |     spiketimes = [] | ||||||
|     output_voltage[0] = v_zero |     output_voltage[0] = v_zero | ||||||
|     adaption[0] = a_zero |     adaption[0] = a_zero | ||||||
|  |     input_voltage[0] = rectified_stimulus_array[0] | ||||||
| 
 | 
 | ||||||
|     for i in range(1, len(time), 1): |     for i in range(1, len(time), 1): | ||||||
| 
 | 
 | ||||||
|         noise_value = np.random.normal() |         noise_value = np.random.normal() | ||||||
|         noise = noise_strength * noise_value / np.sqrt(step_size) |         noise = noise_strength * noise_value / np.sqrt(step_size) | ||||||
| 
 | 
 | ||||||
|  |         input_voltage[i] = input_voltage[i - 1] + (-input_voltage[i - 1] + rectified_stimulus_array[i] * input_scaling) / dend_tau | ||||||
|         output_voltage[i] = output_voltage[i-1] + ((v_base - output_voltage[i-1] + v_offset + (rectified_stimulus_array[i] * input_scaling) - adaption[i-1] + noise) / mem_tau) * step_size |         output_voltage[i] = output_voltage[i-1] + ((v_base - output_voltage[i-1] + v_offset + (rectified_stimulus_array[i] * input_scaling) - adaption[i-1] + noise) / mem_tau) * step_size | ||||||
|         adaption[i] = adaption[i-1] + ((-adaption[i-1]) / tau_a) * step_size |         adaption[i] = adaption[i-1] + ((-adaption[i-1]) / tau_a) * step_size | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user