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 
8 #include <cumlprims/opg/matrix/data.hpp>
9 #include <cumlprims/opg/matrix/part_descriptor.hpp>
10 #include <raft/core/handle.hpp>
11 
12 namespace ML {
13 namespace PCA {
14 namespace opg {
15 
31 void sign_flip_components_u(raft::handle_t& handle,
32  std::vector<MLCommon::Matrix::Data<float>*>& input_data,
33  MLCommon::Matrix::PartDescriptor& input_desc,
34  float* components,
35  std::size_t n_samples,
36  std::size_t n_features,
37  std::size_t n_components,
38  cudaStream_t* streams,
39  std::uint32_t n_stream,
40  bool center);
41 
42 void sign_flip_components_u(raft::handle_t& handle,
43  std::vector<MLCommon::Matrix::Data<double>*>& input_data,
44  MLCommon::Matrix::PartDescriptor& input_desc,
45  double* components,
46  std::size_t n_samples,
47  std::size_t n_features,
48  std::size_t n_components,
49  cudaStream_t* streams,
50  std::uint32_t n_stream,
51  bool center);
52 
65 void sign_flip(raft::handle_t& handle,
66  std::vector<MLCommon::Matrix::Data<float>*>& input_data,
67  MLCommon::Matrix::PartDescriptor& input_desc,
68  float* components,
69  std::size_t n_components,
70  cudaStream_t* streams,
71  std::uint32_t n_stream);
72 
73 void sign_flip(raft::handle_t& handle,
74  std::vector<MLCommon::Matrix::Data<double>*>& input_data,
75  MLCommon::Matrix::PartDescriptor& input_desc,
76  double* components,
77  std::size_t n_components,
78  cudaStream_t* streams,
79  std::uint32_t n_stream);
80 
81 }; // end namespace opg
82 }; // end namespace PCA
83 }; // 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