You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reduce memory_footprint for sparse PCA transform (#5964)
The sparse PCA still densified `X` during the transform step. This defeats the purpose of a sparse PCA in a sense. However
```
precomputed_mean_impact = self.mean_ @ self.components_.T
mean_impact = cp.ones((X.shape[0], 1)) @ precomputed_mean_impact.reshape(1, -1)
X_transformed = X.dot(self.components_.T) -mean_impact
```
is the same as
```
X = X - self.mean_
X_transformed = X.dot(self.components_.T)
```
The new implementation is faster (but mainly due to the fact that we don't have to rely on cupy's `to_array()`) and uses a lot less memory.
Authors:
- Severin Dicks (https://github.com/Intron7)
- Dante Gama Dessavre (https://github.com/dantegd)
Approvers:
- Dante Gama Dessavre (https://github.com/dantegd)
URL: #5964
0 commit comments