From eb17106084ce7d572b6305245f41f5380f5d21c7 Mon Sep 17 00:00:00 2001 From: "Corey J. Nolet" Date: Thu, 1 Apr 2021 11:30:42 -0400 Subject: [PATCH 1/2] Exposing spectral random seed property --- cpp/include/raft/sparse/linalg/spectral.cuh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cpp/include/raft/sparse/linalg/spectral.cuh b/cpp/include/raft/sparse/linalg/spectral.cuh index 43638471ad..89ba2c774c 100644 --- a/cpp/include/raft/sparse/linalg/spectral.cuh +++ b/cpp/include/raft/sparse/linalg/spectral.cuh @@ -32,7 +32,7 @@ namespace spectral { template 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 src_offsets(d_alloc, stream, n + 1); @@ -70,6 +70,8 @@ void fit_embedding(const raft::handle_t &handle, int *rows, int *cols, T *vals, raft::eigen_solver_config_t cfg{neigvs, maxiter, restart_iter, tol}; + cfg.seed = seed; + raft::lanczos_solver_t eig_solver{cfg}; //cluster computation here is irrelevant, From 6dbc2a9d914d5d39293d9ad6ba7fc208b9a55f00 Mon Sep 17 00:00:00 2001 From: "Corey J. Nolet" Date: Thu, 1 Apr 2021 11:58:25 -0400 Subject: [PATCH 2/2] Fixing style --- cpp/include/raft/sparse/linalg/spectral.cuh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cpp/include/raft/sparse/linalg/spectral.cuh b/cpp/include/raft/sparse/linalg/spectral.cuh index 89ba2c774c..15302f3b74 100644 --- a/cpp/include/raft/sparse/linalg/spectral.cuh +++ b/cpp/include/raft/sparse/linalg/spectral.cuh @@ -32,7 +32,8 @@ namespace spectral { template void fit_embedding(const raft::handle_t &handle, int *rows, int *cols, T *vals, - int nnz, int n, int n_components, T *out, unsigned long long seed = 1234567) { + 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 src_offsets(d_alloc, stream, n + 1);