Skip to content
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

Ch/kltransform fsorder #102

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft

Ch/kltransform fsorder #102

wants to merge 6 commits into from

Conversation

cahofer
Copy link

@cahofer cahofer commented Feb 1, 2021

Allow F/S diagonalisation order in kltransform.KLTransform

  • feat(kltransform.KLtrasnform): S/F or F/S diagonalisation order for the first eigenvalue decomposition in the class KLtransform can be configured over the 'diagonalisation_order' config property. Accordingly, either high S/F and low F/S eigenvalues are selected.

Carolin Hofer added 2 commits February 1, 2021 11:34
(cherry picked from commit 3af5152218f19c271b0e26d7e1d8e6523f6f8772)
@lgtm-com
Copy link

lgtm-com bot commented Feb 1, 2021

This pull request introduces 1 alert when merging de682ea into 94f0ece - view on LGTM.com

new alerts:

  • 1 for Unused local variable

@lgtm-com
Copy link

lgtm-com bot commented Feb 2, 2021

This pull request introduces 1 alert when merging b7733b1 into 94f0ece - view on LGTM.com

new alerts:

  • 1 for Unused local variable

Copy link
Contributor

@sjforeman sjforeman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only a few minor things to look at...

if self.diagonalisation_order == "sf":
ind = np.where(evals > self.foreground_threshold)
else:
ind = np.where(evals < self.foreground_threshold)

# Construct evextra dictionary (holding foreground ratio)
evextra = {"ac": ac, "f_evals": evals.copy()}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we consider using sf_evals for S/F transform and fs_evals for F/S transform, to make it more explicit which eigenvalues are being stored?

if self.diagonalisation_order == "sf":
f_evals = evextra["f_evals"]
else:
f_evals = evextra["f_evals"][::-1]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you reverse the order for F/S eigenvalues? To be consistent with the single-KL F/S case, shouldn't the order be left as it is?

drift/core/kltransform.py Show resolved Hide resolved
@cahofer
Copy link
Author

cahofer commented Mar 28, 2021

Hey @sjforeman , I addressed your requests, the issue right now is that when simulating a pathfinder sized telescope the transform is not able to complete in the S/N step (matrix not positive definite). So this probably requires more research time before a final merge.

else:
f_evals = evextra["f_evals"]

f.create_dataset("f_evals", data=f_evals)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This if-else doesn't do anything...

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah ja missed that one.. thanks.

@sjforeman
Copy link
Contributor

Hey @sjforeman , I addressed your requests, the issue right now is that when simulating a pathfinder sized telescope the transform is not able to complete in the S/N step (matrix not positive definite). So this probably requires more research time before a final merge.

Let's try it again after the new cedar CHIME environment is ready. I think pathfinder-sized telescopes were working fine for me, but I manually upgraded the version of scipy in my virtualenv. The new standard environment should have newer packages, so maybe that will solve your matrix issue.

@cahofer
Copy link
Author

cahofer commented Mar 28, 2021

Alright sounds good!

@jrs65
Copy link
Contributor

jrs65 commented May 18, 2021

@cahofer I wrote down on Friday that you were going to run a quick test against the new CHIME env. Let us know when you get around to that one, but I don't think it's a rush.

@jrs65
Copy link
Contributor

jrs65 commented Jun 2, 2021

I'm going to convert this one to a draft until it's closer to be ready to merge.

@jrs65 jrs65 marked this pull request as draft June 2, 2021 00:52
@jrs65
Copy link
Contributor

jrs65 commented Jun 14, 2021

@cahofer Just wanted to follow up on this one. Did you manage to get any tests running through?

@cahofer
Copy link
Author

cahofer commented Jun 15, 2021

uuuggh I am pushing through the very lasts bits of my thesis I will put this on hold until after the thesis is submitted! sorry!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants