LinearTransformation¶
- class torchvision.transforms.LinearTransformation(transformation_matrix, mean_vector)[source]¶
使用方形变换矩阵和离线计算的 mean_vector 转换张量图像。此转换不支持 PIL Image。给定 transformation_matrix 和 mean_vector,将平展 torch.*Tensor 并从中减去 mean_vector,然后计算与变换矩阵的点积,最后将张量重塑为其原始形状。
- 应用
白化变换:假设 X 是一个列向量零中心化数据。然后计算数据协方差矩阵 [D x D] 使用 torch.mm(X.t(), X),对此矩阵执行 SVD,并将其作为 transformation_matrix 传递。
- 参数:
transformation_matrix (Tensor) – 张量 [D x D],D = C x H x W
mean_vector (Tensor) – 张量 [D],D = C x H x W