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

[REVIEW] Exposing spectral random seed property #193

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion cpp/include/raft/sparse/linalg/spectral.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ namespace spectral {

template <typename T>
void fit_embedding(const raft::handle_t &handle, int *rows, int *cols, T *vals,
int nnz, int n, int n_components, T *out) {
int nnz, int n, int n_components, T *out,
unsigned long long seed = 1234567) {
auto stream = handle.get_stream();
auto d_alloc = handle.get_device_allocator();
raft::mr::device::buffer<int> src_offsets(d_alloc, stream, n + 1);
Expand Down Expand Up @@ -70,6 +71,8 @@ void fit_embedding(const raft::handle_t &handle, int *rows, int *cols, T *vals,
raft::eigen_solver_config_t<index_type, value_type> cfg{neigvs, maxiter,
restart_iter, tol};

cfg.seed = seed;

raft::lanczos_solver_t<index_type, value_type> eig_solver{cfg};

//cluster computation here is irrelevant,
Expand Down