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

NdArray bump follow up #121

Merged
merged 7 commits into from
Apr 25, 2021
Merged

NdArray bump follow up #121

merged 7 commits into from
Apr 25, 2021

Conversation

bytesnake
Copy link
Member

@bytesnake bytesnake commented Apr 20, 2021

This is the followup to the PR #110. It tries to simplify our story of cauchy::Scalar and num_trait::Float by moving the trait bound of cauchy behind an associated type and avoiding thus the ambiguity when mixing both bounds.

It adds a function Float::map_cauchy_bound and pulls in the trait bound here for an example in linfa-clustering: https://github.com/rust-ml/linfa/pull/121/files#diff-cc618ed2646ccdd41e994796498d4b9ed256dc0d99c1976302eba1c496caaf64R256.

I also added a F::cast function to shorten number casting and avoid num_traits::FromPrimitive 😅

@relf

@bytesnake bytesnake marked this pull request as draft April 20, 2021 14:50
@@ -43,10 +50,113 @@ pub trait Float:
+ for<'a> SubAssign<&'a Self>
+ for<'a> DivAssign<&'a Self>
+ SampleUniform
+ ScalarOperand
Copy link
Member

Choose a reason for hiding this comment

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

Maybe we could add num_traits::MulAdd<Output = F> (see sparsemat/sprs#278 (comment)) to ease the upgrade to sprs 0.10?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes! Haven't seen the post

@bytesnake bytesnake marked this pull request as ready for review April 24, 2021 10:12
@codecov-commenter
Copy link

Codecov Report

Merging #121 (5f9eb25) into master (8276bdc) will decrease coverage by 0.07%.
The diff coverage is 39.52%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #121      +/-   ##
==========================================
- Coverage   58.30%   58.23%   -0.08%     
==========================================
  Files          75       76       +1     
  Lines        6697     6700       +3     
==========================================
- Hits         3905     3902       -3     
- Misses       2792     2798       +6     
Impacted Files Coverage Δ
...infa-clustering/src/appx_dbscan/hyperparameters.rs 18.51% <0.00%> (-3.71%) ⬇️
...hms/linfa-clustering/src/dbscan/hyperparameters.rs 6.25% <0.00%> (ø)
...clustering/src/gaussian_mixture/hyperparameters.rs 34.92% <0.00%> (ø)
...ms/linfa-clustering/src/k_means/hyperparameters.rs 40.90% <0.00%> (ø)
algorithms/linfa-clustering/src/k_means/init.rs 87.23% <ø> (-0.40%) ⬇️
algorithms/linfa-elasticnet/src/hyperparameters.rs 12.50% <0.00%> (ø)
algorithms/linfa-kernel/src/lib.rs 71.18% <0.00%> (+0.72%) ⬆️
algorithms/linfa-linear/src/ols.rs 71.96% <0.00%> (ø)
algorithms/linfa-pls/src/lib.rs 90.00% <ø> (ø)
algorithms/linfa-pls/src/pls_svd.rs 42.10% <ø> (ø)
... and 43 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8276bdc...5f9eb25. Read the comment docs.

@bytesnake bytesnake merged commit a42401e into rust-ml:master Apr 25, 2021
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