-
Notifications
You must be signed in to change notification settings - Fork 545
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
Compute noise_variance_
in PCA implementation
#6234
base: branch-25.02
Are you sure you want to change the base?
Conversation
f73ec37
to
c4939b6
Compare
@@ -128,9 +128,6 @@ void fit_impl(raft::handle_t& handle, | |||
streams, | |||
n_streams, | |||
verbose); | |||
for (std::uint32_t i = 0; i < n_streams; i++) { | |||
handle.sync_stream(streams[i]); | |||
} |
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 sync point was unneeded, it was already handled after exiting this branch below.
true, | ||
stream); | ||
} else { | ||
raft::matrix::setValue(noise_vars, noise_vars, math_t{0}, 1, stream); |
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.
noise_vars
is a len-1 device array that I want to set to 0. This seems to work (and is used at least one other place in cuml already), but I'm honestly not sure if it's the best spelling of that. In particular, I don't understand why a method for filling an output array with a single value also takes in an input array (which is the same as the output array in all calling locations I can find).
Previously `noise_vars` was an output parameter passed to the cuda PCA implementation, but it was unimplemented. This adds support for computing `noise_vars` in the cuda code, and tests that the results are valid by comparing to the scikit-learn implementation. The previous code would always have a `noise_variance_` of 0, resulting in downstream issues interpreting results after converting a cuml estimator to its sklearn equivalent (e.g. broken `score_samples`).
c4939b6
to
4a927b3
Compare
Previously
noise_vars
was an output parameter passed to the cuda PCA implementation, but it was unimplemented. This adds support for computingnoise_vars
in the cuda code, and tests that the results are valid by comparing to the scikit-learn implementation.The previous code would always have a
noise_variance_
of 0, resulting in downstream issues interpreting results after converting a cuml estimator to its sklearn equivalent (e.g. brokenscore_samples
).