Datasets:
Upload estimated receptive fields
Browse files
data-2p/df_eyewire2_roi_level_mc_rf.md
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# `df_eyewire2_roi_level_mc_rf.parquet`
|
| 2 |
+
|
| 3 |
+
Mouse-cam (MC) movie receptive fields (RFs) of all ROIs in `df_eyewire2_roi_level_GCL{0..4}.parquet`. One row per ROI.
|
| 4 |
+
Join to the ROI tables on `experimenter, date, exp_num, field, roi_id`. Array columns are stored as JSON lists. They
|
| 5 |
+
are restored to numpy arrays by `data_loader.load_parquet_df`.
|
| 6 |
+
|
| 7 |
+
Produced by `scripts/preprocessing/mc_rfs/fit_mc_rfs.py` in eyewire2-functional-analysis.
|
| 8 |
+
|
| 9 |
+
## Method
|
| 10 |
+
|
| 11 |
+
- **Stimulus**: the MC movie of the field (`mc` column), green and UV channels, binned 2 x 2 to 28 x 28 pixels of 25 um,
|
| 12 |
+
z-scored. The movie is centered on the recording field.
|
| 13 |
+
- **Response**: the positive part of the derivative of `mc_pp_trace`, sampled at the movie frame times (30 Hz).
|
| 14 |
+
- **Model**: group-lasso GLM `y ~ relu(X w + b)`. `X` is the stimulus projected onto a separable cubic B-spline basis:
|
| 15 |
+
15 functions over time lags from -1.2 s to +0.3 s, 14 x 14 over space, and the 2 channels. The fit minimizes the MSE
|
| 16 |
+
plus a group-lasso penalty on `w`: the sum over the spatio-temporal basis functions of the Euclidean norm of their
|
| 17 |
+
(green, UV) weight pair. Both channels of a basis function are therefore zero or non-zero together, and the penalty
|
| 18 |
+
does not favor one channel (a plain lasso tends to zero the weaker of the correlated channels, usually green). The
|
| 19 |
+
response is divided by its std. The solver is FISTA (accelerated proximal gradient with adaptive restart, JAX), which
|
| 20 |
+
gives exact zeros. It is trained on both training sequences (`train1` + `train2`, 2 x 54 five-second clips) and has
|
| 21 |
+
no cross-validation. The model is the GLM of RFEst (https://github.com/berenslab/RFEst), with the group penalty in
|
| 22 |
+
place of its L1 penalty.
|
| 23 |
+
- **Penalty sweep**: 7 penalties, log-spaced from 1e-3 to 1 relative to `alpha_max`. `alpha_max` is the smallest
|
| 24 |
+
penalty that gives all-zero weights in the linear model, so with the ReLU it is only approximate. The fits run from
|
| 25 |
+
the largest to the smallest penalty, each warm-started from the previous one.
|
| 26 |
+
- **Test**: the three repeats of the test sequence (`test1`-`test3`, 25 s each). The first 1.2 s of each repeat are
|
| 27 |
+
skipped. The prediction includes the intercept and the ReLU and is in the units of the response.
|
| 28 |
+
- **Selected RF**: the penalty with the best mean test correlation is chosen per ROI. Because it is chosen on the test
|
| 29 |
+
data, `mc_rf_best_cc` is optimistic. Its STRF is split per channel into an sRF and a tRF by SVD (rank 1). The sRFs of
|
| 30 |
+
both channels are then fitted jointly with a difference of Gaussians (DoG). The fit has a soft prior pulling the
|
| 31 |
+
centers towards the window center (SD 100 um) and a soft penalty on the distance between the green and UV centers.
|
| 32 |
+
|
| 33 |
+
## Per-penalty scores (arrays with one entry per penalty)
|
| 34 |
+
|
| 35 |
+
- **mc_rf_alphas**: Penalties relative to `alpha_max`, shape `(7,)`.
|
| 36 |
+
- **mc_rf_cc**: Test correlation between prediction and response, averaged over the 3 repeats, shape `(7,)`. NaN if the
|
| 37 |
+
prediction is constant, e.g. a ReLU that is always off.
|
| 38 |
+
- **mc_rf_mse**: Test MSE, averaged over the 3 repeats, shape `(7,)`. In the raw units of the response, so it is not
|
| 39 |
+
comparable across ROIs.
|
| 40 |
+
- **mc_rf_cc_repeats**, **mc_rf_mse_repeats**: Same per repeat, shape `(7, 3)`.
|
| 41 |
+
- **mc_rf_frac_nonzero**: Fraction of basis weights that are not exactly zero, shape `(7,)`.
|
| 42 |
+
- **mc_rf_n_iter**: Number of FISTA iterations, shape `(7,)`.
|
| 43 |
+
- **mc_rf_converged**: False if the fit ran to the maximum number of iterations, shape `(7,)`.
|
| 44 |
+
- **mc_rf_opt_res**: Final optimality residual of the FISTA fit (largest violation of the group-lasso optimality
|
| 45 |
+
conditions, relative to `alpha_max`; the fit stops once it is small), shape `(7,)`.
|
| 46 |
+
|
| 47 |
+
## Selected penalty
|
| 48 |
+
|
| 49 |
+
- **mc_rf_best_alpha_idx**: Index of the selected penalty, or -1 if no penalty gave a valid correlation. In that case
|
| 50 |
+
all RF columns are NaN.
|
| 51 |
+
- **mc_rf_best_alpha**, **mc_rf_best_cc**, **mc_rf_best_mse**: Penalty, mean test correlation and mean test MSE of the
|
| 52 |
+
selected penalty.
|
| 53 |
+
|
| 54 |
+
## RF of the selected penalty (per channel `{ch}` = `green`, `uv`)
|
| 55 |
+
|
| 56 |
+
sRF, tRF and DoG amplitudes are flipped so that the fitted DoG center is positive, i.e. the tRF carries the center
|
| 57 |
+
polarity. For example, an OFF-center RF has a positive sRF center and a tRF that is negative before the response.
|
| 58 |
+
The sRF scaled by the tRF approximates the STRF in units of the response per unit of the z-scored stimulus.
|
| 59 |
+
|
| 60 |
+
- **mc_rf_{ch}_srf**: sRF, shape `(28, 28)` `(y, x)` in stimulus (movie) pixel coordinates, not rotated or mirrored
|
| 61 |
+
into retinal coordinates.
|
| 62 |
+
- **mc_rf_{ch}_trf**: tRF, normalized to a maximum absolute value of 1, shape `(46,)`.
|
| 63 |
+
- **mc_rf_trf_t0**, **mc_rf_trf_dt**: Time of the first tRF sample (-1.2 s) and the sampling interval (1/30 s).
|
| 64 |
+
Negative times are stimulus frames before the response.
|
| 65 |
+
- **mc_rf_pixel_size_um**: sRF pixel size (25 um).
|
| 66 |
+
- **mc_rf_{ch}_svd_ev**: Fraction of the STRF variance explained by the rank-1 (sRF x tRF) approximation.
|
| 67 |
+
- **mc_rf_{ch}_dog_polarity**: Sign of the DoG center in the unflipped sRF, where the SVD makes the sRF peak positive.
|
| 68 |
+
-1 means the sRF was flipped.
|
| 69 |
+
- **mc_rf_{ch}_dog_amp**: Center peak amplitude (positive after the flip).
|
| 70 |
+
- **mc_rf_{ch}_dog_x0**, **mc_rf_{ch}_dog_y0**: Center position in pixels. (0, 0) is the center of the top-left pixel;
|
| 71 |
+
the window center is (13.5, 13.5).
|
| 72 |
+
- **mc_rf_{ch}_dog_sx**, **mc_rf_{ch}_dog_sy**, **mc_rf_{ch}_dog_theta**: Center Gaussian sigmas (pixels) and angle
|
| 73 |
+
(radians).
|
| 74 |
+
- **mc_rf_{ch}_dog_amp_s**: Surround peak amplitude (opposite sign to the center).
|
| 75 |
+
- **mc_rf_{ch}_dog_sx_s**, **mc_rf_{ch}_dog_sy_s**: Surround sigmas (pixels). The surround is concentric with the center
|
| 76 |
+
and has the same angle and aspect ratio.
|
| 77 |
+
- **mc_rf_{ch}_dog_surround_ratio**: Surround / center sigma ratio `k` (between 2 and 10).
|
| 78 |
+
- **mc_rf_{ch}_dog_surround_rel_amp**: Surround / center peak ratio `w` (between 0 and 1). The relative surround volume
|
| 79 |
+
is `w k^2`.
|
| 80 |
+
- **mc_rf_{ch}_dog_r2**: Explained variance of the DoG fit of this channel's sRF.
|
data-2p/df_eyewire2_roi_level_mc_rf.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:650a2d1753728f9b39ba759efdac530a87c44b6fe89575b3f9e519eebe5b094f
|
| 3 |
+
size 9494051
|