================================================================================
ONLINE SNN RUN
================================================================================

==================================================
Testing ONLINE SNN Training
==================================================

===== Running Within-Session Comparison (10 Sessions, Online SNN) =====

--- Session 1/10 (indy_20160411_02.mat) ---
  Using fixed parameters: Bin Width=0.050s, Stride=0.050s (no overlap)
  Using zero causal lag (0 ms) - skipping lag search.
  Using raw spike counts (no normalisation)...
    Sample spike-count matrix (first 4 bins, first 12 neurons):
[[3 4 3 3 1 1 2 3 3 2 6 4]
 [1 2 2 2 3 0 2 2 3 0 4 1]
 [3 2 4 6 1 0 0 5 2 1 2 6]
 [0 0 2 5 0 2 1 1 1 0 2 6]]
    Counts min / max in this session: 0 9
Global count histogram 0-6: [740226 314133 117862  40916  13376   3971   1122]
    Sample rate-NORMALISED matrix (first 4 bins, first 12 neurons):
[[ 3.367  3.971  2.394  1.996  0.907  3.118  1.88   2.387  1.717  2.474
   4.646  2.067]
 [ 0.716  1.607  1.327  1.054  3.942 -0.285  1.88   1.338  1.717 -0.603
   2.74  -0.201]
 [ 3.367  1.607  3.461  4.824  0.907 -0.285 -0.695  4.485  0.834  0.936
   0.835  3.578]
 [-0.61  -0.757  1.327  3.881 -0.611  6.522  0.592  0.29  -0.049 -0.603
   0.835  3.578]]

  --- Running SNN Online Training ---
Starting SNN Online Training for 50 epochs on cpu...
Evaluation every 500 steps, reset states every 200 steps
Warm-starting RMS EMAs with 50 steps...
RMS EMA warm-start complete.
Epoch [1/50], Step 500, Train Loss: 0.9158, Val Avg Corr: 0.2917
  >>> New best validation model saved with Avg Corr: 0.2917 <<<
Epoch [1/50], Step 1000, Train Loss: 0.7000, Val Avg Corr: 0.4986
  >>> New best validation model saved with Avg Corr: 0.4986 <<<
Epoch [1/50], Step 1500, Train Loss: 0.6920, Val Avg Corr: 0.4471
Epoch [1/50], Step 2000, Train Loss: 0.6091, Val Avg Corr: 0.5825
  >>> New best validation model saved with Avg Corr: 0.5825 <<<
Epoch [1/50], Step 2500, Train Loss: 0.8081, Val Avg Corr: 0.6094
  >>> New best validation model saved with Avg Corr: 0.6094 <<<
Epoch [1/50], Step 3000, Train Loss: 0.3990, Val Avg Corr: 0.5949
Epoch [1/50], Step 3500, Train Loss: 0.7613, Val Avg Corr: 0.6417
  >>> New best validation model saved with Avg Corr: 0.6417 <<<
Epoch [1/50], Step 4000, Train Loss: 0.5152, Val Avg Corr: 0.6364
Epoch [1/50], Step 4500, Train Loss: 0.4585, Val Avg Corr: 0.6245
Epoch [1/50], Step 5000, Train Loss: 0.6348, Val Avg Corr: 0.6184
Epoch [1/50], Step 5500, Train Loss: 0.6454, Val Avg Corr: 0.5643
Epoch [1/50], Step 6000, Train Loss: 0.3902, Val Avg Corr: 0.6548
  >>> New best validation model saved with Avg Corr: 0.6548 <<<
Epoch [1/50], Step 6500, Train Loss: 0.5997, Val Avg Corr: 0.6608
  >>> New best validation model saved with Avg Corr: 0.6608 <<<
Epoch [1/50], Step 7000, Train Loss: 0.6002, Val Avg Corr: 0.6338
Epoch [1/50], Step 7500, Train Loss: 0.5632, Val Avg Corr: 0.6749
  >>> New best validation model saved with Avg Corr: 0.6749 <<<
Epoch [1/50], Step 8000, Train Loss: 0.4887, Val Avg Corr: 0.6179
Epoch [1/50], Step 8500, Train Loss: 0.4800, Val Avg Corr: 0.6261
Epoch [1/50], Step 9000, Train Loss: 0.5941, Val Avg Corr: 0.6971
  >>> New best validation model saved with Avg Corr: 0.6971 <<<
Epoch [1/50], Step 9500, Train Loss: 0.6035, Val Avg Corr: 0.6569
Epoch [1/50], Step 10000, Train Loss: 0.3554, Val Avg Corr: 0.7219
  >>> New best validation model saved with Avg Corr: 0.7219 <<<
Epoch [1/50], Step 10500, Train Loss: 0.4979, Val Avg Corr: 0.7088
Epoch [2/50], Step 500, Train Loss: 0.5798, Val Avg Corr: 0.6287
Epoch [2/50], Step 1000, Train Loss: 0.5784, Val Avg Corr: 0.6572
Epoch [2/50], Step 1500, Train Loss: 0.6708, Val Avg Corr: 0.6449
Epoch [2/50], Step 2000, Train Loss: 0.4924, Val Avg Corr: 0.6673
Epoch [2/50], Step 2500, Train Loss: 0.6782, Val Avg Corr: 0.6803
Epoch [2/50], Step 3000, Train Loss: 0.3488, Val Avg Corr: 0.5865
Epoch [2/50], Step 3500, Train Loss: 0.7368, Val Avg Corr: 0.6667
Epoch [2/50], Step 4000, Train Loss: 0.5606, Val Avg Corr: 0.6272
Epoch [2/50], Step 4500, Train Loss: 0.4228, Val Avg Corr: 0.6111
Epoch [2/50], Step 5000, Train Loss: 0.5621, Val Avg Corr: 0.6446
Epoch [2/50], Step 5500, Train Loss: 0.5616, Val Avg Corr: 0.6207
Epoch [2/50], Step 6000, Train Loss: 0.3558, Val Avg Corr: 0.6448
Epoch [2/50], Step 6500, Train Loss: 0.5136, Val Avg Corr: 0.6735
Epoch [2/50], Step 7000, Train Loss: 0.4956, Val Avg Corr: 0.6722
Epoch [2/50], Step 7500, Train Loss: 0.4940, Val Avg Corr: 0.6836
Epoch [2/50], Step 8000, Train Loss: 0.4873, Val Avg Corr: 0.6891
Epoch [2/50], Step 8500, Train Loss: 0.4355, Val Avg Corr: 0.6216
Epoch [2/50], Step 9000, Train Loss: 0.5635, Val Avg Corr: 0.7066
Epoch [2/50], Step 9500, Train Loss: 0.5802, Val Avg Corr: 0.6541
Early stopping triggered after 9500 steps in epoch 2.
Loaded best model with validation Corr: 0.7219
  Re-evaluating SNN with movement mask for fair comparison...
  SNN Test Corr (All Bins): X=0.7969, Y=0.6491
  SNN Test  R²  (All Bins): X=0.6223, Y=0.3932
Time-series velocity figure saved --> snn_velocity_timeseries_slice_indy_20160411_02.mat.png


--- Finished Session 1 ---

--- Session 2/10 (indy_20161017_02.mat) ---
  Using fixed parameters: Bin Width=0.050s, Stride=0.050s (no overlap)
  Using zero causal lag (0 ms) - skipping lag search.
  Using raw spike counts (no normalisation)...
    Sample spike-count matrix (first 4 bins, first 12 neurons):
[[3 1 1 2 1 1 1 1 1 2 2 2]
 [2 0 0 0 0 0 1 0 1 0 0 2]
 [3 1 1 0 0 0 0 0 0 1 1 1]
 [4 0 0 0 0 0 0 0 0 1 0 2]]
    Counts min / max in this session: 0 6
Global count histogram 0-6: [581778  89263  18471   3807    684     71      6]
    Sample rate-NORMALISED matrix (first 4 bins, first 12 neurons):
[[ 2.702  1.891  4.841  6.454  7.333  2.582  2.017  3.504  6.445  4.126
   4.117  2.895]
 [ 1.562 -0.422 -0.188 -0.288 -0.132 -0.337  2.017 -0.258  6.445 -0.401
  -0.409  2.895]
 [ 2.702  1.891  4.841 -0.288 -0.132 -0.337 -0.368 -0.258 -0.142  1.862
   1.854  1.2  ]
 [ 3.841 -0.422 -0.188 -0.288 -0.132 -0.337 -0.368 -0.258 -0.142  1.862
  -0.409  2.895]]

  --- Running SNN Online Training ---
Starting SNN Online Training for 50 epochs on cpu...
Evaluation every 500 steps, reset states every 200 steps
Warm-starting RMS EMAs with 50 steps...
RMS EMA warm-start complete.
Epoch [1/50], Step 500, Train Loss: 0.7105, Val Avg Corr: 0.0220
  >>> New best validation model saved with Avg Corr: 0.0220 <<<
Epoch [1/50], Step 1000, Train Loss: 0.8190, Val Avg Corr: 0.2105
  >>> New best validation model saved with Avg Corr: 0.2105 <<<
Epoch [1/50], Step 1500, Train Loss: 0.6090, Val Avg Corr: 0.2356
  >>> New best validation model saved with Avg Corr: 0.2356 <<<
Epoch [1/50], Step 2000, Train Loss: 0.7372, Val Avg Corr: 0.3520
  >>> New best validation model saved with Avg Corr: 0.3520 <<<
Epoch [1/50], Step 2500, Train Loss: 0.5404, Val Avg Corr: 0.3271
Epoch [1/50], Step 3000, Train Loss: 0.6480, Val Avg Corr: 0.4162
  >>> New best validation model saved with Avg Corr: 0.4162 <<<
Epoch [1/50], Step 3500, Train Loss: 0.7257, Val Avg Corr: 0.4384
  >>> New best validation model saved with Avg Corr: 0.4384 <<<
Epoch [1/50], Step 4000, Train Loss: 0.3933, Val Avg Corr: 0.4666
  >>> New best validation model saved with Avg Corr: 0.4666 <<<
Epoch [1/50], Step 4500, Train Loss: 0.5769, Val Avg Corr: 0.4937
  >>> New best validation model saved with Avg Corr: 0.4937 <<<
Epoch [1/50], Step 5000, Train Loss: 0.8064, Val Avg Corr: 0.5061
  >>> New best validation model saved with Avg Corr: 0.5061 <<<
Epoch [1/50], Step 5500, Train Loss: 0.6409, Val Avg Corr: 0.4547
Epoch [1/50], Step 6000, Train Loss: 0.5022, Val Avg Corr: 0.5617
  >>> New best validation model saved with Avg Corr: 0.5617 <<<
Epoch [2/50], Step 500, Train Loss: 0.6376, Val Avg Corr: 0.4265
Epoch [2/50], Step 1000, Train Loss: 0.7289, Val Avg Corr: 0.4961
Epoch [2/50], Step 1500, Train Loss: 0.5085, Val Avg Corr: 0.5804
  >>> New best validation model saved with Avg Corr: 0.5804 <<<
Epoch [2/50], Step 2000, Train Loss: 0.6140, Val Avg Corr: 0.5590
Epoch [2/50], Step 2500, Train Loss: 0.5051, Val Avg Corr: 0.5483
Epoch [2/50], Step 3000, Train Loss: 0.5893, Val Avg Corr: 0.5268
Epoch [2/50], Step 3500, Train Loss: 0.6521, Val Avg Corr: 0.3867
Epoch [2/50], Step 4000, Train Loss: 0.3482, Val Avg Corr: 0.5264
Epoch [2/50], Step 4500, Train Loss: 0.5530, Val Avg Corr: 0.5340
Epoch [2/50], Step 5000, Train Loss: 0.7502, Val Avg Corr: 0.5654
Epoch [2/50], Step 5500, Train Loss: 0.5718, Val Avg Corr: 0.5124
Epoch [2/50], Step 6000, Train Loss: 0.4411, Val Avg Corr: 0.5621
Epoch [3/50], Step 500, Train Loss: 0.6835, Val Avg Corr: 0.5556
Epoch [3/50], Step 1000, Train Loss: 0.6737, Val Avg Corr: 0.5196
Epoch [3/50], Step 1500, Train Loss: 0.4714, Val Avg Corr: 0.6327
  >>> New best validation model saved with Avg Corr: 0.6327 <<<
Epoch [3/50], Step 2000, Train Loss: 0.5729, Val Avg Corr: 0.6201
Epoch [3/50], Step 2500, Train Loss: 0.4812, Val Avg Corr: 0.5695
Epoch [3/50], Step 3000, Train Loss: 0.5117, Val Avg Corr: 0.5830
Epoch [3/50], Step 3500, Train Loss: 0.5847, Val Avg Corr: 0.4725
Epoch [3/50], Step 4000, Train Loss: 0.3048, Val Avg Corr: 0.4902
Epoch [3/50], Step 4500, Train Loss: 0.4722, Val Avg Corr: 0.5675
Epoch [3/50], Step 5000, Train Loss: 0.7118, Val Avg Corr: 0.5740
Epoch [3/50], Step 5500, Train Loss: 0.5829, Val Avg Corr: 0.5369
Epoch [3/50], Step 6000, Train Loss: 0.4617, Val Avg Corr: 0.5484
Epoch [4/50], Step 500, Train Loss: 0.5940, Val Avg Corr: 0.5384
Epoch [4/50], Step 1000, Train Loss: 0.6486, Val Avg Corr: 0.5362
Epoch [4/50], Step 1500, Train Loss: 0.4675, Val Avg Corr: 0.5399
Epoch [4/50], Step 2000, Train Loss: 0.5771, Val Avg Corr: 0.5883
Epoch [4/50], Step 2500, Train Loss: 0.4601, Val Avg Corr: 0.5839
Epoch [4/50], Step 3000, Train Loss: 0.5243, Val Avg Corr: 0.5959
Epoch [4/50], Step 3500, Train Loss: 0.6080, Val Avg Corr: 0.5059
Epoch [4/50], Step 4000, Train Loss: 0.2988, Val Avg Corr: 0.5419
Epoch [4/50], Step 4500, Train Loss: 0.4527, Val Avg Corr: 0.5542
Epoch [4/50], Step 5000, Train Loss: 0.7434, Val Avg Corr: 0.5667
Epoch [4/50], Step 5500, Train Loss: 0.5476, Val Avg Corr: 0.5435
Early stopping triggered after 5500 steps in epoch 4.
Loaded best model with validation Corr: 0.6327
  Re-evaluating SNN with movement mask for fair comparison...
  SNN Test Corr (All Bins): X=0.6281, Y=0.7641
  SNN Test  R²  (All Bins): X=0.3874, Y=0.4850
Time-series velocity figure saved --> snn_velocity_timeseries_slice_indy_20161017_02.mat.png

--- Finished Session 2 ---

--- Session 3/10 (indy_20160630_01.mat) ---
  Using fixed parameters: Bin Width=0.050s, Stride=0.050s (no overlap)
  Using zero causal lag (0 ms) - skipping lag search.
  Using raw spike counts (no normalisation)...
    Sample spike-count matrix (first 4 bins, first 12 neurons):
[[3 4 2 1 1 2 2 1 2 1 2 2]
 [1 2 0 0 0 1 1 0 3 1 0 1]
 [2 1 1 1 0 1 1 1 2 0 3 0]
 [1 4 2 0 1 3 0 0 4 0 0 0]]
    Counts min / max in this session: 0 11
Global count histogram 0-6: [1535625  334324  107352   41863   17385    7401    2975]
    Sample rate-NORMALISED matrix (first 4 bins, first 12 neurons):
[[ 2.672  1.805  3.195  2.913  1.505  0.255  3.545  3.367  1.718  2.758
   3.152  5.122]
 [ 0.41   0.407 -0.491 -0.313 -0.458 -0.349  1.528 -0.269  2.881  2.758
  -0.535  2.377]
 [ 1.541 -0.292  1.352  2.913 -0.458 -0.349  1.528  3.367  1.718 -0.327
   4.996 -0.368]
 [ 0.41   1.805  3.195 -0.313  1.505  0.858 -0.49  -0.269  4.044 -0.327
  -0.535 -0.368]]

  --- Running SNN Online Training ---
Starting SNN Online Training for 50 epochs on cpu...
Evaluation every 500 steps, reset states every 200 steps
Warm-starting RMS EMAs with 50 steps...
RMS EMA warm-start complete.
Epoch [1/50], Step 500, Train Loss: 1.0918, Val Avg Corr: 0.0915
  >>> New best validation model saved with Avg Corr: 0.0915 <<<
Epoch [1/50], Step 1000, Train Loss: 0.8747, Val Avg Corr: 0.3311
  >>> New best validation model saved with Avg Corr: 0.3311 <<<
Epoch [1/50], Step 1500, Train Loss: 0.6748, Val Avg Corr: 0.4895
  >>> New best validation model saved with Avg Corr: 0.4895 <<<
Epoch [1/50], Step 2000, Train Loss: 0.7174, Val Avg Corr: 0.4944
  >>> New best validation model saved with Avg Corr: 0.4944 <<<
Epoch [1/50], Step 2500, Train Loss: 0.7689, Val Avg Corr: 0.4130
Epoch [1/50], Step 3000, Train Loss: 0.5620, Val Avg Corr: 0.6111
  >>> New best validation model saved with Avg Corr: 0.6111 <<<
Epoch [1/50], Step 3500, Train Loss: 0.7351, Val Avg Corr: 0.5989
Epoch [1/50], Step 4000, Train Loss: 0.5303, Val Avg Corr: 0.6065
Epoch [1/50], Step 4500, Train Loss: 0.4419, Val Avg Corr: 0.6136
  >>> New best validation model saved with Avg Corr: 0.6136 <<<
Epoch [1/50], Step 5000, Train Loss: 0.5813, Val Avg Corr: 0.6434
  >>> New best validation model saved with Avg Corr: 0.6434 <<<
Epoch [1/50], Step 5500, Train Loss: 0.6008, Val Avg Corr: 0.5365
Epoch [1/50], Step 6000, Train Loss: 0.6932, Val Avg Corr: 0.5659
Epoch [1/50], Step 6500, Train Loss: 0.6077, Val Avg Corr: 0.6012
Epoch [1/50], Step 7000, Train Loss: 0.5279, Val Avg Corr: 0.6349
Epoch [1/50], Step 7500, Train Loss: 0.7738, Val Avg Corr: 0.6251
Epoch [1/50], Step 8000, Train Loss: 0.7099, Val Avg Corr: 0.6570
  >>> New best validation model saved with Avg Corr: 0.6570 <<<
Epoch [1/50], Step 8500, Train Loss: 0.6135, Val Avg Corr: 0.5548
Epoch [1/50], Step 9000, Train Loss: 0.5117, Val Avg Corr: 0.6300
Epoch [1/50], Step 9500, Train Loss: 0.6222, Val Avg Corr: 0.6712
  >>> New best validation model saved with Avg Corr: 0.6712 <<<
Epoch [1/50], Step 10000, Train Loss: 0.6617, Val Avg Corr: 0.6418
Epoch [1/50], Step 10500, Train Loss: 0.6666, Val Avg Corr: 0.6395
Epoch [1/50], Step 11000, Train Loss: 0.5002, Val Avg Corr: 0.6554
Epoch [1/50], Step 11500, Train Loss: 0.6406, Val Avg Corr: 0.6824
  >>> New best validation model saved with Avg Corr: 0.6824 <<<
Epoch [1/50], Step 12000, Train Loss: 0.4881, Val Avg Corr: 0.6729
Epoch [1/50], Step 12500, Train Loss: 0.4710, Val Avg Corr: 0.6515
Epoch [1/50], Step 13000, Train Loss: 0.5157, Val Avg Corr: 0.6081
Epoch [1/50], Step 13500, Train Loss: 0.4649, Val Avg Corr: 0.6613
Epoch [1/50], Step 14000, Train Loss: 0.5452, Val Avg Corr: 0.6088
Epoch [1/50], Step 14500, Train Loss: 0.4997, Val Avg Corr: 0.6937
  >>> New best validation model saved with Avg Corr: 0.6937 <<<
Epoch [1/50], Step 15000, Train Loss: 0.5531, Val Avg Corr: 0.5965
Epoch [1/50], Step 15500, Train Loss: 0.4243, Val Avg Corr: 0.6589
Epoch [1/50], Step 16000, Train Loss: 0.5973, Val Avg Corr: 0.6611
Epoch [1/50], Step 16500, Train Loss: 0.5775, Val Avg Corr: 0.6378
Epoch [1/50], Step 17000, Train Loss: 0.5415, Val Avg Corr: 0.6632
Epoch [1/50], Step 17500, Train Loss: 0.6249, Val Avg Corr: 0.6641
Epoch [1/50], Step 18000, Train Loss: 0.4843, Val Avg Corr: 0.5683
Epoch [2/50], Step 500, Train Loss: 0.8988, Val Avg Corr: 0.5895
Epoch [2/50], Step 1000, Train Loss: 0.7281, Val Avg Corr: 0.6626
Epoch [2/50], Step 1500, Train Loss: 0.5886, Val Avg Corr: 0.6966
  >>> New best validation model saved with Avg Corr: 0.6966 <<<
Epoch [2/50], Step 2000, Train Loss: 0.6236, Val Avg Corr: 0.6192
Epoch [2/50], Step 2500, Train Loss: 0.6961, Val Avg Corr: 0.6489
Epoch [2/50], Step 3000, Train Loss: 0.4796, Val Avg Corr: 0.7006
  >>> New best validation model saved with Avg Corr: 0.7006 <<<
Epoch [2/50], Step 3500, Train Loss: 0.5121, Val Avg Corr: 0.6795
Epoch [2/50], Step 4000, Train Loss: 0.4290, Val Avg Corr: 0.6697
Epoch [2/50], Step 4500, Train Loss: 0.3622, Val Avg Corr: 0.6531
Epoch [2/50], Step 5000, Train Loss: 0.4999, Val Avg Corr: 0.6889
Epoch [2/50], Step 5500, Train Loss: 0.5434, Val Avg Corr: 0.6549
Epoch [2/50], Step 6000, Train Loss: 0.6166, Val Avg Corr: 0.6468
Epoch [2/50], Step 6500, Train Loss: 0.5471, Val Avg Corr: 0.6481
Epoch [2/50], Step 7000, Train Loss: 0.4794, Val Avg Corr: 0.6631
Epoch [2/50], Step 7500, Train Loss: 0.6550, Val Avg Corr: 0.6677
Epoch [2/50], Step 8000, Train Loss: 0.6193, Val Avg Corr: 0.6712
Epoch [2/50], Step 8500, Train Loss: 0.5214, Val Avg Corr: 0.6429
Epoch [2/50], Step 9000, Train Loss: 0.4917, Val Avg Corr: 0.6693
Epoch [2/50], Step 9500, Train Loss: 0.5511, Val Avg Corr: 0.6692
Epoch [2/50], Step 10000, Train Loss: 0.6085, Val Avg Corr: 0.6656
Epoch [2/50], Step 10500, Train Loss: 0.6034, Val Avg Corr: 0.6372
Epoch [2/50], Step 11000, Train Loss: 0.4917, Val Avg Corr: 0.6865
Epoch [2/50], Step 11500, Train Loss: 0.6259, Val Avg Corr: 0.6780
Epoch [2/50], Step 12000, Train Loss: 0.4560, Val Avg Corr: 0.6636
Epoch [2/50], Step 12500, Train Loss: 0.4595, Val Avg Corr: 0.6633
Epoch [2/50], Step 13000, Train Loss: 0.5215, Val Avg Corr: 0.6220
Early stopping triggered after 13000 steps in epoch 2.
Loaded best model with validation Corr: 0.7006
  Re-evaluating SNN with movement mask for fair comparison...
  SNN Test Corr (All Bins): X=0.5821, Y=0.7991
  SNN Test  R²  (All Bins): X=0.3157, Y=0.6227
Time-series velocity figure saved --> snn_velocity_timeseries_slice_indy_20160630_01.mat.png

--- Finished Session 3 ---

--- Session 4/10 (indy_20161212_02.mat) ---
  Using fixed parameters: Bin Width=0.050s, Stride=0.050s (no overlap)
  Using zero causal lag (0 ms) - skipping lag search.
  Using raw spike counts (no normalisation)...
    Sample spike-count matrix (first 4 bins, first 12 neurons):
[[1 2 1 1 1 1 2 1 1 1 1 1]
 [2 0 1 0 2 0 2 0 0 0 0 0]
 [0 1 0 1 1 0 0 0 0 0 0 0]
 [0 0 0 0 1 0 0 0 0 0 1 1]]
    Counts min / max in this session: 0 5
Global count histogram 0-6: [710929  64945   7998    984    120     16      0]
    Sample rate-NORMALISED matrix (first 4 bins, first 12 neurons):
[[ 2.061  5.117  1.658  2.252  2.266  2.607  3.277  4.276  3.335  4.2
   3.032  2.353]
 [ 4.507 -0.355  1.658 -0.353  4.879 -0.329  3.277 -0.222 -0.274 -0.212
  -0.297 -0.34 ]
 [-0.384  2.381 -0.428  2.252  2.266 -0.329 -0.492 -0.222 -0.274 -0.212
  -0.297 -0.34 ]
 [-0.384 -0.355 -0.428 -0.353  2.266 -0.329 -0.492 -0.222 -0.274 -0.212
   3.032  2.353]]

  --- Running SNN Online Training ---
Starting SNN Online Training for 50 epochs on cpu...
Evaluation every 500 steps, reset states every 200 steps
Warm-starting RMS EMAs with 50 steps...
RMS EMA warm-start complete.
Epoch [1/50], Step 500, Train Loss: 0.6473, Val Avg Corr: 0.0000
  >>> New best validation model saved with Avg Corr: 0.0000 <<<
Epoch [1/50], Step 1000, Train Loss: 0.7293, Val Avg Corr: 0.0302
  >>> New best validation model saved with Avg Corr: 0.0302 <<<
Epoch [1/50], Step 1500, Train Loss: 0.8416, Val Avg Corr: 0.0689
  >>> New best validation model saved with Avg Corr: 0.0689 <<<
Epoch [1/50], Step 2000, Train Loss: 0.7121, Val Avg Corr: 0.1823
  >>> New best validation model saved with Avg Corr: 0.1823 <<<
Epoch [1/50], Step 2500, Train Loss: 0.7038, Val Avg Corr: 0.3263
  >>> New best validation model saved with Avg Corr: 0.3263 <<<
Epoch [1/50], Step 3000, Train Loss: 0.7549, Val Avg Corr: 0.3825
  >>> New best validation model saved with Avg Corr: 0.3825 <<<
Epoch [1/50], Step 3500, Train Loss: 0.6124, Val Avg Corr: 0.2395
Epoch [1/50], Step 4000, Train Loss: 0.6763, Val Avg Corr: 0.4063
  >>> New best validation model saved with Avg Corr: 0.4063 <<<
Epoch [1/50], Step 4500, Train Loss: 0.5146, Val Avg Corr: 0.3833
Epoch [1/50], Step 5000, Train Loss: 0.5527, Val Avg Corr: 0.4090
  >>> New best validation model saved with Avg Corr: 0.4090 <<<
Epoch [1/50], Step 5500, Train Loss: 0.5718, Val Avg Corr: 0.4255
  >>> New best validation model saved with Avg Corr: 0.4255 <<<
Epoch [1/50], Step 6000, Train Loss: 0.7350, Val Avg Corr: 0.3931
Epoch [1/50], Step 6500, Train Loss: 0.7719, Val Avg Corr: 0.4179
Epoch [2/50], Step 500, Train Loss: 0.5885, Val Avg Corr: 0.4000
Epoch [2/50], Step 1000, Train Loss: 0.6785, Val Avg Corr: 0.3965
Epoch [2/50], Step 1500, Train Loss: 0.6450, Val Avg Corr: 0.4395
  >>> New best validation model saved with Avg Corr: 0.4395 <<<
Epoch [2/50], Step 2000, Train Loss: 0.6238, Val Avg Corr: 0.4445
  >>> New best validation model saved with Avg Corr: 0.4445 <<<
Epoch [2/50], Step 2500, Train Loss: 0.5749, Val Avg Corr: 0.4674
  >>> New best validation model saved with Avg Corr: 0.4674 <<<
Epoch [2/50], Step 3000, Train Loss: 0.6404, Val Avg Corr: 0.3828
Epoch [2/50], Step 3500, Train Loss: 0.5558, Val Avg Corr: 0.4414
Epoch [2/50], Step 4000, Train Loss: 0.5814, Val Avg Corr: 0.4263
Epoch [2/50], Step 4500, Train Loss: 0.4906, Val Avg Corr: 0.4479
Epoch [2/50], Step 5000, Train Loss: 0.5170, Val Avg Corr: 0.4586
Epoch [2/50], Step 5500, Train Loss: 0.5974, Val Avg Corr: 0.4310
Epoch [2/50], Step 6000, Train Loss: 0.7410, Val Avg Corr: 0.3855
Epoch [2/50], Step 6500, Train Loss: 0.7889, Val Avg Corr: 0.4470
Epoch [3/50], Step 500, Train Loss: 0.5452, Val Avg Corr: 0.4577
Epoch [3/50], Step 1000, Train Loss: 0.6436, Val Avg Corr: 0.4148
Epoch [3/50], Step 1500, Train Loss: 0.5913, Val Avg Corr: 0.4594
Epoch [3/50], Step 2000, Train Loss: 0.5714, Val Avg Corr: 0.4489
Epoch [3/50], Step 2500, Train Loss: 0.5734, Val Avg Corr: 0.5050
  >>> New best validation model saved with Avg Corr: 0.5050 <<<
