Allow loading seed for CNMF and CNMFE #336
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is an enhancement to use seeded CNMF that I've been using regularly in my own code. Basically you just compute the seed however you want, save it as an .npy file, and pass the path to that file in the "Ain_path" field of the params dict. It's not super elegant, but I didn't want to assume how I or others might want to compute the seed in the future, so figured it would be better to just allow loading a seed rather than try to add functionality or parameters for actually computing it. I also added tests and new ground truth data for seeded CNMF and CNMFE.
There's one other piece to this, which is updating the
get_params_diffs
function so that it shows differing parameters anywhere in the dict, not just within "main," but also lifts the contents of "main" to the top level when computing/showing diffs for convenience. I changed this because I wanted to see which "Ain" (if any) was used; in my own code I encoded some parameters for how to compute Ain in the filename. And I factored out the part of the code that computes the diffs so that it just deals with lists of dicts rather than anything to do with pandas (I think I wanted to use it somewhere else). Again, this is what I've been using for a while, but unfortunately it's not currently tested.