Skip to content

Commit2 regularisation - Error float division #153

@arnaudbore

Description

@arnaudbore

Dear experts,

I'm updating scilpy with your new release (2.4.1).

I've got some issues related to the regularisation (code).

After setting the regularisation when I run the fit I end up with this error:

Code

            # set the regularisation
            mit.set_regularisation(
                regularisers=('group_lasso', None, None),
                is_nonnegative=(True, True, True),
                lambdas=(perc_lambda, None, None),
                params=(params_IC, None, None))

            mit.fit(tol_fun=1e-3, max_iter=args.nbr_iter)

Error

INFO:root:Adding commit weights to /tmp/tmpa2_a7n_2/Results_StickZeppelinBall/decompose_commit.h5.
/home/local/USHERBROOKE/bora2502/p/scil/s/scilpy/src/scilpy/cli/scil_tractogram_commit.py:501: RuntimeWarning: invalid value encountered in scalar divide
  mit.set_regularisation(
Traceback (most recent call last):
  File "/home/local/USHERBROOKE/bora2502/.virtualenvs/scilpy312/bin/scil_tractogram_commit", line 10, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/local/USHERBROOKE/bora2502/p/scil/s/scilpy/src/scilpy/cli/scil_tractogram_commit.py", line 507, in main
    mit.fit(tol_fun=1e-3, max_iter=args.nbr_iter)
  File "commit/core.pyx", line 1455, in commit.core.Evaluation.fit
  File "commit/core.pyx", line 1456, in commit.core.Evaluation.fit
  File "/home/local/USHERBROOKE/bora2502/.virtualenvs/scilpy312/lib/python3.12/site-packages/commit/solvers.py", line 241, in solve
    return fista(y, A, At, omega, prox, confidence_array, tol_fun, tol_x, max_iter, verbose, x0)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/local/USHERBROOKE/bora2502/.virtualenvs/scilpy312/lib/python3.12/site-packages/commit/solvers.py", line 272, in fista
    prox( xhat, 1.0 )
  File "/home/local/USHERBROOKE/bora2502/.virtualenvs/scilpy312/lib/python3.12/site-packages/commit/solvers.py", line 201, in <lambda>
    prox = lambda x, scaling: proxIC(proxEC(proxISO(x, scaling), scaling), scaling)
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/local/USHERBROOKE/bora2502/.virtualenvs/scilpy312/lib/python3.12/site-packages/commit/solvers.py", line 97, in <lambda>
    proxIC = lambda x, scaling: non_negativity(prox_group_lasso(x,groupIdxIC,groupSizeIC,dictIC_params['group_weights'],scaling*lambda_group_IC),startIC,sizeIC)
                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "commit/proximals.pyx", line 103, in commit.proximals.prox_group_lasso
  File "commit/proximals.pyx", line 130, in commit.proximals.prox_group_lasso
ZeroDivisionError: float division

Is there any new thing in the API I didn't catch ?

Here are some data

This is the command:

scil_tractogram_commit sub-01__decomposed.h5 sub-01_desc-preproc_dwi.nii.gz sub-01_desc-preproc_dwi.bval sub-01_desc-preproc_dwi.bvec "sub-01__results_bzs/" --processes 1 --para_diff 1.62E-3 --iso_diff 2.92E-3 --commit2 --lambda_commit_2 0.001 --nbr_dir 500 --in_peaks sub-01_desc-peaks.nii.gz -v DEBUG -f

I also have a second error when I set the number of threads at 2, I end up with this error:

Distributing workload to different threads                                 
INFO:core:Distributing workload to different threads
   * Number of threads: 2
Level 21:core:   * Number of threads: 2
   * A operator   Level 21:core:   * A operator 
\ ERROR  Too many threads for the EC compartments to evaluate; try          
decreasing the number                                                        <module:scil_tractogram_commit, line:477>
ERROR:core:Too many threads for the EC compartments to evaluate; try decreasing the number

Thank you very much in advance for your help
Arnaud

Metadata

Metadata

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions