1

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
Naga
  • 65
  • 1
  • 8
  • can't understand that unformatted code, but try a 2D linked list (or 2D array). You have to propagate the changes from 1 neuron to the next so array or list is appropriate in this case. Or you can make your own mesh using lists. – Adrian Mar 01 '12 at 16:52
  • Please correct me if im wrong..Is given node represented by co-ordinate in 2d or weight at the co-ordinate..im kinda of lost with notation :(( – Naga Mar 01 '12 at 16:59
  • Give answered most of my questions. http://stackoverflow.com/q/5926386/667664 – Naga Mar 01 '12 at 20:51

1 Answers1

1

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.

Adrian
  • 5,603
  • 8
  • 53
  • 85
  • Thanks a lot @Adrian..I really appreciate your help. I am tying to implement the concept of self-organizing neural networks(Kohonen map) to this Algorithm. How does weight of neuron node fit into my algorithm. This is most confusing thing for me. In steps 6-8 should I be updating weight or coordinates for that node? 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)] – Naga Mar 01 '12 at 18:59
  • @Naga You update the weights of the nodes (node weight during this iteration = node weight at previous iterations AND some calculations. See this link for a really nice example: http://en.wikipedia.org/wiki/Self-organizing_map – Adrian Mar 01 '12 at 20:02