Comments (5)
Hi @MomoLangenstein,
Thanks for the report. I need to check what is going on. If this is the case, we definitely need to fix it and introduce a better test that also checks the symmetricity.
from dscribe.
Hi @MomoLangenstein,
Indeed there was an issue where the rows and columns of the matrix were not being permuted as expected, causing non-symmetric matrices. There is now a fix in the branch v1.2.2, which will be made into a release in the near future.
It would be great if you can verify this fix as well. I have added a new symmetricity test into our test suite and your examples now also pass after changing the sorting on the python side slightly like this:
sorted_row_indices = np.argsort(-row_norms)
The sorting in your manual implementation needs to be exactly the same as in our C++ implementation due to ambiguity in sorting by row norm. In several cases the norms of the matrix rows are identical and in order to get the exact same results, the sorting logic needs to be identical in your example and in our C++ implementation.
from dscribe.
Hi @lauri-codes,
Thank you for working out the fix for this issue! I can confirm that my small test now works on the v1.2.2
branch. I just wanted to clarify your proposed change to the manual Python implementation. If I do use
sorted_row_indices = np.argsort(-row_norms)
instead of
sorted_row_indices = np.argsort(row_norms)[::-1]
I get exactly the same results with my manual implementation as with dscribe
. Are both methods semantically correct, and only differ in their handling of how to order rows/columns with equivalent norms?
from dscribe.
Hi,
Yes, the sorting simply affects the way that rows with equal norm are handled. If there are no equal norms, then the output is completely independent of the sorting algorithm (see e.g. the kind
attribute in the numpy docs) and whether you do np.argsort(-row_norms)
or np.argsort(row_norms)[::-1].
The small differences only start kicking in when there are equal norms. I think np.argsort(-row_norms)
and np.argsort(row_norms)[::-1]
should not be equal in these cases, e.g.:
import numpy as np
a = [
[2, 1],
[1, 2],
]
row_norms = np.linalg.norm(a, axis=1)
indices1 = np.argsort(row_norms)[::-1]
print(indices1) # [1, 0]
indices2 = np.argsort(-row_norms)
print(indices2) # [0, 1]
In the end it does not really matter which way you sort the rows with equal norms, just as long as you are consistent throughout your data.
from dscribe.
Now fixed in v1.2.2.
from dscribe.
Related Issues (20)
- Is it possible to parallelize `lmbtr.create` when working on one `ase.Atoms` object? HOT 3
- Error with np.str (NumPy >= 1.24) HOT 1
- Descriptor that recognizes each atom of the same species differently HOT 1
- The example in README.md is not correct HOT 1
- [Bug] Error in SOAP derivatives when using weighting. HOT 2
- API compatibility is broken since 0696656 HOT 1
- ACSF.create cannot accept cartesian positions as "centers" parameter HOT 2
- Numpy operations on sparsed derivatives HOT 5
- Similarity based on Average kernel obtain deferent value between each atom and its replica atoms. HOT 1
- Similarity value is different between equivalent atoms HOT 5
- Segmentation fault in SOAP for l_max > 9 HOT 2
- Analytic Integral of SH expansion coefficients HOT 2
- SOAP polynomial RBF error HOT 3
- issue with "species" HOT 2
- MBTR HOT 3
- ACSF G5 values HOT 2
- Segmentation fault in creation of SOAP descriptor HOT 4
- Analytical derivatives of SOAP HOT 4
- Identical geometry but similarity < 1 HOT 4
- Numerical SOAP derivatives for periodic systems HOT 6
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 dscribe.