sign_flip_mg.hpp
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2020-2025, NVIDIA CORPORATION.
3  * SPDX-License-Identifier: Apache-2.0
4  */
5 
6 #pragma once
7 
10 
11 #include <raft/core/handle.hpp>
12 
13 namespace ML {
14 namespace PCA {
15 namespace opg {
16 
32 void sign_flip_components_u(raft::handle_t& handle,
33  std::vector<MLCommon::Matrix::Data<float>*>& input_data,
35  float* components,
36  std::size_t n_samples,
37  std::size_t n_features,
38  std::size_t n_components,
39  cudaStream_t* streams,
40  std::uint32_t n_stream,
41  bool center);
42 
43 void sign_flip_components_u(raft::handle_t& handle,
44  std::vector<MLCommon::Matrix::Data<double>*>& input_data,
46  double* components,
47  std::size_t n_samples,
48  std::size_t n_features,
49  std::size_t n_components,
50  cudaStream_t* streams,
51  std::uint32_t n_stream,
52  bool center);
53 
66 void sign_flip(raft::handle_t& handle,
67  std::vector<MLCommon::Matrix::Data<float>*>& input_data,
69  float* components,
70  std::size_t n_components,
71  cudaStream_t* streams,
72  std::uint32_t n_stream);
73 
74 void sign_flip(raft::handle_t& handle,
75  std::vector<MLCommon::Matrix::Data<double>*>& input_data,
77  double* components,
78  std::size_t n_components,
79  cudaStream_t* streams,
80  std::uint32_t n_stream);
81 
82 }; // end namespace opg
83 }; // end namespace PCA
84 }; // end namespace ML
void sign_flip(raft::handle_t &handle, std::vector< MLCommon::Matrix::Data< float > * > &input_data, MLCommon::Matrix::PartDescriptor &input_desc, float *components, std::size_t n_components, cudaStream_t *streams, std::uint32_t n_stream)
sign flip for PCA and tSVD. This is used to stabilize the sign of column major eigen vectors
void sign_flip_components_u(raft::handle_t &handle, std::vector< MLCommon::Matrix::Data< float > * > &input_data, MLCommon::Matrix::PartDescriptor &input_desc, float *components, std::size_t n_samples, std::size_t n_features, std::size_t n_components, cudaStream_t *streams, std::uint32_t n_stream, bool center)
sign flip for PCA and tSVD. This is used to stabilize the sign of column major eigen vectors
Definition: dbscan.hpp:18
@ PCA
Definition: tsne.h:19
This is a helper wrapper around the multi-gpu data blocks owned by a worker. It's design is NOT final...
Definition: data.hpp:18
Definition: part_descriptor.hpp:40