-
Notifications
You must be signed in to change notification settings - Fork 371
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
nb=0 #1172
base: dev
Are you sure you want to change the base?
nb=0 #1172
Conversation
Sounds very cool -- thanks! Will review in the next day. |
|
||
Y_resf = np.dot(Y, f.T) | ||
b = np.maximum(Y_resf, 0) / (np.linalg.norm(f)**2) | ||
if Y.shape[-1] < 30000: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may want to consider making this threshold overridable or at least less magical
else: | ||
print('estimating f') | ||
f = 0 | ||
for xxx in np.where(not_px)[0]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we give this variable a better name?
@@ -197,7 +197,8 @@ def update_temporal_components(Y, A, b, Cin, fin, bl=None, c1=None, g=None, sn=N | |||
|
|||
A = scipy.sparse.hstack((A, b)).tocsc() | |||
S = np.zeros(np.shape(Cin)) | |||
Cin = np.vstack((Cin, fin)) | |||
if fin is not None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a comment explaining how this works?
Generally looks good |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the selem
keyword was deprecated at scikit learn, and we still have it, it might be nice to define what it means in this function: e.g., in the docs for it maybe just mention it stands for 'structuring element'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you mean skimage? I remember playing with this years ago, it means something like the "where stuff is multiplier" =S
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes oops scikitimage
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this explains selem, the structuring element https://scikit-image.org/docs/stable/auto_examples/applications/plot_morphology.html
if Y.shape[-1] < 30000: | ||
f = Y[not_px, :].mean(0) | ||
else: | ||
print('estimating f') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a few print statements in here -- in final draft convert to logger info or debug statements?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good and is pushing things in an important direction. This makes changes to both block coordinate descent update functions, so let's just keep an eye open for weirdness. 😄
Description
Enable to run CNMF without background components (nb=0) for cases when the background has already been removed in a pre-processing step using other means. Fixes #1068. (and a deprecation mentioned in #1130)
Type of change
Has your PR been tested?
Yes
python caimanmanager.py test
and
python caimanmanager.py demotest