AscendPCAMatrix

API Definition

explicit AscendPCAMatrix(int dimIn, int dimOut, float eigenPower, bool randomRotation, AscendVectorTransformConfig config)

Function

Constructor of AscendPCAMatrix, which configures corresponding parameters.

Input

int dimIn: PCA input dimension.

int dimOut: PCA output dimension.

float eigenPower: whitening parameter. Calculation formula: Whitening value = Component in the feature vector direction x Power of the eigenPower of the corresponding feature. The value -0.5 indicates that the data is completely whitened, and 0 indicates that it is not whitened. In deep learning, the whitening of dimension-reduced data facilitates quick model convergence. This parameter is consistent with that in Faiss for retrieval services. No further research is conducted on this parameter.

bool randomRotation: whether to perform random rotation.

AscendVectorTransformConfig config: resource configuration on the NPU to perform PCA.

Output

N/A

Return Value

N/A

Restrictions

  • 0 < dimOut ≤ dimIn
  • -0.5 ≤ eigenPower ≤ 0