Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

About the PCA in section 3.1 of the paper. #10

Open
biwanqing opened this issue Jul 11, 2022 · 0 comments
Open

About the PCA in section 3.1 of the paper. #10

biwanqing opened this issue Jul 11, 2022 · 0 comments

Comments

@biwanqing
Copy link

Hi, thank you for releasing the code. I have a question that looking forward to your answers:
This PCA code, in my opinion, reduces the dimensionality of the features (K*K) and proves the redundancy of the features within each kernel, how is the intra-kernel correlations derived from this?

step 1: split 3D kernel F into 2D kernels (assuming F is of size CxHxW)

xs = [F[nChannel, :, :].flatten() for nChannel in range(F.shape[0])]
X = np.array(xs)

step 2: perform PCA

import sklearn.decomposition
pca = sklearn.decomposition.PCA(n_components=None)
pca.fit(X)

step3: this is the variance of F which is explained by the first principal component (PC1)

v = pca.explained_variance_ratio_[0]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant