concepts.vision.fm_match.dino.get_feature.torch_pca#

torch_pca(feature, target_dim=256)[source]#

Perform Principal Component Analysis (PCA) on the input feature tensor.

Parameters: - feature (torch.Tensor): The input tensor with shape (N, D), where N is the number of samples

and D is the feature dimension.

  • target_dim (int, optional): The target dimension for the output tensor. Defaults to 256.

Returns: - torch.Tensor: The transformed tensor with shape (N, target_dim).

Parameters:
Return type:

Tensor