OSCR

Cell-Type-Specific Synaptic Scaling Mechanisms Differentially Contribute to Associative Learning.

Code ↔ Paper

3 matches between paragraphs of the paper and lines of its authors' code, computed by the harvester (lexical-v1). Click a colored paragraph or line to see its counterpart.

The 3 matches
  1. [1] § Methods › Multi-compartment model ↔ model.py, lines 439–480 · score 0.61 · apical dendrite, basal dendrite, SST populations, soma, firing rate, model
  2. [2] § Results › Memory undergoes transient generalization caused by Hebbian plasticity before gradually achieving specificity ↔ model_analysis.py, lines 1134–1200 · score 0.56 · steady state, associative memory, active, synaptic scaling, pre, onset
  3. [3] § Results › Characterization of the temporal evolution of memory representations ↔ model_analysis.py, lines 193–241 · score 0.54 · excitatory firing rate, factor Hebbian learning, longer, timescale, synaptic scaling, post

Paper

Loaded from Europe PMC by your browser, not stored by OSCR: doi.org · Europe PMC

The paper is loaded when this pane is shown.

The authors' code

Python · 1,331 lines · 81 KB · no license · 2 matches

  1. import numpy as np
  2. import matplotlib.pyplot as plt
  3. from util import *
  4. import sys
  5. from model import *
  6. from plotting_functions import *
  7. import os
  8. # from parameters import *
  9. import pickle
  10. def analyze_model(hour_sim, flags_list, flags_theta=(1,1), dir_data=r'\figures\data\\', dir_plot=r'\figures\\',
  11. K=0.25, flag_only_S_on=False, run_simulation=True, save_results = False, plot_results=False,modulation_SST=0):
  12. """
  13. :param hour_sim: Defines how many hours does the simulation lasts
  14. :param flags_list: contains a list of tuples. Each tuple is a collection of all the flags (e.g. synaptic scaling, hebbian learning, ...)
  15. :param flags_theta: used to study the behaviour of the model (no longer useful). Theta1 for population1 and Theta2 for population2
  16. :param dir_data
  17. :param dir_plot
  18. :param K: Tunes the steady state value of target activity and its regulator
  19. :param g_top_down_to_S: Represents the top-down signal to SST neurons triggered by the hyperexcitation. It reaches
  20. SST neurons at the offset of the conditioning
  21. :param run_simulation: True to run the numerical simulation, False to read the already saved data
  22. :param save_results: True to save the results
  23. :param plot_results: True to plot the results
  24. Multi-purpose function to analyze the model. Here we run (if run_simulation is True) our computational model to
  25. investigate the role of cell-type dependent synaptic scaling mechanisms in associative learning. We replicate the
  26. experimental procedure in [1] in model() in model.py. The model has two subnetworks, each consisted of a canonical
  27. circuit of excitatory pyramidal neurons (E), parvalbumin-positive interneurons (P), somatostatin-positive
  28. interneurons (S). The simulation procedure is divided into three phases:
  29. Phase 1 - Conditioning: The first subnetwork receives extra input representing the conditioned stimulus in [1].
  30. The parameters describing the stimulation (when and how much stimulation) is described in analyze_model()
  31. function. The onset response of the excitatory firing rate of the first subnetwork is defined as the aversion
  32. threshold of this network. Three-factor Hebbian learning is active during this period. Also, synaptic scaling
  33. mechanisms, adaptive target activity (theta) and target activity regulator (beta) are active.
  34. Phase 2: In the experiment [1], the novel stimulus is presented to the mice at 4h/24h/48h after conditioning.
  35. This phase corresponds to the waiting time after conditioning and before testing. During this phase, synaptic
  36. scaling mechanisms, adaptive target activity (theta) and target activity regulator (beta) are active.
  37. Phase 3 - Testing: In this phase, the second subnetwork receives extra input corresponds to the novel stimulus
  38. in [1]. The memory specificity/overgeneralization is determined whether the excitatory rate in the second
  39. subnetwork is below/above the aversion threshold, respectively.
  40. During simulation model() writes data to the data arrays. This data can be saved (if save_results is set to True)
  41. and the results can be plotted (if plot_results is set to True).
  42. [1] Wu, C. H., Ramos, R., Katz, D. B., & Turrigiano, G. G. (2021). Homeostatic synaptic scaling establishes the
  43. specificity of an associative memory. Current biology, 31(11), 2274-2285.
  44. """
  45. os.makedirs(dir_data, exist_ok=True)
  46. os.makedirs(dir_plot, exist_ok=True)
  47. stim_duration = 15 # stimulation duration in seconds
  48. # Simulation duration in seconds, 5 extra seconds for pre- and post-stimulation each, 2 extra seconds to reach steady state initially (thermalization)
  49. sim_duration = int((hour_sim) * 60 * 60 + (stim_duration + 10) * 2 + 2)
  50. delta_t = 0.0001 # time step in seconds (0.1 ms)
  51. sampling_rate_stim = 20 # register data at every 20 step during phase 1 and 3 (conditioning and testing)
  52. sampling_rate_sim = 200_000 # register data at every 2e5 time step (20 seconds) during phase 2 (in between conditioning and testing)
  53. sampling_rate = (sampling_rate_stim, sampling_rate_sim)
  54. # Total number of timepoints for stimulation and simulation
  55. n_time_points_stim = int((stim_duration + 10) * (1 / delta_t) * (1 / sampling_rate_stim))
  56. n_time_points_phase2 = int((hour_sim * 60 * 60 - 20) * (1 / delta_t) * (1 / sampling_rate_sim)) + 1 # total no the rest
  57. l_time_points_stim = np.linspace(0, stim_duration + 10, n_time_points_stim) #time points for the first 15s
  58. l_time_points_phase2 = np.linspace(0, hour_sim, n_time_points_phase2) ##time points for the seoncd phase 4/24/48h
  59. # Timepoints of the onset (first column) and offset (second column) of the first (first row) and second (second) stimuli.
  60. stim_times = np.array([[5, 5 + stim_duration],
  61. [int(hour_sim * 60 * 60) + 5, int(hour_sim * 60 * 60) + 5 + stim_duration]]).reshape(2, 2)
  62. # The stimuli are given as inputs to the populations.
  63. g_stim_E = np.array([(1, 0), (0, 1)])
  64. g_stim_P = np.array([(0.5, 0), (0, 0.5)])
  65. if modulation_SST == 0:
  66. g_stim_S = np.array([(0, 0), (0, 0)])
  67. elif modulation_SST > 0:
  68. g_stim_S = np.array([(0.5, 0), (0, 0.5)])
  69. elif modulation_SST < 0:
  70. g_stim_S = np.array([(-0.5, 0), (0, -0.5)])
  71. g_stim = (g_stim_E, g_stim_P, g_stim_S)
  72. # Time constants
  73. tau_E = 0.02 # time constant of E population firing rate in seconds(20ms)
  74. tau_P = 0.005 # time constant of P population firing rate in seconds(5ms)
  75. tau_S = 0.01 # time constant of S population firing rate in seconds(10ms)
  76. tau_hebb = 240 # time constant of three-factor Hebbian learning in seconds(2min)
  77. tau_theta = 24 * (60 * 60) # time constant of target activity in seconds(24h)
  78. tau_beta = 28 * (60 * 60) # time constant of target activity regulator in seconds(28h)
  79. tau_scaling_E = 8 * (60 * 60) # time constant of E-to-E scaling in seconds (15h)
  80. tau_scaling_P = 8 * (60 * 60) # time constant of P-to-E scaling in seconds (15h)
  81. tau_scaling_S = 8 * (60 * 60) # time constant of S-to-E scaling in seconds (15h)
  82. taus = (tau_E, tau_P, tau_S, tau_hebb, tau_scaling_E, tau_scaling_P, tau_scaling_S, tau_theta, tau_beta)
  83. # Rheobases (minimum input needed for firing rates to be above zero)
  84. rheobase_E, rheobase_P, rheobase_S = 1.5, 1.5, 1.5
  85. rheobases = (rheobase_E, rheobase_P, rheobase_S)
  86. # Background inputs
  87. g_E = 4.5
  88. g_P = 3.2
  89. g_S = 3
  90. back_inputs = (g_E, g_P, g_S)
  91. # Initial conditions for plastic weights
  92. # w_EP_within = 0.81; w_EP_cross = 0.41
  93. # w_ES_within = 0.81; w_ES_cross = 0.31
  94. # w_EE_within = 0.71; w_EE_cross = 0.41
  95. w_EP_within = 0.91; w_EP_cross = 0.41
  96. w_ES_within = 0.51; w_ES_cross = 0.31
  97. w_EE_within = 0.51; w_EE_cross = 0.51
  98. # # Initial conditions for plastic weights
  99. # w_EP_within = 0.7; w_EP_cross = w_EP_within*0.3
  100. # w_ES_within = 0.7; w_ES_cross = w_ES_within*0.3
  101. # w_EE_within = 0.5; w_EE_cross = 0.4
  102. # Weights
  103. w_PE_within = 0.3; w_PE_cross = 0.1
  104. w_PP_within = 0.2; w_PP_cross = 0.1
  105. w_PS_within = 0.3; w_PS_cross = 0.1
  106. w_SE_within = 0.4; w_SE_cross = 0.1
  107. weights = (w_EE_within, w_EP_within, w_ES_within, w_PE_within, w_PP_within, w_PS_within, w_SE_within,
  108. w_EE_cross, w_EP_cross, w_ES_cross, w_PE_cross, w_PP_cross, w_PS_cross, w_SE_cross)
  109. # Arrays created to hold data
  110. r_phase1 = np.zeros((6, n_time_points_stim), dtype=np.float32) # rE1,rE2,rP1,rP2,rS1,rS2
  111. J_EE_phase1 = np.zeros((4, n_time_points_stim), dtype=np.float32) # WEE11,WEE12,WEE21,WEE22
  112. r_phase2 = np.zeros((10, n_time_points_phase2),
  113. dtype=np.float32) # rE1,rE2,rP1,rP2,rS1,rS2,theta1,theta2,beta1,beta2
  114. J_phase2 = np.zeros((12, n_time_points_phase2),
  115. dtype=np.float32) # WEE11,WEE12,WEE21,WEE22,WEP11,WEP12,WEP21,WEP22,WES11,WES12,WES21,WES22
  116. r_phase3 = np.zeros((6, n_time_points_stim), dtype=np.float32) # rE1,rE2,rP1,rP2,rS1,rS2
  117. max_E = np.zeros(1, dtype=np.float32)
  118. # Lists to hold data arrays
  119. l_res_rates = (r_phase1, r_phase2, r_phase3, max_E)
  120. l_res_weights = (J_EE_phase1, J_phase2)
  121. for flags in flags_list:
  122. id, title = determine_name(flags)
  123. name = 'Case' + id + '_' + str(hour_sim) + 'h' + '_k' + str(K).replace(".","")
  124. print('*****', title, '*****')
  125. if run_simulation:
  126. print('Simulation started.')
  127. print('\n')
  128. #All flags = 0 and simulation is 30 seconds long. It is used to evaluate what happens when activating E1 what's the response of E2. Afterwards it is evaluating the av_threshold given the result
  129. model(delta_t, sampling_rate, l_res_rates, l_res_weights, int(30 * (1 / delta_t)), weights,
  130. back_inputs, g_stim, stim_times, taus, K, rheobases, flags=(0,0,0,0,0,0), flags_theta=flags_theta)
  131. idx_av_threshold = int(15 * (1 / delta_t) * (1 / sampling_rate_stim))
  132. # av_threshold = r_phase1[1][idx_av_threshold] * 1.15 #it is defined with an extra 15% for old reason. not required anymore
  133. av_threshold = r_phase1[1][idx_av_threshold]
  134. model(delta_t, sampling_rate, l_res_rates, l_res_weights, int(sim_duration * (1 / delta_t)), weights,
  135. back_inputs, g_stim, stim_times, taus, K, rheobases, flags=flags, flags_theta=flags_theta)
  136. if save_results:
  137. l_results = [l_time_points_stim, l_time_points_phase2, delta_t, sampling_rate, l_res_rates,
  138. l_res_weights,
  139. av_threshold, stim_times, stim_duration, sim_duration]
  140. # Open a file and save
  141. with open(dir_data + name + '.pkl', 'wb') as file:
  142. # A new file will be created
  143. pickle.dump(l_results, file)
  144. print('Data is saved.')
  145. else:
  146. # Open the file and read
  147. with open(dir_data + name + '.pkl', 'rb') as file:
  148. l_results = pickle.load(file)
  149. print('Data is read.')
  150. [l_time_points_stim, l_time_points_phase2, delta_t, sampling_rate, l_res_rates, l_res_weights,
  151. av_threshold, stim_times, stim_duration, sim_duration] = l_results
  152. if plot_results:
  153. print('Plotting the results.')
  154. time_plots([l_time_points_stim, l_time_points_phase2], l_res_rates, l_res_weights, av_threshold,
  155. stim_times, dir_plot + name, hour_sim,modulation_SST, flag_only_S_on=flag_only_S_on, format='.png')
  156. time_plots([l_time_points_stim, l_time_points_phase2], l_res_rates, l_res_weights, av_threshold,
  157. stim_times, dir_plot + name, hour_sim,modulation_SST, flag_only_S_on=flag_only_S_on, format='.pdf')
  158. #this function is a generalized version of the one above. this one, with the right flags, is the only one necessary. For clarity, they are separated
  159. def analyze_model_timescales(hour_sim, flags_list, flags_theta=(1,1), dir_data=r'\figures\data\\', dir_plot=r'\figures\\',
  160. K=0.25, flag_only_S_on=False, run_simulation=True, save_results = False, plot_results=False,modulation_SST=0,timescales_exploration=False):
  161. """
  162. :param hour_sim: Defines how many hours does the simulation lasts
  163. :param flags_list: contains a list of tuples. Each tuple is a collection of all the flags (e.g. synaptic scaling, hebbian learning, ...)
  164. :param flags_theta: used to study the behaviour of the model (no longer useful). Theta1 for population1 and Theta2 for population2
  165. :param dir_data
  166. :param dir_plot
  167. :param K: Tunes the steady state value of target activity and its regulator
  168. :param run_simulation: True to run the numerical simulation, False to read the already saved data
  169. :param save_results: True to save the results
  170. :param plot_results: True to plot the results
  171. Multi-purpose function to analyze the model. Here we run (if run_simulation is True) our computational model to
  172. investigate the role of cell-type dependent synaptic scaling mechanisms in associative learning. We replicate the
  173. experimental procedure in [1] in model() in model.py. The model has two subnetworks, each consisted of a canonical
  174. circuit of excitatory pyramidal neurons (E), parvalbumin-positive interneurons (P), somatostatin-positive
  175. interneurons (S). The simulation procedure is divided into three phases:
  176. Phase 1 - Conditioning: The first subnetwork receives extra input representing the conditioned stimulus in [1].
  177. The parameters describing the stimulation (when and how much stimulation) is described in analyze_model()
  178. function. The onset response of the excitatory firing rate of the first subnetwork is defined as the aversion
  179. threshold of this network. Three-factor Hebbian learning is active during this period. Also, synaptic scaling
  180. mechanisms, adaptive target activity (theta) and target activity regulator (beta) are active.
  181. Phase 2: In the experiment [1], the novel stimulus is presented to the mice at 4h/24h/48h after conditioning.
  182. This phase corresponds to the waiting time after conditioning and before testing. During this phase, synaptic
  183. scaling mechanisms, adaptive target activity (theta) and target activity regulator (beta) are active.
  184. Phase 3 - Testing: In this phase, the second subnetwork receives extra input corresponds to the novel stimulus
  185. in [1]. The memory specificity/overgeneralization is determined whether the excitatory rate in the second
  186. subnetwork is below/above the aversion threshold, respectively.
  187. During simulation model() writes data to the data arrays. This data can be saved (if save_results is set to True)
  188. and the results can be plotted (if plot_results is set to True).
  189. [1] Wu, C. H., Ramos, R., Katz, D. B., & Turrigiano, G. G. (2021). Homeostatic synaptic scaling establishes the
  190. specificity of an associative memory. Current biology, 31(11), 2274-2285.
  191. """
  192. os.makedirs(dir_data, exist_ok=True)
  193. os.makedirs(dir_plot, exist_ok=True)
  194. stim_duration = 15 # stimulation duration in seconds
  195. # Simulation duration in seconds, 5 extra seconds for pre- and post-stimulation each, 2 extra seconds to reach steady state initially (thermalization)
  196. sim_duration = int((hour_sim) * 60 * 60 + (stim_duration + 10) * 2 + 2)
  197. delta_t = 0.0001 # time step in seconds (0.1 ms)
  198. sampling_rate_stim = 20 # register data at every 20 step during phase 1 and 3 (conditioning and testing)
  199. sampling_rate_sim = 200_000 # register data at every 2e5 time step (20 seconds) during phase 2 (in between conditioning and testing)
  200. sampling_rate = (sampling_rate_stim, sampling_rate_sim)
  201. # Total number of timepoints for stimulation and simulation
  202. n_time_points_stim = int((stim_duration + 10) * (1 / delta_t) * (1 / sampling_rate_stim))
  203. n_time_points_phase2 = int((hour_sim * 60 * 60 - 20) * (1 / delta_t) * (1 / sampling_rate_sim)) + 1 # total no the rest
  204. l_time_points_stim = np.linspace(0, stim_duration + 10, n_time_points_stim) #time points for the first 15s
  205. l_time_points_phase2 = np.linspace(0, hour_sim, n_time_points_phase2) ##time points for the seoncd phase 4/24/48h
  206. # Timepoints of the onset (first column) and offset (second column) of the first (first row) and second (second) stimuli.
  207. stim_times = np.array([[5, 5 + stim_duration],
  208. [int(hour_sim * 60 * 60) + 5, int(hour_sim * 60 * 60) + 5 + stim_duration]]).reshape(2, 2)
  209. # The stimuli are given as inputs to the populations.
  210. g_stim_E = np.array([(1, 0), (0, 1)])
  211. g_stim_P = np.array([(0.5, 0), (0, 0.5)])
  212. if modulation_SST == 0:
  213. g_stim_S = np.array([(0, 0), (0, 0)])
  214. elif modulation_SST > 0:
  215. g_stim_S = np.array([(0.5, 0), (0, 0.5)])
  216. elif modulation_SST < 0:
  217. g_stim_S = np.array([(-0.5, 0), (0, -0.5)])
  218. g_stim = (g_stim_E, g_stim_P, g_stim_S)
  219. # Time constants
  220. tau_E = 0.02 # time constant of E population firing rate in seconds(20ms)
  221. tau_P = 0.005 # time constant of P population firing rate in seconds(5ms)
  222. tau_S = 0.01 # time constant of S population firing rate in seconds(10ms)
  223. tau_hebb = 240 # time constant of three-factor Hebbian learning in seconds(2min)
  224. tau_theta_list = [12*3600]
  225. tau_beta_list = [0.01*3600]
  226. # tau_theta_list = (np.arange(24-12, 24+12) * 3600).tolist()
  227. # tau_beta_list = (np.arange(28-12, 28+12) * 3600).tolist()
  228. # tau_theta_list = [6*3600, 26*3600, 260*3600]
  229. # tau_beta_list = [1e-20*3600, 1e20*3600]
  230. tau_scaling_E = 8 * (60 * 60) # time constant of E-to-E scaling in seconds (15h)
  231. tau_scaling_P = 8 * (60 * 60) # time constant of P-to-E scaling in seconds (15h)
  232. tau_scaling_S = 8 * (60 * 60) # time constant of S-to-E scaling in seconds (15h)
  233. # Rheobases (minimum input needed for firing rates to be above zero)
  234. rheobase_E, rheobase_P, rheobase_S = 1.5, 1.5, 1.5
  235. rheobases = (rheobase_E, rheobase_P, rheobase_S)
  236. # Background inputs
  237. g_E = 4.5
  238. g_P = 3.2
  239. g_S = 3
  240. back_inputs = (g_E, g_P, g_S)
  241. for tau_beta in tau_beta_list:
  242. for tau_theta in tau_theta_list:
  243. taus = (tau_E, tau_P, tau_S, tau_hebb, tau_scaling_E, tau_scaling_P, tau_scaling_S, tau_theta, tau_beta)
  244. # Initial conditions for plastic weights
  245. # w_EP_within = 0.81; w_EP_cross = 0.41
  246. # w_ES_within = 0.81; w_ES_cross = 0.31
  247. # w_EE_within = 0.71; w_EE_cross = 0.41
  248. w_EP_within = 0.91; w_EP_cross = 0.41
  249. w_ES_within = 0.51; w_ES_cross = 0.31
  250. w_EE_within = 0.51; w_EE_cross = 0.51
  251. # # Initial conditions for plastic weights
  252. # w_EP_within = 0.7; w_EP_cross = w_EP_within*0.3
  253. # w_ES_within = 0.7; w_ES_cross = w_ES_within*0.3
  254. # w_EE_within = 0.5; w_EE_cross = 0.4
  255. # Weights
  256. w_PE_within = 0.3; w_PE_cross = 0.1
  257. w_PP_within = 0.2; w_PP_cross = 0.1
  258. w_PS_within = 0.3; w_PS_cross = 0.1
  259. w_SE_within = 0.4; w_SE_cross = 0.1
  260. weights = (w_EE_within, w_EP_within, w_ES_within, w_PE_within, w_PP_within, w_PS_within, w_SE_within,
  261. w_EE_cross, w_EP_cross, w_ES_cross, w_PE_cross, w_PP_cross, w_PS_cross, w_SE_cross)
  262. # Arrays created to hold data
  263. r_phase1 = np.zeros((6, n_time_points_stim), dtype=np.float32) # rE1,rE2,rP1,rP2,rS1,rS2
  264. J_EE_phase1 = np.zeros((4, n_time_points_stim), dtype=np.float32) # WEE11,WEE12,WEE21,WEE22
  265. r_phase2 = np.zeros((10, n_time_points_phase2),
  266. dtype=np.float32) # rE1,rE2,rP1,rP2,rS1,rS2,theta1,theta2,beta1,beta2
  267. J_phase2 = np.zeros((12, n_time_points_phase2),
  268. dtype=np.float32) # WEE11,WEE12,WEE21,WEE22,WEP11,WEP12,WEP21,WEP22,WES11,WES12,WES21,WES22
  269. r_phase3 = np.zeros((6, n_time_points_stim), dtype=np.float32) # rE1,rE2,rP1,rP2,rS1,rS2
  270. max_E = np.zeros(1, dtype=np.float32)
  271. # Lists to hold data arrays
  272. l_res_rates = (r_phase1, r_phase2, r_phase3, max_E)
  273. l_res_weights = (J_EE_phase1, J_phase2)
  274. for flags in flags_list:
  275. id, title = determine_name(flags)
  276. name = 'Case' + id + '_' + str(hour_sim) + 'h' + '_k' + str(K).replace(".","") + '_theta_' + str(int(tau_theta/3600)).replace(".","") + '_beta_' + str(int(tau_beta/3600)).replace(".","")
  277. print('*****', title, '*****')
  278. if run_simulation:
  279. print('Simulation started.')
  280. print('\n')
  281. #All flags = 0 and simulation is 30 seconds long. It is used to evaluate what happens when activating E1 what's the response of E2. Afterwards it is evaluating the av_threshold given the result
  282. model(delta_t, sampling_rate, l_res_rates, l_res_weights, int(30 * (1 / delta_t)), weights,
  283. back_inputs, g_stim, stim_times, taus, K, rheobases, flags=(0,0,0,0,0,0), flags_theta=flags_theta)
  284. idx_av_threshold = int(15 * (1 / delta_t) * (1 / sampling_rate_stim))
  285. # av_threshold = r_phase1[1][idx_av_threshold] * 1.15 #it is defined with an extra 15% for old reason. not required anymore
  286. av_threshold = r_phase1[1][idx_av_threshold]
  287. model(delta_t, sampling_rate, l_res_rates, l_res_weights, int(sim_duration * (1 / delta_t)), weights,
  288. back_inputs, g_stim, stim_times, taus, K, rheobases, flags=flags, flags_theta=flags_theta)
  289. if save_results:
  290. l_results = [l_time_points_stim, l_time_points_phase2, delta_t, sampling_rate, l_res_rates,
  291. l_res_weights,
  292. av_threshold, stim_times, stim_duration, sim_duration]
  293. # Open a file and save
  294. with open(dir_data + name + '.pkl', 'wb') as file:
  295. # A new file will be created
  296. pickle.dump(l_results, file)
  297. print('Data is saved.')
  298. else:
  299. # Open the file and read
  300. with open(dir_data + name + '.pkl', 'rb') as file:
  301. l_results = pickle.load(file)
  302. print('Data is read.')
  303. [l_time_points_stim, l_time_points_phase2, delta_t, sampling_rate, l_res_rates, l_res_weights,
  304. av_threshold, stim_times, stim_duration, sim_duration] = l_results
  305. if plot_results:
  306. print('Plotting the results.')
  307. os.makedirs(dir_plot + 'theta_' + str(int(tau_theta/3600)).replace(".","") + '_beta_' + str(int(tau_beta/3600)).replace(".","") + "/", exist_ok=True)
  308. time_plots([l_time_points_stim, l_time_points_phase2], l_res_rates, l_res_weights, av_threshold,
  309. stim_times, dir_plot + 'theta_' + str(int(tau_theta/3600)).replace(".","") + '_beta_' + str(int(tau_beta/3600)).replace(".","") + "/" + name, hour_sim,modulation_SST, flag_only_S_on=flag_only_S_on, format='.png')
  310. time_plots([l_time_points_stim, l_time_points_phase2], l_res_rates, l_res_weights, av_threshold,
  311. stim_times, dir_plot + 'theta_' + str(int(tau_theta/3600)).replace(".","") + '_beta_' + str(int(tau_beta/3600)).replace(".","")+ "/" + name, hour_sim,modulation_SST, flag_only_S_on=flag_only_S_on, format='.pdf')
  312. def analyze_model_3_compartmental_v3(hour_sim, flags_list, dir_data=r'\figures\data\\', dir_plot=r'\figures\\', modulation_SST=0, run_simulation=True, save_results=False, plot_results=False):
  313. """
  314. :param hour_sim: Defines how many hours does the simulation lasts
  315. :param run_simulation: True to run the numerical simulation, False to read the already saved data
  316. :param save_results: True to save the results
  317. :param plot_results: True to plot the results
  318. Multi-purpose function to analyze the model. Here we run (if run_simulation is True) our computational model to
  319. investigate the role of cell-type dependent synaptic scaling mechanisms in associative learning. We replicate the
  320. experimental procedure in [1] in model() in model.py. The model has two subnetworks, each consisted of a canonical
  321. circuit of excitatory pyramidal neurons (E), parvalbumin-positive interneurons (P), somatostatin-positive
  322. interneurons (S). The simulation procedure is divided into three phases:
  323. Phase 1 - Conditioning: The first subnetwork receives extra input representing the conditioned stimulus in [1].
  324. The parameters describing the stimulation (when and how much stimulation) is described in analyze_model()
  325. function. The onset response of the excitatory firing rate of the first subnetwork is defined as the aversion
  326. threshold of this network. Three-factor Hebbian learning is active during this period. Also, synaptic scaling
  327. mechanisms, adaptive target activity (theta) and target activity regulator (beta) are active.
  328. Phase 2: In the experiment [1], the novel stimulus is presented to the mice at 4h/24h/48h after conditioning.
  329. This phase corresponds to the waiting time after conditioning and before testing. During this phase, synaptic
  330. scaling mechanisms, adaptive target activity (theta) and target activity regulator (beta) are active.
  331. Phase 3 - Testing: In this phase, the second subnetwork receives extra input corresponds to the novel stimulus
  332. in [1]. The memory specificity/overgeneralization is determined whether the excitatory rate in the second
  333. subnetwork is below/above the aversion threshold, respectively.
  334. During simulation model() writes data to the data arrays. This data can be saved (if save_results is set to True)
  335. and the results can be plotted (if plot_results is set to True).
  336. [1] Wu, C. H., Ramos, R., Katz, D. B., & Turrigiano, G. G. (2021). Homeostatic synaptic scaling establishes the
  337. specificity of an associative memory. Current biology, 31(11), 2274-2285.
  338. """
  339. os.makedirs(dir_data, exist_ok=True)
  340. os.makedirs(dir_plot, exist_ok=True)
  341. delta_t = 0.0001 # time step in seconds (0.1 ms)
  342. stim_duration = 15 # stimulation duration in seconds
  343. # Simulation duration in seconds, 5 extra seconds for pre- and post-stimulation each, 2 extra seconds to reach steady state initially
  344. sim_duration = int(((hour_sim) * 60 * 60 + (stim_duration + 10) * 2 + 2)*(1/delta_t))
  345. sampling_rate_stim = 20 # register data at every 20 step during phase 1 and 3 (conditioning and testing)
  346. sampling_rate_sim = 200_000 # register data at every 2e5 time step (20 seconds) during phase 2 (in between conditioning and testing)
  347. sampling_rate = (sampling_rate_stim, sampling_rate_sim)
  348. # Total number of timepoints for stimulation and simulation
  349. n_time_points_stim = int((stim_duration + 10) * (1 / delta_t) * (1 / sampling_rate_stim))
  350. n_time_points_phase2 = int((hour_sim * 60 * 60 - 20) * (1 / delta_t) * (1 / sampling_rate_sim)) + 1 # total no the rest
  351. l_time_points_stim = np.linspace(0, stim_duration + 10, n_time_points_stim)
  352. l_time_points_phase2 = np.linspace(0, hour_sim, n_time_points_phase2)
  353. # Timepoints of the onset (first column) and offset (second column) of the first (first row) and second (second) stimuli.
  354. stim_times = np.array([[5, 5 + stim_duration],
  355. [int(hour_sim * 60 * 60) + 5, int(hour_sim * 60 * 60) + 5 + stim_duration]]).reshape(2, 2)
  356. # Time constants
  357. tau_E = 0.02 # time constant of E population firing rate in seconds(20ms)
  358. tau_P = 0.005 # time constant of P population firing rate in seconds(5ms)
  359. tau_S = 0.01 # time constant of S population firing rate in seconds(10ms)
  360. tau_dend = tau_E # time constant of E population firing rate in seconds(20ms)
  361. tau_hebb = 120 # time constant of three-factor Hebbian learning in seconds(2min)
  362. tau_theta = 24 * (60 * 60) # time constant of target activity in seconds(24h)
  363. tau_beta = 28 * (60 * 60) # time constant of target activity regulator in seconds(28h)
  364. tau_scaling_E = 2.5 * (60 * 60) # time constant of E-to-E scaling in seconds (15h)
  365. tau_scaling_P = 6.5 * (60 * 60) # time constant of P-to-E scaling in seconds (15h)
  366. tau_scaling_S = 2.5 * (60 * 60) # time constant of S-to-E scaling in seconds (15h)
  367. taus = (tau_E, tau_P, tau_S, tau_dend, tau_hebb, tau_scaling_E, tau_scaling_P, tau_scaling_S, tau_theta, tau_beta)
  368. # g_stim, rheobases, g, K, lambdas = get_model_parameters(coupling='strong', excitation='high')
  369. # The stimuli are given as inputs to the populations.
  370. g_stim_E = np.array([(2.5, 0), (0, 2.5)])
  371. g_stim_P = np.array([(0.5, 0), (0, 0.5)])
  372. if modulation_SST == 0:
  373. g_stim_S = np.array([(0, 0), (0, 0)])
  374. elif modulation_SST > 0:
  375. g_stim_S = np.array([(1.25, 0), (0, 1.25)])
  376. elif modulation_SST < 0:
  377. g_stim_S = np.array([(-1.25, 0), (0, -1.25)])
  378. g_stim = (g_stim_E, g_stim_P, g_stim_S)
  379. # Rheobases (minimum input needed for firing rates to be above zero)
  380. rheobase_E, rheobase_P, rheobase_S, rheobase_A,rheobase_B = 1, 1.5, 1.5, 3, 9
  381. rheobases = (rheobase_E, rheobase_P, rheobase_S, rheobase_A,rheobase_B)
  382. # Background inputs
  383. g_AD = 4
  384. g_BD = 6
  385. g_E = 0
  386. g_P = 4
  387. g_S = 3.2
  388. g = (g_AD, g_BD, g_E, g_P, g_S)
  389. # K parameter in target regulator equation, it tunes the steady state value of target activity and its regulator
  390. K = 0.3
  391. # Constant that define the contribution of each current
  392. lambda_AD = 0.4 # in stronger lambda config it is 0.5
  393. lambda_BD = 0.3 # in stronger lambda config it is 0.3
  394. lambdas = (lambda_AD, lambda_BD)
  395. # Initial conditions for plastic weights
  396. w_EP_within = 0.6; w_EP_cross = 0.18 #PV -> soma
  397. w_DS_within = 0.4; w_DS_cross = 0.18# SST -> apioal
  398. w_DE_within = 0.5; w_DE_cross = 0.3 #E -> apical
  399. w_EE_within = 0.5; w_EE_cross = 0.3 #E -> basal
  400. # Weights
  401. w_PE_within = 0.35; w_PE_cross = 0.10 #E -> PV
  402. w_PP_within = 0.20; w_PP_cross = 0.10 #PV -> PV
  403. w_PS_within = 0.30; w_PS_cross = 0.10 #SST -> PV
  404. w_SE_within = 0.15; w_SE_cross = 0.10 #E -> SST
  405. weights = (w_DE_within, w_EE_within, w_EP_within, w_DS_within, w_PE_within, w_PP_within, w_PS_within, w_SE_within,
  406. w_DE_cross, w_EE_cross, w_EP_cross, w_DS_cross, w_PE_cross, w_PP_cross, w_PS_cross, w_SE_cross)
  407. # Arrays created to hold data
  408. r_phase1 = np.zeros((6, n_time_points_stim), dtype=np.float32) # rE1,rE2,rP1,rP2,rS1,rS2
  409. I_phase1 = np.zeros((6, n_time_points_stim), dtype=np.float32) # IAD1, IAD2, IBD1, IBD2, IE1, IE2
  410. J_exc_phase1 = np.zeros((8, n_time_points_stim), dtype=np.float32) # WDE11,WDE12,WDE21,WDE22,WEE11,WEE12,WEE21,WEE22
  411. r_phase2 = np.zeros((6, n_time_points_phase2), dtype=np.float32) # rE1,rE2,rP1,rP2,rS1,rS2
  412. set_phase2 = np.zeros((12, n_time_points_phase2), dtype=np.float32) # thetaDD1,thetaDD2,thetaBD1,thetaBD2,thetaE1,thetaE2,betaAD1,betaAD2,betaBD1,betaBD2,betaE1,betaE2
  413. I_phase2 = np.zeros((6, n_time_points_phase2), dtype=np.float32) # IAD1, IAD2, IBD1, IBD2, IE1, IE2
  414. J_phase2 = np.zeros((20, n_time_points_phase2),
  415. dtype=np.float32) # WDE11,WDE12,WDE21,WDE22,WEE11,WEE12,WEE21,WEE22,WEP11,WEP12,WEP21,WEP22,WES11,WES12,WES21,WES22
  416. r_phase3 = np.zeros((6, n_time_points_stim), dtype=np.float32) # rE1,rE2,rP1,rP2,rS1,rS2
  417. max_E = np.zeros(1, dtype=np.float32)
  418. # Lists to hold data arrays
  419. l_res_rates = (r_phase1, I_phase1, r_phase2, I_phase2, set_phase2, r_phase3, max_E)
  420. l_res_weights = (J_exc_phase1, J_phase2)
  421. # The flags for activating the following plasticity mechanisms in the given order: Hebbian learning, three-factor Hebbian learning,
  422. # adaptive set point, E-to-E scaling, P-to-E scaling, S-to-E scaling
  423. flags_theta = (1, 1)
  424. for flags in flags_list:
  425. id, title = determine_name(flags)
  426. name = 'Case' + id + '_' + str(hour_sim) + 'h' # + '_k' + str(K).replace(".","") + '_td' + str(g_top_down_to_S)
  427. print('*****', title, '*****')
  428. if run_simulation:
  429. print('Simulation started.')
  430. print('\n')
  431. model_3_compartmental_v3(delta_t, sampling_rate, l_res_rates, l_res_weights, sim_duration, weights, g, g_stim,
  432. stim_times, taus, K, rheobases, lambdas, flags=flags,flags_theta=flags_theta)
  433. idx_av_threshold = int(15 * (1 / delta_t) * (1 / sampling_rate_stim))
  434. # av_threshold = r_phase1[1][idx_av_threshold] * 1.15 #it is defined with an extra 15% for old reason. not required anymore
  435. av_threshold = r_phase1[1][idx_av_threshold]
  436. if save_results:
  437. l_results = [l_time_points_stim, l_time_points_phase2, delta_t, sampling_rate, l_res_rates,
  438. l_res_weights, av_threshold, stim_times, stim_duration, sim_duration]
  439. # Open a file and save
  440. with open(dir_data + name + '.pkl', 'wb') as file:
  441. # A new file will be created
  442. pickle.dump(l_results, file)
  443. print('Data is saved.')
  444. else:
  445. # Open the file and read
  446. with open(dir_data + name + '.pkl', 'rb') as file:
  447. l_results = pickle.load(file)
  448. print('Data is read.')
  449. [l_time_points_stim, l_time_points_phase2, delta_t, sampling_rate, l_res_rates, l_res_weights,
  450. av_threshold, stim_times, stim_duration, sim_duration] = l_results
  451. if plot_results:
  452. print('Plotting the results.')
  453. plot_all_3_compartmental([l_time_points_stim, l_time_points_phase2], l_res_rates, l_res_weights,
  454. av_threshold, stim_times,modulation_SST, dir_plot + name, hour_sim, format='.png', scale_y=False)
  455. plot_all_3_compartmental([l_time_points_stim, l_time_points_phase2], l_res_rates, l_res_weights,
  456. av_threshold, stim_times, modulation_SST, dir_plot + name, hour_sim, format='.pdf')
  457. def plot_testing_at_regular_intervals(flags_list, flags_theta=(1,1), dir_data=r'\figures\data\\', dir_plot=r'\figures\\',
  458. K=0.25, flag_only_S_on=False, run_simulation=True,
  459. save_results = False, plot_results=False,modulation_SST=0):
  460. """
  461. :param hour_sim: Defines how many hours does the simulation lasts
  462. :param flags_list
  463. :param flags_theta
  464. :param dir_data
  465. :param dir_plot
  466. :param K: Tunes the steady state value of target activity and its regulator
  467. :param g_top_down_to_S: Represents the top-down signal to SST neurons triggered by the hyperexcitation. It reaches
  468. SST neurons at the offset of the conditioning
  469. :param run_simulation: True to run the numerical simulation, False to read the already saved data
  470. :param save_results: True to save the results
  471. :param plot_results: True to plot the results
  472. Multi-purpose function to analyze the model. Here we run (if run_simulation is True) our computational model to
  473. investigate the role of cell-type dependent synaptic scaling mechanisms in associative learning. We replicate the
  474. experimental procedure in [1] in model() in model.py. The model has two subnetworks, each consisted of a canonical
  475. circuit of excitatory pyramidal neurons (E), parvalbumin-positive interneurons (P), somatostatin-positive
  476. interneurons (S). The simulation procedure is divided into three phases:
  477. Phase 1 - Conditioning: The first subnetwork receives extra input representing the conditioned stimulus in [1].
  478. The parameters describing the stimulation (when and how much stimulation) is described in analyze_model()
  479. function. The onset response of the excitatory firing rate of the first subnetwork is defined as the aversion
  480. threshold of this network. Three-factor Hebbian learning is active during this period. Also, synaptic scaling
  481. mechanisms, adaptive target activity (theta) and target activity regulator (beta) are active.
  482. Phase 2: In the experiment [1], the novel stimulus is presented to the mice at 4h/24h/48h after conditioning.
  483. This phase corresponds to the waiting time after conditioning and before testing. During this phase, synaptic
  484. scaling mechanisms, adaptive target activity (theta) and target activity regulator (beta) are active.
  485. Phase 3 - Testing: In this phase, the second subnetwork receives extra input corresponds to the novel stimulus
  486. in [1]. The memory specificity/overgeneralization is determined whether the excitatory rate in the second
  487. subnetwork is below/above the aversion threshold, respectively.
  488. During simulation model() writes data to the data arrays. This data can be saved (if save_results is set to True)
  489. and the results can be plotted (if plot_results is set to True).
  490. [1] Wu, C. H., Ramos, R., Katz, D. B., & Turrigiano, G. G. (2021). Homeostatic synaptic scaling establishes the
  491. specificity of an associative memory. Current biology, 31(11), 2274-2285.
  492. """
  493. os.makedirs(dir_data, exist_ok=True)
  494. os.makedirs(dir_plot, exist_ok=True)
  495. hour_sims = np.arange(48) + 1
  496. for flags in flags_list:
  497. id, title = determine_name(flags)
  498. name = 'Case' + id + '_test_every_h' + '_k' + str(K).replace(".","")
  499. l_delta_rE1 = []
  500. print('*****', title, '*****')
  501. if run_simulation:
  502. print('Simulation started.')
  503. print('\n')
  504. for hour_sim in hour_sims:
  505. stim_duration = 15 # stimulation duration in seconds
  506. # Simulation duration in seconds, 5 extra seconds for pre- and post-stimulation each, 2 extra seconds to reach steady state initially
  507. sim_duration = int((hour_sim) * 60 * 60 + (stim_duration + 5 + 5) * 2 + 2)
  508. delta_t = 0.0001 # time step in seconds (0.1 ms)
  509. sampling_rate_stim = 20 # register data at every 20 step during phase 1 and 3 (conditioning and testing)
  510. sampling_rate_sim = 200000 # register data at every 2e5 time step (20 seconds) during phase 2 (in between conditioning and testing)
  511. sampling_rate = (sampling_rate_stim, sampling_rate_sim)
  512. # Total number of timepoints for stimulation and simulation
  513. n_time_points_stim = int((stim_duration + 10) * (1 / delta_t) * (1 / sampling_rate_stim))
  514. n_time_points_phase2 = int((hour_sim * 60 * 60 - 20) * (1 / delta_t) * (1 / sampling_rate_sim)) + 1 # total no the rest
  515. # l_time_points_stim = np.linspace(0, stim_duration + 10, n_time_points_stim)
  516. l_time_points_phase2 = np.linspace(0, hour_sim, n_time_points_phase2)
  517. # Timepoints of the onset (first column) and offset (second column) of the first (first row) and second (second) stimuli.
  518. stim_times = np.array([[5, 5 + stim_duration],
  519. [int(hour_sim * 60 * 60) + 5, int(hour_sim * 60 * 60) + 5 + stim_duration]]).reshape(2, 2)
  520. # The stimuli are given as inputs to the populations.
  521. g_stim_E = np.array([(1, 0), (0, 1)])
  522. g_stim_P = np.array([(0.5, 0), (0, 0.5)])
  523. if modulation_SST == 0:
  524. g_stim_S = np.array([(0, 0), (0, 0)])
  525. elif modulation_SST > 0:
  526. g_stim_S = np.array([(0.5, 0), (0, 0.5)])
  527. elif modulation_SST < 0:
  528. g_stim_S = np.array([(-0.5, 0), (0, -0.5)])
  529. g_stim = (g_stim_E, g_stim_P, g_stim_S)
  530. # Time constants
  531. tau_E = 0.02 # time constant of E population firing rate in seconds(20ms)
  532. tau_P = 0.005 # time constant of P population firing rate in seconds(5ms)
  533. tau_S = 0.01 # time constant of S population firing rate in seconds(10ms)
  534. tau_hebb = 240 # time constant of three-factor Hebbian learning in seconds(2min)
  535. tau_theta = 24 * (60 * 60) # time constant of target activity in seconds(24h)
  536. tau_beta = 28 * (60 * 60) # time constant of target activity regulator in seconds(28h)
  537. tau_scaling_E = 8 * (60 * 60) # time constant of E-to-E scaling in seconds (15h)
  538. tau_scaling_P = 8 * (60 * 60) # time constant of P-to-E scaling in seconds (15h)
  539. tau_scaling_S = 8 * (60 * 60) # time constant of S-to-E scaling in seconds (15h)
  540. taus = (tau_E, tau_P, tau_S, tau_hebb, tau_scaling_E, tau_scaling_P, tau_scaling_S, tau_theta, tau_beta)
  541. # Rheobases (minimum input needed for firing rates to be above zero)
  542. rheobase_E, rheobase_P, rheobase_S = 1.5, 1.5, 1.5
  543. rheobases = (rheobase_E, rheobase_P, rheobase_S)
  544. # Background inputs
  545. g_E = 4.5
  546. g_P = 3.2
  547. g_S = 3
  548. back_inputs = (g_E, g_P, g_S)
  549. # Initial conditions for plastic weights
  550. # w_EP_within = 0.81; w_EP_cross = 0.41
  551. # w_ES_within = 0.81; w_ES_cross = 0.31
  552. # w_EE_within = 0.71; w_EE_cross = 0.41
  553. w_EP_within = 0.91; w_EP_cross = 0.41
  554. w_ES_within = 0.51; w_ES_cross = 0.31
  555. w_EE_within = 0.51; w_EE_cross = 0.51
  556. # # Initial conditions for plastic weights
  557. # w_EP_within = 0.7; w_EP_cross = w_EP_within*0.3
  558. # w_ES_within = 0.7; w_ES_cross = w_ES_within*0.3
  559. # w_EE_within = 0.5; w_EE_cross = 0.4
  560. # Weights
  561. w_PE_within = 0.3; w_PE_cross = 0.1
  562. w_PP_within = 0.2; w_PP_cross = 0.1
  563. w_PS_within = 0.3; w_PS_cross = 0.1
  564. w_SE_within = 0.4; w_SE_cross = 0.1
  565. weights = (w_EE_within, w_EP_within, w_ES_within, w_PE_within, w_PP_within, w_PS_within, w_SE_within,
  566. w_EE_cross, w_EP_cross, w_ES_cross, w_PE_cross, w_PP_cross, w_PS_cross, w_SE_cross)
  567. # Arrays created to hold data
  568. r_phase1 = np.zeros((6, n_time_points_stim), dtype=np.float32) # rE1,rE2,rP1,rP2,rS1,rS2
  569. J_EE_phase1 = np.zeros((4, n_time_points_stim), dtype=np.float32) # WEE11,WEE12,WEE21,WEE22
  570. r_phase2 = np.zeros((10, n_time_points_phase2), dtype=np.float32) # rE1,rE2,rP1,rP2,rS1,rS2,theta1,theta2,beta1,beta2
  571. J_phase2 = np.zeros((12, n_time_points_phase2),dtype=np.float32) # WEE11,WEE12,WEE21,WEE22,WEP11,WEP12,WEP21,WEP22,WES11,WES12,WES21,WES22
  572. r_phase3 = np.zeros((6, n_time_points_stim), dtype=np.float32) # rE1,rE2,rP1,rP2,rS1,rS2
  573. max_E = np.zeros(1, dtype=np.float32)
  574. # Lists to hold data arrays
  575. l_res_rates = (r_phase1, r_phase2, r_phase3, max_E)
  576. l_res_weights = (J_EE_phase1, J_phase2)
  577. model(delta_t, sampling_rate, l_res_rates, l_res_weights, int(30 * (1 / delta_t)), weights,
  578. back_inputs, g_stim, stim_times, taus, K, rheobases, flags=(0,0,0,0,0,0), flags_theta=flags_theta)
  579. idx_av_threshold = int(15 * (1 / delta_t) * (1 / sampling_rate_stim))
  580. # av_threshold = r_phase1[1][idx_av_threshold] * 1.15 #it is defined with an extra 15% for old reason. not required anymore
  581. av_threshold = r_phase1[1][idx_av_threshold]
  582. model(delta_t, sampling_rate, l_res_rates, l_res_weights, int(sim_duration * (1 / delta_t)), weights,
  583. back_inputs, g_stim, stim_times, taus, K, rheobases, flags=flags, flags_theta=flags_theta)
  584. l_delta_rE1.append(np.max(r_phase3[0][int(stim_times[0][0] * (1 / (delta_t * sampling_rate_stim))):
  585. int(stim_times[0][1] * (1 / (delta_t * sampling_rate_stim)))]).copy())
  586. print('Simulation of ' + str(hour_sim) + ' hours is completed')
  587. if save_results:
  588. l_results = [r_phase1, l_time_points_phase2, r_phase2, l_delta_rE1, av_threshold, delta_t, sampling_rate_sim,l_res_weights] #added weights for analysis with Kris
  589. # Open a file and save
  590. with open(dir_data + name + '.pkl', 'wb') as file:
  591. # A new file will be created
  592. pickle.dump(l_results, file)
  593. print('Data is saved.')
  594. else:
  595. # Open the file and read
  596. with open(dir_data + name + '.pkl', 'rb') as file:
  597. l_results = pickle.load(file)
  598. print('Data is read.')
  599. [r_phase1, l_time_points_phase2, r_phase2, l_delta_rE1, av_threshold, delta_t, sampling_rate_sim,l_res_weights] = l_results
  600. if plot_results:
  601. print('Plotting the results.')
  602. change_in_reactivation_every_h_vslides(l_time_points_phase2, hour_sims, l_delta_rE1, av_threshold,
  603. dir_plot + name, flag_only_S_on=flag_only_S_on, format='.png')
  604. change_in_reactivation_every_h_vslides(l_time_points_phase2, hour_sims, l_delta_rE1, av_threshold,
  605. dir_plot + name, flag_only_S_on=flag_only_S_on, format='.pdf')
  606. #this function is a generalized version of the one above. this one, with the right flags, is the only one necessary. For clarity, they are separated
  607. def plot_testing_at_regular_intervals_timescales(flags_list, flags_theta=(1,1), dir_data=r'\figures\data\\', dir_plot=r'\figures\\',
  608. K=0.25, flag_only_S_on=False, run_simulation=True,
  609. save_results = False, plot_results=False,modulation_SST=0):
  610. """
  611. :param hour_sim: Defines how many hours does the simulation lasts
  612. :param flags_list
  613. :param flags_theta
  614. :param dir_data
  615. :param dir_plot
  616. :param K: Tunes the steady state value of target activity and its regulator
  617. :param g_top_down_to_S: Represents the top-down signal to SST neurons triggered by the hyperexcitation. It reaches
  618. SST neurons at the offset of the conditioning
  619. :param run_simulation: True to run the numerical simulation, False to read the already saved data
  620. :param save_results: True to save the results
  621. :param plot_results: True to plot the results
  622. Multi-purpose function to analyze the model. Here we run (if run_simulation is True) our computational model to
  623. investigate the role of cell-type dependent synaptic scaling mechanisms in associative learning. We replicate the
  624. experimental procedure in [1] in model() in model.py. The model has two subnetworks, each consisted of a canonical
  625. circuit of excitatory pyramidal neurons (E), parvalbumin-positive interneurons (P), somatostatin-positive
  626. interneurons (S). The simulation procedure is divided into three phases:
  627. Phase 1 - Conditioning: The first subnetwork receives extra input representing the conditioned stimulus in [1].
  628. The parameters describing the stimulation (when and how much stimulation) is described in analyze_model()
  629. function. The onset response of the excitatory firing rate of the first subnetwork is defined as the aversion
  630. threshold of this network. Three-factor Hebbian learning is active during this period. Also, synaptic scaling
  631. mechanisms, adaptive target activity (theta) and target activity regulator (beta) are active.
  632. Phase 2: In the experiment [1], the novel stimulus is presented to the mice at 4h/24h/48h after conditioning.
  633. This phase corresponds to the waiting time after conditioning and before testing. During this phase, synaptic
  634. scaling mechanisms, adaptive target activity (theta) and target activity regulator (beta) are active.
  635. Phase 3 - Testing: In this phase, the second subnetwork receives extra input corresponds to the novel stimulus
  636. in [1]. The memory specificity/overgeneralization is determined whether the excitatory rate in the second
  637. subnetwork is below/above the aversion threshold, respectively.
  638. During simulation model() writes data to the data arrays. This data can be saved (if save_results is set to True)
  639. and the results can be plotted (if plot_results is set to True).
  640. [1] Wu, C. H., Ramos, R., Katz, D. B., & Turrigiano, G. G. (2021). Homeostatic synaptic scaling establishes the
  641. specificity of an associative memory. Current biology, 31(11), 2274-2285.
  642. """
  643. os.makedirs(dir_data, exist_ok=True)
  644. os.makedirs(dir_plot, exist_ok=True)
  645. hour_sims = np.arange(48) + 1
  646. tau_theta_list = (np.arange(22, 31,2) * 3600).tolist()
  647. # tau_beta_list = (np.arange(16, 37) * 3600).tolist()
  648. tau_beta_list = [30*3600]
  649. # tau_theta_list = [12*3600]
  650. # tau_beta_list = [0.01*3600]
  651. # tau_theta_list = (np.arange(24-12, 24+12) * 3600).tolist()
  652. # tau_beta_list = (np.arange(28-12, 28+12) * 3600).tolist()
  653. # tau_theta_list = [6*3600, 26*3600, 260*3600]
  654. # tau_beta_list = [1e-20*3600, 1e20*3600]
  655. # tau_theta_list = [6*3600, 26*3600, 260*3600]
  656. # tau_beta_list = [1e-20*3600, 1e20*3600]
  657. for tau_beta in tau_beta_list:
  658. for tau_theta in tau_theta_list:
  659. for flags in flags_list:
  660. id, title = determine_name(flags)
  661. name = 'Case' + id + '_test_every_h' + '_k' + str(K).replace(".","") + '_theta_' + str(int(tau_theta/3600)).replace(".","") + '_beta_' + str(int(tau_beta/3600)).replace(".","")
  662. l_delta_rE1 = []
  663. print('*****', title, '*****')
  664. if run_simulation:
  665. print('Simulation started.')
  666. print('\n')
  667. for hour_sim in hour_sims:
  668. stim_duration = 15 # stimulation duration in seconds
  669. # Simulation duration in seconds, 5 extra seconds for pre- and post-stimulation each, 2 extra seconds to reach steady state initially
  670. sim_duration = int((hour_sim) * 60 * 60 + (stim_duration + 5 + 5) * 2 + 2)
  671. delta_t = 0.0001 # time step in seconds (0.1 ms)
  672. sampling_rate_stim = 20 # register data at every 20 step during phase 1 and 3 (conditioning and testing)
  673. sampling_rate_sim = 200000 # register data at every 2e5 time step (20 seconds) during phase 2 (in between conditioning and testing)
  674. sampling_rate = (sampling_rate_stim, sampling_rate_sim)
  675. # Total number of timepoints for stimulation and simulation
  676. n_time_points_stim = int((stim_duration + 10) * (1 / delta_t) * (1 / sampling_rate_stim))
  677. n_time_points_phase2 = int((hour_sim * 60 * 60 - 20) * (1 / delta_t) * (1 / sampling_rate_sim)) + 1 # total no the rest
  678. # l_time_points_stim = np.linspace(0, stim_duration + 10, n_time_points_stim)
  679. l_time_points_phase2 = np.linspace(0, hour_sim, n_time_points_phase2)
  680. # Timepoints of the onset (first column) and offset (second column) of the first (first row) and second (second) stimuli.
  681. stim_times = np.array([[5, 5 + stim_duration],
  682. [int(hour_sim * 60 * 60) + 5, int(hour_sim * 60 * 60) + 5 + stim_duration]]).reshape(2, 2)
  683. # The stimuli are given as inputs to the populations.
  684. g_stim_E = np.array([(1, 0), (0, 1)])
  685. g_stim_P = np.array([(0.5, 0), (0, 0.5)])
  686. if modulation_SST == 0:
  687. g_stim_S = np.array([(0, 0), (0, 0)])
  688. elif modulation_SST > 0:
  689. g_stim_S = np.array([(0.5, 0), (0, 0.5)])
  690. elif modulation_SST < 0:
  691. g_stim_S = np.array([(-0.5, 0), (0, -0.5)])
  692. g_stim = (g_stim_E, g_stim_P, g_stim_S)
  693. # Time constants
  694. tau_E = 0.02 # time constant of E population firing rate in seconds(20ms)
  695. tau_P = 0.005 # time constant of P population firing rate in seconds(5ms)
  696. tau_S = 0.01 # time constant of S population firing rate in seconds(10ms)
  697. tau_hebb = 240 # time constant of three-factor Hebbian learning in seconds(2min)
  698. tau_scaling_E = 8 * (60 * 60) # time constant of E-to-E scaling in seconds (15h)
  699. tau_scaling_P = 8 * (60 * 60) # time constant of P-to-E scaling in seconds (15h)
  700. tau_scaling_S = 8 * (60 * 60) # time constant of S-to-E scaling in seconds (15h)
  701. taus = (tau_E, tau_P, tau_S, tau_hebb, tau_scaling_E, tau_scaling_P, tau_scaling_S, tau_theta, tau_beta)
  702. # Rheobases (minimum input needed for firing rates to be above zero)
  703. rheobase_E, rheobase_P, rheobase_S = 1.5, 1.5, 1.5
  704. rheobases = (rheobase_E, rheobase_P, rheobase_S)
  705. # Background inputs
  706. g_E = 4.5
  707. g_P = 3.2
  708. g_S = 3
  709. back_inputs = (g_E, g_P, g_S)
  710. # Initial conditions for plastic weights
  711. # w_EP_within = 0.81; w_EP_cross = 0.41
  712. # w_ES_within = 0.81; w_ES_cross = 0.31
  713. # w_EE_within = 0.71; w_EE_cross = 0.41
  714. w_EP_within = 0.91; w_EP_cross = 0.41
  715. w_ES_within = 0.51; w_ES_cross = 0.31
  716. w_EE_within = 0.51; w_EE_cross = 0.51
  717. # # Initial conditions for plastic weights
  718. # w_EP_within = 0.7; w_EP_cross = w_EP_within*0.3
  719. # w_ES_within = 0.7; w_ES_cross = w_ES_within*0.3
  720. # w_EE_within = 0.5; w_EE_cross = 0.4
  721. # Weights
  722. w_PE_within = 0.3; w_PE_cross = 0.1
  723. w_PP_within = 0.2; w_PP_cross = 0.1
  724. w_PS_within = 0.3; w_PS_cross = 0.1
  725. w_SE_within = 0.4; w_SE_cross = 0.1
  726. weights = (w_EE_within, w_EP_within, w_ES_within, w_PE_within, w_PP_within, w_PS_within, w_SE_within,
  727. w_EE_cross, w_EP_cross, w_ES_cross, w_PE_cross, w_PP_cross, w_PS_cross, w_SE_cross)
  728. # Arrays created to hold data
  729. r_phase1 = np.zeros((6, n_time_points_stim), dtype=np.float32) # rE1,rE2,rP1,rP2,rS1,rS2
  730. J_EE_phase1 = np.zeros((4, n_time_points_stim), dtype=np.float32) # WEE11,WEE12,WEE21,WEE22
  731. r_phase2 = np.zeros((10, n_time_points_phase2), dtype=np.float32) # rE1,rE2,rP1,rP2,rS1,rS2,theta1,theta2,beta1,beta2
  732. J_phase2 = np.zeros((12, n_time_points_phase2),dtype=np.float32) # WEE11,WEE12,WEE21,WEE22,WEP11,WEP12,WEP21,WEP22,WES11,WES12,WES21,WES22
  733. r_phase3 = np.zeros((6, n_time_points_stim), dtype=np.float32) # rE1,rE2,rP1,rP2,rS1,rS2
  734. max_E = np.zeros(1, dtype=np.float32)
  735. # Lists to hold data arrays
  736. l_res_rates = (r_phase1, r_phase2, r_phase3, max_E)
  737. l_res_weights = (J_EE_phase1, J_phase2)
  738. model(delta_t, sampling_rate, l_res_rates, l_res_weights, int(30 * (1 / delta_t)), weights,
  739. back_inputs, g_stim, stim_times, taus, K, rheobases, flags=(0,0,0,0,0,0), flags_theta=flags_theta)
  740. idx_av_threshold = int(15 * (1 / delta_t) * (1 / sampling_rate_stim))
  741. # av_threshold = r_phase1[1][idx_av_threshold] * 1.15 #it is defined with an extra 15% for old reason. not required anymore
  742. av_threshold = r_phase1[1][idx_av_threshold]
  743. model(delta_t, sampling_rate, l_res_rates, l_res_weights, int(sim_duration * (1 / delta_t)), weights,
  744. back_inputs, g_stim, stim_times, taus, K, rheobases, flags=flags, flags_theta=flags_theta)
  745. l_delta_rE1.append(np.max(r_phase3[0][int(stim_times[0][0] * (1 / (delta_t * sampling_rate_stim))):
  746. int(stim_times[0][1] * (1 / (delta_t * sampling_rate_stim)))]).copy())
  747. print('Simulation of ' + str(hour_sim) + ' hours is completed')
  748. if save_results:
  749. l_results = [r_phase1, l_time_points_phase2, r_phase2, l_delta_rE1, av_threshold, delta_t, sampling_rate_sim,l_res_weights] #added weights for analysis with Kris
  750. # Open a file and save
  751. with open(dir_data + name + '.pkl', 'wb') as file:
  752. # A new file will be created
  753. pickle.dump(l_results, file)
  754. print('Data is saved.')
  755. else:
  756. # Open the file and read
  757. with open(dir_data + name + '.pkl', 'rb') as file:
  758. l_results = pickle.load(file)
  759. print('Data is read.')
  760. [r_phase1, l_time_points_phase2, r_phase2, l_delta_rE1, av_threshold, delta_t, sampling_rate_sim,l_res_weights] = l_results
  761. if plot_results:
  762. print('Plotting the results.')
  763. os.makedirs(dir_plot + 'theta_' + str(int(tau_theta/3600)).replace(".","") + '_beta_' + str(int(tau_beta/3600)).replace(".","") + "/", exist_ok=True)
  764. change_in_reactivation_every_h_vslides(l_time_points_phase2, hour_sims, l_delta_rE1, av_threshold,
  765. dir_plot + 'theta_' + str(int(tau_theta/3600)).replace(".","") + '_beta_' + str(int(tau_beta/3600)).replace(".","") + "/" + name, flag_only_S_on=flag_only_S_on, format='.png')
  766. change_in_reactivation_every_h_vslides(l_time_points_phase2, hour_sims, l_delta_rE1, av_threshold,
  767. dir_plot + 'theta_' + str(int(tau_theta/3600)).replace(".","") + '_beta_' + str(int(tau_beta/3600)).replace(".","") + "/" + name, flag_only_S_on=flag_only_S_on, format='.pdf')
  768. def plot_testing_at_regular_intervals_dendrites_v3(flags_list, flags_theta=(1,1), dir_data=r'\figures\data\\', dir_plot=r'\figures\\', flag_only_S_on=False, modulation_SST=0, run_simulation=True,
  769. save_results = False, plot_results=False):
  770. """
  771. :param hour_sim: Defines how many hours does the simulation lasts
  772. :param flags_list
  773. :param flags_theta
  774. :param dir_data
  775. :param dir_plot
  776. :param K: Tunes the steady state value of target activity and its regulator
  777. :param g_top_down_to_S: Represents the top-down signal to SST neurons triggered by the hyperexcitation. It reaches
  778. SST neurons at the offset of the conditioning
  779. :param run_simulation: True to run the numerical simulation, False to read the already saved data
  780. :param save_results: True to save the results
  781. :param plot_results: True to plot the results
  782. Multi-purpose function to analyze the model. Here we run (if run_simulation is True) our computational model to
  783. investigate the role of cell-type dependent synaptic scaling mechanisms in associative learning. We replicate the
  784. experimental procedure in [1] in model() in model.py. The model has two subnetworks, each consisted of a canonical
  785. circuit of excitatory pyramidal neurons (E), parvalbumin-positive interneurons (P), somatostatin-positive
  786. interneurons (S). The simulation procedure is divided into three phases:
  787. Phase 1 - Conditioning: The first subnetwork receives extra input representing the conditioned stimulus in [1].
  788. The parameters describing the stimulation (when and how much stimulation) is described in analyze_model()
  789. function. The onset response of the excitatory firing rate of the first subnetwork is defined as the aversion
  790. threshold of this network. Three-factor Hebbian learning is active during this period. Also, synaptic scaling
  791. mechanisms, adaptive target activity (theta) and target activity regulator (beta) are active.
  792. Phase 2: In the experiment [1], the novel stimulus is presented to the mice at 4h/24h/48h after conditioning.
  793. This phase corresponds to the waiting time after conditioning and before testing. During this phase, synaptic
  794. scaling mechanisms, adaptive target activity (theta) and target activity regulator (beta) are active.
  795. Phase 3 - Testing: In this phase, the second subnetwork receives extra input corresponds to the novel stimulus
  796. in [1]. The memory specificity/overgeneralization is determined whether the excitatory rate in the second
  797. subnetwork is below/above the aversion threshold, respectively.
  798. During simulation model() writes data to the data arrays. This data can be saved (if save_results is set to True)
  799. and the results can be plotted (if plot_results is set to True).
  800. [1] Wu, C. H., Ramos, R., Katz, D. B., & Turrigiano, G. G. (2021). Homeostatic synaptic scaling establishes the
  801. specificity of an associative memory. Current biology, 31(11), 2274-2285.
  802. """
  803. os.makedirs(dir_data, exist_ok=True)
  804. os.makedirs(dir_plot, exist_ok=True)
  805. hour_sims = np.arange(48) + 1
  806. # hour_sims = np.array([1, 4, 24, 48], dtype=int)
  807. # K parameter in target regulator equation, it tunes the steady state value of target activity and its regulator
  808. K = 0.25
  809. for flags in flags_list:
  810. id, title = determine_name(flags)
  811. name = 'Case' + id + '_test_every_h' + '_k' + str(K).replace(".","") + '_td'
  812. l_delta_rE1 = []
  813. print('*****', title, '*****')
  814. if run_simulation:
  815. print('Simulation started.')
  816. print('\n')
  817. for hour_sim in hour_sims:
  818. stim_duration = 15 # stimulation duration in seconds
  819. # Simulation duration in seconds, 5 extra seconds for pre- and post-stimulation each, 2 extra seconds to reach steady state initially
  820. sim_duration = int((hour_sim) * 60 * 60 + (stim_duration + 5 + 5) * 2 + 2)
  821. delta_t = 0.0001 # time step in seconds (0.1 ms)
  822. sampling_rate_stim = 20 # register data at every 20 step during phase 1 and 3 (conditioning and testing)
  823. sampling_rate_sim = 200000 # register data at every 2e5 time step (20 seconds) during phase 2 (in between conditioning and testing)
  824. sampling_rate = (sampling_rate_stim, sampling_rate_sim)
  825. # Total number of timepoints for stimulation and simulation
  826. n_time_points_stim = int((stim_duration + 10) * (1 / delta_t) * (1 / sampling_rate_stim))
  827. n_time_points_phase2 = int((hour_sim * 60 * 60 - 20) * (1 / delta_t) * (1 / sampling_rate_sim)) + 1 # total no the rest
  828. # l_time_points_stim = np.linspace(0, stim_duration + 10, n_time_points_stim)
  829. l_time_points_phase2 = np.linspace(0, hour_sim, n_time_points_phase2)
  830. # Timepoints of the onset (first column) and offset (second column) of the first (first row) and second (second) stimuli.
  831. stim_times = np.array([[5, 5 + stim_duration],
  832. [int(hour_sim * 60 * 60) + 5, int(hour_sim * 60 * 60) + 5 + stim_duration]]).reshape(2, 2)
  833. # The stimuli are given as inputs to the populations.
  834. g_stim_E = np.array([(2.5, 0), (0, 2.5)])
  835. g_stim_P = np.array([(0.5, 0), (0, 0.5)])
  836. if modulation_SST == 0:
  837. g_stim_S = np.array([(0, 0), (0, 0)])
  838. elif modulation_SST > 0:
  839. g_stim_S = np.array([(1.25, 0), (0, 1.25)])
  840. elif modulation_SST < 0:
  841. g_stim_S = np.array([(-1.25, 0), (0, -1.25)])
  842. g_stim = (g_stim_E, g_stim_P, g_stim_S)
  843. # Time constants
  844. tau_E = 0.02 # time constant of E population firing rate in seconds(20ms)
  845. tau_P = 0.005 # time constant of P population firing rate in seconds(5ms)
  846. tau_S = 0.01 # time constant of S population firing rate in seconds(10ms)
  847. tau_dend = tau_E
  848. tau_hebb = 120 # time constant of three-factor Hebbian learning in seconds(2min)
  849. tau_theta = 24 * (60 * 60) # time constant of target activity in seconds(24h)
  850. tau_beta = 28 * (60 * 60) # time constant of target activity regulator in seconds(28h)
  851. tau_scaling_E = 2.5 * (60 * 60) # time constant of E-to-E scaling in seconds (15h)
  852. tau_scaling_P = 6.5 * (60 * 60) # time constant of P-to-E scaling in seconds (15h)
  853. tau_scaling_S = 2.5 * (60 * 60) # time constant of S-to-E scaling in seconds (15h)
  854. taus = (tau_E, tau_P, tau_S, tau_dend, tau_hebb, tau_scaling_E, tau_scaling_P, tau_scaling_S, tau_theta, tau_beta)
  855. # Rheobases (minimum input needed for firing rates to be above zero)
  856. rheobase_E, rheobase_P, rheobase_S, rheobase_A,rheobase_B = 1, 1.5, 1.5, 3, 9
  857. rheobases = (rheobase_E, rheobase_P, rheobase_S, rheobase_A,rheobase_B)
  858. # Background inputs
  859. g_AD = 4
  860. g_BD = 6
  861. g_E = 0
  862. g_P = 4
  863. g_S = 3.2
  864. back_inputs = (g_AD, g_BD, g_E, g_P, g_S)
  865. # Constant that define the contribution of each current
  866. lambda_AD = 0.4 # in stronger lambda config it is 0.5
  867. lambda_BD = 0.3 # in stronger lambda config it is 0.3
  868. lambdas = (lambda_AD, lambda_BD)
  869. # Initial conditions for plastic weights
  870. w_EP_within = 0.6; w_EP_cross = 0.18
  871. w_DS_within = 0.4; w_DS_cross = 0.18
  872. w_DE_within = 0.5; w_DE_cross = 0.3
  873. w_EE_within = 0.5; w_EE_cross = 0.3
  874. # Weights
  875. w_PE_within = 0.35; w_PE_cross = 0.10
  876. w_PP_within = 0.20; w_PP_cross = 0.10
  877. w_PS_within = 0.30; w_PS_cross = 0.10
  878. w_SE_within = 0.15; w_SE_cross = 0.10
  879. weights = (w_DE_within, w_EE_within, w_EP_within, w_DS_within, w_PE_within, w_PP_within, w_PS_within, w_SE_within,
  880. w_DE_cross, w_EE_cross, w_EP_cross, w_DS_cross, w_PE_cross, w_PP_cross, w_PS_cross, w_SE_cross)
  881. # Arrays created to hold data
  882. r_phase1 = np.zeros((6, n_time_points_stim), dtype=np.float32) # rE1,rE2,rP1,rP2,rS1,rS2
  883. I_phase1 = np.zeros((6, n_time_points_stim), dtype=np.float32) # IAD1, IAD2, IBD1, IBD2, IE1, IE2
  884. J_exc_phase1 = np.zeros((8, n_time_points_stim), dtype=np.float32) # WDE11,WDE12,WDE21,WDE22,WEE11,WEE12,WEE21,WEE22
  885. r_phase2 = np.zeros((6, n_time_points_phase2), dtype=np.float32) # rE1,rE2,rP1,rP2,rS1,rS2
  886. set_phase2 = np.zeros((12, n_time_points_phase2), dtype=np.float32) # thetaDD1,thetaDD2,thetaBD1,thetaBD2,thetaE1,thetaE2,betaAD1,betaAD2,betaBD1,betaBD2,betaE1,betaE2
  887. I_phase2 = np.zeros((6, n_time_points_phase2), dtype=np.float32) # IAD1, IAD2, IBD1, IBD2, IE1, IE2
  888. J_phase2 = np.zeros((20, n_time_points_phase2),
  889. dtype=np.float32) # WDE11,WDE12,WDE21,WDE22,WEE11,WEE12,WEE21,WEE22,WEP11,WEP12,WEP21,WEP22,WES11,WES12,WES21,WES22
  890. r_phase3 = np.zeros((6, n_time_points_stim), dtype=np.float32) # rE1,rE2,rP1,rP2,rS1,rS2
  891. max_E = np.zeros(1, dtype=np.float32)
  892. # Lists to hold data arrays
  893. l_res_rates = (r_phase1, I_phase1, r_phase2, I_phase2, set_phase2, r_phase3, max_E)
  894. l_res_weights = (J_exc_phase1, J_phase2)
  895. model_3_compartmental_v3(delta_t, sampling_rate, l_res_rates, l_res_weights, int(30 * (1 / delta_t)), weights, back_inputs, g_stim,
  896. stim_times, taus, K, rheobases, lambdas, flags=(0,0,0,0,0,0),flags_theta=flags_theta)
  897. idx_av_threshold = int(15 * (1 / delta_t) * (1 / sampling_rate_stim))
  898. # av_threshold = r_phase1[1][idx_av_threshold] * 1.15 #it is defined with an extra 15% for old reason. not required anymore
  899. av_threshold = r_phase1[1][idx_av_threshold]
  900. model_3_compartmental_v3(delta_t, sampling_rate, l_res_rates, l_res_weights, int(sim_duration * (1 / delta_t)), weights, back_inputs, g_stim,
  901. stim_times, taus, K, rheobases, lambdas, flags=flags,flags_theta=flags_theta)
  902. # print(r_phase3)
  903. l_delta_rE1.append(np.max(r_phase3[0][int(stim_times[0][0] * (1 / (delta_t * sampling_rate_stim))):
  904. int(stim_times[0][1] * (1 / (delta_t * sampling_rate_stim)))]).copy())
  905. print('Simulation of ' + str(hour_sim) + ' hours is completed')
  906. if save_results:
  907. l_results = [r_phase1, l_time_points_phase2, r_phase2, l_delta_rE1, av_threshold, delta_t, sampling_rate_sim,l_res_weights] #added weights for analysis with Kris
  908. # Open a file and save
  909. with open(dir_data + name + '.pkl', 'wb') as file:
  910. # A new file will be created
  911. pickle.dump(l_results, file)
  912. print('Data is saved.')
  913. else:
  914. # Open the file and read
  915. with open(dir_data + name + '.pkl', 'rb') as file:
  916. l_results = pickle.load(file)
  917. print('Data is read.')
  918. [r_phase1, l_time_points_phase2, r_phase2, l_delta_rE1, av_threshold, delta_t, sampling_rate_sim,l_res_weights] = l_results
  919. if plot_results:
  920. print('Plotting the results.')
  921. change_in_reactivation_every_h_vslides(l_time_points_phase2, hour_sims, l_delta_rE1, av_threshold,
  922. dir_plot + name, flag_only_S_on=flag_only_S_on, format='.png')
  923. change_in_reactivation_every_h_vslides(l_time_points_phase2, hour_sims, l_delta_rE1, av_threshold,
  924. dir_plot + name, flag_only_S_on=flag_only_S_on, format='.pdf')
  925. def plot_testing_at_regular_intervals_weights(ww_weights,flags_list, plastic_flag, flags_theta=(1,1), dir_data=r'\figures\data\\', dir_plot=r'\figures\\',
  926. K=0.25, flag_only_S_on=False, run_simulation=True,
  927. save_results = False, plot_results=False,modulation_SST=0):
  928. """
  929. :param hour_sim: Defines how many hours does the simulation lasts
  930. :param flags_list
  931. :param flags_theta
  932. :param dir_data
  933. :param dir_plot
  934. :param K: Tunes the steady state value of target activity and its regulator
  935. :param g_top_down_to_S: Represents the top-down signal to SST neurons triggered by the hyperexcitation. It reaches
  936. SST neurons at the offset of the conditioning
  937. :param run_simulation: True to run the numerical simulation, False to read the already saved data
  938. :param save_results: True to save the results
  939. :param plot_results: True to plot the results
  940. Multi-purpose function to analyze the model. Here we run (if run_simulation is True) our computational model to
  941. investigate the role of cell-type dependent synaptic scaling mechanisms in associative learning. We replicate the
  942. experimental procedure in [1] in model() in model.py. The model has two subnetworks, each consisted of a canonical
  943. circuit of excitatory pyramidal neurons (E), parvalbumin-positive interneurons (P), somatostatin-positive
  944. interneurons (S). The simulation procedure is divided into three phases:
  945. Phase 1 - Conditioning: The first subnetwork receives extra input representing the conditioned stimulus in [1].
  946. The parameters describing the stimulation (when and how much stimulation) is described in analyze_model()
  947. function. The onset response of the excitatory firing rate of the first subnetwork is defined as the aversion
  948. threshold of this network. Three-factor Hebbian learning is active during this period. Also, synaptic scaling
  949. mechanisms, adaptive target activity (theta) and target activity regulator (beta) are active.
  950. Phase 2: In the experiment [1], the novel stimulus is presented to the mice at 4h/24h/48h after conditioning.
  951. This phase corresponds to the waiting time after conditioning and before testing. During this phase, synaptic
  952. scaling mechanisms, adaptive target activity (theta) and target activity regulator (beta) are active.
  953. Phase 3 - Testing: In this phase, the second subnetwork receives extra input corresponds to the novel stimulus
  954. in [1]. The memory specificity/overgeneralization is determined whether the excitatory rate in the second
  955. subnetwork is below/above the aversion threshold, respectively.
  956. During simulation model() writes data to the data arrays. This data can be saved (if save_results is set to True)
  957. and the results can be plotted (if plot_results is set to True).
  958. [1] Wu, C. H., Ramos, R., Katz, D. B., & Turrigiano, G. G. (2021). Homeostatic synaptic scaling establishes the
  959. specificity of an associative memory. Current biology, 31(11), 2274-2285.
  960. """
  961. hour_sims = np.arange(48) + 1
  962. os.makedirs(dir_data, exist_ok=True)
  963. os.makedirs(dir_plot, exist_ok=True)
  964. # print('Simulation started.')
  965. for flags in flags_list:
  966. id, title = determine_name(flags)
  967. name = 'Case' + id + '_test_every_h' + '_k' + str(K).replace(".","") + "_"
  968. name += '_'.join(str(weight).replace(".","") for weight in ww_weights)
  969. l_delta_rE1 = []
  970. # print('*****', title, '*****')
  971. if run_simulation:
  972. # print('Simulation started.')
  973. # print('\n')
  974. for hour_sim in hour_sims:
  975. stim_duration = 15 # stimulation duration in seconds
  976. # Simulation duration in seconds, 5 extra seconds for pre- and post-stimulation each, 2 extra seconds to reach steady state initially
  977. sim_duration = int((hour_sim) * 60 * 60 + (stim_duration + 5 + 5) * 2 + 2)
  978. delta_t = 0.0001 # time step in seconds (0.1 ms)
  979. sampling_rate_stim = 20 # register data at every 20 step during phase 1 and 3 (conditioning and testing)
  980. sampling_rate_sim = 200000 # register data at every 2e5 time step (20 seconds) during phase 2 (in between conditioning and testing)
  981. sampling_rate = (sampling_rate_stim, sampling_rate_sim)
  982. # Total number of timepoints for stimulation and simulation
  983. n_time_points_stim = int((stim_duration + 10) * (1 / delta_t) * (1 / sampling_rate_stim))
  984. n_time_points_phase2 = int((hour_sim * 60 * 60 - 20) * (1 / delta_t) * (1 / sampling_rate_sim)) + 1 # total no the rest
  985. # l_time_points_stim = np.linspace(0, stim_duration + 10, n_time_points_stim)
  986. l_time_points_phase2 = np.linspace(0, hour_sim, n_time_points_phase2)
  987. # Timepoints of the onset (first column) and offset (second column) of the first (first row) and second (second) stimuli.
  988. stim_times = np.array([[5, 5 + stim_duration],
  989. [int(hour_sim * 60 * 60) + 5, int(hour_sim * 60 * 60) + 5 + stim_duration]]).reshape(2, 2)
  990. # The stimuli are given as inputs to the populations.
  991. g_stim_E = np.array([(1, 0), (0, 1)])
  992. g_stim_P = np.array([(0.5, 0), (0, 0.5)])
  993. if modulation_SST == 0:
  994. g_stim_S = np.array([(0, 0), (0, 0)])
  995. elif modulation_SST > 0:
  996. g_stim_S = np.array([(0.5, 0), (0, 0.5)])
  997. elif modulation_SST < 0:
  998. g_stim_S = np.array([(-0.5, 0), (0, -0.5)])
  999. g_stim = (g_stim_E, g_stim_P, g_stim_S)
  1000. # Time constants
  1001. tau_E = 0.02 # time constant of E population firing rate in seconds(20ms)
  1002. tau_P = 0.005 # time constant of P population firing rate in seconds(5ms)
  1003. tau_S = 0.01 # time constant of S population firing rate in seconds(10ms)
  1004. tau_hebb = 240 # time constant of three-factor Hebbian learning in seconds(2min)
  1005. tau_theta = 24 * (60 * 60) # time constant of target activity in seconds(24h)
  1006. tau_beta = 28 * (60 * 60) # time constant of target activity regulator in seconds(28h)
  1007. tau_scaling_E = 8 * (60 * 60) # time constant of E-to-E scaling in seconds (15h)
  1008. tau_scaling_P = 8 * (60 * 60) # time constant of P-to-E scaling in seconds (15h)
  1009. tau_scaling_S = 8 * (60 * 60) # time constant of S-to-E scaling in seconds (15h)
  1010. taus = (tau_E, tau_P, tau_S, tau_hebb, tau_scaling_E, tau_scaling_P, tau_scaling_S, tau_theta, tau_beta)
  1011. # Rheobases (minimum input needed for firing rates to be above zero)
  1012. rheobase_E, rheobase_P, rheobase_S = 1.5, 1.5, 1.5
  1013. rheobases = (rheobase_E, rheobase_P, rheobase_S)
  1014. # Background inputs
  1015. g_E = 4.5
  1016. g_P = 3.2
  1017. g_S = 3
  1018. back_inputs = (g_E, g_P, g_S)
  1019. if plastic_flag == True: #I want to modify plastic weights
  1020. # Initial conditions for plastic weights
  1021. (w_EP_within, w_EP_cross, w_ES_within, w_ES_cross, w_EE_within, w_EE_cross) = ww_weights
  1022. # Weights
  1023. w_PE_within = 0.3; w_PE_cross = 0.1
  1024. w_PP_within = 0.2; w_PP_cross = 0.1
  1025. # w_PS_within = 0.3; w_PS_cross = 0.1
  1026. # w_SE_within = 0.4; w_SE_cross = 0.1
  1027. #strong_connection version
  1028. w_PS_within = 0.95; w_PS_cross = 0.1
  1029. w_SE_within = 0.1; w_SE_cross = 0.1
  1030. weights = (w_EE_within, w_EP_within, w_ES_within, w_PE_within, w_PP_within, w_PS_within, w_SE_within,
  1031. w_EE_cross, w_EP_cross, w_ES_cross, w_PE_cross, w_PP_cross, w_PS_cross, w_SE_cross)
  1032. else:
  1033. # Initial conditions for plastic weights
  1034. (w_PE_within,w_PP_within,w_PS_within, w_SE_within) = ww_weights
  1035. w_PE_cross = 0.1
  1036. w_PP_cross = 0.1
  1037. w_PS_cross = 0.1
  1038. w_SE_cross = 0.1
  1039. w_EP_within = 0.91; w_EP_cross = 0.41
  1040. w_ES_within = 0.51; w_ES_cross = 0.31
  1041. w_EE_within = 0.51; w_EE_cross = 0.51
  1042. weights = (w_EE_within, w_EP_within, w_ES_within, w_PE_within, w_PP_within, w_PS_within, w_SE_within,
  1043. w_EE_cross, w_EP_cross, w_ES_cross, w_PE_cross, w_PP_cross, w_PS_cross, w_SE_cross)
  1044. # Arrays created to hold data
  1045. # r_phase1 = np.zeros((6, n_time_points_stim), dtype=np.float32) # rE1,rE2,rP1,rP2,rS1,rS2
  1046. # J_EE_phase1 = np.zeros((4, n_time_points_stim), dtype=np.float32) # WEE11,WEE12,WEE21,WEE22
  1047. # r_phase2 = np.zeros((10, n_time_points_phase2), dtype=np.float32) # rE1,rE2,rP1,rP2,rS1,rS2,theta1,theta2,beta1,beta2
  1048. # J_phase2 = np.zeros((12, n_time_points_phase2),dtype=np.float32) # WEE11,WEE12,WEE21,WEE22,WEP11,WEP12,WEP21,WEP22,WES11,WES12,WES21,WES22
  1049. # r_phase3 = np.zeros((6, n_time_points_stim), dtype=np.float32) # rE1,rE2,rP1,rP2,rS1,rS2
  1050. max_E = np.zeros(1, dtype=np.float32)
  1051. r_phase1 = np.full((6, n_time_points_stim), np.nan, dtype=np.float32) # rE1,rE2,rP1,rP2,rS1,rS2
  1052. J_EE_phase1 = np.full((4, n_time_points_stim), np.nan, dtype=np.float32) # WEE11,WEE12,WEE21,WEE22
  1053. r_phase2 = np.full((10, n_time_points_phase2), np.nan, dtype=np.float32) # rE1,rE2,rP1,rP2,rS1,rS2,theta1,theta2,beta1,beta2
  1054. J_phase2 = np.full((12, n_time_points_phase2), np.nan, dtype=np.float32) # WEE11,WEE12,WEE21,WEE22,WEP11,WEP12,WEP21,WEP22,WES11,WES12,WES21,WES22
  1055. r_phase3 = np.full((6, n_time_points_stim), np.nan, dtype=np.float32) # rE1,rE2,rP1,rP2,rS1,rS2
  1056. # Lists to hold data arrays
  1057. l_res_rates = (r_phase1, r_phase2, r_phase3, max_E)
  1058. l_res_weights = (J_EE_phase1, J_phase2)
  1059. model(delta_t, sampling_rate, l_res_rates, l_res_weights, int(30 * (1 / delta_t)), weights,
  1060. back_inputs, g_stim, stim_times, taus, K, rheobases, flags=(0,0,0,0,0,0), flags_theta=flags_theta)
  1061. idx_av_threshold = int(15 * (1 / delta_t) * (1 / sampling_rate_stim))
  1062. av_threshold = r_phase1[1][idx_av_threshold] * 1.15
  1063. model(delta_t, sampling_rate, l_res_rates, l_res_weights, int(sim_duration * (1 / delta_t)), weights,
  1064. back_inputs, g_stim, stim_times, taus, K, rheobases, flags=flags, flags_theta=flags_theta)
  1065. l_delta_rE1.append(np.max(r_phase3[0][int(stim_times[0][0] * (1 / (delta_t * sampling_rate_stim))):
  1066. int(stim_times[0][1] * (1 / (delta_t * sampling_rate_stim)))]).copy())
  1067. # print('Simulation of ' + str(hour_sim) + ' hours is completed')
  1068. if save_results:
  1069. l_results = [r_phase1, l_time_points_phase2, r_phase2, l_delta_rE1, av_threshold, delta_t, sampling_rate_sim,l_res_weights]
  1070. # Open a file and save
  1071. with open(dir_data + name + '.pkl', 'wb') as file:
  1072. # A new file will be created
  1073. pickle.dump(l_results, file)
  1074. else:
  1075. # Open the file and read
  1076. with open(dir_data + name + '.pkl', 'rb') as file:
  1077. l_results = pickle.load(file)
  1078. print('Data is read.')
  1079. [r_phase1, l_time_points_phase2, r_phase2, l_delta_rE1, av_threshold, delta_t, sampling_rate_sim,l_res_weights] = l_results
  1080. #it doesn't go through here
  1081. if plot_results:
  1082. print('Plotting the results.')
  1083. change_in_reactivation_every_h(l_time_points_phase2, hour_sims, l_delta_rE1, av_threshold,
  1084. dir_plot + name, flag_only_S_on=flag_only_S_on, format='.png')
  1085. change_in_reactivation_every_h(l_time_points_phase2, hour_sims, l_delta_rE1, av_threshold,
  1086. dir_plot + name, flag_only_S_on=flag_only_S_on, format='.pdf')
  1087. print("Data for", '_'.join(str(weight).replace(".", "") for weight in ww_weights), "is saved\n")

