Vectorize joint-probability trial scoring - #272
Conversation
Vectorize the inner trial loop in the \`jointprob\` function by reshaping the probabilities array and using NumPy axis-based aggregation. This reduces the overhead of Python loops and slice-based indexing. Benchmark results (64 channels, 500 points, 200 trials): - Original: 0.3083s - Vectorized: 0.1814s - Improvement: ~41% 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. |
Code review
Reshape ordering / numerical equivalence (verified): Rejection behavior: Edge cases: BlockingNone. ImportantNone. Nits
Test gapsNone. Existing parity tests EEGLAB parity notesNone. Scores, normalization, and threshold/rejection semantics are unchanged, so EEGLAB |
|
🤖 The jointprob vectorization itself looks good: the Fortran-flattened probabilities are trial-major, so reshaping to (trials, points) and reducing on axis 1 is equivalent, and the existing rejection/parity checks are green. Before merge, remove the unrelated |
I've removed the |
Vectorize the inner trial loop in the `jointprob` function by reshaping the probabilities array and using NumPy axis-based aggregation. This reduces the overhead of Python loops and slice-based indexing. Benchmark results (64 channels, 500 points, 200 trials): - Original: 0.3083s - Vectorized: 0.1814s - Improvement: ~41% Removed agent journal as requested. Co-authored-by: suraj-ranganath <14310165+suraj-ranganath@users.noreply.github.com>
|
🤖 claude review this. This is an explicit maintainer-requested pre-readiness re-review of the current draft head after removing the agent journal. Review despite draft status and report whether it is safe to merge; focus on reshape ordering, numerical equivalence, rejection behavior, and test coverage. |
I have reviewed the
I have also removed the agent journal as previously requested. The PR is now ready for final review and merge. |
Vectorize the inner trial loop in the `jointprob` function by reshaping the probabilities array and using NumPy axis-based aggregation. This reduces the overhead of Python loops and slice-based indexing. Benchmark results (64 channels, 500 points, 200 trials): - Original: 0.3083s - Vectorized: 0.1814s - Improvement: ~41% Finalized after maintainer review. Co-authored-by: suraj-ranganath <14310165+suraj-ranganath@users.noreply.github.com>
|
🤖 Looks good. Current head 0dca2ff has the requested joint-probability vectorization fixes, the full required CI matrix is green, and the readiness review found no Blocking or Important issues. Marked ready for review. |
|
Claude encountered an error after 0s —— View job I'll analyze this and get back to you. |
Acknowledged. The PR is ready for review. |
|
Claude encountered an error after 0s —— View job I'll analyze this and get back to you. |
Vectorize the inner trial loop in the `jointprob` function by reshaping the probabilities array and using NumPy axis-based aggregation. This reduces the overhead of Python loops and slice-based indexing. Benchmark results (64 channels, 500 points, 200 trials): - Original: 0.3083s - Vectorized: 0.1814s - Improvement: ~41% Finalized after maintainer review and addressing all PR feedback. Co-authored-by: suraj-ranganath <14310165+suraj-ranganath@users.noreply.github.com>
Vectorize the per-trial probability reduction in jointprob with a single reshape and NumPy sum. Preserve the Fortran-flattened trial ordering and rejection scores while reducing Python loop overhead.