Skip to content

BUG: movSv is all zeros when motSVD is disabled #173

Description

@mwshinn

Version information:

$ python -m facemap

facemap version: 	1.0.8
platform:       	linux
python version: 	3.8.20
torch version:  	2.4.1+cu121
numpy version:  	1.24.4

Describe the issue:

When calling process.run() with motSVD=False and movSVD=True, the saved movSv is a vector of zeros. Similarly, under these conditions, movSVD has more than ncomps components.

It looks like the final reduction is iterating over the length of U_mot:

for nr in range(len(U_mot)):

When motSVD=False, U_mot is empty, so this loop is skipped and S_mov remains at its zero initialisation.

I think this can be fixed by choosing the list based on which SVD is enabled:

-        for nr in range(len(U_mot)):
+        for nr in range(len(U_mov) if movSVD else len(U_mot)):

As a workaround, running with both motSVD=True and movSVD=True produces the expected nonzero movSv.

Error message:

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions