pyclustering  0.10.1
pyclustring is a Python, C++ data mining library.
legion.py
1 """!
2 
3 @brief Neural Network: Local Excitatory Global Inhibitory Oscillatory Network (LEGION)
4 @details Implementation based on paper @cite article::legion::1, @cite article::legion::2.
5 
6 @authors Andrei Novikov (pyclustering@yandex.ru)
7 @date 2014-2020
8 @copyright BSD-3-Clause
9 
10 """
11 
12 import numpy
13 import random
14 
15 import pyclustering.core.legion_wrapper as wrapper
16 
17 from pyclustering.core.wrapper import ccore_library
18 
19 from pyclustering.nnet import *
20 
21 from pyclustering.utils import heaviside, allocate_sync_ensembles
22 
23 from scipy.integrate import odeint
24 
25 
27  """!
28  @brief Describes parameters of LEGION.
29  @details Contained parameters affect on output dynamic of each oscillator of the network.
30 
31  @see legion_network
32 
33  """
34 
35  def __init__(self):
36  """!
37  @brief Default constructor of parameters for LEGION (local excitatory global inhibitory oscillatory network).
38  @details Constructor initializes parameters by default non-zero values that can be
39  used for simple simulation.
40  """
41 
42 
43  self.eps = 0.02;
44 
45 
46  self.alpha = 0.005;
47 
48 
49  self.gamma = 6.0;
50 
51 
52  self.betta = 0.1;
53 
54 
55  self.lamda = 0.1;
56 
57 
58  self.teta = 0.9;
59 
60 
61  self.teta_x = -1.5;
62 
63 
64  self.teta_p = 1.5;
65 
66 
67  self.teta_xz = 0.1;
68 
69 
70  self.teta_zx = 0.1;
71 
72 
73  self.T = 2.0;
74 
75 
76  self.mu = 0.01;
77 
78 
79  self.Wz = 1.5;
80 
81 
82  self.Wt = 8.0;
83 
84 
85  self.fi = 3.0;
86 
87 
88  self.ro = 0.02;
89 
90 
91  self.I = 0.2;
92 
93 
94  self.ENABLE_POTENTIONAL = True;
95 
96 
98  """!
99  @brief Represents output dynamic of LEGION.
100 
101  """
102 
103  @property
104  def output(self):
105  """!
106  @brief Returns output dynamic of the network.
107 
108  """
109  if (self.__ccore_legion_dynamic_pointer is not None):
110  return wrapper.legion_dynamic_get_output(self.__ccore_legion_dynamic_pointer);
111 
112  return self.__output;
113 
114 
115  @property
116  def inhibitor(self):
117  """!
118  @brief Returns output dynamic of the global inhibitor of the network.
119 
120  """
121 
122  if (self.__ccore_legion_dynamic_pointer is not None):
123  return wrapper.legion_dynamic_get_inhibitory_output(self.__ccore_legion_dynamic_pointer);
124 
125  return self.__inhibitor;
126 
127 
128  @property
129  def time(self):
130  """!
131  @brief Returns simulation time.
132 
133  """
134  if (self.__ccore_legion_dynamic_pointer is not None):
135  return wrapper.legion_dynamic_get_time(self.__ccore_legion_dynamic_pointer);
136 
137  return list(range(len(self)));
138 
139 
140  def __init__(self, output, inhibitor, time, ccore = None):
141  """!
142  @brief Constructor of legion dynamic.
143 
144  @param[in] output (list): Output dynamic of the network represented by excitatory values of oscillators.
145  @param[in] inhibitor (list): Output dynamic of the global inhibitor of the network.
146  @param[in] time (list): Simulation time.
147  @param[in] ccore (POINTER): Pointer to CCORE legion_dynamic. If it is specified then others arguments can be omitted.
148 
149  """
150 
151  self.__output = output;
152  self.__inhibitor = inhibitor;
153  self._time = time;
154 
155  self.__ccore_legion_dynamic_pointer = ccore;
156 
157 
158  def __del__(self):
159  """!
160  @brief Destructor of the dynamic of the legion network.
161 
162  """
163  if (self.__ccore_legion_dynamic_pointer is not None):
164  wrapper.legion_dynamic_destroy(self.__ccore_legion_dynamic_pointer);
165 
166 
167  def __len__(self):
168  """!
169  @brief Returns length of output dynamic.
170 
171  """
172  if (self.__ccore_legion_dynamic_pointer is not None):
173  return wrapper.legion_dynamic_get_size(self.__ccore_legion_dynamic_pointer);
174 
175  return len(self._time);
176 
177 
178  def allocate_sync_ensembles(self, tolerance = 0.1):
179  """!
180  @brief Allocate clusters in line with ensembles of synchronous oscillators where each synchronous ensemble corresponds to only one cluster.
181 
182  @param[in] tolerance (double): Maximum error for allocation of synchronous ensemble oscillators.
183 
184  @return (list) Grours of indexes of synchronous oscillators, for example, [ [index_osc1, index_osc3], [index_osc2], [index_osc4, index_osc5] ].
185 
186  """
187 
188  if (self.__ccore_legion_dynamic_pointer is not None):
189  self.__output = wrapper.legion_dynamic_get_output(self.__ccore_legion_dynamic_pointer);
190 
191  return allocate_sync_ensembles(self.__output, tolerance);
192 
193 
195  """!
196  @brief Local excitatory global inhibitory oscillatory network (LEGION) that uses relaxation oscillator
197  based on Van der Pol model.
198 
199  @details The model uses global inhibitor to de-synchronize synchronous ensembles of oscillators.
200 
201  CCORE option can be used to use the pyclustering core - C/C++ shared library for processing that significantly increases performance.
202 
203  Example:
204  @code
205  # Create parameters of the network
206  parameters = legion_parameters();
207  parameters.Wt = 4.0;
208 
209  # Create stimulus
210  stimulus = [1, 1, 0, 0, 0, 1, 1, 1];
211 
212  # Create the network (use CCORE for fast solving)
213  net = legion_network(len(stimulus), parameters, conn_type.GRID_FOUR, ccore = True);
214 
215  # Simulate network - result of simulation is output dynamic of the network
216  output_dynamic = net.simulate(1000, 750, stimulus);
217 
218  # Draw output dynamic
219  draw_dynamics(output_dynamic.time, output_dynamic.output, x_title = "Time", y_title = "x(t)");
220  @endcode
221 
222  """
223 
224  def __init__(self, num_osc, parameters = None, type_conn = conn_type.ALL_TO_ALL, type_conn_represent = conn_represent.MATRIX, ccore = True):
225  """!
226  @brief Constructor of oscillatory network LEGION (local excitatory global inhibitory oscillatory network).
227 
228  @param[in] num_osc (uint): Number of oscillators in the network.
229  @param[in] parameters (legion_parameters): Parameters of the network that are defined by structure 'legion_parameters'.
230  @param[in] type_conn (conn_type): Type of connection between oscillators in the network.
231  @param[in] type_conn_represent (conn_represent): Internal representation of connection in the network: matrix or list.
232  @param[in] ccore (bool): If True then all interaction with object will be performed via CCORE library (C++ implementation of pyclustering).
233 
234  """
235 
236  self._params = None; # parameters of the network
237 
238  self.__ccore_legion_pointer = None;
239  self._params = parameters;
240 
241  # set parameters of the network
242  if (self._params is None):
243  self._params = legion_parameters();
244 
245  if ( (ccore is True) and ccore_library.workable() ):
246  self.__ccore_legion_pointer = wrapper.legion_create(num_osc, type_conn, self._params);
247 
248  else:
249  super().__init__(num_osc, type_conn, type_conn_represent);
250 
251  # initial states
252  self._excitatory = [ random.random() for _ in range(self._num_osc) ];
253  self._inhibitory = [0.0] * self._num_osc;
254  self._potential = [0.0] * self._num_osc;
255 
256  self._coupling_term = None; # coupling term of each oscillator
257  self._global_inhibitor = 0; # value of global inhibitory
258  self._stimulus = None; # stimulus of each oscillator
259 
260  self._dynamic_coupling = None; # dynamic connection between oscillators
261  self._coupling_term = [0.0] * self._num_osc;
262  self._buffer_coupling_term = [0.0] * self._num_osc;
263 
264  # generate first noises
265  self._noise = [random.random() * self._params.ro for i in range(self._num_osc)];
266 
267 
268  def __del__(self):
269  """!
270  @brief Default destructor of LEGION.
271 
272  """
273  if (self.__ccore_legion_pointer is not None):
274  wrapper.legion_destroy(self.__ccore_legion_pointer);
275  self.__ccore_legion_pointer = None;
276 
277 
278  def __len__(self):
279  """!
280  @brief (uint) Returns size of LEGION.
281 
282  """
283 
284  if (self.__ccore_legion_pointer is not None):
285  return wrapper.legion_get_size(self.__ccore_legion_pointer);
286 
287  return self._num_osc;
288 
289 
290  def __create_stimulus(self, stimulus):
291  """!
292  @brief Create stimulus for oscillators in line with stimulus map and parameters.
293 
294  @param[in] stimulus (list): Stimulus for oscillators that is represented by list, number of stimulus should be equal number of oscillators.
295 
296  """
297 
298  if (len(stimulus) != self._num_osc):
299  raise NameError("Number of stimulus should be equal number of oscillators in the network.");
300  else:
301  self._stimulus = [];
302 
303  for val in stimulus:
304  if (val > 0): self._stimulus.append(self._params.I);
305  else: self._stimulus.append(0);
306 
307 
308  def __create_dynamic_connections(self):
309  """!
310  @brief Create dynamic connection in line with input stimulus.
311 
312  """
313 
314  if self._stimulus is None:
315  raise NameError("Stimulus should initialed before creation of the dynamic connections in the network.");
316 
317  self._dynamic_coupling = [ [0] * self._num_osc for i in range(self._num_osc)];
318 
319  for i in range(self._num_osc):
320  neighbors = self.get_neighbors(i)
321 
322  if (len(neighbors) > 0) and (self._stimulus[i] > 0):
323  number_stimulated_neighbors = 0.0
324  for j in neighbors:
325  if self._stimulus[j] > 0:
326  number_stimulated_neighbors += 1.0
327 
328  if (number_stimulated_neighbors > 0):
329  dynamic_weight = self._params.Wt / number_stimulated_neighbors
330 
331  for j in neighbors:
332  self._dynamic_coupling[i][j] = dynamic_weight
333 
334 
335  def simulate(self, steps, time, stimulus, solution=solve_type.RK4, collect_dynamic=True):
336  """!
337  @brief Performs static simulation of LEGION oscillatory network.
338 
339  @param[in] steps (uint): Number steps of simulations during simulation.
340  @param[in] time (double): Time of simulation.
341  @param[in] stimulus (list): Stimulus for oscillators, number of stimulus should be equal to number of oscillators,
342  example of stimulus for 5 oscillators [0, 0, 1, 1, 0], value of stimulus is defined by parameter 'I'.
343  @param[in] solution (solve_type): Method that is used for differential equation.
344  @param[in] collect_dynamic (bool): If True - returns whole dynamic of oscillatory network, otherwise returns only last values of dynamics.
345 
346  @return (list) Dynamic of oscillatory network. If argument 'collect_dynamic' = True, than return dynamic for the whole simulation time,
347  otherwise returns only last values (last step of simulation) of dynamic.
348 
349  """
350 
351  if self.__ccore_legion_pointer is not None:
352  pointer_dynamic = wrapper.legion_simulate(self.__ccore_legion_pointer, steps, time, solution, collect_dynamic, stimulus)
353  return legion_dynamic(None, None, None, pointer_dynamic)
354 
355  # Check solver before simulation
356  if solution == solve_type.FAST:
357  raise NameError("Solver FAST is not support due to low accuracy that leads to huge error.")
358 
359  elif solution == solve_type.RKF45:
360  raise NameError("Solver RKF45 is not support in python version. RKF45 is supported in CCORE implementation.")
361 
362  # set stimulus
363  self.__create_stimulus(stimulus)
364 
365  # calculate dynamic weights
367 
368  dyn_exc = None
369  dyn_time = None
370  dyn_ginh = None
371 
372  # Store only excitatory of the oscillator
373  if collect_dynamic is True:
374  dyn_exc = []
375  dyn_time = []
376  dyn_ginh = []
377 
378  step = time / steps
379  int_step = step / 10.0
380 
381  for t in numpy.arange(step, time + step, step):
382  # update states of oscillators
383  self._calculate_states(solution, t, step, int_step)
384 
385  # update states of oscillators
386  if collect_dynamic is True:
387  dyn_exc.append(self._excitatory)
388  dyn_time.append(t)
389  dyn_ginh.append(self._global_inhibitor)
390  else:
391  dyn_exc = self._excitatory
392  dyn_time = t
393  dyn_ginh = self._global_inhibitor
394 
395  return legion_dynamic(dyn_exc, dyn_ginh, dyn_time);
396 
397 
398  def _calculate_states(self, solution, t, step, int_step):
399  """!
400  @brief Calculates new state of each oscillator in the network.
401 
402  @param[in] solution (solve_type): Type solver of the differential equation.
403  @param[in] t (double): Current time of simulation.
404  @param[in] step (double): Step of solution at the end of which states of oscillators should be calculated.
405  @param[in] int_step (double): Step differentiation that is used for solving differential equation.
406 
407  """
408 
409  next_excitatory = [0.0] * self._num_osc;
410  next_inhibitory = [0.0] * self._num_osc;
411 
412  next_potential = [];
413  if (self._params.ENABLE_POTENTIONAL is True):
414  next_potential = [0.0] * self._num_osc;
415 
416  # Update states of oscillators
417  for index in range (0, self._num_osc, 1):
418  if (self._params.ENABLE_POTENTIONAL is True):
419  result = odeint(self._legion_state, [self._excitatory[index], self._inhibitory[index], self._potential[index]], numpy.arange(t - step, t, int_step), (index , ));
420  [ next_excitatory[index], next_inhibitory[index], next_potential[index] ] = result[len(result) - 1][0:3];
421 
422  else:
423  result = odeint(self._legion_state_simplify, [self._excitatory[index], self._inhibitory[index] ], numpy.arange(t - step, t, int_step), (index , ));
424  [ next_excitatory[index], next_inhibitory[index] ] = result[len(result) - 1][0:2];
425 
426  # Update coupling term
427  neighbors = self.get_neighbors(index);
428 
429  coupling = 0
430  for index_neighbor in neighbors:
431  coupling += self._dynamic_coupling[index][index_neighbor] * heaviside(self._excitatory[index_neighbor] - self._params.teta_x);
432 
433  self._buffer_coupling_term[index] = coupling - self._params.Wz * heaviside(self._global_inhibitor - self._params.teta_xz);
434 
435  # Update state of global inhibitory
436  result = odeint(self._global_inhibitor_state, self._global_inhibitor, numpy.arange(t - step, t, int_step), (None, ));
437  self._global_inhibitor = result[len(result) - 1][0];
438 
439  self._noise = [random.random() * self._params.ro for i in range(self._num_osc)];
440  self._coupling_term = self._buffer_coupling_term[:];
441  self._inhibitory = next_inhibitory[:];
442  self._excitatory = next_excitatory[:];
443 
444  if (self._params.ENABLE_POTENTIONAL is True):
445  self._potential = next_potential[:];
446 
447 
448 
449  def _global_inhibitor_state(self, z, t, argv):
450  """!
451  @brief Returns new value of global inhibitory
452 
453  @param[in] z (dobule): Current value of inhibitory.
454  @param[in] t (double): Current time of simulation.
455  @param[in] argv (tuple): It's not used, can be ignored.
456 
457  @return (double) New value if global inhibitory (not assign).
458 
459  """
460 
461  sigma = 0.0;
462 
463  for x in self._excitatory:
464  if (x > self._params.teta_zx):
465  sigma = 1.0;
466  break;
467 
468  return self._params.fi * (sigma - z);
469 
470 
471  def _legion_state_simplify(self, inputs, t, argv):
472  """!
473  @brief Returns new values of excitatory and inhibitory parts of oscillator of oscillator.
474  @details Simplify model doesn't consider oscillator potential.
475 
476  @param[in] inputs (list): Initial values (current) of oscillator [excitatory, inhibitory].
477  @param[in] t (double): Current time of simulation.
478  @param[in] argv (uint): Extra arguments that are not used for integration - index of oscillator.
479 
480  @return (list) New values of excitatoty and inhibitory part of oscillator (not assign).
481 
482  """
483 
484  index = argv;
485 
486  x = inputs[0]; # excitatory
487  y = inputs[1]; # inhibitory
488 
489  dx = 3.0 * x - x ** 3.0 + 2.0 - y + self._stimulus[index] + self._coupling_term[index] + self._noise[index];
490  dy = self._params.eps * (self._params.gamma * (1.0 + math.tanh(x / self._params.betta)) - y);
491 
492  neighbors = self.get_neighbors(index);
493  potential = 0.0;
494 
495  for index_neighbor in neighbors:
496  potential += self._params.T * heaviside(self._excitatory[index_neighbor] - self._params.teta_x);
497 
498  return [dx, dy];
499 
500 
501  def _legion_state(self, inputs, t, argv):
502  """!
503  @brief Returns new values of excitatory and inhibitory parts of oscillator and potential of oscillator.
504 
505  @param[in] inputs (list): Initial values (current) of oscillator [excitatory, inhibitory, potential].
506  @param[in] t (double): Current time of simulation.
507  @param[in] argv (uint): Extra arguments that are not used for integration - index of oscillator.
508 
509  @return (list) New values of excitatoty and inhibitory part of oscillator and new value of potential (not assign).
510 
511  """
512 
513  index = argv;
514 
515  x = inputs[0]; # excitatory
516  y = inputs[1]; # inhibitory
517  p = inputs[2]; # potential
518 
519  potential_influence = heaviside(p + math.exp(-self._params.alpha * t) - self._params.teta);
520 
521  dx = 3.0 * x - x ** 3.0 + 2.0 - y + self._stimulus[index] * potential_influence + self._coupling_term[index] + self._noise[index];
522  dy = self._params.eps * (self._params.gamma * (1.0 + math.tanh(x / self._params.betta)) - y);
523 
524  neighbors = self.get_neighbors(index);
525  potential = 0.0;
526 
527  for index_neighbor in neighbors:
528  potential += self._params.T * heaviside(self._excitatory[index_neighbor] - self._params.teta_x);
529 
530  dp = self._params.lamda * (1.0 - p) * heaviside(potential - self._params.teta_p) - self._params.mu * p;
531 
532  return [dx, dy, dp];
pyclustering.nnet.legion.legion_network.__init__
def __init__(self, num_osc, parameters=None, type_conn=conn_type.ALL_TO_ALL, type_conn_represent=conn_represent.MATRIX, ccore=True)
Constructor of oscillatory network LEGION (local excitatory global inhibitory oscillatory network).
Definition: legion.py:224
pyclustering.nnet.legion.legion_parameters.fi
fi
Rate at which the global inhibitor reacts to the stimulation from the oscillator network.
Definition: legion.py:85
pyclustering.nnet.legion.legion_parameters.betta
betta
Coefficient that affects on intrinsic inhibitor of each oscillator.
Definition: legion.py:52
pyclustering.nnet.legion.legion_parameters.ro
ro
Multiplier of oscillator noise.
Definition: legion.py:88
pyclustering.nnet.legion.legion_network._legion_state
def _legion_state(self, inputs, t, argv)
Returns new values of excitatory and inhibitory parts of oscillator and potential of oscillator.
Definition: legion.py:501
pyclustering.nnet.legion.legion_network._coupling_term
_coupling_term
Definition: legion.py:256
pyclustering.nnet.legion.legion_parameters
Describes parameters of LEGION.
Definition: legion.py:26
pyclustering.nnet.legion.legion_parameters.I
I
Value of external stimulus.
Definition: legion.py:91
pyclustering.nnet.network._num_osc
int _num_osc
Definition: __init__.py:88
pyclustering.nnet.legion.legion_network._legion_state_simplify
def _legion_state_simplify(self, inputs, t, argv)
Returns new values of excitatory and inhibitory parts of oscillator of oscillator.
Definition: legion.py:471
pyclustering.nnet.legion.legion_dynamic.__inhibitor
__inhibitor
Definition: legion.py:152
pyclustering.nnet.legion.legion_network._potential
_potential
Definition: legion.py:254
pyclustering.nnet.legion.legion_network._global_inhibitor_state
def _global_inhibitor_state(self, z, t, argv)
Returns new value of global inhibitory.
Definition: legion.py:449
pyclustering.nnet.legion.legion_dynamic.__init__
def __init__(self, output, inhibitor, time, ccore=None)
Constructor of legion dynamic.
Definition: legion.py:140
pyclustering.nnet.legion.legion_network.__del__
def __del__(self)
Default destructor of LEGION.
Definition: legion.py:268
pyclustering.nnet.legion.legion_parameters.teta_zx
teta_zx
Threshold that should be exceeded to affect on a oscillator by the global inhibitor.
Definition: legion.py:70
pyclustering.nnet.legion.legion_dynamic.inhibitor
def inhibitor(self)
Returns output dynamic of the global inhibitor of the network.
Definition: legion.py:116
pyclustering.nnet.legion.legion_parameters.lamda
lamda
Scale coefficient that is used by potential, should be greater than 0.
Definition: legion.py:55
pyclustering.nnet.legion.legion_dynamic.__del__
def __del__(self)
Destructor of the dynamic of the legion network.
Definition: legion.py:158
pyclustering.nnet.legion.legion_network._stimulus
_stimulus
Definition: legion.py:258
pyclustering.nnet.legion.legion_network._global_inhibitor
_global_inhibitor
Definition: legion.py:257
pyclustering.nnet.legion.legion_parameters.Wz
Wz
Weight of global inhibitory connections.
Definition: legion.py:79
pyclustering.nnet.legion.legion_parameters.alpha
alpha
Coefficient is chosen to be on the same order of magnitude as 'eps'.
Definition: legion.py:46
pyclustering.nnet.legion.legion_network.simulate
def simulate(self, steps, time, stimulus, solution=solve_type.RK4, collect_dynamic=True)
Performs static simulation of LEGION oscillatory network.
Definition: legion.py:335
pyclustering.nnet.legion.legion_dynamic.time
def time(self)
Returns simulation time.
Definition: legion.py:129
pyclustering.nnet.legion.legion_network.__create_stimulus
def __create_stimulus(self, stimulus)
Create stimulus for oscillators in line with stimulus map and parameters.
Definition: legion.py:290
pyclustering.nnet.legion.legion_network._excitatory
_excitatory
Definition: legion.py:252
pyclustering.nnet.legion.legion_parameters.teta_xz
teta_xz
Threshold that should be exceeded by any oscillator to activate global inhibitor.
Definition: legion.py:67
pyclustering.nnet.legion.legion_parameters.T
T
Weight of permanent connections.
Definition: legion.py:73
pyclustering.nnet.network
Common network description that consists of information about oscillators and connection between them...
Definition: __init__.py:82
pyclustering.nnet.network.get_neighbors
def get_neighbors(self, index)
Finds neighbors of the oscillator with specified index.
Definition: __init__.py:394
pyclustering.nnet.legion.legion_parameters.ENABLE_POTENTIONAL
ENABLE_POTENTIONAL
Defines whether to use potentional of oscillator or not.
Definition: legion.py:94
pyclustering.nnet.legion.legion_parameters.__init__
def __init__(self)
Default constructor of parameters for LEGION (local excitatory global inhibitory oscillatory network)...
Definition: legion.py:35
pyclustering.nnet.legion.legion_dynamic.__len__
def __len__(self)
Returns length of output dynamic.
Definition: legion.py:167
pyclustering.nnet.legion.legion_parameters.Wt
Wt
Total dynamic weights to a single oscillator from neighbors.
Definition: legion.py:82
pyclustering.nnet.legion.legion_network._buffer_coupling_term
_buffer_coupling_term
Definition: legion.py:262
pyclustering.nnet.legion.legion_dynamic._time
_time
Definition: legion.py:153
pyclustering.nnet.legion.legion_network.__create_dynamic_connections
def __create_dynamic_connections(self)
Create dynamic connection in line with input stimulus.
Definition: legion.py:308
pyclustering.nnet.legion.legion_network._dynamic_coupling
_dynamic_coupling
Definition: legion.py:260
pyclustering.nnet.legion.legion_dynamic.__ccore_legion_dynamic_pointer
__ccore_legion_dynamic_pointer
Definition: legion.py:155
pyclustering.nnet.legion.legion_network._noise
_noise
Definition: legion.py:265
pyclustering.nnet.legion.legion_dynamic.output
def output(self)
Returns output dynamic of the network.
Definition: legion.py:104
pyclustering.nnet.legion.legion_network.__len__
def __len__(self)
(uint) Returns size of LEGION.
Definition: legion.py:278
pyclustering.nnet
Neural and oscillatory network module. Consists of models of bio-inspired networks.
Definition: __init__.py:1
pyclustering.nnet.legion.legion_network._params
_params
Definition: legion.py:236
pyclustering.nnet.legion.legion_dynamic
Represents output dynamic of LEGION.
Definition: legion.py:97
pyclustering.nnet.legion.legion_parameters.teta
teta
Threshold that should be exceeded by a potential to switch on potential.
Definition: legion.py:58
pyclustering.nnet.legion.legion_network.__ccore_legion_pointer
__ccore_legion_pointer
Definition: legion.py:238
pyclustering.nnet.legion.legion_parameters.teta_p
teta_p
Threshold that should be exceeded to activate potential.
Definition: legion.py:64
pyclustering.nnet.legion.legion_parameters.teta_x
teta_x
Threshold that should be exceeded by a single oscillator to affect its neighbors.
Definition: legion.py:61
pyclustering.nnet.legion.legion_network._inhibitory
_inhibitory
Definition: legion.py:253
pyclustering.nnet.legion.legion_parameters.gamma
gamma
Coefficient that is used to control the ratio of the times that the solution spends in these two phas...
Definition: legion.py:49
pyclustering.nnet.legion.legion_parameters.mu
mu
Defines time scaling of relaxing of oscillator potential.
Definition: legion.py:76
pyclustering.nnet.legion.legion_dynamic.allocate_sync_ensembles
def allocate_sync_ensembles(self, tolerance=0.1)
Allocate clusters in line with ensembles of synchronous oscillators where each synchronous ensemble c...
Definition: legion.py:178
pyclustering.nnet.legion.legion_network
Local excitatory global inhibitory oscillatory network (LEGION) that uses relaxation oscillator based...
Definition: legion.py:194
pyclustering.utils
Utils that are used by modules of pyclustering.
Definition: __init__.py:1
pyclustering.nnet.legion.legion_network._calculate_states
def _calculate_states(self, solution, t, step, int_step)
Calculates new state of each oscillator in the network.
Definition: legion.py:398
pyclustering.nnet.legion.legion_parameters.eps
eps
Coefficient that affects intrinsic inhibitor of each oscillator.
Definition: legion.py:43
pyclustering.nnet.legion.legion_dynamic.__output
__output
Definition: legion.py:151