Epoch [3/50], Step 3000, Train Loss: 0.6198, Val Avg Corr: 0.4673
Epoch [3/50], Step 3500, Train Loss: 0.5533, Val Avg Corr: 0.4744
Epoch [3/50], Step 4000, Train Loss: 0.5301, Val Avg Corr: 0.4048
Epoch [3/50], Step 4500, Train Loss: 0.4573, Val Avg Corr: 0.4593
Epoch [3/50], Step 5000, Train Loss: 0.4595, Val Avg Corr: 0.4803
Epoch [3/50], Step 5500, Train Loss: 0.5578, Val Avg Corr: 0.3910
Epoch [3/50], Step 6000, Train Loss: 0.6990, Val Avg Corr: 0.4727
Epoch [3/50], Step 6500, Train Loss: 0.7887, Val Avg Corr: 0.4679
Epoch [4/50], Step 500, Train Loss: 0.5518, Val Avg Corr: 0.4511
Epoch [4/50], Step 1000, Train Loss: 0.6540, Val Avg Corr: 0.4352
Epoch [4/50], Step 1500, Train Loss: 0.6020, Val Avg Corr: 0.4764
Epoch [4/50], Step 2000, Train Loss: 0.5652, Val Avg Corr: 0.4518
Epoch [4/50], Step 2500, Train Loss: 0.5454, Val Avg Corr: 0.4883
Epoch [4/50], Step 3000, Train Loss: 0.5844, Val Avg Corr: 0.4887
Epoch [4/50], Step 3500, Train Loss: 0.5482, Val Avg Corr: 0.4599
Epoch [4/50], Step 4000, Train Loss: 0.5441, Val Avg Corr: 0.4660
Epoch [4/50], Step 4500, Train Loss: 0.4271, Val Avg Corr: 0.4802
Epoch [4/50], Step 5000, Train Loss: 0.4520, Val Avg Corr: 0.5045
Epoch [4/50], Step 5500, Train Loss: 0.5292, Val Avg Corr: 0.3838
Epoch [4/50], Step 6000, Train Loss: 0.7171, Val Avg Corr: 0.4386
Early stopping triggered after 6000 steps in epoch 4.
Loaded best model with validation Corr: 0.5050
  Re-evaluating SNN with movement mask for fair comparison...
  SNN Test Corr (All Bins): X=0.4616, Y=0.6198
  SNN Test  R²  (All Bins): X=0.1816, Y=0.3167
Time-series velocity figure saved --> snn_velocity_timeseries_slice_indy_20161212_02.mat.png

--- Finished Session 4 ---

--- Session 5/10 (indy_20161013_03.mat) ---
  Using fixed parameters: Bin Width=0.050s, Stride=0.050s (no overlap)
  Using zero causal lag (0 ms) - skipping lag search.
  Using raw spike counts (no normalisation)...
    Sample spike-count matrix (first 4 bins, first 12 neurons):
[[3 1 2 1 0 1 1 1 1 2 1 1]
 [3 0 1 0 0 0 0 0 0 1 0 1]
 [3 0 0 0 0 0 0 0 0 0 0 0]
 [1 0 2 1 0 0 0 0 0 0 0 0]]
    Counts min / max in this session: 0 5
Global count histogram 0-6: [622420  80888  16612   3655    664     81      0]
    Sample rate-NORMALISED matrix (first 4 bins, first 12 neurons):
[[ 2.4660e+00  1.0898e+01  4.1040e+00  3.6730e+00 -3.3000e-02  1.4863e+01
   6.9980e+00  3.5170e+00  8.6856e+01  4.3050e+00  3.4900e+00  1.0350e+00]
 [ 2.4660e+00 -8.9000e-02  1.8440e+00 -2.4300e-01 -3.3000e-02 -6.3000e-02
  -1.4100e-01 -2.4600e-01 -1.2000e-02  1.9590e+00 -2.4900e-01  1.0350e+00]
 [ 2.4660e+00 -8.9000e-02 -4.1600e-01 -2.4300e-01 -3.3000e-02 -6.3000e-02
  -1.4100e-01 -2.4600e-01 -1.2000e-02 -3.8600e-01 -2.4900e-01 -6.1000e-01]
 [ 3.2700e-01 -8.9000e-02  4.1040e+00  3.6730e+00 -3.3000e-02 -6.3000e-02
  -1.4100e-01 -2.4600e-01 -1.2000e-02 -3.8600e-01 -2.4900e-01 -6.1000e-01]]

  --- Running SNN Online Training ---
Starting SNN Online Training for 50 epochs on cpu...
Evaluation every 500 steps, reset states every 200 steps
Warm-starting RMS EMAs with 50 steps...
RMS EMA warm-start complete.
Epoch [1/50], Step 500, Train Loss: 0.8800, Val Avg Corr: 0.2863
  >>> New best validation model saved with Avg Corr: 0.2863 <<<
Epoch [1/50], Step 1000, Train Loss: 0.8173, Val Avg Corr: 0.3615
  >>> New best validation model saved with Avg Corr: 0.3615 <<<
Epoch [1/50], Step 1500, Train Loss: 0.7883, Val Avg Corr: 0.4414
  >>> New best validation model saved with Avg Corr: 0.4414 <<<
Epoch [1/50], Step 2000, Train Loss: 0.5239, Val Avg Corr: 0.4896
  >>> New best validation model saved with Avg Corr: 0.4896 <<<
Epoch [1/50], Step 2500, Train Loss: 0.6642, Val Avg Corr: 0.4314
Epoch [1/50], Step 3000, Train Loss: 0.6425, Val Avg Corr: 0.5432
  >>> New best validation model saved with Avg Corr: 0.5432 <<<
Epoch [1/50], Step 3500, Train Loss: 0.7350, Val Avg Corr: 0.5587
  >>> New best validation model saved with Avg Corr: 0.5587 <<<
Epoch [1/50], Step 4000, Train Loss: 0.6433, Val Avg Corr: 0.5758
  >>> New best validation model saved with Avg Corr: 0.5758 <<<
Epoch [1/50], Step 4500, Train Loss: 0.6297, Val Avg Corr: 0.5777
  >>> New best validation model saved with Avg Corr: 0.5777 <<<
Epoch [1/50], Step 5000, Train Loss: 0.5796, Val Avg Corr: 0.5899
  >>> New best validation model saved with Avg Corr: 0.5899 <<<
Epoch [1/50], Step 5500, Train Loss: 0.5972, Val Avg Corr: 0.5937
  >>> New best validation model saved with Avg Corr: 0.5937 <<<
Epoch [1/50], Step 6000, Train Loss: 0.7502, Val Avg Corr: 0.4509
Epoch [2/50], Step 500, Train Loss: 0.7275, Val Avg Corr: 0.5296
Epoch [2/50], Step 1000, Train Loss: 0.6529, Val Avg Corr: 0.5656
Epoch [2/50], Step 1500, Train Loss: 0.6984, Val Avg Corr: 0.5553
Epoch [2/50], Step 2000, Train Loss: 0.4584, Val Avg Corr: 0.5566
Epoch [2/50], Step 2500, Train Loss: 0.5771, Val Avg Corr: 0.5678
Epoch [2/50], Step 3000, Train Loss: 0.5551, Val Avg Corr: 0.5871
Epoch [2/50], Step 3500, Train Loss: 0.6588, Val Avg Corr: 0.6281
  >>> New best validation model saved with Avg Corr: 0.6281 <<<
Epoch [2/50], Step 4000, Train Loss: 0.6110, Val Avg Corr: 0.6313
  >>> New best validation model saved with Avg Corr: 0.6313 <<<
Epoch [2/50], Step 4500, Train Loss: 0.5852, Val Avg Corr: 0.6113
Epoch [2/50], Step 5000, Train Loss: 0.5981, Val Avg Corr: 0.5880
Epoch [2/50], Step 5500, Train Loss: 0.5193, Val Avg Corr: 0.6537
  >>> New best validation model saved with Avg Corr: 0.6537 <<<
Epoch [2/50], Step 6000, Train Loss: 0.7410, Val Avg Corr: 0.6065
Epoch [3/50], Step 500, Train Loss: 0.6375, Val Avg Corr: 0.6238
Epoch [3/50], Step 1000, Train Loss: 0.5941, Val Avg Corr: 0.6036
Epoch [3/50], Step 1500, Train Loss: 0.6269, Val Avg Corr: 0.6171
Epoch [3/50], Step 2000, Train Loss: 0.4303, Val Avg Corr: 0.6445
Epoch [3/50], Step 2500, Train Loss: 0.5366, Val Avg Corr: 0.6455
Epoch [3/50], Step 3000, Train Loss: 0.5659, Val Avg Corr: 0.5598
Epoch [3/50], Step 3500, Train Loss: 0.6373, Val Avg Corr: 0.6451
Epoch [3/50], Step 4000, Train Loss: 0.6071, Val Avg Corr: 0.6436
Epoch [3/50], Step 4500, Train Loss: 0.5978, Val Avg Corr: 0.6265
Epoch [3/50], Step 5000, Train Loss: 0.5788, Val Avg Corr: 0.6499
Epoch [3/50], Step 5500, Train Loss: 0.5200, Val Avg Corr: 0.7155
  >>> New best validation model saved with Avg Corr: 0.7155 <<<
Epoch [3/50], Step 6000, Train Loss: 0.6879, Val Avg Corr: 0.6524
Epoch [4/50], Step 500, Train Loss: 0.6191, Val Avg Corr: 0.5930
Epoch [4/50], Step 1000, Train Loss: 0.6075, Val Avg Corr: 0.6275
Epoch [4/50], Step 1500, Train Loss: 0.5930, Val Avg Corr: 0.5385
Epoch [4/50], Step 2000, Train Loss: 0.4426, Val Avg Corr: 0.6589
Epoch [4/50], Step 2500, Train Loss: 0.5270, Val Avg Corr: 0.6743
Epoch [4/50], Step 3000, Train Loss: 0.5304, Val Avg Corr: 0.6517
Epoch [4/50], Step 3500, Train Loss: 0.5823, Val Avg Corr: 0.7116
Epoch [4/50], Step 4000, Train Loss: 0.6141, Val Avg Corr: 0.6980
Epoch [4/50], Step 4500, Train Loss: 0.5423, Val Avg Corr: 0.6400
Epoch [4/50], Step 5000, Train Loss: 0.5059, Val Avg Corr: 0.6604
Epoch [4/50], Step 5500, Train Loss: 0.4823, Val Avg Corr: 0.7125
Epoch [4/50], Step 6000, Train Loss: 0.7106, Val Avg Corr: 0.6374
Epoch [5/50], Step 500, Train Loss: 0.6510, Val Avg Corr: 0.5709
Epoch [5/50], Step 1000, Train Loss: 0.6445, Val Avg Corr: 0.5968
Epoch [5/50], Step 1500, Train Loss: 0.6383, Val Avg Corr: 0.6016
Epoch [5/50], Step 2000, Train Loss: 0.4438, Val Avg Corr: 0.6233
Epoch [5/50], Step 2500, Train Loss: 0.6045, Val Avg Corr: 0.6574
Epoch [5/50], Step 3000, Train Loss: 0.5625, Val Avg Corr: 0.6150
Epoch [5/50], Step 3500, Train Loss: 0.6623, Val Avg Corr: 0.5425
Early stopping triggered after 3500 steps in epoch 5.
Loaded best model with validation Corr: 0.7155
  Re-evaluating SNN with movement mask for fair comparison...
  SNN Test Corr (All Bins): X=0.6521, Y=0.7543
  SNN Test  R²  (All Bins): X=0.4087, Y=0.5324
Time-series velocity figure saved --> snn_velocity_timeseries_slice_indy_20161013_03.mat.png

--- Finished Session 5 ---

--- Session 6/10 (indy_20160927_06.mat) ---
  Using fixed parameters: Bin Width=0.050s, Stride=0.050s (no overlap)
  Using zero causal lag (0 ms) - skipping lag search.
  Using raw spike counts (no normalisation)...
    Sample spike-count matrix (first 4 bins, first 12 neurons):
[[1 1 1 1 1 1 1 1 1 1 1 1]
 [1 0 0 0 0 1 0 0 0 0 0 0]
 [0 0 0 0 0 0 0 0 0 0 0 0]
 [1 1 0 1 0 0 2 1 0 1 0 1]]
    Counts min / max in this session: 0 6
Global count histogram 0-6: [492097  75395  16587   4108    972    173     12]
    Sample rate-NORMALISED matrix (first 4 bins, first 12 neurons):
[[ 0.619  1.194  2.545  0.657  1.854  2.549  0.345  1.477  6.522  2.899
   6.937  3.985]
 [ 0.619 -0.54  -0.314 -0.658 -0.43   2.549 -0.8   -0.486 -0.147 -0.296
  -0.135 -0.216]
 [-0.663 -0.54  -0.314 -0.658 -0.43  -0.345 -0.8   -0.486 -0.147 -0.296
  -0.135 -0.216]
 [ 0.619  1.194 -0.314  0.657 -0.43  -0.345  1.49   1.477 -0.147  2.899
  -0.135  3.985]]

  --- Running SNN Online Training ---
Starting SNN Online Training for 50 epochs on cpu...
Evaluation every 500 steps, reset states every 200 steps
Warm-starting RMS EMAs with 50 steps...
RMS EMA warm-start complete.
Epoch [1/50], Step 500, Train Loss: 0.0025, Val Avg Corr: -0.0138
  >>> New best validation model saved with Avg Corr: -0.0138 <<<
Epoch [1/50], Step 1000, Train Loss: 0.3498, Val Avg Corr: 0.1239
  >>> New best validation model saved with Avg Corr: 0.1239 <<<
Epoch [1/50], Step 1500, Train Loss: 0.8192, Val Avg Corr: 0.2257
  >>> New best validation model saved with Avg Corr: 0.2257 <<<
Epoch [1/50], Step 2000, Train Loss: 0.7617, Val Avg Corr: 0.1080
Epoch [1/50], Step 2500, Train Loss: 0.8533, Val Avg Corr: 0.2975
  >>> New best validation model saved with Avg Corr: 0.2975 <<<
Epoch [1/50], Step 3000, Train Loss: 0.7173, Val Avg Corr: 0.2743
Epoch [1/50], Step 3500, Train Loss: 0.9809, Val Avg Corr: 0.3351
  >>> New best validation model saved with Avg Corr: 0.3351 <<<
Epoch [1/50], Step 4000, Train Loss: 0.6449, Val Avg Corr: 0.3834
  >>> New best validation model saved with Avg Corr: 0.3834 <<<
Epoch [1/50], Step 4500, Train Loss: 0.5490, Val Avg Corr: 0.4903
  >>> New best validation model saved with Avg Corr: 0.4903 <<<
Epoch [1/50], Step 5000, Train Loss: 0.5647, Val Avg Corr: 0.4481
Epoch [2/50], Step 500, Train Loss: 0.0228, Val Avg Corr: 0.2928
Epoch [2/50], Step 1000, Train Loss: 0.3376, Val Avg Corr: 0.3426
Epoch [2/50], Step 1500, Train Loss: 0.7090, Val Avg Corr: 0.4396
Epoch [2/50], Step 2000, Train Loss: 0.6665, Val Avg Corr: 0.5076
  >>> New best validation model saved with Avg Corr: 0.5076 <<<
Epoch [2/50], Step 2500, Train Loss: 0.7664, Val Avg Corr: 0.4043
Epoch [2/50], Step 3000, Train Loss: 0.6233, Val Avg Corr: 0.4489
Epoch [2/50], Step 3500, Train Loss: 0.8762, Val Avg Corr: 0.5020
Epoch [2/50], Step 4000, Train Loss: 0.5316, Val Avg Corr: 0.5527
  >>> New best validation model saved with Avg Corr: 0.5527 <<<
Epoch [2/50], Step 4500, Train Loss: 0.5319, Val Avg Corr: 0.5826
  >>> New best validation model saved with Avg Corr: 0.5826 <<<
Epoch [2/50], Step 5000, Train Loss: 0.5038, Val Avg Corr: 0.4570
Epoch [3/50], Step 500, Train Loss: 0.0086, Val Avg Corr: 0.2526
Epoch [3/50], Step 1000, Train Loss: 0.3163, Val Avg Corr: 0.4812
Epoch [3/50], Step 1500, Train Loss: 0.6327, Val Avg Corr: 0.4601
Epoch [3/50], Step 2000, Train Loss: 0.5998, Val Avg Corr: 0.5251
Epoch [3/50], Step 2500, Train Loss: 0.7355, Val Avg Corr: 0.5341
Epoch [3/50], Step 3000, Train Loss: 0.5658, Val Avg Corr: 0.4979
Epoch [3/50], Step 3500, Train Loss: 0.8191, Val Avg Corr: 0.5579
Epoch [3/50], Step 4000, Train Loss: 0.5289, Val Avg Corr: 0.5937
  >>> New best validation model saved with Avg Corr: 0.5937 <<<
Epoch [3/50], Step 4500, Train Loss: 0.4695, Val Avg Corr: 0.5673
Epoch [3/50], Step 5000, Train Loss: 0.5179, Val Avg Corr: 0.4531
Epoch [4/50], Step 500, Train Loss: 0.0103, Val Avg Corr: 0.4524
Epoch [4/50], Step 1000, Train Loss: 0.3291, Val Avg Corr: 0.4946
Epoch [4/50], Step 1500, Train Loss: 0.6027, Val Avg Corr: 0.4710
Epoch [4/50], Step 2000, Train Loss: 0.6118, Val Avg Corr: 0.5520
Epoch [4/50], Step 2500, Train Loss: 0.7280, Val Avg Corr: 0.4802
Epoch [4/50], Step 3000, Train Loss: 0.5665, Val Avg Corr: 0.4832
Epoch [4/50], Step 3500, Train Loss: 0.7864, Val Avg Corr: 0.5616
Epoch [4/50], Step 4000, Train Loss: 0.5029, Val Avg Corr: 0.6172
  >>> New best validation model saved with Avg Corr: 0.6172 <<<
Epoch [4/50], Step 4500, Train Loss: 0.4876, Val Avg Corr: 0.4786
Epoch [4/50], Step 5000, Train Loss: 0.5318, Val Avg Corr: 0.4106
Epoch [5/50], Step 500, Train Loss: 0.0066, Val Avg Corr: 0.3961
Epoch [5/50], Step 1000, Train Loss: 0.3253, Val Avg Corr: 0.5308
Epoch [5/50], Step 1500, Train Loss: 0.5733, Val Avg Corr: 0.4169
Epoch [5/50], Step 2000, Train Loss: 0.6433, Val Avg Corr: 0.5415
Epoch [5/50], Step 2500, Train Loss: 0.7565, Val Avg Corr: 0.5652
Epoch [5/50], Step 3000, Train Loss: 0.5089, Val Avg Corr: 0.4969
Epoch [5/50], Step 3500, Train Loss: 0.8197, Val Avg Corr: 0.4695
Epoch [5/50], Step 4000, Train Loss: 0.5297, Val Avg Corr: 0.5665
Epoch [5/50], Step 4500, Train Loss: 0.5254, Val Avg Corr: 0.4788
Epoch [5/50], Step 5000, Train Loss: 0.5277, Val Avg Corr: 0.4437
Epoch [6/50], Step 500, Train Loss: 0.0067, Val Avg Corr: 0.3473
Epoch [6/50], Step 1000, Train Loss: 0.3249, Val Avg Corr: 0.5063
Epoch [6/50], Step 1500, Train Loss: 0.5886, Val Avg Corr: 0.3835
Epoch [6/50], Step 2000, Train Loss: 0.6108, Val Avg Corr: 0.5739
Epoch [6/50], Step 2500, Train Loss: 0.7852, Val Avg Corr: 0.5511
Epoch [6/50], Step 3000, Train Loss: 0.5193, Val Avg Corr: 0.4355
Epoch [6/50], Step 3500, Train Loss: 0.7904, Val Avg Corr: 0.5232
Epoch [6/50], Step 4000, Train Loss: 0.5345, Val Avg Corr: 0.5424
Early stopping triggered after 4000 steps in epoch 6.
Loaded best model with validation Corr: 0.6172
  Re-evaluating SNN with movement mask for fair comparison...
  SNN Test Corr (All Bins): X=0.6753, Y=0.7068
  SNN Test  R²  (All Bins): X=0.4536, Y=0.4868
Time-series velocity figure saved --> snn_velocity_timeseries_slice_indy_20160927_06.mat.png

 
--- Finished Session 6 ---

--- Session 7/10 (indy_20160921_01.mat) ---
  Using fixed parameters: Bin Width=0.050s, Stride=0.050s (no overlap)
  Using zero causal lag (0 ms) - skipping lag search.
  Using raw spike counts (no normalisation)...
    Sample spike-count matrix (first 4 bins, first 12 neurons):
[[1 1 1 1 1 1 1 1 1 2 2 1]
 [0 1 0 0 0 0 1 0 0 0 0 0]
 [1 0 1 0 1 0 0 0 0 0 0 2]
 [0 1 0 1 0 1 0 0 0 0 1 0]]
    Counts min / max in this session: 0 6
Global count histogram 0-6: [407503  77294  15691   3138    518     45      3]
    Sample rate-NORMALISED matrix (first 4 bins, first 12 neurons):
[[ 1.45   1.016  1.493  2.412  2.058  2.783  1.31   1.716  4.391  6.504
   3.166  1.891]
 [-0.461  1.016 -0.466 -0.348 -0.398 -0.331  1.31  -0.459 -0.211 -0.268
  -0.516 -0.386]
 [ 1.45  -0.604  1.493 -0.348  2.058 -0.331 -0.524 -0.459 -0.211 -0.268
  -0.516  4.168]
 [-0.461  1.016 -0.466  2.412 -0.398  2.783 -0.524 -0.459 -0.211 -0.268
   1.325 -0.386]]

  --- Running SNN Online Training ---
Starting SNN Online Training for 50 epochs on cpu...
Evaluation every 500 steps, reset states every 200 steps
Warm-starting RMS EMAs with 50 steps...
RMS EMA warm-start complete.
Epoch [1/50], Step 500, Train Loss: 0.8429, Val Avg Corr: 0.1004
  >>> New best validation model saved with Avg Corr: 0.1004 <<<
Epoch [1/50], Step 1000, Train Loss: 0.6923, Val Avg Corr: 0.3046
  >>> New best validation model saved with Avg Corr: 0.3046 <<<
Epoch [1/50], Step 1500, Train Loss: 0.6045, Val Avg Corr: 0.3666
  >>> New best validation model saved with Avg Corr: 0.3666 <<<
Epoch [1/50], Step 2000, Train Loss: 0.6541, Val Avg Corr: 0.5029
  >>> New best validation model saved with Avg Corr: 0.5029 <<<
Epoch [1/50], Step 2500, Train Loss: 0.4897, Val Avg Corr: 0.5518
  >>> New best validation model saved with Avg Corr: 0.5518 <<<
Epoch [1/50], Step 3000, Train Loss: 0.7482, Val Avg Corr: 0.6083
  >>> New best validation model saved with Avg Corr: 0.6083 <<<
Epoch [1/50], Step 3500, Train Loss: 0.6918, Val Avg Corr: 0.6924
  >>> New best validation model saved with Avg Corr: 0.6924 <<<
Epoch [1/50], Step 4000, Train Loss: 0.6206, Val Avg Corr: 0.7178
  >>> New best validation model saved with Avg Corr: 0.7178 <<<
Epoch [2/50], Step 500, Train Loss: 0.7392, Val Avg Corr: 0.6719
Epoch [2/50], Step 1000, Train Loss: 0.5828, Val Avg Corr: 0.7179
  >>> New best validation model saved with Avg Corr: 0.7179 <<<
Epoch [2/50], Step 1500, Train Loss: 0.4802, Val Avg Corr: 0.6955
Epoch [2/50], Step 2000, Train Loss: 0.5133, Val Avg Corr: 0.5237
Epoch [2/50], Step 2500, Train Loss: 0.4439, Val Avg Corr: 0.6428
Epoch [2/50], Step 3000, Train Loss: 0.6470, Val Avg Corr: 0.6988
Epoch [2/50], Step 3500, Train Loss: 0.6206, Val Avg Corr: 0.6497
Epoch [2/50], Step 4000, Train Loss: 0.5984, Val Avg Corr: 0.6760
Epoch [3/50], Step 500, Train Loss: 0.7377, Val Avg Corr: 0.6990
Epoch [3/50], Step 1000, Train Loss: 0.5283, Val Avg Corr: 0.6816
Epoch [3/50], Step 1500, Train Loss: 0.4425, Val Avg Corr: 0.7080
Epoch [3/50], Step 2000, Train Loss: 0.4810, Val Avg Corr: 0.6071
Epoch [3/50], Step 2500, Train Loss: 0.4521, Val Avg Corr: 0.7030
Epoch [3/50], Step 3000, Train Loss: 0.6097, Val Avg Corr: 0.6897
Epoch [3/50], Step 3500, Train Loss: 0.5634, Val Avg Corr: 0.6825
Epoch [3/50], Step 4000, Train Loss: 0.5724, Val Avg Corr: 0.7028
Epoch [4/50], Step 500, Train Loss: 0.7085, Val Avg Corr: 0.6831
Epoch [4/50], Step 1000, Train Loss: 0.5440, Val Avg Corr: 0.7081
Epoch [4/50], Step 1500, Train Loss: 0.4421, Val Avg Corr: 0.7081
Epoch [4/50], Step 2000, Train Loss: 0.4030, Val Avg Corr: 0.5849
Epoch [4/50], Step 2500, Train Loss: 0.3843, Val Avg Corr: 0.6885
Epoch [4/50], Step 3000, Train Loss: 0.5810, Val Avg Corr: 0.6701
Early stopping triggered after 3000 steps in epoch 4.
Loaded best model with validation Corr: 0.7179
  Re-evaluating SNN with movement mask for fair comparison...
  SNN Test Corr (All Bins): X=0.5117, Y=0.7361
  SNN Test  R²  (All Bins): X=0.2532, Y=0.4025
Time-series velocity figure saved --> snn_velocity_timeseries_slice_indy_20160921_01.mat.png

--- Finished Session 7 ---

--- Session 8/10 (indy_20161026_03.mat) ---
  Using fixed parameters: Bin Width=0.050s, Stride=0.050s (no overlap)
  Using zero causal lag (0 ms) - skipping lag search.
  Using raw spike counts (no normalisation)...
    Sample spike-count matrix (first 4 bins, first 12 neurons):
[[1 2 1 1 1 2 1 1 2 1 1 2]
 [0 0 0 0 0 0 0 0 0 0 0 1]
 [0 1 0 0 1 1 0 0 0 0 0 0]
 [0 1 0 0 0 0 0 0 0 2 1 1]]
    Counts min / max in this session: 0 6
Global count histogram 0-6: [614882  69200  10416   1586    271     28      1]
    Sample rate-NORMALISED matrix (first 4 bins, first 12 neurons):
[[ 3.8760e+00  2.3110e+00  4.3140e+00  5.5890e+00  2.2300e+00  6.2970e+00
   8.5165e+01  4.1840e+00  5.7380e+00  3.2300e+00  2.7970e+00  3.8670e+00]
 [-2.3300e-01 -5.7300e-01 -2.1200e-01 -1.7200e-01 -3.4200e-01 -2.9600e-01
  -1.2000e-02 -2.2600e-01 -3.0700e-01 -2.6000e-01 -3.1800e-01  1.7370e+00]
 [-2.3300e-01  8.6900e-01 -2.1200e-01 -1.7200e-01  2.2300e+00  3.0010e+00
  -1.2000e-02 -2.2600e-01 -3.0700e-01 -2.6000e-01 -3.1800e-01 -3.9400e-01]
 [-2.3300e-01  8.6900e-01 -2.1200e-01 -1.7200e-01 -3.4200e-01 -2.9600e-01
  -1.2000e-02 -2.2600e-01 -3.0700e-01  6.7190e+00  2.7970e+00  1.7370e+00]]

  --- Running SNN Online Training ---
Starting SNN Online Training for 50 epochs on cpu...
Evaluation every 500 steps, reset states every 200 steps
Warm-starting RMS EMAs with 50 steps...
RMS EMA warm-start complete.
Epoch [1/50], Step 500, Train Loss: 0.6963, Val Avg Corr: 0.1229
  >>> New best validation model saved with Avg Corr: 0.1229 <<<
Epoch [1/50], Step 1000, Train Loss: 0.6139, Val Avg Corr: 0.2141
  >>> New best validation model saved with Avg Corr: 0.2141 <<<
Epoch [1/50], Step 1500, Train Loss: 0.6917, Val Avg Corr: 0.3098
  >>> New best validation model saved with Avg Corr: 0.3098 <<<
Epoch [1/50], Step 2000, Train Loss: 0.6378, Val Avg Corr: 0.3447
  >>> New best validation model saved with Avg Corr: 0.3447 <<<
Epoch [1/50], Step 2500, Train Loss: 0.7693, Val Avg Corr: 0.3624
  >>> New best validation model saved with Avg Corr: 0.3624 <<<
Epoch [1/50], Step 3000, Train Loss: 0.5498, Val Avg Corr: 0.4119
  >>> New best validation model saved with Avg Corr: 0.4119 <<<
Epoch [1/50], Step 3500, Train Loss: 0.6305, Val Avg Corr: 0.5254
  >>> New best validation model saved with Avg Corr: 0.5254 <<<
Epoch [1/50], Step 4000, Train Loss: 0.5568, Val Avg Corr: 0.5377
  >>> New best validation model saved with Avg Corr: 0.5377 <<<
Epoch [1/50], Step 4500, Train Loss: 0.4845, Val Avg Corr: 0.5476
  >>> New best validation model saved with Avg Corr: 0.5476 <<<
Epoch [1/50], Step 5000, Train Loss: 0.6037, Val Avg Corr: 0.5498
  >>> New best validation model saved with Avg Corr: 0.5498 <<<
Epoch [1/50], Step 5500, Train Loss: 0.4849, Val Avg Corr: 0.5534
  >>> New best validation model saved with Avg Corr: 0.5534 <<<
Epoch [1/50], Step 6000, Train Loss: 0.6567, Val Avg Corr: 0.5525
Epoch [2/50], Step 500, Train Loss: 0.6004, Val Avg Corr: 0.5759
  >>> New best validation model saved with Avg Corr: 0.5759 <<<
Epoch [2/50], Step 1000, Train Loss: 0.4456, Val Avg Corr: 0.5096
Epoch [2/50], Step 1500, Train Loss: 0.5585, Val Avg Corr: 0.5148
Epoch [2/50], Step 2000, Train Loss: 0.5932, Val Avg Corr: 0.5505
Epoch [2/50], Step 2500, Train Loss: 0.6666, Val Avg Corr: 0.5464
Epoch [2/50], Step 3000, Train Loss: 0.4906, Val Avg Corr: 0.5256
Epoch [2/50], Step 3500, Train Loss: 0.5155, Val Avg Corr: 0.4874
Epoch [2/50], Step 4000, Train Loss: 0.4860, Val Avg Corr: 0.5089
Epoch [2/50], Step 4500, Train Loss: 0.4903, Val Avg Corr: 0.5624
Epoch [2/50], Step 5000, Train Loss: 0.5383, Val Avg Corr: 0.5474
Epoch [2/50], Step 5500, Train Loss: 0.4993, Val Avg Corr: 0.5220
Epoch [2/50], Step 6000, Train Loss: 0.5850, Val Avg Corr: 0.5699
Epoch [3/50], Step 500, Train Loss: 0.5699, Val Avg Corr: 0.5738
Epoch [3/50], Step 1000, Train Loss: 0.4187, Val Avg Corr: 0.5441
Epoch [3/50], Step 1500, Train Loss: 0.4732, Val Avg Corr: 0.5501
Epoch [3/50], Step 2000, Train Loss: 0.5108, Val Avg Corr: 0.5735
Epoch [3/50], Step 2500, Train Loss: 0.6584, Val Avg Corr: 0.5695
Epoch [3/50], Step 3000, Train Loss: 0.4350, Val Avg Corr: 0.5458
Epoch [3/50], Step 3500, Train Loss: 0.5274, Val Avg Corr: 0.5700
Epoch [3/50], Step 4000, Train Loss: 0.4881, Val Avg Corr: 0.6011
  >>> New best validation model saved with Avg Corr: 0.6011 <<<
Epoch [3/50], Step 4500, Train Loss: 0.4766, Val Avg Corr: 0.5674
Epoch [3/50], Step 5000, Train Loss: 0.5691, Val Avg Corr: 0.5774
Epoch [3/50], Step 5500, Train Loss: 0.3912, Val Avg Corr: 0.5606
Epoch [3/50], Step 6000, Train Loss: 0.5750, Val Avg Corr: 0.5329
Epoch [4/50], Step 500, Train Loss: 0.5416, Val Avg Corr: 0.6127
  >>> New best validation model saved with Avg Corr: 0.6127 <<<
Epoch [4/50], Step 1000, Train Loss: 0.3663, Val Avg Corr: 0.6008
Epoch [4/50], Step 1500, Train Loss: 0.4483, Val Avg Corr: 0.6010
Epoch [4/50], Step 2000, Train Loss: 0.4868, Val Avg Corr: 0.6093
Epoch [4/50], Step 2500, Train Loss: 0.6373, Val Avg Corr: 0.6161
  >>> New best validation model saved with Avg Corr: 0.6161 <<<
Epoch [4/50], Step 3000, Train Loss: 0.4273, Val Avg Corr: 0.5548
Epoch [4/50], Step 3500, Train Loss: 0.4980, Val Avg Corr: 0.5478
Epoch [4/50], Step 4000, Train Loss: 0.4670, Val Avg Corr: 0.5748
Epoch [4/50], Step 4500, Train Loss: 0.4701, Val Avg Corr: 0.5833
Epoch [4/50], Step 5000, Train Loss: 0.5353, Val Avg Corr: 0.6106
Epoch [4/50], Step 5500, Train Loss: 0.4621, Val Avg Corr: 0.5904
Epoch [4/50], Step 6000, Train Loss: 0.5805, Val Avg Corr: 0.5681
Epoch [5/50], Step 500, Train Loss: 0.5329, Val Avg Corr: 0.5991
Epoch [5/50], Step 1000, Train Loss: 0.3799, Val Avg Corr: 0.6143
Epoch [5/50], Step 1500, Train Loss: 0.4782, Val Avg Corr: 0.5736
Epoch [5/50], Step 2000, Train Loss: 0.4865, Val Avg Corr: 0.6273
  >>> New best validation model saved with Avg Corr: 0.6273 <<<
Epoch [5/50], Step 2500, Train Loss: 0.6508, Val Avg Corr: 0.5974
Epoch [5/50], Step 3000, Train Loss: 0.4541, Val Avg Corr: 0.5429
Epoch [5/50], Step 3500, Train Loss: 0.5432, Val Avg Corr: 0.5791
Epoch [5/50], Step 4000, Train Loss: 0.4344, Val Avg Corr: 0.6179
Epoch [5/50], Step 4500, Train Loss: 0.4243, Val Avg Corr: 0.6322
  >>> New best validation model saved with Avg Corr: 0.6322 <<<
Epoch [5/50], Step 5000, Train Loss: 0.5776, Val Avg Corr: 0.6064
Epoch [5/50], Step 5500, Train Loss: 0.4209, Val Avg Corr: 0.5691
Epoch [5/50], Step 6000, Train Loss: 0.5913, Val Avg Corr: 0.6137
Epoch [6/50], Step 500, Train Loss: 0.5473, Val Avg Corr: 0.6291
Epoch [6/50], Step 1000, Train Loss: 0.3571, Val Avg Corr: 0.5701
Epoch [6/50], Step 1500, Train Loss: 0.4431, Val Avg Corr: 0.5574
Epoch [6/50], Step 2000, Train Loss: 0.4357, Val Avg Corr: 0.5591
Epoch [6/50], Step 2500, Train Loss: 0.6028, Val Avg Corr: 0.5957
Epoch [6/50], Step 3000, Train Loss: 0.4315, Val Avg Corr: 0.5308
Epoch [6/50], Step 3500, Train Loss: 0.5220, Val Avg Corr: 0.5257
Epoch [6/50], Step 4000, Train Loss: 0.4685, Val Avg Corr: 0.6113
Epoch [6/50], Step 4500, Train Loss: 0.4844, Val Avg Corr: 0.6143
Epoch [6/50], Step 5000, Train Loss: 0.5786, Val Avg Corr: 0.6046
Epoch [6/50], Step 5500, Train Loss: 0.4538, Val Avg Corr: 0.5712
Epoch [6/50], Step 6000, Train Loss: 0.6480, Val Avg Corr: 0.5851
Epoch [7/50], Step 500, Train Loss: 0.5792, Val Avg Corr: 0.5449
Epoch [7/50], Step 1000, Train Loss: 0.4346, Val Avg Corr: 0.4550
Epoch [7/50], Step 1500, Train Loss: 0.5694, Val Avg Corr: 0.5560
Epoch [7/50], Step 2000, Train Loss: 0.6039, Val Avg Corr: 0.5692
Epoch [7/50], Step 2500, Train Loss: 0.7071, Val Avg Corr: 0.5521
Early stopping triggered after 2500 steps in epoch 7.
Loaded best model with validation Corr: 0.6322
  Re-evaluating SNN with movement mask for fair comparison...
  SNN Test Corr (All Bins): X=0.6388, Y=0.7051
  SNN Test  R²  (All Bins): X=0.3988, Y=0.4125
Time-series velocity figure saved --> snn_velocity_timeseries_slice_indy_20161026_03.mat.png

--- Finished Session 8 ---

--- Session 9/10 (indy_20161027_03.mat) ---
  Using fixed parameters: Bin Width=0.050s, Stride=0.050s (no overlap)
  Using zero causal lag (0 ms) - skipping lag search.
  Using raw spike counts (no normalisation)...
    Sample spike-count matrix (first 4 bins, first 12 neurons):
[[1 1 1 1 1 2 1 1 1 1 1 1]
 [0 0 0 0 0 0 0 1 0 0 0 0]
 [0 0 0 0 1 0 0 0 1 0 0 0]
 [0 0 0 0 0 0 0 0 0 0 0 0]]
    Counts min / max in this session: 0 6
Global count histogram 0-6: [723543  70043  12006   3435   1115    268     22]
    Sample rate-NORMALISED matrix (first 4 bins, first 12 neurons):
[[ 8.8680e+00  1.6420e+00  3.4140e+00  7.1950e+00  3.6360e+00  7.5480e+00
   9.1875e+01  5.3410e+00  4.6200e+00  3.7580e+00  4.5630e+00  2.7500e+00]
 [-1.1100e-01 -4.4100e-01 -2.5200e-01 -1.2500e-01 -2.4800e-01 -2.5000e-01
  -1.1000e-02  5.3410e+00 -1.9000e-01 -2.3000e-01 -1.9800e-01 -2.9000e-01]
 [-1.1100e-01 -4.4100e-01 -2.5200e-01 -1.2500e-01  3.6360e+00 -2.5000e-01
  -1.1000e-02 -1.7500e-01  4.6200e+00 -2.3000e-01 -1.9800e-01 -2.9000e-01]
 [-1.1100e-01 -4.4100e-01 -2.5200e-01 -1.2500e-01 -2.4800e-01 -2.5000e-01
  -1.1000e-02 -1.7500e-01 -1.9000e-01 -2.3000e-01 -1.9800e-01 -2.9000e-01]]

  --- Running SNN Online Training ---
Starting SNN Online Training for 50 epochs on cpu...
Evaluation every 500 steps, reset states every 200 steps
Warm-starting RMS EMAs with 50 steps...
RMS EMA warm-start complete.
Epoch [1/50], Step 500, Train Loss: 0.0502, Val Avg Corr: 0.1368
  >>> New best validation model saved with Avg Corr: 0.1368 <<<
Epoch [1/50], Step 1000, Train Loss: 0.5250, Val Avg Corr: -0.0224
Epoch [1/50], Step 1500, Train Loss: 0.4564, Val Avg Corr: 0.1440
  >>> New best validation model saved with Avg Corr: 0.1440 <<<
Epoch [1/50], Step 2000, Train Loss: 0.5843, Val Avg Corr: 0.2314
  >>> New best validation model saved with Avg Corr: 0.2314 <<<
Epoch [1/50], Step 2500, Train Loss: 0.7573, Val Avg Corr: 0.2425
  >>> New best validation model saved with Avg Corr: 0.2425 <<<
Epoch [1/50], Step 3000, Train Loss: 0.8553, Val Avg Corr: 0.2207
Epoch [1/50], Step 3500, Train Loss: 0.7157, Val Avg Corr: 0.3950
  >>> New best validation model saved with Avg Corr: 0.3950 <<<
Epoch [1/50], Step 4000, Train Loss: 0.7076, Val Avg Corr: 0.4603
  >>> New best validation model saved with Avg Corr: 0.4603 <<<
Epoch [1/50], Step 4500, Train Loss: 0.7984, Val Avg Corr: 0.4058
Epoch [1/50], Step 5000, Train Loss: 0.7948, Val Avg Corr: 0.3918
Epoch [1/50], Step 5500, Train Loss: 0.7167, Val Avg Corr: 0.3048
Epoch [1/50], Step 6000, Train Loss: 0.5662, Val Avg Corr: 0.3099
Epoch [1/50], Step 6500, Train Loss: 0.5359, Val Avg Corr: 0.4637
  >>> New best validation model saved with Avg Corr: 0.4637 <<<
Epoch [1/50], Step 7000, Train Loss: 0.9915, Val Avg Corr: 0.4701
  >>> New best validation model saved with Avg Corr: 0.4701 <<<
Epoch [2/50], Step 500, Train Loss: 0.0579, Val Avg Corr: 0.3349
Epoch [2/50], Step 1000, Train Loss: 0.4847, Val Avg Corr: 0.3751
Epoch [2/50], Step 1500, Train Loss: 0.4343, Val Avg Corr: 0.4859
  >>> New best validation model saved with Avg Corr: 0.4859 <<<
Epoch [2/50], Step 2000, Train Loss: 0.5799, Val Avg Corr: 0.5273
  >>> New best validation model saved with Avg Corr: 0.5273 <<<
Epoch [2/50], Step 2500, Train Loss: 0.6945, Val Avg Corr: 0.5434
  >>> New best validation model saved with Avg Corr: 0.5434 <<<
Epoch [2/50], Step 3000, Train Loss: 0.7944, Val Avg Corr: 0.5070
Epoch [2/50], Step 3500, Train Loss: 0.6183, Val Avg Corr: 0.5576
  >>> New best validation model saved with Avg Corr: 0.5576 <<<
Epoch [2/50], Step 4000, Train Loss: 0.6150, Val Avg Corr: 0.5548
Epoch [2/50], Step 4500, Train Loss: 0.7193, Val Avg Corr: 0.5027
Epoch [2/50], Step 5000, Train Loss: 0.7792, Val Avg Corr: 0.5928
  >>> New best validation model saved with Avg Corr: 0.5928 <<<
Epoch [2/50], Step 5500, Train Loss: 0.6757, Val Avg Corr: 0.5459
Epoch [2/50], Step 6000, Train Loss: 0.4698, Val Avg Corr: 0.4458
Epoch [2/50], Step 6500, Train Loss: 0.5285, Val Avg Corr: 0.5349
Epoch [2/50], Step 7000, Train Loss: 0.9416, Val Avg Corr: 0.5168
Epoch [3/50], Step 500, Train Loss: 0.0584, Val Avg Corr: 0.5043
Epoch [3/50], Step 1000, Train Loss: 0.4692, Val Avg Corr: 0.4804
Epoch [3/50], Step 1500, Train Loss: 0.3989, Val Avg Corr: 0.5369
Epoch [3/50], Step 2000, Train Loss: 0.5600, Val Avg Corr: 0.5757
Epoch [3/50], Step 2500, Train Loss: 0.6956, Val Avg Corr: 0.5888
Epoch [3/50], Step 3000, Train Loss: 0.7561, Val Avg Corr: 0.5353
Epoch [3/50], Step 3500, Train Loss: 0.5839, Val Avg Corr: 0.4915
Epoch [3/50], Step 4000, Train Loss: 0.5503, Val Avg Corr: 0.5666
Epoch [3/50], Step 4500, Train Loss: 0.6908, Val Avg Corr: 0.4793
Epoch [3/50], Step 5000, Train Loss: 0.7372, Val Avg Corr: 0.5960
  >>> New best validation model saved with Avg Corr: 0.5960 <<<
Epoch [3/50], Step 5500, Train Loss: 0.7031, Val Avg Corr: 0.6235
  >>> New best validation model saved with Avg Corr: 0.6235 <<<
Epoch [3/50], Step 6000, Train Loss: 0.4391, Val Avg Corr: 0.4940
Epoch [3/50], Step 6500, Train Loss: 0.5201, Val Avg Corr: 0.5243
Epoch [3/50], Step 7000, Train Loss: 0.9302, Val Avg Corr: 0.5393
Epoch [4/50], Step 500, Train Loss: 0.0561, Val Avg Corr: 0.5938
Epoch [4/50], Step 1000, Train Loss: 0.4423, Val Avg Corr: 0.5147
Epoch [4/50], Step 1500, Train Loss: 0.3796, Val Avg Corr: 0.5265
Epoch [4/50], Step 2000, Train Loss: 0.5565, Val Avg Corr: 0.5742
Epoch [4/50], Step 2500, Train Loss: 0.6454, Val Avg Corr: 0.5422
Epoch [4/50], Step 3000, Train Loss: 0.7714, Val Avg Corr: 0.6175
Epoch [4/50], Step 3500, Train Loss: 0.5673, Val Avg Corr: 0.5610
Epoch [4/50], Step 4000, Train Loss: 0.5620, Val Avg Corr: 0.5711
Epoch [4/50], Step 4500, Train Loss: 0.6805, Val Avg Corr: 0.5610
Epoch [4/50], Step 5000, Train Loss: 0.6898, Val Avg Corr: 0.5866
Epoch [4/50], Step 5500, Train Loss: 0.6365, Val Avg Corr: 0.5960
Epoch [4/50], Step 6000, Train Loss: 0.4359, Val Avg Corr: 0.5708
Epoch [4/50], Step 6500, Train Loss: 0.5015, Val Avg Corr: 0.5794
Epoch [4/50], Step 7000, Train Loss: 0.8946, Val Avg Corr: 0.5217
Epoch [5/50], Step 500, Train Loss: 0.0608, Val Avg Corr: 0.5567
Epoch [5/50], Step 1000, Train Loss: 0.4240, Val Avg Corr: 0.5318
Epoch [5/50], Step 1500, Train Loss: 0.3874, Val Avg Corr: 0.5565
Early stopping triggered after 1500 steps in epoch 5.
Loaded best model with validation Corr: 0.6235
  Re-evaluating SNN with movement mask for fair comparison...
  SNN Test Corr (All Bins): X=0.5754, Y=0.7145
  SNN Test  R²  (All Bins): X=0.2820, Y=0.4938
Time-series velocity figure saved --> snn_velocity_timeseries_slice_indy_20161027_03.mat.png

--- Finished Session 9 ---

--- Session 10/10 (indy_20160419_01.mat) ---
  Using fixed parameters: Bin Width=0.050s, Stride=0.050s (no overlap)
  Using zero causal lag (0 ms) - skipping lag search.
  Using raw spike counts (no normalisation)...
    Sample spike-count matrix (first 4 bins, first 12 neurons):
[[2 1 1 1 2 2 1 1 1 1 1 3]
 [0 1 0 0 0 0 0 0 0 0 0 1]
 [0 0 0 0 1 0 0 0 0 0 0 0]
 [0 0 0 0 1 1 0 0 1 0 0 0]]
    Counts min / max in this session: 0 8
Global count histogram 0-6: [571721 125803  27440   6549   1545    379     83]
    Sample rate-NORMALISED matrix (first 4 bins, first 12 neurons):
[[ 3.62   1.108  2.99   2.484  3.8    3.04   0.599  2.676  1.469  2.616
   1.281  4.447]
 [-0.438  1.108 -0.274 -0.303 -0.414 -0.53  -0.694 -0.301 -0.44  -0.315
  -0.515  1.145]
 [-0.438 -0.544 -0.274 -0.303  1.693 -0.53  -0.694 -0.301 -0.44  -0.315
  -0.515 -0.506]
 [-0.438 -0.544 -0.274 -0.303  1.693  1.255 -0.694 -0.301  1.469 -0.315
  -0.515 -0.506]]

  --- Running SNN Online Training ---
Starting SNN Online Training for 50 epochs on cpu...
Evaluation every 500 steps, reset states every 200 steps
Warm-starting RMS EMAs with 50 steps...
RMS EMA warm-start complete.
Epoch [1/50], Step 500, Train Loss: 0.8078, Val Avg Corr: 0.3138
  >>> New best validation model saved with Avg Corr: 0.3138 <<<
Epoch [1/50], Step 1000, Train Loss: 0.7819, Val Avg Corr: 0.3993
  >>> New best validation model saved with Avg Corr: 0.3993 <<<
Epoch [1/50], Step 1500, Train Loss: 0.6762, Val Avg Corr: 0.4251
  >>> New best validation model saved with Avg Corr: 0.4251 <<<
Epoch [1/50], Step 2000, Train Loss: 0.6653, Val Avg Corr: 0.4936
  >>> New best validation model saved with Avg Corr: 0.4936 <<<
Epoch [1/50], Step 2500, Train Loss: 0.5118, Val Avg Corr: 0.3983
Epoch [1/50], Step 3000, Train Loss: 0.7617, Val Avg Corr: 0.5433
  >>> New best validation model saved with Avg Corr: 0.5433 <<<
Epoch [1/50], Step 3500, Train Loss: 0.5873, Val Avg Corr: 0.4336
Epoch [1/50], Step 4000, Train Loss: 0.5825, Val Avg Corr: 0.5312
Epoch [1/50], Step 4500, Train Loss: 0.4208, Val Avg Corr: 0.5565
  >>> New best validation model saved with Avg Corr: 0.5565 <<<
Epoch [1/50], Step 5000, Train Loss: 0.7664, Val Avg Corr: 0.5767
  >>> New best validation model saved with Avg Corr: 0.5767 <<<
Epoch [1/50], Step 5500, Train Loss: 0.7140, Val Avg Corr: 0.5838
  >>> New best validation model saved with Avg Corr: 0.5838 <<<
Epoch [1/50], Step 6000, Train Loss: 0.5747, Val Avg Corr: 0.5946
  >>> New best validation model saved with Avg Corr: 0.5946 <<<
Epoch [2/50], Step 500, Train Loss: 0.5588, Val Avg Corr: 0.5619
Epoch [2/50], Step 1000, Train Loss: 0.5880, Val Avg Corr: 0.6136
  >>> New best validation model saved with Avg Corr: 0.6136 <<<
Epoch [2/50], Step 1500, Train Loss: 0.5921, Val Avg Corr: 0.5021
Epoch [2/50], Step 2000, Train Loss: 0.5128, Val Avg Corr: 0.5838
Epoch [2/50], Step 2500, Train Loss: 0.4405, Val Avg Corr: 0.5956
Epoch [2/50], Step 3000, Train Loss: 0.7263, Val Avg Corr: 0.6049
Epoch [2/50], Step 3500, Train Loss: 0.5253, Val Avg Corr: 0.5078
Epoch [2/50], Step 4000, Train Loss: 0.5648, Val Avg Corr: 0.6073
Epoch [2/50], Step 4500, Train Loss: 0.4036, Val Avg Corr: 0.5918
Epoch [2/50], Step 5000, Train Loss: 0.7552, Val Avg Corr: 0.6210
  >>> New best validation model saved with Avg Corr: 0.6210 <<<
Epoch [2/50], Step 5500, Train Loss: 0.7215, Val Avg Corr: 0.6559
  >>> New best validation model saved with Avg Corr: 0.6559 <<<
Epoch [2/50], Step 6000, Train Loss: 0.5341, Val Avg Corr: 0.6497
Epoch [3/50], Step 500, Train Loss: 0.4279, Val Avg Corr: 0.6139
Epoch [3/50], Step 1000, Train Loss: 0.5895, Val Avg Corr: 0.5485
Epoch [3/50], Step 1500, Train Loss: 0.5696, Val Avg Corr: 0.4628
Epoch [3/50], Step 2000, Train Loss: 0.4739, Val Avg Corr: 0.5507
Epoch [3/50], Step 2500, Train Loss: 0.3919, Val Avg Corr: 0.5248
Epoch [3/50], Step 3000, Train Loss: 0.6909, Val Avg Corr: 0.6364
Epoch [3/50], Step 3500, Train Loss: 0.4818, Val Avg Corr: 0.6327
Epoch [3/50], Step 4000, Train Loss: 0.4858, Val Avg Corr: 0.6626
  >>> New best validation model saved with Avg Corr: 0.6626 <<<
Epoch [3/50], Step 4500, Train Loss: 0.3739, Val Avg Corr: 0.6590
Epoch [3/50], Step 5000, Train Loss: 0.7155, Val Avg Corr: 0.6485
Epoch [3/50], Step 5500, Train Loss: 0.6864, Val Avg Corr: 0.6454
Epoch [3/50], Step 6000, Train Loss: 0.5091, Val Avg Corr: 0.6735
  >>> New best validation model saved with Avg Corr: 0.6735 <<<
Epoch [4/50], Step 500, Train Loss: 0.4103, Val Avg Corr: 0.6137
Epoch [4/50], Step 1000, Train Loss: 0.5509, Val Avg Corr: 0.5314
Epoch [4/50], Step 1500, Train Loss: 0.5802, Val Avg Corr: 0.5487
Epoch [4/50], Step 2000, Train Loss: 0.4928, Val Avg Corr: 0.5991
Epoch [4/50], Step 2500, Train Loss: 0.3824, Val Avg Corr: 0.5673
Epoch [4/50], Step 3000, Train Loss: 0.6424, Val Avg Corr: 0.6001
Epoch [4/50], Step 3500, Train Loss: 0.4749, Val Avg Corr: 0.6253
Epoch [4/50], Step 4000, Train Loss: 0.4873, Val Avg Corr: 0.6575
Epoch [4/50], Step 4500, Train Loss: 0.3329, Val Avg Corr: 0.6436
Epoch [4/50], Step 5000, Train Loss: 0.7265, Val Avg Corr: 0.6478
Epoch [4/50], Step 5500, Train Loss: 0.6886, Val Avg Corr: 0.6344
Epoch [4/50], Step 6000, Train Loss: 0.5051, Val Avg Corr: 0.6907
  >>> New best validation model saved with Avg Corr: 0.6907 <<<
Epoch [5/50], Step 500, Train Loss: 0.3776, Val Avg Corr: 0.6356
Epoch [5/50], Step 1000, Train Loss: 0.5530, Val Avg Corr: 0.5043
Epoch [5/50], Step 1500, Train Loss: 0.5473, Val Avg Corr: 0.4833
Epoch [5/50], Step 2000, Train Loss: 0.4498, Val Avg Corr: 0.5499
Epoch [5/50], Step 2500, Train Loss: 0.3836, Val Avg Corr: 0.4950
Epoch [5/50], Step 3000, Train Loss: 0.6355, Val Avg Corr: 0.6249
Epoch [5/50], Step 3500, Train Loss: 0.4522, Val Avg Corr: 0.5826
Epoch [5/50], Step 4000, Train Loss: 0.5024, Val Avg Corr: 0.6189
Epoch [5/50], Step 4500, Train Loss: 0.4149, Val Avg Corr: 0.6453
Epoch [5/50], Step 5000, Train Loss: 0.7668, Val Avg Corr: 0.6495
Epoch [5/50], Step 5500, Train Loss: 0.7159, Val Avg Corr: 0.6204
Epoch [5/50], Step 6000, Train Loss: 0.5003, Val Avg Corr: 0.6594
Epoch [6/50], Step 500, Train Loss: 0.4808, Val Avg Corr: 0.6131
Epoch [6/50], Step 1000, Train Loss: 0.6041, Val Avg Corr: 0.5037
Epoch [6/50], Step 1500, Train Loss: 0.6642, Val Avg Corr: 0.3145
Epoch [6/50], Step 2000, Train Loss: 0.5944, Val Avg Corr: 0.5462
Epoch [6/50], Step 2500, Train Loss: 0.4362, Val Avg Corr: 0.5388
Epoch [6/50], Step 3000, Train Loss: 0.7478, Val Avg Corr: 0.5899
Epoch [6/50], Step 3500, Train Loss: 0.5090, Val Avg Corr: 0.6278
Epoch [6/50], Step 4000, Train Loss: 0.5176, Val Avg Corr: 0.6087
Early stopping triggered after 4000 steps in epoch 6.
Loaded best model with validation Corr: 0.6907
  Re-evaluating SNN with movement mask for fair comparison...
  SNN Test Corr (All Bins): X=0.6029, Y=0.6898
  SNN Test  R²  (All Bins): X=0.3601, Y=0.4086
Time-series velocity figure saved --> snn_velocity_timeseries_slice_indy_20160419_01.mat.png

  
--- Finished Session 10 ---

===== Within-Session Comparison Final Results =====
Full results saved to results_within_session_comparison.csv

--- Average Test Corr & R² --- 
Model: SNN
  X-Corr: Mean=0.6125, Std=0.0917
  Y-Corr: Mean=0.7139, Std=0.0534
  X-R² : Mean=0.3663, Std=0.1216
  Y-R² : Mean=0.4554, Std=0.0864
Model: KF
  X-Corr: Mean=0.4155, Std=0.0704
  Y-Corr: Mean=0.4557, Std=0.0772
  X-R² : Mean=0.1568, Std=0.0579
  Y-R² : Mean=0.1919, Std=0.0633
Model: LSTM
  X-Corr: Mean=0.7512, Std=0.0719
  Y-Corr: Mean=0.8355, Std=0.0315
  X-R² : Mean=0.5500, Std=0.1141
  Y-R² : Mean=0.6845, Std=0.0566
Comparison plot saved to within_session_comparison_plot.png
===== Experiment Complete =====

ONLINE SNN Results:
  Mean X Correlation: 0.6125
  Mean Y Correlation: 0.7139
  Average: 0.6632

================================================================================
COMPARISON COMPLETE
Key differences between modes:
- WINDOWED: Uses 10-timestep sequences, batch updates
- ONLINE: Uses single timesteps, persistent hidden states
- Online mode should show lower but more stable learning
- Online mode simulates real-time BCI operation
================================================================================

===== Running Within-Session BPTT SNN Evaluation (10 Sessions) =====

--- Session 1/10 (indy_20160411_02.mat) ---
  Datasets created: Train=9324, Val=1626, Test=2726
Training on device: cpu
/scratch/zt1/project/sshah389-prj/user/snallani/myenv/lib/python3.10/site-packages/torch/optim/lr_scheduler.py:28: UserWarning: The verbose parameter is deprecated. Please use get_last_lr() to access the learning rate.
  warnings.warn("The verbose parameter is deprecated. Please use get_last_lr() "
Epoch [1/50], Train Loss: 0.7140, Val Loss: 0.5728, Val Avg Corr: 0.6165
  New best model saved with Val Avg Corr: 0.6165
Epoch [2/50], Train Loss: 0.4942, Val Loss: 0.4788, Val Avg Corr: 0.6894
  New best model saved with Val Avg Corr: 0.6894
Epoch [3/50], Train Loss: 0.4150, Val Loss: 0.4444, Val Avg Corr: 0.7178
  New best model saved with Val Avg Corr: 0.7178
Epoch [4/50], Train Loss: 0.3682, Val Loss: 0.4087, Val Avg Corr: 0.7446
  New best model saved with Val Avg Corr: 0.7446
Epoch [5/50], Train Loss: 0.3314, Val Loss: 0.3941, Val Avg Corr: 0.7541
  New best model saved with Val Avg Corr: 0.7541
Epoch [6/50], Train Loss: 0.3080, Val Loss: 0.3874, Val Avg Corr: 0.7581
  New best model saved with Val Avg Corr: 0.7581
Epoch [7/50], Train Loss: 0.2897, Val Loss: 0.4044, Val Avg Corr: 0.7544
Epoch [8/50], Train Loss: 0.2703, Val Loss: 0.3913, Val Avg Corr: 0.7596
  New best model saved with Val Avg Corr: 0.7596
Epoch [9/50], Train Loss: 0.2513, Val Loss: 0.4038, Val Avg Corr: 0.7516
Epoch [10/50], Train Loss: 0.2357, Val Loss: 0.3999, Val Avg Corr: 0.7543
Epoch [11/50], Train Loss: 0.2192, Val Loss: 0.4117, Val Avg Corr: 0.7473
Epoch [12/50], Train Loss: 0.2059, Val Loss: 0.3982, Val Avg Corr: 0.7575
Epoch [13/50], Train Loss: 0.1942, Val Loss: 0.4056, Val Avg Corr: 0.7503
Epoch [14/50], Train Loss: 0.1851, Val Loss: 0.4041, Val Avg Corr: 0.7511
Epoch [15/50], Train Loss: 0.1734, Val Loss: 0.4010, Val Avg Corr: 0.7528
Early stopping triggered after 7 epochs with no improvement.

--- Evaluating on Test Set for Session 1 ---
  Loading best model from snn_bptt_session_indy_20160411_02.pth
  Test Set Results: Loss=0.3607, CorrX=0.7741, CorrY=0.7875

--- Session 2/10 (indy_20161017_02.mat) ---
  Datasets created: Train=5242, Val=906, Test=1525
Training on device: cpu
/scratch/zt1/project/sshah389-prj/user/snallani/myenv/lib/python3.10/site-packages/torch/optim/lr_scheduler.py:28: UserWarning: The verbose parameter is deprecated. Please use get_last_lr() to access the learning rate.
  warnings.warn("The verbose parameter is deprecated. Please use get_last_lr() "
Epoch [1/50], Train Loss: 0.9015, Val Loss: 1.0431, Val Avg Corr: 0.4013
  New best model saved with Val Avg Corr: 0.4013
Epoch [2/50], Train Loss: 0.7312, Val Loss: 0.9272, Val Avg Corr: 0.5081
  New best model saved with Val Avg Corr: 0.5081
Epoch [3/50], Train Loss: 0.6181, Val Loss: 0.7934, Val Avg Corr: 0.6023
  New best model saved with Val Avg Corr: 0.6023
Epoch [4/50], Train Loss: 0.5365, Val Loss: 0.7272, Val Avg Corr: 0.6482
  New best model saved with Val Avg Corr: 0.6482
Epoch [5/50], Train Loss: 0.4732, Val Loss: 0.6930, Val Avg Corr: 0.6698
  New best model saved with Val Avg Corr: 0.6698
Epoch [6/50], Train Loss: 0.4226, Val Loss: 0.6723, Val Avg Corr: 0.6782
  New best model saved with Val Avg Corr: 0.6782
Epoch [7/50], Train Loss: 0.3674, Val Loss: 0.6525, Val Avg Corr: 0.6901
  New best model saved with Val Avg Corr: 0.6901
Epoch [8/50], Train Loss: 0.3320, Val Loss: 0.6444, Val Avg Corr: 0.6957
  New best model saved with Val Avg Corr: 0.6957
Epoch [9/50], Train Loss: 0.2975, Val Loss: 0.6359, Val Avg Corr: 0.7027
  New best model saved with Val Avg Corr: 0.7027
Epoch [10/50], Train Loss: 0.2735, Val Loss: 0.6501, Val Avg Corr: 0.7013
Epoch [11/50], Train Loss: 0.2492, Val Loss: 0.6214, Val Avg Corr: 0.7107
  New best model saved with Val Avg Corr: 0.7107
Epoch [12/50], Train Loss: 0.2301, Val Loss: 0.6415, Val Avg Corr: 0.6996
Epoch [13/50], Train Loss: 0.2138, Val Loss: 0.6258, Val Avg Corr: 0.7052
Epoch [14/50], Train Loss: 0.2029, Val Loss: 0.6195, Val Avg Corr: 0.7140
  New best model saved with Val Avg Corr: 0.7140
Epoch [15/50], Train Loss: 0.1949, Val Loss: 0.6211, Val Avg Corr: 0.7126
Epoch [16/50], Train Loss: 0.1841, Val Loss: 0.6198, Val Avg Corr: 0.7115
Epoch [17/50], Train Loss: 0.1783, Val Loss: 0.6259, Val Avg Corr: 0.7090
Epoch [18/50], Train Loss: 0.1758, Val Loss: 0.6206, Val Avg Corr: 0.7134
Epoch [19/50], Train Loss: 0.1643, Val Loss: 0.6247, Val Avg Corr: 0.7109
Epoch [20/50], Train Loss: 0.1553, Val Loss: 0.6314, Val Avg Corr: 0.7083
Epoch [21/50], Train Loss: 0.1508, Val Loss: 0.6246, Val Avg Corr: 0.7114
Early stopping triggered after 7 epochs with no improvement.

--- Evaluating on Test Set for Session 2 ---
  Loading best model from snn_bptt_session_indy_20161017_02.pth
  Test Set Results: Loss=0.5217, CorrX=0.6193, CorrY=0.7632

--- Session 3/10 (indy_20160630_01.mat) ---
  Datasets created: Train=15520, Val=2720, Test=4549
Training on device: cpu
/scratch/zt1/project/sshah389-prj/user/snallani/myenv/lib/python3.10/site-packages/torch/optim/lr_scheduler.py:28: UserWarning: The verbose parameter is deprecated. Please use get_last_lr() to access the learning rate.
  warnings.warn("The verbose parameter is deprecated. Please use get_last_lr() "
Epoch [1/50], Train Loss: 0.8599, Val Loss: 0.5294, Val Avg Corr: 0.4743
  New best model saved with Val Avg Corr: 0.4743
Epoch [2/50], Train Loss: 0.7211, Val Loss: 0.4905, Val Avg Corr: 0.5372
  New best model saved with Val Avg Corr: 0.5372
Epoch [3/50], Train Loss: 0.6369, Val Loss: 0.4745, Val Avg Corr: 0.5553
  New best model saved with Val Avg Corr: 0.5553
Epoch [4/50], Train Loss: 0.5786, Val Loss: 0.4783, Val Avg Corr: 0.5549
Epoch [5/50], Train Loss: 0.5326, Val Loss: 0.4654, Val Avg Corr: 0.5711
  New best model saved with Val Avg Corr: 0.5711
Epoch [6/50], Train Loss: 0.4854, Val Loss: 0.4841, Val Avg Corr: 0.5510
Epoch [7/50], Train Loss: 0.4474, Val Loss: 0.4896, Val Avg Corr: 0.5559
Epoch [8/50], Train Loss: 0.4105, Val Loss: 0.4918, Val Avg Corr: 0.5477
Epoch [9/50], Train Loss: 0.3785, Val Loss: 0.4991, Val Avg Corr: 0.5401
Epoch [10/50], Train Loss: 0.3423, Val Loss: 0.5039, Val Avg Corr: 0.5357
Epoch [11/50], Train Loss: 0.3219, Val Loss: 0.4996, Val Avg Corr: 0.5446
Epoch [12/50], Train Loss: 0.3060, Val Loss: 0.5076, Val Avg Corr: 0.5377
Early stopping triggered after 7 epochs with no improvement.

--- Evaluating on Test Set for Session 3 ---
  Loading best model from snn_bptt_session_indy_20160630_01.pth
  Test Set Results: Loss=0.5152, CorrX=0.4027, CorrY=0.6195

--- Session 4/10 (indy_20161212_02.mat) ---
  Datasets created: Train=5931, Val=1028, Test=1728
Training on device: cpu
/scratch/zt1/project/sshah389-prj/user/snallani/myenv/lib/python3.10/site-packages/torch/optim/lr_scheduler.py:28: UserWarning: The verbose parameter is deprecated. Please use get_last_lr() to access the learning rate.
  warnings.warn("The verbose parameter is deprecated. Please use get_last_lr() "
Epoch [1/50], Train Loss: 0.9913, Val Loss: 1.0696, Val Avg Corr: 0.2804
  New best model saved with Val Avg Corr: 0.2804
Epoch [2/50], Train Loss: 0.9048, Val Loss: 0.9209, Val Avg Corr: 0.5049
  New best model saved with Val Avg Corr: 0.5049
Epoch [3/50], Train Loss: 0.7408, Val Loss: 0.7880, Val Avg Corr: 0.5961
  New best model saved with Val Avg Corr: 0.5961
Epoch [4/50], Train Loss: 0.6532, Val Loss: 0.7507, Val Avg Corr: 0.6362
  New best model saved with Val Avg Corr: 0.6362
Epoch [5/50], Train Loss: 0.5865, Val Loss: 0.7246, Val Avg Corr: 0.6549
  New best model saved with Val Avg Corr: 0.6549
Epoch [6/50], Train Loss: 0.5225, Val Loss: 0.7060, Val Avg Corr: 0.6705
  New best model saved with Val Avg Corr: 0.6705
Epoch [7/50], Train Loss: 0.4679, Val Loss: 0.6959, Val Avg Corr: 0.6751
  New best model saved with Val Avg Corr: 0.6751
Epoch [8/50], Train Loss: 0.4212, Val Loss: 0.6982, Val Avg Corr: 0.6783
  New best model saved with Val Avg Corr: 0.6783
Epoch [9/50], Train Loss: 0.3788, Val Loss: 0.7066, Val Avg Corr: 0.6751
Epoch [10/50], Train Loss: 0.3452, Val Loss: 0.7043, Val Avg Corr: 0.6777
Epoch [11/50], Train Loss: 0.3206, Val Loss: 0.7007, Val Avg Corr: 0.6727
Epoch [12/50], Train Loss: 0.2989, Val Loss: 0.7042, Val Avg Corr: 0.6714
Epoch [13/50], Train Loss: 0.2846, Val Loss: 0.6942, Val Avg Corr: 0.6765
Epoch [14/50], Train Loss: 0.2718, Val Loss: 0.7031, Val Avg Corr: 0.6722
Epoch [15/50], Train Loss: 0.2634, Val Loss: 0.7077, Val Avg Corr: 0.6698
Early stopping triggered after 7 epochs with no improvement.

--- Evaluating on Test Set for Session 4 ---
  Loading best model from snn_bptt_session_indy_20161212_02.pth
  Test Set Results: Loss=0.5981, CorrX=0.5595, CorrY=0.6997

--- Session 5/10 (indy_20161013_03.mat) ---
  Datasets created: Train=5472, Val=946, Test=1593
Training on device: cpu
/scratch/zt1/project/sshah389-prj/user/snallani/myenv/lib/python3.10/site-packages/torch/optim/lr_scheduler.py:28: UserWarning: The verbose parameter is deprecated. Please use get_last_lr() to access the learning rate.
  warnings.warn("The verbose parameter is deprecated. Please use get_last_lr() "
Epoch [1/50], Train Loss: 0.8705, Val Loss: 0.5547, Val Avg Corr: 0.6338
  New best model saved with Val Avg Corr: 0.6338
Epoch [2/50], Train Loss: 0.5951, Val Loss: 0.4879, Val Avg Corr: 0.6811
  New best model saved with Val Avg Corr: 0.6811
Epoch [3/50], Train Loss: 0.4728, Val Loss: 0.4165, Val Avg Corr: 0.7354
  New best model saved with Val Avg Corr: 0.7354
Epoch [4/50], Train Loss: 0.4040, Val Loss: 0.4136, Val Avg Corr: 0.7403
  New best model saved with Val Avg Corr: 0.7403
Epoch [5/50], Train Loss: 0.3577, Val Loss: 0.4117, Val Avg Corr: 0.7450
  New best model saved with Val Avg Corr: 0.7450
Epoch [6/50], Train Loss: 0.3231, Val Loss: 0.4201, Val Avg Corr: 0.7433
Epoch [7/50], Train Loss: 0.2960, Val Loss: 0.4237, Val Avg Corr: 0.7448
Epoch [8/50], Train Loss: 0.2732, Val Loss: 0.4164, Val Avg Corr: 0.7517
  New best model saved with Val Avg Corr: 0.7517
Epoch [9/50], Train Loss: 0.2493, Val Loss: 0.4145, Val Avg Corr: 0.7524
  New best model saved with Val Avg Corr: 0.7524
Epoch [10/50], Train Loss: 0.2287, Val Loss: 0.3987, Val Avg Corr: 0.7621
  New best model saved with Val Avg Corr: 0.7621
Epoch [11/50], Train Loss: 0.2156, Val Loss: 0.4151, Val Avg Corr: 0.7533
Epoch [12/50], Train Loss: 0.2067, Val Loss: 0.4086, Val Avg Corr: 0.7585
Epoch [13/50], Train Loss: 0.1982, Val Loss: 0.4115, Val Avg Corr: 0.7566
Epoch [14/50], Train Loss: 0.1901, Val Loss: 0.4144, Val Avg Corr: 0.7548
Epoch [15/50], Train Loss: 0.1822, Val Loss: 0.4209, Val Avg Corr: 0.7508
Epoch [16/50], Train Loss: 0.1774, Val Loss: 0.4192, Val Avg Corr: 0.7545
Epoch [17/50], Train Loss: 0.1725, Val Loss: 0.4169, Val Avg Corr: 0.7567
Early stopping triggered after 7 epochs with no improvement.

--- Evaluating on Test Set for Session 5 ---
  Loading best model from snn_bptt_session_indy_20161013_03.pth
  Test Set Results: Loss=0.3713, CorrX=0.6733, CorrY=0.7870

--- Session 6/10 (indy_20160927_06.mat) ---
  Datasets created: Train=4447, Val=765, Test=1292
Training on device: cpu
/scratch/zt1/project/sshah389-prj/user/snallani/myenv/lib/python3.10/site-packages/torch/optim/lr_scheduler.py:28: UserWarning: The verbose parameter is deprecated. Please use get_last_lr() to access the learning rate.
  warnings.warn("The verbose parameter is deprecated. Please use get_last_lr() "
Epoch [1/50], Train Loss: 0.8914, Val Loss: 0.8744, Val Avg Corr: 0.5174
  New best model saved with Val Avg Corr: 0.5174
Epoch [2/50], Train Loss: 0.6983, Val Loss: 0.7147, Val Avg Corr: 0.6133
  New best model saved with Val Avg Corr: 0.6133
Epoch [3/50], Train Loss: 0.5850, Val Loss: 0.6509, Val Avg Corr: 0.6673
  New best model saved with Val Avg Corr: 0.6673
Epoch [4/50], Train Loss: 0.4995, Val Loss: 0.6177, Val Avg Corr: 0.6913
  New best model saved with Val Avg Corr: 0.6913
Epoch [5/50], Train Loss: 0.4390, Val Loss: 0.6032, Val Avg Corr: 0.7007
  New best model saved with Val Avg Corr: 0.7007
Epoch [6/50], Train Loss: 0.3920, Val Loss: 0.6031, Val Avg Corr: 0.7006
Epoch [7/50], Train Loss: 0.3505, Val Loss: 0.5774, Val Avg Corr: 0.7138
  New best model saved with Val Avg Corr: 0.7138
Epoch [8/50], Train Loss: 0.3152, Val Loss: 0.5889, Val Avg Corr: 0.7124
Epoch [9/50], Train Loss: 0.2852, Val Loss: 0.5777, Val Avg Corr: 0.7195
  New best model saved with Val Avg Corr: 0.7195
Epoch [10/50], Train Loss: 0.2610, Val Loss: 0.5593, Val Avg Corr: 0.7245
  New best model saved with Val Avg Corr: 0.7245
Epoch [11/50], Train Loss: 0.2366, Val Loss: 0.5675, Val Avg Corr: 0.7197
Epoch [12/50], Train Loss: 0.2176, Val Loss: 0.5691, Val Avg Corr: 0.7179
Epoch [13/50], Train Loss: 0.2021, Val Loss: 0.6035, Val Avg Corr: 0.7090
Epoch [14/50], Train Loss: 0.1848, Val Loss: 0.6016, Val Avg Corr: 0.7127
Epoch [15/50], Train Loss: 0.1736, Val Loss: 0.5761, Val Avg Corr: 0.7174
Epoch [16/50], Train Loss: 0.1647, Val Loss: 0.5715, Val Avg Corr: 0.7190
Epoch [17/50], Train Loss: 0.1563, Val Loss: 0.5720, Val Avg Corr: 0.7202
Early stopping triggered after 7 epochs with no improvement.

--- Evaluating on Test Set for Session 6 ---
  Loading best model from snn_bptt_session_indy_20160927_06.pth
  Test Set Results: Loss=0.7196, CorrX=0.6330, CorrY=0.7338

--- Session 7/10 (indy_20160921_01.mat) ---
  Datasets created: Train=3801, Val=651, Test=1101
Training on device: cpu
/scratch/zt1/project/sshah389-prj/user/snallani/myenv/lib/python3.10/site-packages/torch/optim/lr_scheduler.py:28: UserWarning: The verbose parameter is deprecated. Please use get_last_lr() to access the learning rate.
  warnings.warn("The verbose parameter is deprecated. Please use get_last_lr() "
Epoch [1/50], Train Loss: 0.9487, Val Loss: 1.1256, Val Avg Corr: 0.4301
  New best model saved with Val Avg Corr: 0.4301
Epoch [2/50], Train Loss: 0.7359, Val Loss: 0.8410, Val Avg Corr: 0.5840
  New best model saved with Val Avg Corr: 0.5840
Epoch [3/50], Train Loss: 0.5897, Val Loss: 0.7644, Val Avg Corr: 0.6318
  New best model saved with Val Avg Corr: 0.6318
Epoch [4/50], Train Loss: 0.4903, Val Loss: 0.6942, Val Avg Corr: 0.6596
  New best model saved with Val Avg Corr: 0.6596
Epoch [5/50], Train Loss: 0.4322, Val Loss: 0.6655, Val Avg Corr: 0.6705
  New best model saved with Val Avg Corr: 0.6705
Epoch [6/50], Train Loss: 0.3841, Val Loss: 0.6538, Val Avg Corr: 0.6779
  New best model saved with Val Avg Corr: 0.6779
Epoch [7/50], Train Loss: 0.3449, Val Loss: 0.6340, Val Avg Corr: 0.6906
  New best model saved with Val Avg Corr: 0.6906
Epoch [8/50], Train Loss: 0.3140, Val Loss: 0.6092, Val Avg Corr: 0.6994
  New best model saved with Val Avg Corr: 0.6994
Epoch [9/50], Train Loss: 0.2824, Val Loss: 0.5882, Val Avg Corr: 0.7102
  New best model saved with Val Avg Corr: 0.7102
Epoch [10/50], Train Loss: 0.2576, Val Loss: 0.6087, Val Avg Corr: 0.7029
Epoch [11/50], Train Loss: 0.2366, Val Loss: 0.5848, Val Avg Corr: 0.7089
Epoch [12/50], Train Loss: 0.2190, Val Loss: 0.5806, Val Avg Corr: 0.7200
  New best model saved with Val Avg Corr: 0.7200
Epoch [13/50], Train Loss: 0.2035, Val Loss: 0.5862, Val Avg Corr: 0.7117
Epoch [14/50], Train Loss: 0.1932, Val Loss: 0.5979, Val Avg Corr: 0.7086
Epoch [15/50], Train Loss: 0.1840, Val Loss: 0.5792, Val Avg Corr: 0.7131
Epoch [16/50], Train Loss: 0.1731, Val Loss: 0.5880, Val Avg Corr: 0.7166
Epoch [17/50], Train Loss: 0.1642, Val Loss: 0.5779, Val Avg Corr: 0.7166
Epoch [18/50], Train Loss: 0.1553, Val Loss: 0.5797, Val Avg Corr: 0.7149
Epoch [19/50], Train Loss: 0.1496, Val Loss: 0.5861, Val Avg Corr: 0.7149
Early stopping triggered after 7 epochs with no improvement.

--- Evaluating on Test Set for Session 7 ---
  Loading best model from snn_bptt_session_indy_20160921_01.pth
  Test Set Results: Loss=0.5562, CorrX=0.6327, CorrY=0.7518

--- Session 8/10 (indy_20161026_03.mat) ---
  Datasets created: Train=5259, Val=909, Test=1530
Training on device: cpu
/scratch/zt1/project/sshah389-prj/user/snallani/myenv/lib/python3.10/site-packages/torch/optim/lr_scheduler.py:28: UserWarning: The verbose parameter is deprecated. Please use get_last_lr() to access the learning rate.
  warnings.warn("The verbose parameter is deprecated. Please use get_last_lr() "
Epoch [1/50], Train Loss: 0.9157, Val Loss: 0.8301, Val Avg Corr: 0.4594
  New best model saved with Val Avg Corr: 0.4594
Epoch [2/50], Train Loss: 0.6663, Val Loss: 0.6601, Val Avg Corr: 0.6188
  New best model saved with Val Avg Corr: 0.6188
Epoch [3/50], Train Loss: 0.5280, Val Loss: 0.5598, Val Avg Corr: 0.6824
  New best model saved with Val Avg Corr: 0.6824
Epoch [4/50], Train Loss: 0.4687, Val Loss: 0.5263, Val Avg Corr: 0.7039
  New best model saved with Val Avg Corr: 0.7039
Epoch [5/50], Train Loss: 0.4219, Val Loss: 0.5496, Val Avg Corr: 0.7001
Epoch [6/50], Train Loss: 0.3737, Val Loss: 0.5124, Val Avg Corr: 0.7223
  New best model saved with Val Avg Corr: 0.7223
Epoch [7/50], Train Loss: 0.3324, Val Loss: 0.5248, Val Avg Corr: 0.7230
  New best model saved with Val Avg Corr: 0.7230
Epoch [8/50], Train Loss: 0.2974, Val Loss: 0.5120, Val Avg Corr: 0.7338
  New best model saved with Val Avg Corr: 0.7338
Epoch [9/50], Train Loss: 0.2708, Val Loss: 0.5372, Val Avg Corr: 0.7239
Epoch [10/50], Train Loss: 0.2485, Val Loss: 0.4896, Val Avg Corr: 0.7424
  New best model saved with Val Avg Corr: 0.7424
Epoch [11/50], Train Loss: 0.2298, Val Loss: 0.5090, Val Avg Corr: 0.7299
Epoch [12/50], Train Loss: 0.2128, Val Loss: 0.5116, Val Avg Corr: 0.7346
Epoch [13/50], Train Loss: 0.2006, Val Loss: 0.5056, Val Avg Corr: 0.7347
Epoch [14/50], Train Loss: 0.1915, Val Loss: 0.5243, Val Avg Corr: 0.7259
Epoch [15/50], Train Loss: 0.1817, Val Loss: 0.5154, Val Avg Corr: 0.7286
Epoch [16/50], Train Loss: 0.1730, Val Loss: 0.5124, Val Avg Corr: 0.7292
Epoch [17/50], Train Loss: 0.1683, Val Loss: 0.4970, Val Avg Corr: 0.7359
Early stopping triggered after 7 epochs with no improvement.

--- Evaluating on Test Set for Session 8 ---
  Loading best model from snn_bptt_session_indy_20161026_03.pth
  Test Set Results: Loss=0.4304, CorrX=0.6704, CorrY=0.7632

--- Session 9/10 (indy_20161027_03.mat) ---
  Datasets created: Train=6125, Val=1062, Test=1785
Training on device: cpu
/scratch/zt1/project/sshah389-prj/user/snallani/myenv/lib/python3.10/site-packages/torch/optim/lr_scheduler.py:28: UserWarning: The verbose parameter is deprecated. Please use get_last_lr() to access the learning rate.
  warnings.warn("The verbose parameter is deprecated. Please use get_last_lr() "
Epoch [1/50], Train Loss: 0.9206, Val Loss: 0.5861, Val Avg Corr: 0.4388
  New best model saved with Val Avg Corr: 0.4388
Epoch [2/50], Train Loss: 0.7227, Val Loss: 0.4823, Val Avg Corr: 0.5790
  New best model saved with Val Avg Corr: 0.5790
Epoch [3/50], Train Loss: 0.5938, Val Loss: 0.4361, Val Avg Corr: 0.6274
  New best model saved with Val Avg Corr: 0.6274
Epoch [4/50], Train Loss: 0.5223, Val Loss: 0.4143, Val Avg Corr: 0.6464
  New best model saved with Val Avg Corr: 0.6464
Epoch [5/50], Train Loss: 0.4719, Val Loss: 0.4307, Val Avg Corr: 0.6483
  New best model saved with Val Avg Corr: 0.6483
Epoch [6/50], Train Loss: 0.4280, Val Loss: 0.4213, Val Avg Corr: 0.6683
  New best model saved with Val Avg Corr: 0.6683
Epoch [7/50], Train Loss: 0.3884, Val Loss: 0.4226, Val Avg Corr: 0.6648
Epoch [8/50], Train Loss: 0.3571, Val Loss: 0.4293, Val Avg Corr: 0.6708
  New best model saved with Val Avg Corr: 0.6708
Epoch [9/50], Train Loss: 0.3294, Val Loss: 0.4439, Val Avg Corr: 0.6750
  New best model saved with Val Avg Corr: 0.6750
Epoch [10/50], Train Loss: 0.3088, Val Loss: 0.4412, Val Avg Corr: 0.6793
  New best model saved with Val Avg Corr: 0.6793
Epoch [11/50], Train Loss: 0.2944, Val Loss: 0.4366, Val Avg Corr: 0.6801
  New best model saved with Val Avg Corr: 0.6801
Epoch [12/50], Train Loss: 0.2827, Val Loss: 0.4525, Val Avg Corr: 0.6794
Epoch [13/50], Train Loss: 0.2703, Val Loss: 0.4639, Val Avg Corr: 0.6788
Epoch [14/50], Train Loss: 0.2627, Val Loss: 0.4535, Val Avg Corr: 0.6784
Epoch [15/50], Train Loss: 0.2570, Val Loss: 0.4600, Val Avg Corr: 0.6742
Epoch [16/50], Train Loss: 0.2515, Val Loss: 0.4666, Val Avg Corr: 0.6732
Epoch [17/50], Train Loss: 0.2456, Val Loss: 0.4552, Val Avg Corr: 0.6779
Epoch [18/50], Train Loss: 0.2424, Val Loss: 0.4647, Val Avg Corr: 0.6735
Early stopping triggered after 7 epochs with no improvement.

--- Evaluating on Test Set for Session 9 ---
  Loading best model from snn_bptt_session_indy_20161027_03.pth
  Test Set Results: Loss=0.5335, CorrX=0.6692, CorrY=0.7046

--- Session 10/10 (indy_20160419_01.mat) ---
  Datasets created: Train=5541, Val=959, Test=1613
Training on device: cpu
/scratch/zt1/project/sshah389-prj/user/snallani/myenv/lib/python3.10/site-packages/torch/optim/lr_scheduler.py:28: UserWarning: The verbose parameter is deprecated. Please use get_last_lr() to access the learning rate.
  warnings.warn("The verbose parameter is deprecated. Please use get_last_lr() "
Epoch [1/50], Train Loss: 0.7822, Val Loss: 0.6752, Val Avg Corr: 0.5513
  New best model saved with Val Avg Corr: 0.5513
Epoch [2/50], Train Loss: 0.5698, Val Loss: 0.5938, Val Avg Corr: 0.6139
  New best model saved with Val Avg Corr: 0.6139
Epoch [3/50], Train Loss: 0.4743, Val Loss: 0.5381, Val Avg Corr: 0.6536
  New best model saved with Val Avg Corr: 0.6536
Epoch [4/50], Train Loss: 0.4224, Val Loss: 0.5368, Val Avg Corr: 0.6547
  New best model saved with Val Avg Corr: 0.6547
Epoch [5/50], Train Loss: 0.3808, Val Loss: 0.5463, Val Avg Corr: 0.6498
Epoch [6/50], Train Loss: 0.3408, Val Loss: 0.5216, Val Avg Corr: 0.6689
  New best model saved with Val Avg Corr: 0.6689
Epoch [7/50], Train Loss: 0.3060, Val Loss: 0.5004, Val Avg Corr: 0.6830
  New best model saved with Val Avg Corr: 0.6830
Epoch [8/50], Train Loss: 0.2788, Val Loss: 0.5009, Val Avg Corr: 0.6829
Epoch [9/50], Train Loss: 0.2498, Val Loss: 0.5057, Val Avg Corr: 0.6808
Epoch [10/50], Train Loss: 0.2212, Val Loss: 0.5112, Val Avg Corr: 0.6728
Epoch [11/50], Train Loss: 0.2024, Val Loss: 0.4976, Val Avg Corr: 0.6856
  New best model saved with Val Avg Corr: 0.6856
Epoch [12/50], Train Loss: 0.1858, Val Loss: 0.4940, Val Avg Corr: 0.6878
  New best model saved with Val Avg Corr: 0.6878
Epoch [13/50], Train Loss: 0.1731, Val Loss: 0.5097, Val Avg Corr: 0.6751
Epoch [14/50], Train Loss: 0.1701, Val Loss: 0.4847, Val Avg Corr: 0.6947
  New best model saved with Val Avg Corr: 0.6947
Epoch [15/50], Train Loss: 0.1584, Val Loss: 0.4907, Val Avg Corr: 0.6893
Epoch [16/50], Train Loss: 0.1490, Val Loss: 0.5035, Val Avg Corr: 0.6812
Epoch [17/50], Train Loss: 0.1405, Val Loss: 0.5015, Val Avg Corr: 0.6845
Epoch [18/50], Train Loss: 0.1375, Val Loss: 0.5117, Val Avg Corr: 0.6748
Epoch [19/50], Train Loss: 0.1291, Val Loss: 0.4980, Val Avg Corr: 0.6844
Epoch [20/50], Train Loss: 0.1208, Val Loss: 0.5122, Val Avg Corr: 0.6742
Epoch [21/50], Train Loss: 0.1166, Val Loss: 0.4943, Val Avg Corr: 0.6854
Early stopping triggered after 7 epochs with no improvement.

--- Evaluating on Test Set for Session 10 ---
  Loading best model from snn_bptt_session_indy_20160419_01.pth
  Test Set Results: Loss=0.4600, CorrX=0.6913, CorrY=0.6354


===== FINAL SNN BPTT RESULTS (WITHIN-SESSION) =====
Full results saved to results_snn_bptt_within_session.csv

--- Results per Session ---
                session  test_loss  test_corr_x  test_corr_y
0  indy_20160411_02.mat   0.360673     0.774077     0.787519
1  indy_20161017_02.mat   0.521749     0.619250     0.763156
2  indy_20160630_01.mat   0.515216     0.402692     0.619457
3  indy_20161212_02.mat   0.598090     0.559531     0.699719
4  indy_20161013_03.mat   0.371341     0.673314     0.787003
5  indy_20160927_06.mat   0.719561     0.633008     0.733751
6  indy_20160921_01.mat   0.556183     0.632742     0.751782
7  indy_20161026_03.mat   0.430408     0.670352     0.763180
8  indy_20161027_03.mat   0.533514     0.669159     0.704626
9  indy_20160419_01.mat   0.460014     0.691254     0.635428

--- Average Performance ---
  Average Test Loss:        0.5067 +/- 0.1079
  Average Test Correlation X: 0.6325 +/- 0.0979
  Average Test Correlation Y: 0.7246 +/- 0.0593
======================================================
