I am looking for hexagonal self-organizing map on Python.
- ready module. If one exists.
- way to plot hexagonal cell
- algorithms to work with hexagonal cells as array or smth else
About: A self-organizing map (SOM) or self-organizing feature map (SOFM) is a type of artificial neural network that is trained using unsupervised learning to produce a low-dimensional (typically two-dimensional)
I don't have an answer for point 1, but some hints for point 2 and 3. In your context, you're not modelling a physical 2D space but a conceptual space with tiles that have 6 neighbors. This can be modelled with square tiles arranged in columns with the odd colums shifted vertically by half the size of a square. I'll try an ASCII diagram:
You can see easily that each square has 6 neighbors (except the ones on the edges of course). This gets easily modeled as a 2D array of squares, and the rules to compute the coordinates of the square at at position (i, j), i being the row and j the column are quite simple:
if j is even:
if j is odd:
(the 4 first terms are identical)
I know this discussion is 4 years old, however I haven't find a satisfactory answer over the web.
If you have something as a array mapping the input to the neuron and a 2-d array related to the location for each neuron.
For example consider something like this:
So I'do this using a the following method:
Finally I got this output:
EDIT
An updated version of this code on https://stackoverflow.com/a/23811383/575734