sign_flip_mg.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2020-2022, NVIDIA CORPORATION.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #pragma once
18 
19 #include <cumlprims/opg/matrix/data.hpp>
20 #include <cumlprims/opg/matrix/part_descriptor.hpp>
21 #include <raft/core/handle.hpp>
22 
23 namespace ML {
24 namespace PCA {
25 namespace opg {
26 
39 void sign_flip(raft::handle_t& handle,
40  std::vector<MLCommon::Matrix::Data<float>*>& input_data,
41  MLCommon::Matrix::PartDescriptor& input_desc,
42  float* components,
43  std::size_t n_components,
44  cudaStream_t* streams,
45  std::uint32_t n_stream);
46 
47 void sign_flip(raft::handle_t& handle,
48  std::vector<MLCommon::Matrix::Data<double>*>& input_data,
49  MLCommon::Matrix::PartDescriptor& input_desc,
50  double* components,
51  std::size_t n_components,
52  cudaStream_t* streams,
53  std::uint32_t n_stream);
54 
55 }; // end namespace opg
56 }; // end namespace PCA
57 }; // 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
Definition: dbscan.hpp:30
@ PCA
Definition: tsne.h:31