Pregunta

How does one represent nodes in a 2-D neural network?

In self-organizing neural networks(Kohonen map) how is weight of node related to co-ordinate in 2D network. Does the map self-organize based on co-ordinate of location or weight at that location.

I am trying to implement the algorithm shown below using MPI

Distributed Localization Algorithm: Input: N, the number of nodes; G = (g_ij), knowledge of nearest neighbors Output: node positions p_i = (x_i,y_j), i,j = 1,......,N

// Initialization of the node locations
   for all nodes i do
     p_i = (x_i,y_j) = random();
   end for

// Main Loop
   for t = 1 to N_iter do
     p = (x,y) = random()
     for all network nodes i, update its location
       for j=1 to N
         x_i (t+1) = x_i (t) +α(t) δ_ij [x-x_i(t)] 
         y_i (t+1) = y_i (t) +α(t) δ_ij [y-y_i(t)]
         for k=1 to N
           for m=1 to N
             tmp += g_km exp{ ||p-p_k||2 } exp{ ||p-p_m||2 }
           end for
         end for
         δ_ij = g_ij exp{ ||p-p_i||2 } exp{ ||p-p_j||2 } / tmp
        end for
      end for
    end for
¿Fue útil?

Solución

In your code, each neuron node is denoted by pair (Xi,Yj). I see you initializing your datastructure with random values. Each node has at minimum a weight, and a pair of coordinates. The coordinates give its location; while the weight gives its value.

For all it's worth it, you can create your own datastructure with the method getNodeAt(x,y). You can use a 2D array or linked list as I already mentioned.

I'm not sure how you group the nodes later on (there are many types of neural networks), I see a tier by tier distribution in your code. Kinda like levels in breadth first search.

The way you propagate weights throughout the network is to start to calculate values for one node located at the input/top/start level, then jump to the neighbours (ie next tier/level). You have the calculations in lines 6-8. You stop at the output nodes/bottom level.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top