Optimize the surround predictors in fitB's baseline estimate
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 12/100
- issue の種類
- リファクタリング
- 明瞭さ
- 説明が足りない
- 活発さ
- 活発
- 領域
- data
調査の方向性
Start in dependencies/extraction/extractTrial.m, where fitB calls getSurround, and read setParamsExtractTrial.m for params.Bfilter and the ±10·mean(Y) bounds. The issue lists several alternative designs and no chosen one, so agree on an approach with the maintainers first. Done means the paired short-trial denoised r and the real-trial RSS drop, coherence and bound-fraction checks all move in the intended direction.
索引モデルが issue の本文から書いたものです。
説明
Background
fitB (dependencies/extraction/extractTrial.m) fits each pixel's baseline jointly with three surround predictors. They are meant to capture fast background fluctuations shared with neighbouring pixels. getSurround builds them by filtering the high-passed residual (Y − HX, high-passed by splitFreq) with the filters in params.Bfilter (setParamsExtractTrial.m):
- a ring, max(0, G(σ = selRadius) − G(σ = selRadius/2)), positive from about 5.7 px out at selRadius = 6;
- that ring times a left–right gradient mask;
- that ring times an up–down gradient mask.
Each pixel gets its own coefficient for each predictor. The coefficients are bounded at ±10·mean(Y), like the other baseline coefficients.
These notes come from the baseline-model work in #37 and #40. #40 keeps the surround unchanged, because removing it costs a little accuracy. But it looks under-used, and there are clear things to try.
What it contributes now
Short-trial ground truth. These are the 12 simulations, cut into 30 s trials with the real 780125 trial-end gaps imposed (the harness described in #40). Removing the surround predictors changes denoised r by:
- −0.0019 per source with the sine basis (24 sources better, 74 worse by more than 0.005);
- −0.0015 with the penalized spline from #40 (26 better, 78 worse).
LS r and event F1 barely change.
Real data. I dumped 65 fitB calls from 780125 trials (T = 5633 at 200 Hz) and refitted each with and without the surround (sine basis):
- It explains little. The median fractional drop in weighted RSS is 0.0010 (10th–90th percentile 0.0006–0.0017). That is about twice what 3 extra predictors give by chance (3/T = 0.0005).
- It changes LS traces slightly. The fast part moves by 0.08 noise SD (0.03–0.15), about 1.3% of F0.
- No activity leaks into it on average. The correlation between the change in LS and the source's activity has a median of 0.00.
- It is incoherent across pixels. Within a subproblem, the surround contributions of different pixels correlate at a median of 0.02.
- The exception is one single-source subproblem, where they correlate at 0.54 and rise with bursts of activity.
- There it explains 15× chance (RSS drop 0.0075) and moves LS by 0.37 noise SD.
- Its correlation with activity is −0.20, so it lowers LS when the source is active. That may be real neuropil or out-of-focus signal, or it may be removing real signal.
The 10 dumps from the long simulations (T = 78260) look the same: RSS drop 0.0001 against 0.00004 by chance, and coherence 0.06.
Cost. Since #37 the surround is a sparse pixels × pixels product, and cheap. Before #37 it was most of fitB's time on long trials.
Why it is probably under-used
-
Most of the ring lies outside the subproblem. A subproblem only holds pixels within selRadius of its sources (
imdilate(..., strel('disk', selRadius)) & selPix), andgetSurroundtreats everything else as zero. On the real dumps, the median share of the ring's weight that lands on pixels inside the subproblem is:- 13% for single-source subproblems;
- 35% for subproblems with 4 or more sources;
- 5–40% across all 65.
So the predictor mostly sees the subproblem's own pixels near the sources, not the surround.
-
The coefficient bounds are on the wrong scale. A surround coefficient is dimensionless: the pixel's fast fluctuation per unit of filtered residual. Its bound, ±10·mean(Y), is in photons per sample.
- With the median mean(Y) of 0.57, the bound is about ±6.
- The ring's weight inside the subproblem sums to only about 0.06 (median over pixels; 0.445 in total).
- So following a fluctuation shared by the whole neighbourhood would need a coefficient of about 17.
On the real trials, a median of 27% of surround coefficients sit at a bound (7–50% across subproblems). On the long simulations it is about 10%.
-
Independent per-pixel coefficients fit noise. Each pixel fits three coefficients on its own, which gives contributions that are incoherent across pixels (r ≈ 0.02). A truly shared background would give coherent contributions.
Things to try
- Feed the surround from outside the subproblem. Give each subproblem a wider ring of pixels (for example selPix dilated by another selRadius), used only to build the surround.
- Their residual needs HX for sources that belong to neighbouring subproblems.
- One option is to high-pass Y directly at pixels outside every footprint. Another is to use the previous iteration's estimates.
- Normalize the predictors. Divide each surround predictor by its filter weight inside the subproblem, or by its SD. Coefficients then mean the same thing in every pixel, and bounds of a few units make sense, independent of mean(Y). A ridge penalty could replace the bounds.
- Share the fast background across the subproblem. Fit one or a few fast background time courses per subproblem, with per-pixel loadings, instead of three independent coefficients per pixel. That uses far fewer free parameters and is coherent by construction.
- Watch for activity leakage. A wider or less constrained surround could take on more of the coherent, activity-correlated component seen in the one subproblem above. Check the correlation between the change in LS and activity.
- Check what the simulations contain. If they have no fast, spatially shared background, ground truth can only show what the surround costs, not what it gains. It is worth checking before relying on the short-trial harness to judge changes here.
How to evaluate
- Short-trial ground truth: paired per-source denoised r, overall, near trial ends and in the interior.
- Real trials: RSS drop against chance, coherence across pixels, the fraction of coefficients at a bound, and the correlation between the change in LS and activity.
The short-trial harness and the dump analysis behind these numbers aren't in the repo yet.
- 主要言語
- MATLAB
- スター
- 3
- フォーク
- 3
- 平均マージ
- 1日 22時間
- マージ済み PR(30日)
- 31
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
AllenNeuralDynamics/GIAnT-MATLAB のほかの issue
-
難易度 5/5 1週間以上 初心者へのやさしさ 8/100
AllenNeuralDynamics/GIAnT-MATLAB#56 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
AllenNeuralDynamics/GIAnT-MATLAB#49 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 20/100
AllenNeuralDynamics/GIAnT-MATLAB#45 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 12/100
AllenNeuralDynamics/GIAnT-MATLAB#42 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
AllenNeuralDynamics/GIAnT-MATLAB#36 ·
メンテナーはふだん 1 日以内に返信
AllenNeuralDynamics/GIAnT-MATLAB の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 76/100
UniprJRC/DSwithMATLAB#255 ·
-
Bump ODEInterface_jll to rebuilt 0.0.2+2 (execstack fix) in 8 benchmark folder Manifests対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
SciML/SciMLBenchmarks.jl#2044 · コメント 2 件 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
MohammadRaziei/ctoon#12 ·
-
easy first-contributor first-contributors good first issue help wanted matlab up-for-grabs
難易度 1/5 1時間未満 初心者へのやさしさ 95/100
fork-commit-merge/fork-commit-merge#8766 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100