Comments (6)
hi @Pedro-V thanks for raising this.
I'm struggling to understand you point. Looking at the vector in um
that you are referring to:
[17. 4. 3. 1. 2. 4. nan nan]
The middle weight in your snippet is considered to have 6 neighbors. Which can be seen as the ones highlighted here in red:
Please clarify your point if this doesn't clear your doubts.
from minisom.
Hi @JustGlowing thanks for taking the time.
The thing is, the ones highlighted in red are not the ones that the um
says the middle neuron is bordering! This is the problem I noticed.
The following is a mapping between each neighbor of the middle neuron (the red ones in your adapted image) and its distance to it. * denotes a neuron whose distance is present in um[1, 1]
.
neuron value | distance | distance present in um[1, 1] ? |
---|---|---|
22 | 2 | Yes |
29 | 5 | No |
28 | 4 | Yes |
7 | 17 | Yes |
20 | 4 | Yes |
25 | 1 | Yes |
See how the neuron with 29 value doesn't have his distance in um[1,1]
?
That's the reason I raised the issue. Why is 29 not present in the the middle neuron neighborhood? Indeed, executing the code of the method in a debugger shows it is not considered in the neighborhood of the middle neuron.
If this is a misunderstood, I'm sorry for taking your time 😆
from minisom.
Just to clarify, you might be right but I want to understand if there's an actual issue before jumping into fixing it.
Notice that in your table the the neuron with value 15 is missing and it is also excluded by the computation of um[1,1]
.
Why is 29 not present in the the middle neuron neighborhood?
29 and also 15 are excluded as an hexagonal neighborhood only has 6 elements. We could have excluded any other 2 elements by rearranging the coordinates system.
I'm I still missing something?
from minisom.
We could have excluded any other 2 elements by rearranging the coordinates system.
I see. I thought that the coordinate was arranged in a way such that the array would be like the following
15 22 29
25 24 28
21 20 7
Such that the middle neuron (24) woul have his neighborhood as 25, 20, 7, 22, 29, 28
, because that would make sense "visually".
Again, thanks for taking the time. I'll close this issue.
from minisom.
Hello @JustGlowing, I'm reopening this because of further doubt.
Again, suppose the same ii, jj
lists for helping define the neighborhood of the neuron. Also suppose the following code:
ii = [[-1, 0, 0, 1, 1, 1], [-1, -1, -1, 0, 0, 1]]
jj = [[ 0, -1, 1, -1, 0, 1], [-1, 0, 1, -1, 1, 0]]
n, m = 3, 3
for x in range(n):
for y in range(m):
print(f'For {x, y}: ', end=' ')
e = y % 2 == 0
for k, (i, j) in enumerate(zip(ii[e], jj[e])):
if (x + i >= 0 and x + i < n and
y + j >= 0 and y + j < m):
print(f'{x+i, y+j}', end=' ')
print()
It outputs the following:
For (0, 0): (0, 1) (1, 0)
For (0, 1): (0, 0) (0, 2) (1, 0) (1, 1) (1, 2)
For (0, 2): (0, 1) (1, 2)
For (1, 0): (0, 0) (0, 1) (1, 1) (2, 0)
For (1, 1): (0, 1) (1, 0) (1, 2) (2, 0) (2, 1) (2, 2)
For (1, 2): (0, 1) (0, 2) (1, 1) (2, 2)
For (2, 0): (1, 0) (1, 1) (2, 1)
For (2, 1): (1, 1) (2, 0) (2, 2)
For (2, 2): (1, 1) (1, 2) (2, 1)
Consider the same map graph:
Now take the neuron (1, 0). In the above image, it has 5 neighbors:
(0, 0) (0, 1)
(1, 0) (1, 1)
(2, 0) (2, 1)
My question is why the code used in the MiniSom.distance_map
method considers only 4 of that neuron's 5 neighbors.
Note that there are some other neurons with different number of reported neighbors that the image presented.
Thanks.
from minisom.
After working out in a paper sheet, I now understand. I misunderstood minisom
concept of a hexagonal grid. Visually, minisom
sees a hexagonal 3x3 grid like this:
2
1 3
5
4 6
8
7 9
That is, the variations occur in the y axis. The current code is appropriate for this view.
I was thinking it saw like this:
1 2 3
4 5 6
7 8 9
Where the variations occur in the x axis.
Again, closing this issue. But definitely this time.
from minisom.
Related Issues (20)
- Question on topology parameter. HOT 2
- KeyError: 339
- Question on the radius. HOT 2
- About how you efficiently calculate the winner and the neighbourhood function. HOT 1
- How can I get reproducible results? HOT 2
- Meaning of the position of winning nodes and distance map HOT 3
- It seems the next run will be influenced by the former run. Will it be more rational to reset after every run? HOT 4
- Is there a way to create clusters of equal size? HOT 2
- What's the order of the coordinates returned by the winner method? HOT 2
- How to save and load trained model for cluster prediction on new data? HOT 1
- PCA initialization HOT 7
- Adjacent nodes in hexagonal distance do not have distance 1 HOT 2
- Question: Interest in a connectivity matrix? HOT 2
- unexpected problem calling the functions HOT 11
- errors in 'AdvancedVisualization.ipnyb' example HOT 2
- Help with clustering and visualization of neurons HOT 1
- There might be an index error in TimeSeries.ipynb HOT 1
- decay for sigma can be improved HOT 5
- Large Quantization Error with Spatio-Temporal Data? HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from minisom.