model_analysis.py at commit 3955ed2, no license · at the source

Overview

Authors: Fabio Veneto1,2, Ayça Kepçe2,3, Yue Kris Wu2,4, Julijana Gjorgjieva1,2,5
  1. School of Medicine and Health, Institute for Neuroscience, Technical University of Munich, Munich 81675, Germany
  2. School of Life Sciences, Technical University of Munich, Freising 85354, Germany
  3. Elite Master Program in Neuroengineering, Technical University of Munich, Munich 80333, Germany
  4. Zuckerman Mind Brain Behavior Institute, Columbia University, New York, New York 10027
  5. Munich Cluster for Systems Neurology (SyNergy), Munich 81377, Germany
Dates: received 20 May 2025; accepted 3 May 2026; published online 28 May 2026; in print 8 July 2026
Type: Research article · Language: English
License: CC BY
Identifiers: DOI 10.1523/jneurosci.0987-25.2026 · PMID 42209264 · PMCID PMC13421141 · OpenAlex W4410351841
Open access: hybrid, a free copy (OpenAlex)
Status: code verified
Categories: cellular / molecular (subfield)
Methods: Single-unit activity, calcium imaging
Keywords: associative learning, circuit model, interneurons, synaptic scaling, top-down modulation
MeSH: Association Learning*, Neuronal Plasticity*, Neurons*, Synapses*, Animals, Memory, Models, Neurological, Parvalbumins, Pyramidal Cells, Somatostatin (* major topic)
Topic: Neuroscience and Neuropharmacology Research (Cellular and Molecular Neuroscience, Neuroscience), according to OpenAlex
Funding: Deutsche Forschungsgemeinschaft (CRC 1080); EC | Horizon Europe | Excellent Science | HORIZON EUROPE European Research Council (101170267); European Research Council (101170267); Joachim Herz Stiftung
Citations: not cited yet (Europe PMC); 82 references in the paper

Abstract

Excitatory synaptic scaling regulates network dynamics by proportionally adjusting excitatory synaptic strengths after sensory perturbations. During associative learning, blocking excitatory scaling in conditioned taste aversion paradigms prolongs generalized aversive responses and delays memory specificity. Recent evidence also implicates inhibitory synaptic scaling in the regulation of network dynamics. Specifically, parvalbumin (PV)-expressing inhibitory neurons, targeting perisomatic regions of excitatory (E) pyramidal neurons, and somatostatin (SST)-expressing neurons, targeting distal dendrites, exhibit distinct scaling responses. This leaves open the question of how complex plasticity mechanisms regulate recurrent excitatory-inhibitory circuit dynamics in associative learning. Using computational approaches, we demonstrate that Hebbian plasticity drives memory generalization to novel stimuli not presented during conditioning. Following conditioning, diverse synaptic scaling mechanisms progressively induce memory specificity, which can be regulated by top-down inputs. Our results reveal that, in the absence of excitatory scaling, PV-to-E scaling can effectively compensate and rescue memory specificity, highlighting the presence of degenerate mechanisms in the brain. Notably, in the process of establishing memory specificity, excitatory scaling and PV-to-E scaling function synergistically, while concurrently opposing SST-to-E scaling. The synergistic and antagonistic plasticity mechanisms are orchestrated to shape the temporal evolution of memory representations, from generalized to precise.

