⚡ Bolt: optimize runica.py preprocessing and training loops#270
⚡ Bolt: optimize runica.py preprocessing and training loops#270suraj-ranganath wants to merge 1 commit into
Conversation
- Vectorized row mean subtraction using broadcasting. - Replaced redundant matrix-based bias addition with broadcasting. - Moved np.errstate outside of training loops and switched to native @ operator to reduce overhead. - Improved readability of core natural gradient formulas. Co-authored-by: suraj-ranganath <14310165+suraj-ranganath@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
Claude finished @suraj-ranganath's task in 2m 42s —— View job Code review
I reviewed all four training loops, the mean-subtraction vectorization, and the
Important
Nits
Test gapsNone. Existing EEGLAB parity notesNone. The
|
💡 What: Optimized the `runica` implementation in `src/eegprep/functions/sigprocfunc/runica.py`.
🎯 Why: The previous implementation had significant overhead from tight Python loops and redundant matrix operations that could be handled efficiently by NumPy broadcasting and native operators.
📊 Impact: Reduces Standard ICA execution time by approximately 10% (from ~0.86s to ~0.78s for 10k frames/20 steps in local benchmarks). Improves readability of core numerical logic.
🔬 Measurement: Verified correctness using `uv run pytest tests/test_runica.py` (21 passed) and documented performance gains using a temporary benchmark script.
PR created automatically by Jules for task 16203114544017163981 started by @suraj-ranganath