New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed topographic_error() and quantization_error() #55
Conversation
… the topographic_error() and quantization_error() methods with vectorized implementation.
Hi there, thanks for your submission. I'll have a look next week. |
In the meanwhile, please make sure that the methods you are introducing are unit tested and make sure that pycodestyle doesn't flag any line. |
Thanks. The original commit only works for numpy.ndarray type input. I fixed this problem and now it passes the unit test. |
That's amazing! Can you report there speedup achieved on the quantization error? Also, please don't disable any of the pylint checks. |
The speed-up is very significant. On my PC, it's about 50 times faster. When the data is 300-by-50000, original methods take several minutes, while the new methods take seconds to complete. The reason that I disabled the pylint check is because I encountered some issue similar to this: pylint-dev/pylint#2061. Not sure how to resolve it. Do you have suggestions on that? |
I would just avoid unpacking the two elements in a single line.
…On Sat, Dec 7, 2019, 7:44 AM Wei Zhang ***@***.***> wrote:
The speed-up is very significant. On my PC, it's about 50 times faster.
When the data is 300-by-50000, original methods take several minutes, while
the new methods take seconds to complete.
The reason that I disabled the pylint check is because I encountered some
issue similar to this: pylint-dev/pylint#2061
<pylint-dev/pylint#2061>. Not sure how to resolve
it. Do you have suggestions on that?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#55?email_source=notifications&email_token=ABFTNGNBNVNSPZJMJ6EWQODQXNH5FA5CNFSM4JXAXIGKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEGGAQIY#issuecomment-562825251>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABFTNGIK7VE6P4BGLA7YGY3QXNH5FANCNFSM4JXAXIGA>
.
|
Please checkout the new version. Thanks! |
hi @wei-zhang-thz , I left my code review as promised. Let me know once you manage to have a look. |
Also, if you merge the new version of master in your code you'll find the test mentioned in a comment above. |
Thanks for the review! I will resolve the problems in one or two days. |
Please check the new version. Your suggestion on using an alternative way to implement _distance_from_weights() is indeed very simple (but has some problem). A correct implementation would be something like: norm(input_data[:, :, None] - weights_flat.T[None, :, :], axis=1). However, this implementation does not work well for big data because of memory consumption. Assume m is number of data entries, n is number of nodes, and k is data dimension, then the runtime analysis of the two implementations of _distance_from_weights() are: |
pycodestyle gives flags some lines now:
|
Please check the new version. Thanks! |
distances = self.som._distance_from_weights(data) | ||
for i in range(len(data)): | ||
for j in range(len(weights)): | ||
assert(distances[i][j] == norm(data[i] - weights[j])) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a great test 👍
I'm going to merge this now. 🎉 Thanks for your amazing contribution. You'll be mentioned in the notes of the next release and on a twitter announcement. Let me know if you have a twitter account. |
Thank you! It's a great experience and I learned a lot from you. @835Aloha is my twitter account. |
Fixed topographic_error() and quantization_error()
hi there, I'm thinking about changing the license of Minisom to MIT (or GPL). This will allow Minisom to have a paper on the Journal of Open Source software. This WILL NOT affect the ownership of your contribution and does not imply that I will profit from Minisom. Your contribution was very welcome and I'd like to have your approval. |
Hello, Thanks for letting me know this. I have no problem with the license
changing.
…On Thu, Jul 23, 2020 at 9:47 AM Giuseppe Vettigli ***@***.***> wrote:
hi there, I'm thinking about changing the license of Minisom to MIT (or
GPL). This will allow Minisom to have a paper on the Journal of Open Source
software. This WILL NOT affect the ownership of your contribution and does
not imply that I will profit from Minisom. Your contribution was very
welcome and I'd like to have your approval.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#55 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AL6XS4DSF6HKOYMVFEP2LQDR5BSQRANCNFSM4JXAXIGA>
.
|
Fixed topographic_error() and quantization_error()
Problems:
Fixes: