alphacsc.learn_d_z#
- alphacsc.learn_d_z(X, n_atoms, n_times_atom, func_d=<function update_d_block>, reg=0.1, lmbd_max='fixed', n_iter=60, random_state=None, n_jobs=1, solver_z='l-bfgs', solver_d_kwargs={}, solver_z_kwargs={}, ds_init=None, sample_weights=None, verbose=10, callback=None, stopping_pobj=None)#
Univariate Convolutional Sparse Coding.
- Parameters
- Xarray, shape (n_trials, n_times)
The data on which to perform CSC.
- n_atomsint
The number of atoms to learn.
- n_times_atomint
The support of the atom.
- func_dcallable
The function to update the atoms.
- regfloat
The regularization parameter
- lmbd_max‘fixed’ | ‘scaled’ | ‘per_atom’ | ‘shared’
- If not fixed, adapt the regularization rate as a ratio of lambda_max:
‘scaled’: the regularization parameter is fixed as a ratio of its maximal value at init i.e. reg_used = reg * lmbd_max(uv_init)
‘shared’: the regularization parameter is set at each iteration as a ratio of its maximal value for the current dictionary estimate i.e. reg_used = reg * lmbd_max(uv_hat)
‘per_atom’: the regularization parameter is set per atom and at each iteration as a ratio of its maximal value for this atom i.e. reg_used[k] = reg * lmbd_max(uv_hat[k])
- n_iterint
The number of coordinate-descent iterations.
- random_stateint | None
The random state.
- n_jobsint
The number of parallel jobs.
- solver_zstr
The solver to use for the z update. Options are ‘l-bfgs’ (default) | ‘ista’ | ‘fista’
- solver_d_kwargsdict
Additional keyword arguments to provide to update_d
- solver_z_kwargsdict
Additional keyword arguments to pass to update_z
- ds_initstr or array, shape (n_atoms, n_times_atom)
The initial atoms or an initialization scheme in {‘chunk’ | ‘random’}.
- sample_weightsarray, shape (n_trials, n_times)
The weights in the alphaCSC problem. Should be None when using vanilla CSC.
- verboseint
The verbosity level.
- callbackfunc
A callback function called at the end of each loop of the coordinate descent.
- Returns
- pobjlist
The objective function value at each step of the coordinate descent.
- timeslist
The cumulative time for each iteration of the coordinate descent.
- d_hatarray, shape (n_atoms, n_times)
The estimated atoms.
- z_hatarray, shape (n_atoms, n_trials, n_times - n_times_atom + 1)
The sparse activation matrix.
- regfloat
Regularization parameter used.