init is only X and not X, active_set#3
init is only X and not X, active_set#3agramfort merged 2 commits intoagramfort:CD_mxnefrom joewalter:CD_mxne_no_as_in_init
Conversation
mne/mixed_norm/optim.py
Outdated
There was a problem hiding this comment.
the purpose is to never store a full X with n_sources, n_times but just the non zeros. In other words we should never have to do : np.zeros((n_sources, n_times))
There was a problem hiding this comment.
use init with (X, active set) is a simple way to have a sparse row matrix.
There was a problem hiding this comment.
but you already transfer X restricted to the active set (both _solver functions do this restriction) and G[:, active_set] to the _solver functions. So active_set (which is defined on the full leadfield) has no real meaning in the _solver functions as it points to the full leadfield.
In the first iteration, X will be a dense matrix, but then as soon as we use init, X will be nonzero in rows corresponding to the old active set
There was a problem hiding this comment.
In the init case, the matrix I pass, is still the old one, which is a matrix n_new_as x n_times, with non_zeros in n_old_as rows and zeros otherwise
init is only X and not X, active_set
|
ok merged |
|
thanks ! |
Init is now X_init, which is either None or the previous source estimate. Active set is not transferred using Init as it is not used but overwritten in the _solver functions. Nosetests run without error.