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

use np.linalg.lstsq to _optimize? #8

Closed
yigaza opened this issue Jun 29, 2023 · 4 comments
Closed

use np.linalg.lstsq to _optimize? #8

yigaza opened this issue Jun 29, 2023 · 4 comments

Comments

@yigaza
Copy link

yigaza commented Jun 29, 2023

def _optimize(self, alpha: float, lr: float, n_iter: int) -> np.ndarray:
try:
return np.linalg.lstsq(self.mutual_ics[:self.size, :self.size],self.single_ics[:self.size])[0]
except:
return self.weights[:self.size];

very fast

@xuehongyanL
Copy link
Contributor

That's a good shoot! Have you assessed the impact on final results?

@yigaza
Copy link
Author

yigaza commented Jul 6, 2023

I obtained similar results. But omit alpha*loss_l1 may be bad idea?

@xuehongyanL
Copy link
Contributor

Thank you for your insightful suggestion. We'll make a decision after further evaluations.

@xuehongyanL
Copy link
Contributor

xuehongyanL commented Jul 7, 2023

After careful assessment, we have found that l1 regularization has such a significant impact on the stability of the model that we cannot adopt this optimization as default. However, we have implemented it as an optional feature. Thank you for your contribution to this project, once again.

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

No branches or pull requests

2 participants