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
Add warm restart to AJDC #196
Conversation
@@ -20,7 +20,7 @@ def _get_normalized_weight(sample_weight, data): | |||
return normalized_weight | |||
|
|||
|
|||
def rjd(X, eps=1e-8, n_iter_max=1000): | |||
def rjd(X, *, init=None, eps=1e-8, n_iter_max=1000): |
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 technically an API change but I think it's save to do.
aux = 1./np.sqrt(np.abs(np.diag(Raux))) | ||
W_est = np.dot(np.diag(aux), W_est) | ||
aux = 1. / np.sqrt(np.abs(np.diag(Raux))) | ||
W_est = np.diag(aux) @ W_est |
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.
use broadcasting if you can. Every time I see a np.diag in numpy my brain produces a strong ERP ;)
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 agree. I try to remove np.dot and np.diag when I can.
But I only improve the code when I’m sure to break nothing.
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.
uwedge seems deep, I couldn't think of a way to get rid of the np.diag nicely.
good for me, I'll merge if you're ok |
Thanks a lot Quentin! |
This PR enhances AJDC when used for group BBS (gBSS): it allows to refine group sources for a specific subject, using an initial diagonalizer.
ajd_pham
andrjd
to allow warm restart, and complete tests;AJDC
, and add key 'warm_restart' for dimension reduction, and update tests.