pyclustering.nnet.cnn.cnn_network Class Reference

Chaotic neural network based on system of logistic map where clustering phenomenon can be observed. More...

Public Member Functions

def __init__ (self, num_osc, conn_type=type_conn.ALL_TO_ALL, amount_neighbors=3)
 Constructor of chaotic neural network. More...
 
def __len__ (self)
 Returns size of the chaotic neural network that is defined by amount of neurons.
 
def simulate (self, steps, stimulus)
 Simulates chaotic neural network with extrnal stimulus during specified steps. More...
 
def show_network (self)
 Shows structure of the network: neurons and connections between them.
 

Detailed Description

Chaotic neural network based on system of logistic map where clustering phenomenon can be observed.

Here is an example how to perform cluster analysis using chaotic neural network:

from pyclustering.cluster import cluster_visualizer
from pyclustering.samples.definitions import SIMPLE_SAMPLES
from pyclustering.utils import read_sample
from pyclustering.nnet.cnn import cnn_network, cnn_visualizer
# Load stimulus from file.
stimulus = read_sample(SIMPLE_SAMPLES.SAMPLE_SIMPLE3)
# Create chaotic neural network, amount of neurons should be equal to amount of stimulus.
network_instance = cnn_network(len(stimulus))
# Perform simulation during 100 steps.
steps = 100
output_dynamic = network_instance.simulate(steps, stimulus)
# Display output dynamic of the network.
cnn_visualizer.show_output_dynamic(output_dynamic)
# Display dynamic matrix and observation matrix to show clustering phenomenon.
cnn_visualizer.show_dynamic_matrix(output_dynamic)
cnn_visualizer.show_observation_matrix(output_dynamic)
# Visualize clustering results.
clusters = output_dynamic.allocate_sync_ensembles(10)
visualizer = cluster_visualizer()
visualizer.append_clusters(clusters, stimulus)
visualizer.show()

Definition at line 238 of file cnn.py.

Constructor & Destructor Documentation

◆ __init__()

def pyclustering.nnet.cnn.cnn_network.__init__ (   self,
  num_osc,
  conn_type = type_conn.ALL_TO_ALL,
  amount_neighbors = 3 
)

Constructor of chaotic neural network.

Parameters
[in]num_osc(uint): Amount of neurons in the chaotic neural network.
[in]conn_type(type_conn): CNN type connection for the network.
[in]amount_neighbors(uint): k-nearest neighbors for calculation scaling constant of weights.

Definition at line 274 of file cnn.py.

Member Function Documentation

◆ simulate()

def pyclustering.nnet.cnn.cnn_network.simulate (   self,
  steps,
  stimulus 
)

Simulates chaotic neural network with extrnal stimulus during specified steps.

Stimulus are considered as a coordinates of neurons and in line with that weights are initialized.

Parameters
[in]steps(uint): Amount of steps for simulation.
[in]stimulus(list): Stimulus that are used for simulation.
Returns
(cnn_dynamic) Output dynamic of the chaotic neural network.

Definition at line 306 of file cnn.py.


The documentation for this class was generated from the following file: