Processing MC_MAZE data from scratch...
Applying spike processing: 'binary'
Spike rates shape: (94095, 182)
Hand velocity shape: (94095, 2)
Total unique trials: 114750
Splitting each random permutation into: 80325 train, 17212 validation, 17213 test trials
Summary of Online Adaptation (20 Splits):
    X_corr_spk       Y_corr_spk  ...  n_train_samples  n_val_samples  n_test_samples
0     0.713564  0.0    0.635013  ...              NaN            NaN             NaN
1          NaN  NaN         NaN  ...          66297.0        13448.0         14350.0
2     0.722287  0.0    0.608100  ...              NaN            NaN             NaN
3          NaN  NaN         NaN  ...          64657.0        15293.0         14145.0
4     0.746335  0.0    0.665354  ...              NaN            NaN             NaN
5          NaN  NaN         NaN  ...          66789.0        14268.0         13038.0
6     0.734051  0.0    0.617875  ...              NaN            NaN             NaN
7          NaN  NaN         NaN  ...          66953.0        14309.0         12833.0
8     0.739991  0.0    0.631688  ...              NaN            NaN             NaN
9          NaN  NaN         NaN  ...          66297.0        14104.0         13694.0
10    0.735070  0.0    0.625582  ...              NaN            NaN             NaN
11         NaN  NaN         NaN  ...          65764.0        14432.0         13899.0
12    0.733086  0.0    0.651367  ...              NaN            NaN             NaN
13         NaN  NaN         NaN  ...          65108.0        14637.0         14350.0
14    0.739307  0.0    0.634675  ...              NaN            NaN             NaN
15         NaN  NaN         NaN  ...          65928.0        14104.0         14063.0
16    0.737217  0.0    0.641784  ...              NaN            NaN             NaN
17         NaN  NaN         NaN  ...          66133.0        13899.0         14063.0
18    0.722942  0.0    0.610063  ...              NaN            NaN             NaN
19         NaN  NaN         NaN  ...          66256.0        14350.0         13489.0

[20 rows x 8 columns]

Summary of Kalman Filter (20 Splits):
   split  kf_corr_x  kf_corr_y
0      1   0.799980   0.748239
1      2   0.797702   0.751548
2      3   0.796733   0.750026
3      4   0.796143   0.762522
4      5   0.794807   0.759978
5      6   0.791841   0.762070
6      7   0.800113   0.776670
7      8   0.798035   0.739000
8      9   0.800612   0.737184
9     10   0.802470   0.749920
-----

window size=5, hiddensize=512

Trajectory comparison metrics (Full Test Set, 15375 steps):
Raw predictions:
  Mean squared error (Position): 824681205.0018
  X-position correlation: -0.9704
  Y-position correlation: 0.9142
  X-VELOCITY correlation: 0.6842
  Y-VELOCITY correlation: 0.6263
Training Elapsed time (Online Adaptation):  1638.6880369186401

--- Running Kalman Filter ---

--- Setting up Kalman Filter ---
Estimating Observation Matrix H using Linear Regression...
Estimated H shape: (182, 2)
Estimating Measurement Noise Covariance R from residuals...
Estimated R shape: (182, 182) (Full covariance)
Estimating State Transition Matrix F using Linear Regression...
Estimated State Transition Matrix F:
[[ 0.9930368  -0.02839899]
 [ 0.01958494  0.9868502 ]]
Estimating Process Noise Covariance Q from residuals...
Estimated Process Noise Covariance Q:
[[1812.2598209   329.08170343]
 [ 329.08170343 2369.4716229 ]]
Initializing Kalman Filter...
Running Kalman Filter prediction/update loop for 15375 test steps...
Kalman Filter processing time: 18.35 seconds
--- Kalman Filter Setup and Run Complete ---
Split 1 - KF X-Velocity Correlation: 0.7800
Split 1 - KF Y-Velocity Correlation: 0.7565
Trajectory comparison metrics (Full Test Set, 14432 steps):
Raw predictions:
  Mean squared error (Position): 62030070.3846
  X-position correlation: 0.9643
  Y-position correlation: -0.5504
  X-VELOCITY correlation: 0.7112
  Y-VELOCITY correlation: 0.6615
Training Elapsed time (Online Adaptation):  1639.1636581420898

--- Running Kalman Filter ---

--- Setting up Kalman Filter ---
Estimating Observation Matrix H using Linear Regression...
Estimated H shape: (182, 2)
Estimating Measurement Noise Covariance R from residuals...
Estimated R shape: (182, 182) (Full covariance)
Estimating State Transition Matrix F using Linear Regression...
Estimated State Transition Matrix F:
[[ 0.9931975  -0.02712457]
 [ 0.01812566  0.9870214 ]]
Estimating Process Noise Covariance Q from residuals...
Estimated Process Noise Covariance Q:
[[1819.02205007  321.64274421]
 [ 321.64274421 2258.19270354]]
Initializing Kalman Filter...
Running Kalman Filter prediction/update loop for 14432 test steps...
Kalman Filter processing time: 17.34 seconds
--- Kalman Filter Setup and Run Complete ---
Split 2 - KF X-Velocity Correlation: 0.8056
Split 2 - KF Y-Velocity Correlation: 0.7709


Trajectory comparison metrics (Full Test Set, 15457 steps):
Raw predictions:
  Mean squared error (Position): 11696331.7914
  X-position correlation: 0.9104
  Y-position correlation: 0.7360
  X-VELOCITY correlation: 0.7312
  Y-VELOCITY correlation: 0.6269
Training Elapsed time (Online Adaptation):  1627.8287906646729

--- Running Kalman Filter ---

--- Setting up Kalman Filter ---
Estimating Observation Matrix H using Linear Regression...
Estimated H shape: (182, 2)
Estimating Measurement Noise Covariance R from residuals...
Estimated R shape: (182, 182) (Full covariance)
Estimating State Transition Matrix F using Linear Regression...
Estimated State Transition Matrix F:
[[ 0.99271876 -0.02840624]
 [ 0.01877718  0.98688525]]
Estimating Process Noise Covariance Q from residuals...
Estimated Process Noise Covariance Q:
[[1893.47385117  333.93093471]
 [ 333.93093471 2320.01219033]]
Initializing Kalman Filter...
Running Kalman Filter prediction/update loop for 15457 test steps...
Kalman Filter processing time: 18.54 seconds
--- Kalman Filter Setup and Run Complete ---
Split 3 - KF X-Velocity Correlation: 0.7969
Split 3 - KF Y-Velocity Correlation: 0.7501
--- Finished Split 3 ---

Raw predictions:
  Mean squared error (Position): 97537386.0095
  X-position correlation: 0.6628
  Y-position correlation: 0.5232
  X-VELOCITY correlation: 0.7456
  Y-VELOCITY correlation: 0.6541
Training Elapsed time (Online Adaptation):  1665.0059268474579

--- Running Kalman Filter ---

--- Setting up Kalman Filter ---
Estimating Observation Matrix H using Linear Regression...
Estimated H shape: (182, 2)
Estimating Measurement Noise Covariance R from residuals...
Estimated R shape: (182, 182) (Full covariance)
Estimating State Transition Matrix F using Linear Regression...
Estimated State Transition Matrix F:
[[ 0.9932731  -0.02796697]
 [ 0.01947581  0.9865707 ]]
Estimating Process Noise Covariance Q from residuals...
Estimated Process Noise Covariance Q:
[[1819.33352818  325.15703998]
 [ 325.15703998 2376.98612446]]
Initializing Kalman Filter...
Running Kalman Filter prediction/update loop for 13325 test steps...
Kalman Filter processing time: 16.02 seconds
--- Kalman Filter Setup and Run Complete ---
Split 4 - KF X-Velocity Correlation: 0.7966
Split 4 - KF Y-Velocity Correlation: 0.7629
--- Finished Split 4 ---
Velocity magnitude analysis (Full Test Set, 14063 steps):
Actual velocity magnitude: 405.5751
Predicted velocity magnitude: 436.2273

Trajectory comparison metrics (Full Test Set, 14063 steps):
Raw predictions:
  Mean squared error (Position): 945996565.7487
  X-position correlation: 0.5119
  Y-position correlation: 0.8892
  X-VELOCITY correlation: 0.6985
  Y-VELOCITY correlation: 0.6054
Training Elapsed time (Online Adaptation):  1648.1482043266296

--- Running Kalman Filter ---

--- Setting up Kalman Filter ---
Estimating Observation Matrix H using Linear Regression...
Estimated H shape: (182, 2)
Estimating Measurement Noise Covariance R from residuals...
Estimated R shape: (182, 182) (Full covariance)
Estimating State Transition Matrix F using Linear Regression...
Estimated State Transition Matrix F:
[[ 0.99300736 -0.02745324]
 [ 0.01886596  0.9869328 ]]
Estimating Process Noise Covariance Q from residuals...
Estimated Process Noise Covariance Q:
[[1822.71333155  301.21532717]
 [ 301.21532717 2315.91524504]]
Initializing Kalman Filter...
Running Kalman Filter prediction/update loop for 14063 test steps...
Kalman Filter processing time: 17.01 seconds
--- Kalman Filter Setup and Run Complete ---
Split 5 - KF X-Velocity Correlation: 0.7892
Split 5 - KF Y-Velocity Correlation: 0.7447
--- Finished Split 5 ---
-----------------------------------------------------------------------
WITH BETA LIF1,2,3 = 0.8 ----> incr hiddensize back to 1024, windiw size incr to 50

ummary of Online Adaptation (20 Splits):
    X_corr_spk       Y_corr_spk  ...  n_train_samples  n_val_samples  n_test_samples
0     0.781776  0.0    0.749497  ...              NaN            NaN             NaN
1          NaN  NaN         NaN  ...          66871.0        13776.0         13448.0
2     0.792861  0.0    0.751800  ...              NaN            NaN             NaN
3          NaN  NaN         NaN  ...          66297.0        13817.0         13981.0
4     0.793190  0.0    0.751239  ...              NaN            NaN             NaN
5          NaN  NaN         NaN  ...          64944.0        14965.0         14186.0
6     0.770343  0.0    0.728358  ...              NaN            NaN             NaN
7          NaN  NaN         NaN  ...          65846.0        12792.0         15457.0
8     0.769463  0.0    0.740763  ...              NaN            NaN             NaN
9          NaN  NaN         NaN  ...          65272.0        14924.0         13899.0
10    0.790037  0.0    0.739870  ...              NaN            NaN             NaN
11         NaN  NaN         NaN  ...          66297.0        13694.0         14104.0
12    0.780155  0.0    0.762446  ...              NaN            NaN             NaN
13         NaN  NaN         NaN  ...          67240.0        13817.0         13038.0
14    0.790512  0.0    0.735746  ...              NaN            NaN             NaN
15         NaN  NaN         NaN  ...          64739.0        14719.0         14637.0
16    0.782202  0.0    0.752161  ...              NaN            NaN             NaN
17         NaN  NaN         NaN  ...          65313.0        14268.0         14514.0
18    0.786708  0.0    0.751219  ...              NaN            NaN             NaN
19         NaN  NaN         NaN  ...          65846.0        14473.0         13776.0

[20 rows x 8 columns]

Summary of Kalman Filter (20 Splits):
   split  kf_corr_x  kf_corr_y
0      1   0.794658   0.744142
1      2   0.806547   0.757050
2      3   0.793181   0.746803
3      4   0.789316   0.750730
4      5   0.788153   0.752522
5      6   0.798333   0.758931
6      7   0.783497   0.770775
7      8   0.797471   0.754894
8      9   0.801934   0.758650

---
BEST RESULTS VERY STATISTICALLY SIGNIFICANT DIFF BETWEEN SNN - KF. snn mean > kf mean
Summary of Online Adaptation (20 Splits):
    X_corr_spk       Y_corr_spk  ...  n_train_samples  n_val_samples  n_test_samples
0     0.806466  0.0    0.782636  ...              NaN            NaN             NaN
1          NaN  NaN         NaN  ...          66748.0        13735.0         13612.0
2     0.814235  0.0    0.776682  ...              NaN            NaN             NaN
3          NaN  NaN         NaN  ...          64903.0        14227.0         14965.0
4     0.804846  0.0    0.790024  ...              NaN            NaN             NaN
5          NaN  NaN         NaN  ...          65928.0        14145.0         14022.0
6     0.810467  0.0    0.773812  ...              NaN            NaN             NaN
7          NaN  NaN         NaN  ...          66871.0        14268.0         12956.0
8     0.796973  0.0    0.779367  ...              NaN            NaN             NaN
9          NaN  NaN         NaN  ...          64780.0        14842.0         14473.0
10    0.827050  0.0    0.772868  ...              NaN            NaN             NaN
11         NaN  NaN         NaN  ...          65395.0        14555.0         14145.0
12    0.810433  0.0    0.792491  ...              NaN            NaN             NaN
13         NaN  NaN         NaN  ...          65149.0        13817.0         15129.0
14    0.823908  0.0    0.776671  ...              NaN            NaN             NaN
15         NaN  NaN         NaN  ...          66502.0        14350.0         13243.0
16    0.812481  0.0    0.781481  ...              NaN            NaN             NaN
17         NaN  NaN         NaN  ...          64698.0        14268.0         15129.0
18    0.814171  0.0    0.766050  ...              NaN            NaN             NaN
19         NaN  NaN         NaN  ...          65559.0        14268.0         14268.0

[20 rows x 8 columns]

Summary of Kalman Filter (20 Splits):
   split  kf_corr_x  kf_corr_y
0      1   0.791342   0.773095
1      2   0.786800   0.747997
2      3   0.789599   0.764772
3      4   0.788562   0.753425
4      5   0.780235   0.765658
5      6   0.809809   0.750069
6      7   0.797582   0.768101
7      8   0.805106   0.762591
8      9   0.790156   0.774789
9     10   0.800777   0.741019
