Skip to content

Commit

Permalink
Rename l1_ratio parameter for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
pgunn committed Jan 14, 2025
1 parent 56ffa62 commit 52dfd57
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions caiman/source_extraction/cnmf/initialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def initialize_components(Y, K=30, gSig=[5, 5], gSiz=None, ssub=1, tsub=1, nIter
min_corr=0.8, min_pnr=10, seed_method='auto', ring_size_factor=1.5,
center_psf=False, ssub_B=2, init_iter=2, remove_baseline = True,
SC_kernel='heat', SC_sigma=1, SC_thr=0, SC_normalize=True, SC_use_NN=False,
SC_nnn=20, lambda_gnmf=1, l1_ratio:float=0.0):
SC_nnn=20, lambda_gnmf=1, snmf_l1_ratio:float=0.0):
"""
Initialize components. This function initializes the spatial footprints, temporal components,
and background which are then further refined by the CNMF iterations. There are four
Expand Down Expand Up @@ -256,7 +256,7 @@ def initialize_components(Y, K=30, gSig=[5, 5], gSiz=None, ssub=1, tsub=1, nIter
init_iter: int, optional
number of iterations for 1-photon imaging initialization
l1_ratio: float
snmf_l1_ratio: float
Used only by sparse NMF, passed to NMF call
Returns:
Expand Down Expand Up @@ -337,7 +337,7 @@ def initialize_components(Y, K=30, gSig=[5, 5], gSiz=None, ssub=1, tsub=1, nIter
elif method == 'sparse_nmf':
Ain, Cin, _, b_in, f_in = sparseNMF(
Y_ds, nr=K, nb=nb, max_iter_snmf=max_iter_snmf, alpha=alpha_snmf,
sigma_smooth=sigma_smooth_snmf, remove_baseline=remove_baseline, perc_baseline=perc_baseline_snmf, l1_ratio=l1_ratio)
sigma_smooth=sigma_smooth_snmf, remove_baseline=remove_baseline, perc_baseline=perc_baseline_snmf, l1_ratio=snmf_l1_ratio)

elif method == 'compressed_nmf':
Ain, Cin, _, b_in, f_in = compressedNMF(
Expand Down
2 changes: 1 addition & 1 deletion caiman/source_extraction/cnmf/params.py
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,7 @@ def __init__(self, fnames=None, dims=None, dxy=(1, 1),
'init_iter': init_iter,
'kernel': None, # user specified template for greedyROI
'lambda_gnmf': 1, # regularization weight for graph NMF
'l1_ratio': 0.0,
'snmf_l1_ratio': 0.0, # L1 ratio, used by sparse nmf mode only
'maxIter': 5, # number of HALS iterations
'max_iter_snmf': 500,
'method_init': method_init, # can be greedy_roi, corr_pnr sparse_nmf, local_NMF
Expand Down

0 comments on commit 52dfd57

Please sign in to comment.