apollon.som.topologies module¶
apollon/som/topologies.py
 Michael Blaß 2016
Topologies for selforganizing maps.
 Functions:
 rect_neighbourhood Return rectangular neighbourhood. vn_neighbourhood Return 4neighbourhood.

apollon.som.topologies.
rect_neighbourhood
(mat_shape, point, w=1)¶

apollon.som.topologies.
vn_neighbourhood
(x, y, dx, dy, flat=False)¶ Compute Von Neuman Neighbourhood.
Compute the Von Neuman Neighbourhood of index (x, y) given an array with dimension (dx, dy). The Von Neumann Neighbourhood is the 4neighbourhood, which includes the four direct neighbours of index (x, y) given a rect angular array.
 Params:
 x (int) xIndex for which to compute the neighbourhood. y (int) yIndex for which to compute the neighbourhood. dx (int) Size of enclosing array’s xaxis. dy (int) Size of enclosing array’s yaxis. flat (bool) Return flat index if True. Default is False.
Returns: 1darray of ints if flat, 2darray otherwise.