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

Add entropy analysis singular vectors #277

Open
charlesmartin14 opened this issue Aug 20, 2023 · 0 comments
Open

Add entropy analysis singular vectors #277

charlesmartin14 opened this issue Aug 20, 2023 · 0 comments

Comments

@charlesmartin14
Copy link
Member

charlesmartin14 commented Aug 20, 2023

We would like to extend the entropy analysis of eigenvectors to add the
Entropy Analysis of Singular Vectors of W

Currently we analyze the eigenvectors of X = W^{T}W (or sometimes X=WW^{T})
I would like to extend this to perform SVD on W=USV^{W} and perform the same analysis on the U and V left and right singular vectors

Note: when X=W^{T}W then the eigenvectors of X correspond to the left singular vectors U
(and when X=WW^{T}) then we analyzing V)

Recently, however, we have found that the entropies (and other metrics) of the U and V vectors can be very different

To make this as easy as possible:

I propose simply refactoring the method
apply_analyze_eigenvectors(self, ww_layer, params=None):

into
apply_analyze_singularvectors(self, ww_layer, params=None):
and
plot_singularvector_metrics(svals, vec_entropies, loc_ratios, part_ratios, type=LEFT|RIGHT)

Then we modify the main method so that instead of computing

evals, V = eig_full(X, method=params[SVD_METHOD])
            all_evals.extend(evals)

We compute the full SVD, and generate the metrics for the U and V singular vectors, and provide the same plots for both

This should take an hour or so to code, not counting unit tests

Additional extensions

  • save the U and V metrics in the layer for use later in a new method
  • possibly change /extend the entropy to be normalized by the number of bins so entropies can be compared across different layers
  • add the SVDShuffling method which is like SVDSmoothing, but uses the full SVD (rather than Truncated SVD) and shuffles the bulk eigenvalues rather than simply dropping them
  • Allow SVDShuffling and/or SVDSmoothing to select vectors to retain by the entropy metrics ( i.e. N lowest entropy left and right singular vectors, etc)
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