Reproduced under the paper's license (CC BY), from the paper cited above.

Repository

Its files are read in the Code ↔ Paper reader above, with 3 matches between paragraphs and lines of code.

comp-neural-circuits/cell-type-specific-synaptic-scaling

License: none: the authors keep all their rights
State: the link answers, verified on 27 September 2026
Evidence: files inventoried
Commit: 3955ed23c29e65a6bc2bfe238beb380ce63675e1, 14 November 2025
Languages: Python (7), Jupyter (3), Shell (1)
Size: 63 files, 11 scripts
Software Heritage: not archived
Found in: “Data Availability”
Holds: README, 3 notebooks
Not found: license file, CITATION.cff, environment file, tests, continuous integration, documentation
Tools: NumPy (8 files), Matplotlib (6 files), seaborn (4 files), Numba (1 file), pandas (1 file), SciPy (1 file)
Availability: 1 check, the latest on 27 September 2026: the link answers
  • 27 September 2026: the link answers
12 files

The paper's code and data availability statement is in the Data section.

Tracing map

Proposed by the machine: these links were found in the paper and verified at the source, without human review. The map will receive a Zenodo DOI once one of the paper's authors has validated it with their ORCID.

What the map holds:

  • 1 repository of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
  • 11 scripts, each with its path and the digest of its content;
  • 3 matches between paragraphs of the paper and lines of the code (method lexical-v1);
  • neither the text of the paper nor the code itself.

