Model of phase oscillatory network for pattern recognition that is based on the Kuramoto model. More...
Public Member Functions | |
def | __init__ (self, num_osc, increase_strength1, increase_strength2, ccore=True) |
Constructor of oscillatory network for pattern recognition based on Kuramoto model. More... | |
def | __del__ (self) |
Default destructor of syncpr. | |
def | __len__ (self) |
Returns size of the network. | |
def | train (self, samples) |
Trains syncpr network using Hebbian rule for adjusting strength of connections between oscillators during training. More... | |
def | simulate (self, steps, time, pattern, solution=solve_type.RK4, collect_dynamic=True) |
Performs static simulation of syncpr oscillatory network. More... | |
def | simulate_dynamic (self, pattern, order=0.998, solution=solve_type.RK4, collect_dynamic=False, step=0.1, int_step=0.01, threshold_changes=0.0000001) |
Performs dynamic simulation of the network until stop condition is not reached. More... | |
def | simulate_static (self, steps, time, pattern, solution=solve_type.FAST, collect_dynamic=False) |
Performs static simulation of syncpr oscillatory network. More... | |
def | memory_order (self, pattern) |
Calculates function of the memorized pattern. More... | |
Public Member Functions inherited from pyclustering.nnet.sync.sync_network | |
def | __init__ (self, num_osc, weight=1, frequency=0, type_conn=conn_type.ALL_TO_ALL, representation=conn_represent.MATRIX, initial_phases=initial_type.RANDOM_GAUSSIAN, ccore=True) |
Constructor of oscillatory network is based on Kuramoto model. More... | |
def | __del__ (self) |
Destructor of oscillatory network is based on Kuramoto model. | |
def | sync_order (self) |
Calculates current level of global synchorization (order parameter) in the network. More... | |
def | sync_local_order (self) |
Calculates current level of local (partial) synchronization in the network. More... | |
def | simulate (self, steps, time, solution=solve_type.FAST, collect_dynamic=True) |
Performs static simulation of Sync oscillatory network. More... | |
def | simulate_dynamic (self, order=0.998, solution=solve_type.FAST, collect_dynamic=False, step=0.1, int_step=0.01, threshold_changes=0.0000001) |
Performs dynamic simulation of the network until stop condition is not reached. More... | |
def | simulate_static (self, steps, time, solution=solve_type.FAST, collect_dynamic=False) |
Performs static simulation of oscillatory network. More... | |
def | get_neighbors (self, index) |
Finds neighbors of the oscillator with specified index. More... | |
def | has_connection (self, i, j) |
Returns True if there is connection between i and j oscillators and False - if connection doesn't exist. More... | |
Public Member Functions inherited from pyclustering.nnet.network | |
def | height (self) |
Height of the network grid (that is defined by amout of oscillators in each column), this value is zero in case of non-grid structure. More... | |
def | width (self) |
Width of the network grid, this value is zero in case of non-grid structure. More... | |
def | structure (self) |
Type of network structure that is used for connecting oscillators. | |
def | __init__ (self, num_osc, type_conn=conn_type.ALL_TO_ALL, conn_repr=conn_represent.MATRIX, height=None, width=None) |
Constructor of the network. More... | |
def | __len__ (self) |
Returns size of the network that is defined by amount of oscillators. | |
def | has_connection (self, i, j) |
Returns True if there is connection between i and j oscillators and False - if connection doesn't exist. More... | |
def | set_connection (self, i, j) |
Couples two specified oscillators in the network with dynamic connections. More... | |
def | get_neighbors (self, index) |
Finds neighbors of the oscillator with specified index. More... | |
Model of phase oscillatory network for pattern recognition that is based on the Kuramoto model.
The model uses second-order and third-order modes of the Fourier components.
CCORE option can be used to use the pyclustering core - C/C++ shared library for processing that significantly increases performance.
Example:
def pyclustering.nnet.syncpr.syncpr.__init__ | ( | self, | |
num_osc, | |||
increase_strength1, | |||
increase_strength2, | |||
ccore = True |
|||
) |
Constructor of oscillatory network for pattern recognition based on Kuramoto model.
[in] | num_osc | (uint): Number of oscillators in the network. |
[in] | increase_strength1 | (double): Parameter for increasing strength of the second term of the Fourier component. |
[in] | increase_strength2 | (double): Parameter for increasing strength of the third term of the Fourier component. |
[in] | ccore | (bool): If True simulation is performed by CCORE library (C++ implementation of pyclustering). |
def pyclustering.nnet.syncpr.syncpr.memory_order | ( | self, | |
pattern | |||
) |
Calculates function of the memorized pattern.
Throws exception if length of pattern is not equal to size of the network or if it consists feature with value that are not equal to [-1; 1].
[in] | pattern | (list): Pattern for recognition represented by list of features that are equal to [-1; 1]. |
def pyclustering.nnet.syncpr.syncpr.simulate | ( | self, | |
steps, | |||
time, | |||
pattern, | |||
solution = solve_type.RK4 , |
|||
collect_dynamic = True |
|||
) |
Performs static simulation of syncpr oscillatory network.
In other words network performs pattern recognition during simulation.
[in] | steps | (uint): Number steps of simulations during simulation. |
[in] | time | (double): Time of simulation. |
[in] | pattern | (list): Pattern for recognition represented by list of features that are equal to [-1; 1]. |
[in] | solution | (solve_type): Type of solver that should be used for simulation. |
[in] | collect_dynamic | (bool): If True - returns whole dynamic of oscillatory network, otherwise returns only last values of dynamics. |
def pyclustering.nnet.syncpr.syncpr.simulate_dynamic | ( | self, | |
pattern, | |||
order = 0.998 , |
|||
solution = solve_type.RK4 , |
|||
collect_dynamic = False , |
|||
step = 0.1 , |
|||
int_step = 0.01 , |
|||
threshold_changes = 0.0000001 |
|||
) |
Performs dynamic simulation of the network until stop condition is not reached.
In other words network performs pattern recognition during simulation. Stop condition is defined by input argument 'order' that represents memory order, but process of simulation can be stopped if convergance rate is low whose threshold is defined by the argument 'threshold_changes'.
[in] | pattern | (list): Pattern for recognition represented by list of features that are equal to [-1; 1]. |
[in] | order | (double): Order of process synchronization, distributed 0..1. |
[in] | solution | (solve_type): Type of solution. |
[in] | collect_dynamic | (bool): If True - returns whole dynamic of oscillatory network, otherwise returns only last values of dynamics. |
[in] | step | (double): Time step of one iteration of simulation. |
[in] | int_step | (double): Integration step, should be less than step. |
[in] | threshold_changes | (double): Additional stop condition that helps prevent infinite simulation, defines limit of changes of oscillators between current and previous steps. |
def pyclustering.nnet.syncpr.syncpr.simulate_static | ( | self, | |
steps, | |||
time, | |||
pattern, | |||
solution = solve_type.FAST , |
|||
collect_dynamic = False |
|||
) |
Performs static simulation of syncpr oscillatory network.
In other words network performs pattern recognition during simulation.
[in] | steps | (uint): Number steps of simulations during simulation. |
[in] | time | (double): Time of simulation. |
[in] | pattern | (list): Pattern for recognition represented by list of features that are equal to [-1; 1]. |
[in] | solution | (solve_type): Type of solution. |
[in] | collect_dynamic | (bool): If True - returns whole dynamic of oscillatory network, otherwise returns only last values of dynamics. |
def pyclustering.nnet.syncpr.syncpr.train | ( | self, | |
samples | |||
) |