When mode = "complete"
, the function returns a square matrix
which dimensions are equal to the product of the grid dimensions.
When mode = "neighbors"
, the function returns a list which length is
equal to the product of the grid dimensions; the length of each item is equal
to the number of neighbors. Neurons are considered to have 8 neighbors at
most (i.e., two neurons are neighbors if they have an Euclidean
distance smaller than radius
. Natural choice for radius
is
1 for hexagonal topology and 1 or \(\sqrt{2}\) for square
topology (4 and 8 neighbors respectively).