Python中的六角形自组织图 [英] Hexagonal Self-Organizing map in Python
问题描述
我正在寻找六角形 自组织地图在Python上.
I am looking for hexagonal self-organizing map on Python.
- 就绪模块.如果存在的话.
- 绘制六角形细胞的方式
- 与六角形单元格作为数组或其他元素一起使用的算法
关于: 自组织图(SOM)或自组织特征图(SOFM)是一种人工神经网络,使用无监督学习对其进行训练,以生成低维(通常为二维)
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)
推荐答案
我没有关于第1点的答案,但是有关于第2点和第3点的一些提示.但是一个具有6个邻居的图块的概念空间.可以用排列成列的正方形瓷砖进行建模,其中奇数列垂直移动一个正方形大小的一半.我将尝试一个ASCII图:
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:
___ ___ ___
| |___| |___| |___
|___| |___| |___| |
| |___| |___| |___|
|___| |___| |___| |
| |___| |___| |___|
|___| |___| |___| |
|___| |___| |___|
您可以轻松地看到每个正方形都有6个邻居(当然,边缘上的邻居除外).可以很容易地将其建模为2D正方形数组,并且计算位置(i,j)处正方形的坐标的规则非常简单:
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:
如果j是偶数:
(i+1, j), (i-1, j), (i, j-1), (i, j+1), (i-1, j-1), (i+1, j-1)
如果j为奇数:
(i+1, j), (i-1, j), (i, j-1), (i, j+1), (i+1, j-1), (i+1, j+1)
(前四个词是相同的)
这篇关于Python中的六角形自组织图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!