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

Implement PCA for f32 and f64 #234

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

Conversation

YuhanLiin
Copy link
Collaborator

Addresses #232

Adds PCA impl for f32 for all BLAS backends using macros. Does not involve the Float trait.

There is currently a logic bug, as the test_explained_variance_diag and test_whitening_small tests are currently failing on f32. It might be related to the TruncateSvd code. @bytesnake any ideas?

@YuhanLiin YuhanLiin marked this pull request as draft August 7, 2022 04:31
@YuhanLiin
Copy link
Collaborator Author

I also ran the tests with BLAS backend and white_small passes, but explained_variance_diag still fails.

@bytesnake
Copy link
Member

for explained_variance_diag this relates to rust-ml/linfa-linalg#11 when decreasing to single-precision floats we can't extract as many eigenvalues without losing coherence

@bytesnake
Copy link
Member

the same occurs for test_whitening_small, it calculate covariance of 2x2 https://github.com/rust-ml/linfa-linalg/blob/main/src/lobpcg/svd.rs#L200

@bytesnake
Copy link
Member

I propose first fixing first rust-ml/linfa-linalg#11 by adding the 1/5 rules to TruncatedSvd and TruncatedEig and then test 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

Successfully merging this pull request may close these issues.

None yet

2 participants