昇腾社区首页
中文
注册

AscendPCAMatrix

API定义

explicit AscendPCAMatrix(int dimIn, int dimOut, float eigenPower, bool randomRotation, std::initializer_list<int> devices = { 0 })

功能描述

AscendPCAMatrix的构造函数,配置对应参数。

输入

int dimIn:PCA的输入维度。

int dimOut:PCA的输出维度。

float eigenPower:白化参数,特征向量方向的分量乘以对应特征值的eigenPower次方,该值为“-0.5”时完全白化,为“0”时不变。在深度学习中,降维数据白化有利于模型的快速收敛。在检索业务中与Faiss保持一致,但未对该参数作详细研究。

bool randomRotation:是否进行随机旋转。

std::initializer_list<int> devices:执行PCA的NPU侧资源配置。

输出

返回值

约束说明

  • “devices”需要为合法有效的芯片ID。
  • 0 < dimOut ≤ dimIn
  • -0.5 ≤ eigenPower ≤ 0