runamica: min_dll and min_grad_norm written as %f, so AMICA's stopping rules never fire

Open Beginner friendly
#680 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
82/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
data

Research direction

Start in runamica._write_param_file, where float parameters are written with %f except minlrate and mineig, which already use scientific format. Switch min_dll and min_grad_norm (and any other parameter that can fall below 1e-6) to the same scientific format. Add a test that writes the parameter file and reads it back, checking that the two values are not written as 0.000000. Done when the amica15 parameter file carries the nonzero values and the test passes.

Written by the indexing model from the issue text.

Description

At edf694c8, runamica._write_param_file writes every float parameter with %f except minlrate and mineig. min_dll=1e-9 and min_grad_norm=1e-7 therefore reach the amica15 binary as 0.000000, so use_min_dll and use_grad_norm can never stop a run and every fit runs to max_iter. Fix: write both (and any other parameter that can be below 1e-6) in scientific format, as for minlrate and mineig, and add a test that reads the parameter file back.

Found while setting conservative AMICA convergence for NEMAR's nemar-ica (nemarOrg/nemar-process#81, epic nemarOrg/nemar-cli#2324). pAMICA receives the correct values; only the amica15 binary path is affected.

Dominant language
Python
Stars
38
Forks
10
Avg merge
18h 23m
Merged PRs (30d)
218

Getting set up

  • Ships a Dockerfile or Docker Compose file
  • No pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from sccn/eegprep

All issues in sccn/eegprep

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.