pscotti commited on
Commit
041f6e6
Β·
verified Β·
1 Parent(s): 5f2d6ef

Upload main.ipynb with huggingface_hub

Browse files
Files changed (1) hide show
  1. main.ipynb +20 -16
main.ipynb CHANGED
@@ -81,7 +81,7 @@
81
  },
82
  {
83
  "cell_type": "code",
84
- "execution_count": 2,
85
  "id": "489193ba-061f-4815-88bc-d247e47e868c",
86
  "metadata": {},
87
  "outputs": [
@@ -600,7 +600,7 @@
600
  },
601
  {
602
  "cell_type": "code",
603
- "execution_count": 10,
604
  "id": "598a041f-8410-445f-8b7f-5fcc4fce0712",
605
  "metadata": {},
606
  "outputs": [
@@ -611,7 +611,7 @@
611
  "Loading concatenated nsdgeneral voxels from all betas_sessions for NSD subj01\n",
612
  "nsd_vox (30000, 15724)\n",
613
  "voxels have been zscored\n",
614
- "2.6526928801710407e-17 0.9999999980682533\n"
615
  ]
616
  }
617
  ],
@@ -623,7 +623,11 @@
623
  " nsd_vox = file['subj01'][:] # (30000, 15724)\n",
624
  " print(\"nsd_vox\", nsd_vox.shape)\n",
625
  "\n",
626
- " nsd_vox = zscore(nsd_vox)\n",
 
 
 
 
627
  " print(\"voxels have been zscored\")\n",
628
  " print(nsd_vox[:,0].mean(), nsd_vox[:,0].std())\n",
629
  "except:\n",
@@ -652,7 +656,7 @@
652
  },
653
  {
654
  "cell_type": "code",
655
- "execution_count": 11,
656
  "id": "954c9282-1627-4b79-9bc5-607cfb771157",
657
  "metadata": {},
658
  "outputs": [
@@ -709,7 +713,7 @@
709
  },
710
  {
711
  "cell_type": "code",
712
- "execution_count": 12,
713
  "id": "5fa54e09-0830-471e-8364-e9a2af5a4047",
714
  "metadata": {},
715
  "outputs": [
@@ -764,7 +768,7 @@
764
  },
765
  {
766
  "cell_type": "code",
767
- "execution_count": 13,
768
  "id": "4c21a67b-f6df-4db2-b691-9c0935e8210d",
769
  "metadata": {},
770
  "outputs": [
@@ -772,7 +776,7 @@
772
  "name": "stderr",
773
  "output_type": "stream",
774
  "text": [
775
- "100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 15724/15724 [00:00<00:00, 20573.28it/s]"
776
  ]
777
  },
778
  {
@@ -800,7 +804,7 @@
800
  },
801
  {
802
  "cell_type": "code",
803
- "execution_count": 14,
804
  "id": "351ea533-f62a-4ee6-ae73-7cb430c27d94",
805
  "metadata": {},
806
  "outputs": [
@@ -810,7 +814,7 @@
810
  "(150, 2, 15724)"
811
  ]
812
  },
813
- "execution_count": 14,
814
  "metadata": {},
815
  "output_type": "execute_result"
816
  }
@@ -829,7 +833,7 @@
829
  },
830
  {
831
  "cell_type": "code",
832
- "execution_count": 15,
833
  "id": "0fcd3c21-8d45-4384-8709-c28ccd0869b9",
834
  "metadata": {},
835
  "outputs": [
@@ -844,7 +848,7 @@
844
  "name": "stderr",
845
  "output_type": "stream",
846
  "text": [
847
- "100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 150/150 [00:05<00:00, 28.85it/s]\n"
848
  ]
849
  },
850
  {
@@ -858,7 +862,7 @@
858
  "name": "stderr",
859
  "output_type": "stream",
860
  "text": [
861
- "100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 150/150 [00:04<00:00, 34.49it/s]\n"
862
  ]
863
  },
864
  {
@@ -872,7 +876,7 @@
872
  "name": "stderr",
873
  "output_type": "stream",
874
  "text": [
875
- "100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 150/150 [00:03<00:00, 45.08it/s]\n"
876
  ]
877
  },
878
  {
@@ -886,7 +890,7 @@
886
  "name": "stderr",
887
  "output_type": "stream",
888
  "text": [
889
- "100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 150/150 [00:02<00:00, 54.06it/s]\n"
890
  ]
891
  }
892
  ],
@@ -915,7 +919,7 @@
915
  },
