pyclustering  0.10.1
pyclustring is a Python, C++ data mining library.
hhn.py
1 """!
2 
3 @brief Oscillatory Neural Network based on Hodgkin-Huxley Neuron Model
4 @details Implementation based on paper @cite article::nnet::hnn::1.
5 
6 @authors Andrei Novikov (pyclustering@yandex.ru)
7 @date 2014-2020
8 @copyright BSD-3-Clause
9 
10 """
11 
12 from scipy.integrate import odeint
13 
14 from pyclustering.core.wrapper import ccore_library
15 
16 import pyclustering.core.hhn_wrapper as wrapper
17 
18 from pyclustering.nnet import *
19 
20 from pyclustering.utils import allocate_sync_ensembles
21 
22 import numpy
23 import random
24 
26  """!
27  @brief Describes parameters of Hodgkin-Huxley Oscillatory Network.
28 
29  @see hhn_network
30 
31  """
32 
33  def __init__(self):
34  """!
35  @brief Default constructor of parameters for Hodgkin-Huxley Oscillatory Network.
36  @details Constructor initializes parameters by default non-zero values that can be
37  used for simple simulation.
38  """
39 
40 
41  self.nu = random.random() * 2.0 - 1.0
42 
43 
44  self.gNa = 120.0 * (1 + 0.02 * self.nu)
45 
46 
47  self.gK = 36.0 * (1 + 0.02 * self.nu)
48 
49 
50  self.gL = 0.3 * (1 + 0.02 * self.nu)
51 
52 
53 
54  self.vNa = 50.0
55 
56 
57  self.vK = -77.0
58 
59 
60  self.vL = -54.4
61 
62 
63  self.vRest = -65.0
64 
65 
66 
67  self.Icn1 = 5.0
68 
69 
70  self.Icn2 = 30.0
71 
72 
73 
74  self.Vsyninh = -80.0
75 
76 
77  self.Vsynexc = 0.0
78 
79 
80  self.alfa_inhibitory = 6.0
81 
82 
83  self.betta_inhibitory = 0.3
84 
85 
86 
87  self.alfa_excitatory = 40.0
88 
89 
90  self.betta_excitatory = 2.0
91 
92 
93 
94  self.w1 = 0.1
95 
96 
97  self.w2 = 9.0
98 
99 
100  self.w3 = 5.0
101 
102 
103 
104  self.deltah = 650.0
105 
106 
107  self.threshold = -10
108 
109 
110  self.eps = 0.16
111 
112 
114  """!
115  @brief Central element consist of two central neurons that are described by a little bit different dynamic than peripheral.
116 
117  @see hhn_network
118 
119  """
120 
121  def __init__(self):
122  """!
123  @brief Constructor of central element.
124 
125  """
126 
127 
129 
130 
132 
133 
135 
136 
138 
139 
140  self.pulse_generation = False
141 
142 
144 
145  def __repr__(self):
146  """!
147  @brief Returns string that represents central element.
148 
149  """
150  return "%s, %s" % (self.membrane_potential, self.pulse_generation_time)
151 
152 
154  """!
155  @brief Oscillatory Neural Network with central element based on Hodgkin-Huxley neuron model.
156  @details Interaction between oscillators is performed via central element (no connection between oscillators that
157  are called as peripheral). Peripheral oscillators receive external stimulus. Central element consist of
158  two oscillators: the first is used for synchronization some ensemble of oscillators and the second
159  controls synchronization of the first central oscillator with various ensembles.
160 
161  Usage example where oscillatory network with 6 oscillators is used for simulation. The first two oscillators
162  have the same stimulus, as well as the third and fourth oscillators and the last two. Thus three synchronous
163  ensembles are expected after simulation.
164  @code
165  from pyclustering.nnet.hhn import hhn_network, hhn_parameters
166  from pyclustering.nnet.dynamic_visualizer import dynamic_visualizer
167 
168  # Change period of time when high strength value of synaptic connection exists from CN2 to PN.
169  params = hhn_parameters()
170  params.deltah = 400
171 
172  # Create Hodgkin-Huxley oscillatory network with stimulus.
173  net = hhn_network(6, [0, 0, 25, 25, 47, 47], params)
174 
175  # Simulate network.
176  (t, dyn_peripheral, dyn_central) = net.simulate(2400, 600)
177 
178  # Visualize network's output (membrane potential of peripheral and central neurons).
179  amount_canvases = 6 + 2 # 6 peripheral oscillator + 2 central elements
180  visualizer = dynamic_visualizer(amount_canvases, x_title="Time", y_title="V", y_labels=False)
181  visualizer.append_dynamics(t, dyn_peripheral, 0, True)
182  visualizer.append_dynamics(t, dyn_central, amount_canvases - 2, True)
183  visualizer.show()
184  @endcode
185 
186  There is visualized result of simulation where three synchronous ensembles of oscillators can be observed. The
187  first and the second oscillators form the first ensemble, the third and the fourth form the second ensemble and
188  the last two oscillators form the third ensemble.
189  @image html hhn_three_ensembles.png
190 
191  """
192 
193  def __init__(self, num_osc, stimulus = None, parameters = None, type_conn = None, type_conn_represent = conn_represent.MATRIX, ccore = True):
194  """!
195  @brief Constructor of oscillatory network based on Hodgkin-Huxley neuron model.
196 
197  @param[in] num_osc (uint): Number of peripheral oscillators in the network.
198  @param[in] stimulus (list): List of stimulus for oscillators, number of stimulus should be equal to number of peripheral oscillators.
199  @param[in] parameters (hhn_parameters): Parameters of the network.
200  @param[in] type_conn (conn_type): Type of connections between oscillators in the network (ignored for this type of network).
201  @param[in] type_conn_represent (conn_represent): Internal representation of connection in the network: matrix or list.
202  @param[in] ccore (bool): If 'True' then CCORE is used (C/C++ implementation of the model).
203 
204  """
205 
206  super().__init__(num_osc, conn_type.NONE, type_conn_represent)
207 
208  if stimulus is None:
209  self._stimulus = [0.0] * num_osc
210  else:
211  self._stimulus = stimulus
212 
213  if parameters is not None:
214  self._params = parameters
215  else:
216  self._params = hhn_parameters()
217 
218  self.__ccore_hhn_pointer = None
219  self.__ccore_hhn_dynamic_pointer = None
220 
221  if (ccore is True) and ccore_library.workable():
222  self.__ccore_hhn_pointer = wrapper.hhn_create(num_osc, self._params)
223  else:
224  self._membrane_dynamic_pointer = None # final result is stored here.
225 
226  self._membrane_potential = [0.0] * self._num_osc
227  self._active_cond_sodium = [0.0] * self._num_osc
228  self._inactive_cond_sodium = [0.0] * self._num_osc
229  self._active_cond_potassium = [0.0] * self._num_osc
230  self._link_activation_time = [0.0] * self._num_osc
231  self._link_pulse_counter = [0.0] * self._num_osc
232  self._link_weight3 = [0.0] * self._num_osc
233  self._pulse_generation_time = [[] for i in range(self._num_osc)]
234  self._pulse_generation = [False] * self._num_osc
235 
236  self._noise = [random.random() * 2.0 - 1.0 for i in range(self._num_osc)]
237 
239 
240  def __del__(self):
241  """!
242  @brief Destroy dynamically allocated oscillatory network instance in case of CCORE usage.
243 
244  """
245  if self.__ccore_hhn_pointer:
246  wrapper.hhn_destroy(self.__ccore_hhn_pointer)
247 
248  def simulate(self, steps, time, solution = solve_type.RK4):
249  """!
250  @brief Performs static simulation of oscillatory network based on Hodgkin-Huxley neuron model.
251  @details Output dynamic is sensible to amount of steps of simulation and solver of differential equation.
252  Python implementation uses 'odeint' from 'scipy', CCORE uses classical RK4 and RFK45 methods,
253  therefore in case of CCORE HHN (Hodgkin-Huxley network) amount of steps should be greater than in
254  case of Python HHN.
255 
256  @param[in] steps (uint): Number steps of simulations during simulation.
257  @param[in] time (double): Time of simulation.
258  @param[in] solution (solve_type): Type of solver for differential equations.
259 
260  @return (tuple) Dynamic of oscillatory network represented by (time, peripheral neurons dynamic, central elements
261  dynamic), where types are (list, list, list).
262 
263  """
264 
265  return self.simulate_static(steps, time, solution)
266 
267  def simulate_static(self, steps, time, solution = solve_type.RK4):
268  """!
269  @brief Performs static simulation of oscillatory network based on Hodgkin-Huxley neuron model.
270  @details Output dynamic is sensible to amount of steps of simulation and solver of differential equation.
271  Python implementation uses 'odeint' from 'scipy', CCORE uses classical RK4 and RFK45 methods,
272  therefore in case of CCORE HHN (Hodgkin-Huxley network) amount of steps should be greater than in
273  case of Python HHN.
274 
275  @param[in] steps (uint): Number steps of simulations during simulation.
276  @param[in] time (double): Time of simulation.
277  @param[in] solution (solve_type): Type of solver for differential equations.
278 
279  @return (tuple) Dynamic of oscillatory network represented by (time, peripheral neurons dynamic, central elements
280  dynamic), where types are (list, list, list).
281 
282  """
283 
284  # Check solver before simulation
285  if solution == solve_type.FAST:
286  raise NameError("Solver FAST is not support due to low accuracy that leads to huge error.")
287 
288  self._membrane_dynamic_pointer = None
289 
290  if self.__ccore_hhn_pointer is not None:
291  self.__ccore_hhn_dynamic_pointer = wrapper.hhn_dynamic_create(True, False, False, False)
292  wrapper.hhn_simulate(self.__ccore_hhn_pointer, steps, time, solution, self._stimulus, self.__ccore_hhn_dynamic_pointer)
293 
294  peripheral_membrane_potential = wrapper.hhn_dynamic_get_peripheral_evolution(self.__ccore_hhn_dynamic_pointer, 0)
295  central_membrane_potential = wrapper.hhn_dynamic_get_central_evolution(self.__ccore_hhn_dynamic_pointer, 0)
296  dynamic_time = wrapper.hhn_dynamic_get_time(self.__ccore_hhn_dynamic_pointer)
297 
298  self._membrane_dynamic_pointer = peripheral_membrane_potential
299 
300  wrapper.hhn_dynamic_destroy(self.__ccore_hhn_dynamic_pointer)
301 
302  return dynamic_time, peripheral_membrane_potential, central_membrane_potential
303 
304  if solution == solve_type.RKF45:
305  raise NameError("Solver RKF45 is not support in python version.")
306 
307  dyn_peripheral = [self._membrane_potential[:]]
308  dyn_central = [[0.0, 0.0]]
309  dyn_time = [0.0]
310 
311  step = time / steps
312  int_step = step / 10.0
313 
314  for t in numpy.arange(step, time + step, step):
315  # update states of oscillators
316  (memb_peripheral, memb_central) = self._calculate_states(solution, t, step, int_step)
317 
318  # update states of oscillators
319  dyn_peripheral.append(memb_peripheral)
320  dyn_central.append(memb_central)
321  dyn_time.append(t)
322 
323  self._membrane_dynamic_pointer = dyn_peripheral
324  return dyn_time, dyn_peripheral, dyn_central
325 
326  def _calculate_states(self, solution, t, step, int_step):
327  """!
328  @brief Calculates new state of each oscillator in the network. Returns only excitatory state of oscillators.
329 
330  @param[in] solution (solve_type): Type solver of the differential equations.
331  @param[in] t (double): Current time of simulation.
332  @param[in] step (uint): Step of solution at the end of which states of oscillators should be calculated.
333  @param[in] int_step (double): Differentiation step that is used for solving differential equation.
334 
335  @return (list) New states of membrane potentials for peripheral oscillators and for cental elements as a list where
336  the last two values correspond to central element 1 and 2.
337 
338  """
339 
340  next_membrane = [0.0] * self._num_osc
341  next_active_sodium = [0.0] * self._num_osc
342  next_inactive_sodium = [0.0] * self._num_osc
343  next_active_potassium = [0.0] * self._num_osc
344 
345  # Update states of oscillators
346  for index in range(0, self._num_osc, 1):
347  result = odeint(self.hnn_state,
348  [self._membrane_potential[index], self._active_cond_sodium[index], self._inactive_cond_sodium[index], self._active_cond_potassium[index]],
349  numpy.arange(t - step, t, int_step),
350  (index, ))
351 
352  [ next_membrane[index], next_active_sodium[index], next_inactive_sodium[index], next_active_potassium[index] ] = result[len(result) - 1][0:4]
353 
354  next_cn_membrane = [0.0, 0.0]
355  next_cn_active_sodium = [0.0, 0.0]
356  next_cn_inactive_sodium = [0.0, 0.0]
357  next_cn_active_potassium = [0.0, 0.0]
358 
359  # Update states of central elements
360  for index in range(0, len(self._central_element)):
361  result = odeint(self.hnn_state,
362  [self._central_element[index].membrane_potential, self._central_element[index].active_cond_sodium, self._central_element[index].inactive_cond_sodium, self._central_element[index].active_cond_potassium],
363  numpy.arange(t - step, t, int_step),
364  (self._num_osc + index, ))
365 
366  [ next_cn_membrane[index], next_cn_active_sodium[index], next_cn_inactive_sodium[index], next_cn_active_potassium[index] ] = result[len(result) - 1][0:4]
367 
368  # Noise generation
369  self._noise = [ 1.0 + 0.01 * (random.random() * 2.0 - 1.0) for i in range(self._num_osc)]
370 
371  # Updating states of PNs
372  self.__update_peripheral_neurons(t, step, next_membrane, next_active_sodium, next_inactive_sodium, next_active_potassium)
373 
374  # Updation states of CN
375  self.__update_central_neurons(t, next_cn_membrane, next_cn_active_sodium, next_cn_inactive_sodium, next_cn_active_potassium)
376 
377  return (next_membrane, next_cn_membrane)
378 
379  def __update_peripheral_neurons(self, t, step, next_membrane, next_active_sodium, next_inactive_sodium, next_active_potassium):
380  """!
381  @brief Update peripheral neurons in line with new values of current in channels.
382 
383  @param[in] t (doubles): Current time of simulation.
384  @param[in] step (uint): Step (time duration) during simulation when states of oscillators should be calculated.
385  @param[in] next_membrane (list): New values of membrane potentials for peripheral neurons.
386  @Param[in] next_active_sodium (list): New values of activation conductances of the sodium channels for peripheral neurons.
387  @param[in] next_inactive_sodium (list): New values of inactivaton conductances of the sodium channels for peripheral neurons.
388  @param[in] next_active_potassium (list): New values of activation conductances of the potassium channel for peripheral neurons.
389 
390  """
391 
392  self._membrane_potential = next_membrane[:]
393  self._active_cond_sodium = next_active_sodium[:]
394  self._inactive_cond_sodium = next_inactive_sodium[:]
395  self._active_cond_potassium = next_active_potassium[:]
396 
397  for index in range(0, self._num_osc):
398  if self._pulse_generation[index] is False:
399  if self._membrane_potential[index] >= 0.0:
400  self._pulse_generation[index] = True
401  self._pulse_generation_time[index].append(t)
402  elif self._membrane_potential[index] < 0.0:
403  self._pulse_generation[index] = False
404 
405  # Update connection from CN2 to PN
406  if self._link_weight3[index] == 0.0:
407  if self._membrane_potential[index] > self._params.threshold:
408  self._link_pulse_counter[index] += step
409 
410  if self._link_pulse_counter[index] >= 1 / self._params.eps:
411  self._link_weight3[index] = self._params.w3
412  self._link_activation_time[index] = t
413  elif not ((self._link_activation_time[index] < t) and (t < self._link_activation_time[index] + self._params.deltah)):
414  self._link_weight3[index] = 0.0
415  self._link_pulse_counter[index] = 0.0
416 
417  def __update_central_neurons(self, t, next_cn_membrane, next_cn_active_sodium, next_cn_inactive_sodium, next_cn_active_potassium):
418  """!
419  @brief Update of central neurons in line with new values of current in channels.
420 
421  @param[in] t (doubles): Current time of simulation.
422  @param[in] next_membrane (list): New values of membrane potentials for central neurons.
423  @Param[in] next_active_sodium (list): New values of activation conductances of the sodium channels for central neurons.
424  @param[in] next_inactive_sodium (list): New values of inactivaton conductances of the sodium channels for central neurons.
425  @param[in] next_active_potassium (list): New values of activation conductances of the potassium channel for central neurons.
426 
427  """
428 
429  for index in range(0, len(self._central_element)):
430  self._central_element[index].membrane_potential = next_cn_membrane[index]
431  self._central_element[index].active_cond_sodium = next_cn_active_sodium[index]
432  self._central_element[index].inactive_cond_sodium = next_cn_inactive_sodium[index]
433  self._central_element[index].active_cond_potassium = next_cn_active_potassium[index]
434 
435  if self._central_element[index].pulse_generation is False:
436  if self._central_element[index].membrane_potential >= 0.0:
437  self._central_element[index].pulse_generation = True
438  self._central_element[index].pulse_generation_time.append(t)
439  elif self._central_element[index].membrane_potential < 0.0:
440  self._central_element[index].pulse_generation = False
441 
442  def hnn_state(self, inputs, t, argv):
443  """!
444  @brief Returns new values of excitatory and inhibitory parts of oscillator and potential of oscillator.
445 
446  @param[in] inputs (list): States of oscillator for integration [v, m, h, n] (see description below).
447  @param[in] t (double): Current time of simulation.
448  @param[in] argv (tuple): Extra arguments that are not used for integration - index of oscillator.
449 
450  @return (list) new values of oscillator [v, m, h, n], where:
451  v - membrane potantial of oscillator,
452  m - activation conductance of the sodium channel,
453  h - inactication conductance of the sodium channel,
454  n - activation conductance of the potassium channel.
455 
456  """
457 
458  index = argv
459 
460  v = inputs[0] # membrane potential (v).
461  m = inputs[1] # activation conductance of the sodium channel (m).
462  h = inputs[2] # inactivaton conductance of the sodium channel (h).
463  n = inputs[3] # activation conductance of the potassium channel (n).
464 
465  # Calculate ion current
466  # gNa * m[i]^3 * h * (v[i] - vNa) + gK * n[i]^4 * (v[i] - vK) + gL (v[i] - vL)
467  active_sodium_part = self._params.gNa * (m ** 3) * h * (v - self._params.vNa)
468  inactive_sodium_part = self._params.gK * (n ** 4) * (v - self._params.vK)
469  active_potassium_part = self._params.gL * (v - self._params.vL)
470 
471  Iion = active_sodium_part + inactive_sodium_part + active_potassium_part
472 
473  Iext = 0.0
474  Isyn = 0.0
475  if index < self._num_osc:
476  # PN - peripheral neuron - calculation of external current and synaptic current.
477  Iext = self._stimulus[index] * self._noise[index] # probably noise can be pre-defined for reducting compexity
478 
479  memory_impact1 = 0.0
480  for i in range(0, len(self._central_element[0].pulse_generation_time)):
481  memory_impact1 += self.__alfa_function(t - self._central_element[0].pulse_generation_time[i], self._params.alfa_inhibitory, self._params.betta_inhibitory);
482 
483  memory_impact2 = 0.0
484  for i in range(0, len(self._central_element[1].pulse_generation_time)):
485  memory_impact2 += self.__alfa_function(t - self._central_element[1].pulse_generation_time[i], self._params.alfa_inhibitory, self._params.betta_inhibitory);
486 
487  Isyn = self._params.w2 * (v - self._params.Vsyninh) * memory_impact1 + self._link_weight3[index] * (v - self._params.Vsyninh) * memory_impact2;
488  else:
489  # CN - central element.
490  central_index = index - self._num_osc
491  if central_index == 0:
492  Iext = self._params.Icn1 # CN1
493 
494  memory_impact = 0.0
495  for index_oscillator in range(0, self._num_osc):
496  for index_generation in range(0, len(self._pulse_generation_time[index_oscillator])):
497  memory_impact += self.__alfa_function(t - self._pulse_generation_time[index_oscillator][index_generation], self._params.alfa_excitatory, self._params.betta_excitatory);
498 
499  Isyn = self._params.w1 * (v - self._params.Vsynexc) * memory_impact
500 
501  elif central_index == 1:
502  Iext = self._params.Icn2 # CN2
503  Isyn = 0.0
504 
505  else:
506  assert 0;
507 
508  # Membrane potential
509  dv = -Iion + Iext - Isyn
510 
511  # Calculate variables
512  potential = v - self._params.vRest
513  am = (2.5 - 0.1 * potential) / (math.exp(2.5 - 0.1 * potential) - 1.0)
514  ah = 0.07 * math.exp(-potential / 20.0)
515  an = (0.1 - 0.01 * potential) / (math.exp(1.0 - 0.1 * potential) - 1.0)
516 
517  bm = 4.0 * math.exp(-potential / 18.0)
518  bh = 1.0 / (math.exp(3.0 - 0.1 * potential) + 1.0)
519  bn = 0.125 * math.exp(-potential / 80.0)
520 
521  dm = am * (1.0 - m) - bm * m
522  dh = ah * (1.0 - h) - bh * h
523  dn = an * (1.0 - n) - bn * n
524 
525  return [dv, dm, dh, dn]
526 
527  def allocate_sync_ensembles(self, tolerance = 0.1):
528  """!
529  @brief Allocates clusters in line with ensembles of synchronous oscillators where each. Synchronous ensemble corresponds to only one cluster.
530 
531  @param[in] tolerance (double): maximum error for allocation of synchronous ensemble oscillators.
532 
533  @return (list) Grours (lists) of indexes of synchronous oscillators. For example [ [index_osc1, index_osc3], [index_osc2], [index_osc4, index_osc5] ].
534 
535  """
536 
537  return allocate_sync_ensembles(self._membrane_dynamic_pointer, tolerance, 20.0, None)
538 
539  def __alfa_function(self, time, alfa, betta):
540  """!
541  @brief Calculates value of alfa-function for difference between spike generation time and current simulation time.
542 
543  @param[in] time (double): Difference between last spike generation time and current time.
544  @param[in] alfa (double): Alfa parameter for alfa-function.
545  @param[in] betta (double): Betta parameter for alfa-function.
546 
547  @return (double) Value of alfa-function.
548 
549  """
550 
551  return alfa * time * math.exp(-betta * time)
pyclustering.nnet.hhn.hhn_network._membrane_potential
_membrane_potential
Definition: hhn.py:226
pyclustering.nnet.hhn.hhn_network._calculate_states
def _calculate_states(self, solution, t, step, int_step)
Calculates new state of each oscillator in the network.
Definition: hhn.py:326
pyclustering.nnet.hhn.hhn_network.__update_peripheral_neurons
def __update_peripheral_neurons(self, t, step, next_membrane, next_active_sodium, next_inactive_sodium, next_active_potassium)
Update peripheral neurons in line with new values of current in channels.
Definition: hhn.py:379
pyclustering.nnet.hhn.hhn_parameters.vK
vK
Reverse potential of potassium current [mV].
Definition: hhn.py:57
pyclustering.nnet.hhn.hhn_parameters.vRest
vRest
Rest potential [mV].
Definition: hhn.py:63
pyclustering.nnet.hhn.hhn_network._inactive_cond_sodium
_inactive_cond_sodium
Definition: hhn.py:228
pyclustering.nnet.hhn.hhn_parameters.__init__
def __init__(self)
Default constructor of parameters for Hodgkin-Huxley Oscillatory Network.
Definition: hhn.py:33
pyclustering.nnet.hhn.hhn_network._pulse_generation
_pulse_generation
Definition: hhn.py:234
pyclustering.nnet.hhn.hhn_parameters.w2
w2
Strength of the synaptic connection from CN1 to PN.
Definition: hhn.py:97
pyclustering.nnet.hhn.hhn_parameters.alfa_excitatory
alfa_excitatory
Alfa-parameter for alfa-function for excitatory effect.
Definition: hhn.py:87
pyclustering.nnet.hhn.hhn_network.__del__
def __del__(self)
Destroy dynamically allocated oscillatory network instance in case of CCORE usage.
Definition: hhn.py:240
pyclustering.nnet.network._num_osc
int _num_osc
Definition: __init__.py:88
pyclustering.nnet.hhn.hhn_network._link_pulse_counter
_link_pulse_counter
Definition: hhn.py:231
pyclustering.nnet.hhn.hhn_parameters.w1
w1
Strength of the synaptic connection from PN to CN1.
Definition: hhn.py:94
pyclustering.nnet.hhn.hhn_parameters
Describes parameters of Hodgkin-Huxley Oscillatory Network.
Definition: hhn.py:25
pyclustering.nnet.hhn.hhn_network._active_cond_potassium
_active_cond_potassium
Definition: hhn.py:229
pyclustering.nnet.hhn.hhn_network._pulse_generation_time
_pulse_generation_time
Definition: hhn.py:233
pyclustering.nnet.hhn.hhn_parameters.alfa_inhibitory
alfa_inhibitory
Alfa-parameter for alfa-function for inhibitory effect.
Definition: hhn.py:80
pyclustering.nnet.hhn.hhn_network.hnn_state
def hnn_state(self, inputs, t, argv)
Returns new values of excitatory and inhibitory parts of oscillator and potential of oscillator.
Definition: hhn.py:442
pyclustering.nnet.hhn.hhn_network._noise
_noise
Definition: hhn.py:236
pyclustering.nnet.hhn.central_element.pulse_generation_time
pulse_generation_time
Timestamps of generated pulses.
Definition: hhn.py:143
pyclustering.nnet.hhn.central_element.active_cond_sodium
active_cond_sodium
Activation conductance of the sodium channel (m).
Definition: hhn.py:131
pyclustering.nnet.hhn.hhn_parameters.Icn1
Icn1
External current [mV] for central element 1.
Definition: hhn.py:67
pyclustering.nnet.hhn.hhn_parameters.Vsynexc
Vsynexc
Synaptic reversal potential [mV] for exciting effects.
Definition: hhn.py:77
pyclustering.nnet.hhn.hhn_network.simulate_static
def simulate_static(self, steps, time, solution=solve_type.RK4)
Performs static simulation of oscillatory network based on Hodgkin-Huxley neuron model.
Definition: hhn.py:267
pyclustering.nnet.hhn.hhn_network._params
_params
Definition: hhn.py:214
pyclustering.nnet.hhn.hhn_parameters.gK
gK
Maximal conductivity for potassium current.
Definition: hhn.py:47
pyclustering.nnet.network
Common network description that consists of information about oscillators and connection between them...
Definition: __init__.py:82
pyclustering.nnet.hhn.hhn_network._membrane_dynamic_pointer
_membrane_dynamic_pointer
Definition: hhn.py:224
pyclustering.nnet.hhn.hhn_network._central_element
_central_element
Definition: hhn.py:238
pyclustering.nnet.hhn.central_element.active_cond_potassium
active_cond_potassium
Activaton conductance of the sodium channel (h).
Definition: hhn.py:137
pyclustering.nnet.hhn.central_element
Central element consist of two central neurons that are described by a little bit different dynamic t...
Definition: hhn.py:113
pyclustering.nnet.hhn.hhn_parameters.Vsyninh
Vsyninh
Synaptic reversal potential [mV] for inhibitory effects.
Definition: hhn.py:74
pyclustering.nnet.hhn.hhn_network.simulate
def simulate(self, steps, time, solution=solve_type.RK4)
Performs static simulation of oscillatory network based on Hodgkin-Huxley neuron model.
Definition: hhn.py:248
pyclustering.nnet.hhn.hhn_parameters.gNa
gNa
Maximal conductivity for sodium current.
Definition: hhn.py:44
pyclustering.nnet.hhn.hhn_network.__ccore_hhn_dynamic_pointer
__ccore_hhn_dynamic_pointer
Definition: hhn.py:219
pyclustering.nnet.hhn.central_element.__init__
def __init__(self)
Constructor of central element.
Definition: hhn.py:121
pyclustering.nnet.hhn.hhn_network.allocate_sync_ensembles
def allocate_sync_ensembles(self, tolerance=0.1)
Allocates clusters in line with ensembles of synchronous oscillators where each.
Definition: hhn.py:527
pyclustering.nnet.hhn.hhn_network
Oscillatory Neural Network with central element based on Hodgkin-Huxley neuron model.
Definition: hhn.py:153
pyclustering.nnet
Neural and oscillatory network module. Consists of models of bio-inspired networks.
Definition: __init__.py:1
pyclustering.nnet.hhn.central_element.pulse_generation
pulse_generation
Spike generation of central neuron.
Definition: hhn.py:140
pyclustering.nnet.hhn.hhn_parameters.betta_excitatory
betta_excitatory
Betta-parameter for alfa-function for excitatory effect.
Definition: hhn.py:90
pyclustering.nnet.hhn.hhn_parameters.Icn2
Icn2
External current [mV] for central element 2.
Definition: hhn.py:70
pyclustering.nnet.hhn.central_element.inactive_cond_sodium
inactive_cond_sodium
Inactivaton conductance of the sodium channel (h).
Definition: hhn.py:134
pyclustering.nnet.hhn.hhn_parameters.vNa
vNa
Reverse potential of sodium current [mV].
Definition: hhn.py:54
pyclustering.nnet.hhn.central_element.__repr__
def __repr__(self)
Returns string that represents central element.
Definition: hhn.py:145
pyclustering.nnet.hhn.hhn_parameters.deltah
deltah
Period of time [ms] when high strength value of synaptic connection exists from CN2 to PN.
Definition: hhn.py:104
pyclustering.nnet.hhn.hhn_parameters.betta_inhibitory
betta_inhibitory
Betta-parameter for alfa-function for inhibitory effect.
Definition: hhn.py:83
pyclustering.nnet.hhn.hhn_network.__init__
def __init__(self, num_osc, stimulus=None, parameters=None, type_conn=None, type_conn_represent=conn_represent.MATRIX, ccore=True)
Constructor of oscillatory network based on Hodgkin-Huxley neuron model.
Definition: hhn.py:193
pyclustering.nnet.hhn.hhn_parameters.eps
eps
Affects pulse counter.
Definition: hhn.py:110
pyclustering.nnet.hhn.hhn_network._stimulus
_stimulus
Definition: hhn.py:209
pyclustering.nnet.hhn.hhn_network.__alfa_function
def __alfa_function(self, time, alfa, betta)
Calculates value of alfa-function for difference between spike generation time and current simulation...
Definition: hhn.py:539
pyclustering.utils
Utils that are used by modules of pyclustering.
Definition: __init__.py:1
pyclustering.nnet.hhn.hhn_network.__update_central_neurons
def __update_central_neurons(self, t, next_cn_membrane, next_cn_active_sodium, next_cn_inactive_sodium, next_cn_active_potassium)
Update of central neurons in line with new values of current in channels.
Definition: hhn.py:417
pyclustering.nnet.hhn.hhn_parameters.nu
nu
Intrinsic noise.
Definition: hhn.py:41
pyclustering.nnet.hhn.hhn_parameters.vL
vL
Reverse potential of leakage current [mV].
Definition: hhn.py:60
pyclustering.nnet.hhn.hhn_parameters.gL
gL
Maximal conductivity for leakage current.
Definition: hhn.py:50
pyclustering.nnet.hhn.hhn_network._active_cond_sodium
_active_cond_sodium
Definition: hhn.py:227
pyclustering.nnet.hhn.hhn_parameters.threshold
threshold
Threshold of the membrane potential that should exceeded by oscillator to be considered as an active.
Definition: hhn.py:107
pyclustering.nnet.hhn.hhn_parameters.w3
w3
Strength of the synaptic connection from CN2 to PN.
Definition: hhn.py:100
pyclustering.nnet.hhn.hhn_network._link_weight3
_link_weight3
Definition: hhn.py:232
pyclustering.nnet.hhn.hhn_network.__ccore_hhn_pointer
__ccore_hhn_pointer
Definition: hhn.py:218
pyclustering.nnet.hhn.central_element.membrane_potential
membrane_potential
Membrane potential of cenral neuron (V).
Definition: hhn.py:128
pyclustering.nnet.hhn.hhn_network._link_activation_time
_link_activation_time
Definition: hhn.py:230