Its JSON (tracing-map.json) is deposited on Zenodo with its DOI once the map is validated.

Data

No dataset and no data link were found in the paper.

Data Availability

The simulation code is publicly available at https://github.com/comp-neural-circuits/cell-type-specific-synaptic-scaling.

Reproduced under the paper's license (CC BY), from the paper cited above.

Versions

The history of this record: each version stored by the harvester or made by a correction of its authors or of the maintainers of its code, and what changed in its facts. The texts of the paper (its abstract, its availability statements) are not part of it; versions that changed only those are not listed.

Version 1, 27 September 2026: the first record

Recorded: type, language, journal, volume, issue, pages, dates, 4 authors, 5 keywords, 10 MeSH terms, 4 funders, 76 references.

Cite

This paper

Veneto, F., Kepçe, A., Wu, Y. K., & Gjorgjieva, J. (2026). Cell-Type-Specific Synaptic Scaling Mechanisms Differentially Contribute to Associative Learning. The Journal of neuroscience : the official journal of the Society for Neuroscience, 46(27), e0987252026. https://doi.org/10.1523/jneurosci.0987-25.2026

BibTeX

@article{veneto2026cell,
author = {Veneto, Fabio and Kepçe, Ayça and Wu, Yue Kris and Gjorgjieva, Julijana},
title = {{Cell-Type-Specific Synaptic Scaling Mechanisms Differentially Contribute to Associative Learning}},
journal = {The Journal of neuroscience : the official journal of the Society for Neuroscience},
year = {2026},
month = jul,
volume = {46},
number = {27},
pages = {e0987252026},
publisher = {Society for Neuroscience},
issn = {0270-6474},
doi = {10.1523/jneurosci.0987-25.2026},
url = {https://doi.org/10.1523/jneurosci.0987-25.2026},
pmid = {42209264},
pmcid = {PMC13421141}
}

RIS

TY - JOUR
AU - Veneto, Fabio
AU - Kepçe, Ayça
AU - Wu, Yue Kris
AU - Gjorgjieva, Julijana
TI - Cell-Type-Specific Synaptic Scaling Mechanisms Differentially Contribute to Associative Learning
T2 - The Journal of neuroscience : the official journal of the Society for Neuroscience
J2 - J Neurosci
PY - 2026
DA - 2026/07/08
VL - 46
IS - 27
SP - e0987252026
SN - 0270-6474
PB - Society for Neuroscience
DO - 10.1523/jneurosci.0987-25.2026
UR - https://doi.org/10.1523/jneurosci.0987-25.2026
LA - en
ER -

CSL-JSON

{
"id": "10.1523/jneurosci.0987-25.2026",
"type": "article-journal",
"title": "Cell-Type-Specific Synaptic Scaling Mechanisms Differentially Contribute to Associative Learning",
"container-title": "The Journal of neuroscience : the official journal of the Society for Neuroscience",
"author": [
{
"family": "Veneto",
"given": "Fabio"
},
{
"family": "Kepçe",
"given": "Ayça"
},
{
"family": "Wu",
"given": "Yue Kris"
},
{
"family": "Gjorgjieva",
"given": "Julijana"
}
],
"container-title-short": "J Neurosci",
"volume": "46",
"issue": "27",
"page": "e0987252026",
"DOI": "10.1523/jneurosci.0987-25.2026",
"PMID": "42209264",
"PMCID": "PMC13421141",
"ISSN": "0270-6474",
"publisher": "Society for Neuroscience",
"URL": "https://doi.org/10.1523/jneurosci.0987-25.2026",
"language": "en",
"issued": {
"date-parts": [
[
2026,
7,
8
]
]
}
}

The tracing map gets a citation of its own once an author has validated it and it has a DOI.

Similar papers

The papers with a page that share the most with this one: the tools found in their code, their categories, datasets, cited references and authors, the rarest counting most.

[1] doi:10.1371/journal.pbio.3003831 [code]
Disinhibitory signaling enables flexible coding of top-down information in cortical networks.
Journal: PLoS biology
In common: pandas, SciPy, Matplotlib, 1 other tool, 10 references
[2] doi:10.1371/journal.pcbi.1014730 [code]
A unified model of short- and long-term plasticity: Effects on network connectivity and information capacity.
Journal: PLoS computational biology
In common: seaborn, pandas, SciPy, 2 other tools, 7 references
[3] doi:10.1038/s42003-026-10418-2 [code]
Cortical PV and VIP interneurons similarly influence SST neuron output despite distinct unitary properties.
Journal: Communications biology
In common: cellular / molecular, 8 references
[4] doi:10.1093/cercor/bhag047 [code]
Association learning drives synaptic plasticity at feedforward synapses in somatosensory cortex.
Journal: Cerebral cortex (New York, N.Y. : 1991)
In common: pandas, SciPy, Matplotlib, 1 other tool, cellular / molecular, 6 references
[5] doi:10.1126/sciadv.aed6417 [code]
Intrinsic timing, not temporal prediction, underlies ramping dynamics in visual and parietal cortex during passive behavior.
Journal: Science advances
In common: seaborn, pandas, SciPy, 2 other tools, 5 references
[6] doi:10.1038/s41467-026-70354-x [code]
Global error signal guides local optimization in mismatch calculation.
Journal: Nature communications
In common: Numba, seaborn, SciPy, 2 other tools, 4 references
[7] doi:10.1038/s41467-026-74460-8 [code]
Spike-based alignment learning solves the weight transport problem.
Journal: Nature communications
In common: Numba, seaborn, pandas, 3 other tools, 3 references
[8] doi:10.1126/sciadv.aed4172 [code]
Locomotion optimizes sensory representations through a computational principle shared by rodents and primates.
Journal: Science advances
In common: Numba, pandas, SciPy, 2 other tools, cellular / molecular, 3 references
[9] doi:10.1371/journal.pcbi.1014001 [code]
Burst firing creates an attractor in synaptic weight dynamics.
Journal: PLoS computational biology
In common: 6 references
[10] doi:10.1016/j.ebiom.2026.106362 [code]
Neuron-derived neurotrophic factor-positive interneurons: a cellular target for anti-seizure therapies.
Journal: EBioMedicine
In common: Numba, pandas, SciPy, 2 other tools, 3 references

Contribute

The authors of this paper can claim it, correct its record and validate its tracing map, and the maintainers of its code (its owner, or a public member of its organization) correct what it says of their repository; anyone signed in can ask for its removal. Every request goes to OSCR's own machine, which answers it; your account page follows them.

Sign in with ORCID to claim this paper as one of its authors, correct its record or validate its tracing map: when the paper's metadata lists your ORCID iD, you are recognized at once. Maintainers of its code: sign in with GitHub, then claim the repository on your account page.

Request its removal

To ask OSCR to remove this record, the copies of its authors' scripts or its tracing map, use the removal request page: signed in, you say who you are, what to remove and why, then review and confirm the request. Published rules decide every request (how).

Discussion, reproductions, activity

Discussion: questions and error reports about this paper and its code, from signed-in readers and its authors. It opens with sign-in.

Reproductions: reports from readers who ran the authors' code: what they reproduced, with which environment, commit and data. It opens with sign-in.

Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.