916
  {
917
  "cell_type": "code",
918
- "execution_count": 16,
919
  "id": "5dbbb1e1-7ed9-43a9-b482-b1005bbaf6c7",
920
  "metadata": {},
921
  "outputs": [
 
81
  },
82
  {
83
  "cell_type": "code",
84
+ "execution_count": 52,
85
  "id": "489193ba-061f-4815-88bc-d247e47e868c",
86
  "metadata": {},
87
  "outputs": [
 
600
  },
601
  {
602
  "cell_type": "code",
603
+ "execution_count": 50,
604
  "id": "598a041f-8410-445f-8b7f-5fcc4fce0712",
605
  "metadata": {},
606
  "outputs": [
 
611
  "Loading concatenated nsdgeneral voxels from all betas_sessions for NSD subj01\n",
612
  "nsd_vox (30000, 15724)\n",
613
  "voxels have been zscored\n",
614
+ "-9.177843670234628e-19 0.9999999979254887\n"
615
  ]
616
  }
617
  ],
 
623
  " nsd_vox = file['subj01'][:] # (30000, 15724)\n",
624
  " print(\"nsd_vox\", nsd_vox.shape)\n",
625
  "\n",
626
+ " # session-wise zscoring\n",
627
+ " for start_idx in range(0,len(nsd_vox),750):\n",
628
+ " end_idx = min(start_idx + 750, len(nsd_vox))\n",
629
+ " nsd_vox[start_idx:end_idx] = zscore(nsd_vox[start_idx:end_idx])\n",
630
+ "\n",
631
  " print(\"voxels have been zscored\")\n",
632
  " print(nsd_vox[:,0].mean(), nsd_vox[:,0].std())\n",
633
  "except:\n",
 
656
  },
657
  {
658
  "cell_type": "code",
659
+ "execution_count": 54,
660
  "id": "954c9282-1627-4b79-9bc5-607cfb771157",
661
  "metadata": {},
662
  "outputs": [
 
713
  },
714
  {
715
  "cell_type": "code",
716
+ "execution_count": 55,
717
  "id": "5fa54e09-0830-471e-8364-e9a2af5a4047",
718
  "metadata": {},
719
  "outputs": [
 
768
  },
769
  {
770
  "cell_type": "code",
771
+ "execution_count": 56,
772
  "id": "4c21a67b-f6df-4db2-b691-9c0935e8210d",
773
  "metadata": {},
774
  "outputs": [
 
776
  "name": "stderr",
777
  "output_type": "stream",
778
  "text": [
779
+ "100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 15724/15724 [00:00<00:00, 22100.95it/s]"
780
  ]
781
  },
782
  {
 
804
  },
805
  {
806
  "cell_type": "code",
807
+ "execution_count": 57,
808
  "id": "351ea533-f62a-4ee6-ae73-7cb430c27d94",
809
  "metadata": {},
810
  "outputs": [
 
814
  "(150, 2, 15724)"
815
  ]
816
  },
817
+ "execution_count": 57,
818
  "metadata": {},
819
  "output_type": "execute_result"
820
  }
 
833
  },
834
  {
835
  "cell_type": "code",
836
+ "execution_count": 58,
837
  "id": "0fcd3c21-8d45-4384-8709-c28ccd0869b9",
838
  "metadata": {},
839
  "outputs": [
 
848
  "name": "stderr",
849
  "output_type": "stream",
850
  "text": [
851
+ "100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 150/150 [00:05<00:00, 29.30it/s]\n"
852
  ]
853
  },
854
  {
 
862
  "name": "stderr",
863
  "output_type": "stream",
864
  "text": [
865
+ "100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 150/150 [00:04<00:00, 34.58it/s]\n"
866
  ]
867
  },
868
  {
 
876
  "name": "stderr",
877
  "output_type": "stream",
878
  "text": [
879
+ "100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 150/150 [00:03<00:00, 44.06it/s]\n"
880
  ]
881
  },
882
  {
 
890
  "name": "stderr",
891
  "output_type": "stream",
892
  "text": [
893
+ "100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 150/150 [00:02<00:00, 51.37it/s]\n"
894
  ]
895
  }
896
  ],
 
919
  },
920
  {
921
  "cell_type": "code",
922
+ "execution_count": 59,
923
  "id": "5dbbb1e1-7ed9-43a9-b482-b1005bbaf6c7",
924
  "metadata": {},
925
  "outputs": [