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
Improve GPCCA.optimize()
: Change complex conjugate splitting handling etc
#13
Conversation
…f more then one cluster number was supplied.
…tead of only conjugated eigenvalues.
…ate splitting handling.
…t_sections in _checks. Co-authored-by: Michal Klein <michal.klein@protonmail.com>
Hmm, why is doc building failing? Locally it works fine for me... mb. the example-notebook.ipynb... |
If you have any warnings, it's set to fail on RTD. This is changed in #12 (in |
Will try to go over this tomorrow! |
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.
I think it's really important that we have tests for this. Also, @msmdev , you mentioned that this would still fail if m_max
from the given range splits complex conjugates, has that been resolved?
pygpcca/_gpcca.py
Outdated
|
||
@property # type: ignore[misc] | ||
@d.dedent | ||
def crispness_values(self) -> OArray: |
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.
Maybe a better naming convention is needed here, you have top_eigenvalues
<-> n_macrostates_crispness
and eigenvalues
<-> crispness_values
, but it's not very obvious from the naming that one relates to the optimal cluster number whereas the other is an iterable over a range of cluster numbers
.
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.
Yes, it is difficult here, since we also accept the interval to only contain one cluster number and thus I wouldn't really call this optimal then...
But yes, strictly speaking even then it would be the optimal number out of an "interval" with only one number in it.
I don't really had good ideas here, mb. you guys @Marius1311 @michalk8 have nicer ones in mind?
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.
Tried to settle this here.
@Marius1311 what is your opinion on this?
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.
Sorry, I don't get it, what's the new naming convention you propose?
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.
I not only renamed some properties, but also reordered all the properties. Mb. take a look here
Both |
…rties alphabetically, fix docstrings.
I think that's okay for now. |
@Marius1311 @michalk8 currently (since one of the commits I made today) I have a lot of strange errors, when trying to optimize for any interval of cluster numbers for the toy matrix from |
@Marius1311 @michalk8 this seems to originate from using Any suggestions what to do instead? |
|
Ok, this helps to get rid of some errors, but now there are runtime warnings
Using NaN is really unconvenient. @Marius1311 Shouldn't the first |
@msmdev I'd then use |
Ok for |
@michalk8 any idea whats the reason for the following warning?
|
@msmdev not yet, doing so now. However, even if it works on c64/list, I think it's too brittle to consider this a fix. |
@msmdev changing to c64 and removing the skipped tests and it works. Changing to list does not. |
@michalk8 after having done the final fixes, could you please accept the changes? |
Done. The tests should pass (I've added a test which checks for the |
Cool, thank you again @michalk8 for your excellent work! |
@michalk8 hmmm, it fails on macOS since RuntimeError in the linalg error test is not raised x.x |
I wanted to be clever by parametrizing |
821a877
to
05161b4
Compare
@michalk8 again |
Ok, I think I will remove the test - in #17, I've swapped the Python versions so that it's more comparable, here it stay the same (so that we have PETSc/SLEPc coverage on 3.7 and 3.8). The matrix there was only py37... Regarding
I removed |
@michalk8 another issue: I tried to run the example from the docs with binder. It loads and everything, but fails when I try tho execute the first cell to import the packages (matplotlib, numpy, gpcca), because it can't find matplotlib - numpy and gpcca are found. |
I think we should stay with mu=0 as far as possible, since there is in principle nothing wrong with it and the issue with macOS was merely technical in my opinion. |
Can confirm - the binder requirements are not executed - I think it gets the
Agreed. |
@michalk8 should I wait with merging until the binder issue is fixed? |
Yes please, almost there! |
sure! :D |
Ok, done, once this is merged, the binder should work (it will pip install from |
Alright! Lets go with it then! |
@michalk8 yup, binder works smoothly now! :) |
Currently it is not possible to optimize for cluster numbers
m in [m_min, m_max]
, if the interval contains cluster numbersm
that would lead to splitting of complex conjugate eigenvalues, since this raises aValueError
. This rendersGPCCA.optimize()
dysfunctional for some typical use cases.Thus I made changes to adapt this behavior: Now it will only raise, if we are only optimizing for a single cluster number
m
and if thism
would lead to splitting, or, ifm_max
would cause splitting.Further I added some properties, like a vector
crispness_values
of all crispness values form in [m_min, m_max]
and a vectoreigenvalues
of all eigenvalues associated withm in [m_min, m_max]
.Additionally, I changed some property names like
cluster_crispness
->n_macrostates_crispness
andn_metastable
->n_macrostates
.@michalk8 could you please take a look at this and tell me what you think?
@Marius1311 I know you are very busy, but could you mb. also take a quick look, since this would be a significant change?