Comments (6)
from minisom.
Hey,
I think I have the same Issue. I get a index out of bounds error, when I try to compute the topographical error using a hexagonal grid. Not using a hexagonal grid the topographical error can be computed just fine.
I am calling the som.topographical_error() function with my data as an argument.
te = som.topographic_error(data)
When not using a hexagonal grid the topographical error can be computed. However when using a hexagonal grid I get the following error:
~/.venvs/viewer/lib/python3.7/site-packages/minisom.py in topographic_error(self, data)
558 return nan
559 if self.topology == 'hexagonal':
--> 560 return self._topographic_error_hexagonal(data)
...
--> 245 return self._xx.T[xy], self._yy.T[xy]
246
247 def _activate(self, x):
IndexError: index 5 is out of bounds for axis 1 with size 5
Hope that helps somehow.
from minisom.
This must be bug then. I'll reopen the issue. Unfortunately I don't have time to fix this in the short term.
from minisom.
A correction, I can't replicate this error as I'm able to compute the topographic error using the hexagonal topology under different setups. You need to share more details about your situation if you want any support with this.
from minisom.
Hey,
Thanks for the super fast reply. I create a som, initialise it with weights according to the pca and train it. Afterwards I try to compute the topographic error which results in the out of bounds error. This is the code that I am running:
som_size = [6,5]
som = MiniSom(som_size[0], som_size[1], np.size(data,1), sigma=1.5, learning_rate=0.8,topology='hexagonal')
som.pca_weights_init(data)
som.train(data, 100000,verbose=False,random_order=True)
te = som.topographic_error(data)
from minisom.
I don't think this line of code makes sense:
coords = som.convert_map_to_euclidean((index % y, int(index/y)))
Shouldn't the parameters be inverted, e.g.:
coords = som.convert_map_to_euclidean((int(index/y), index % y))
Anyway, thanks for the amazing work!
The change from above fixed the issue for me!
from minisom.
Related Issues (20)
- Meaning of num_iteration inside train method HOT 2
- Clarification on the self.update function? HOT 2
- Decay function (Question) HOT 2
- Why is the project called minisom ? HOT 2
- is there a way to find out clusters with minisom? HOT 3
- Is there way to classify SOM based on the u-matrix ? HOT 1
- 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
- considerations on the hexagonal neighborhood used in `distance_map()` HOT 6
- 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
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.