diff --git a/spurious_reconstruction/analysis/1_case_study/feature-decoding/.ipynb_checkpoints/README-checkpoint.md b/spurious_reconstruction/analysis/1_case_study/feature-decoding/.ipynb_checkpoints/README-checkpoint.md new file mode 100644 index 0000000000000000000000000000000000000000..df8a03b4c08190c855c596d9e8471f4afa248152 --- /dev/null +++ b/spurious_reconstruction/analysis/1_case_study/feature-decoding/.ipynb_checkpoints/README-checkpoint.md @@ -0,0 +1,75 @@ + +# Feature decoding (feature translation) analysis + +This directory contains scripts for feature decoding (feature translation). The decoded (translated) features can be used for image reconstruction (Figure 2 in the main text) and for performance evaluation (Figures 5 and 6 in the main text). + +Since completing this task can take a significant amount of time (1 to 6 days), we recommend using the download script to obtain the pre-decoded (translated) features. + +`bdpy torchvision fastl2lir hydra-core` + +## Feature decoding analysis (Related to Figure 2 or Figure 5) + +To perform feature decoding analysis on VGG19 features of the Deeprecon dataset, follow these steps: + +#### 1. Decoder Training +Run the following command to train the decoder: +``` +run python ./analysis/1_case_study/feature-decoding/featdec_fastl2lir_train.py ./analysis/1_case_study/config/deeprecon_fmriprep_rep5_500voxel_caffe_VGG19_allunits_fastl2lir_alpha100.yaml +``` +#### 2. Decoder Testing +After training, test the decoder using this command: +``` +python ./analysis/1_case_study/feature-decoding/featdec_fastl2lir_predict.py ./analysis/1_case_study/config/deeprecon_fmriprep_rep5_500voxel_caffe_VGG19_allunits_fastl2lir_alpha100.yaml +``` +Alternatively, you can skip this time-consuming process and directly get decoded features by running download script: +``` +python download.py "image reconstruction analysis" +``` + +#### 3. Evaluation (Figure 5) +To reproduce the zero-shot identification analysis in Figure 5, you may need to download files, especially you download the decoded features. +``` +python download.py "hold-out analysis" +``` +Then, the zero-shot identification can be performed by: +``` +python ./analysis/1_case_study/feature-decoding/featdec_eval_zero-shot_indentification.py +``` +Since this analysis also takes much time and needs heavy resources, you can download the results: +``` +python download.py "zero-shot identification results" +``` +The figure can be reproduced by +``` +python ./analysis/1_case_study/feature-decoding/Figure_zero_shot_sample_identification.py +``` + +## Hold out analysis (Figure 6) + +#### 1. Decoder training +```rye run python ./analysis/1_case_study/feature-decoding/featdec_cv_fastl2lir_train.py ./analysis/1_case_study/config/umap_space_holdout_split_cv_nsd-betasfithrfGLMdenoiseRR_testshared1000_trainnoave_testave_fastl2lir_alpha_100000_versatile_diffusion.yaml``` +#### 2. Decoder test +```rye run python ./analysis/1_case_study/feature-decoding/featdec_cv_fastl2lir_predict.py ./analysis/1_case_study/config/umap_space_holdout_split_cv_nsd-betasfithrfGLMdenoiseRR_testshared1000_trainnoave_testave_fastl2lir_alpha_100000_versatile_diffusion.yaml``` + +Since this analysis takes time, you can download the decoding results by: +``` +python download.py "hold-out analysis" +``` +#### 3. Evaluation (Related to Figure 6) +Evaluate the performance for cluster identification using: +``` +python ./analysis/1_case_study/feature-decoding/featdec_cv_eval_cluster_identification.py ./analysis/1_case_study/config/umap_space_holdout_split_cv_nsd-betasfithrfGLMdenoiseRR_testshared1000_trainnoave_testave_fastl2lir_alpha_100000_versatile_diffusion.yaml +``` +For pairwise identification, run: +``` +python ./analysis/1_case_study/feature-decoding/featdec_cv_eval_pairwise_identification.py ./analysis/1_case_study/config/umap_space_holdout_split_cv_nsd-betasfithrfGLMdenoiseRR_testshared1000_trainnoave_testave_fastl2lir_alpha_100000_versatile_diffusion.yaml +``` +The figures can be get by: +``` +python ./analysis/1_case_study/feature-decoding/Figure_hold_out_analysis_pairwise_identification.py +python ./analysis/1_case_study/feature-decoding/Figure_hold_out_analysis_cluster_identification.py +``` +--- + +Ensure that the required data files are prepared and the environment is properly set up before executing these commands. + diff --git a/spurious_reconstruction/analysis/1_case_study/feature-decoding/.ipynb_checkpoints/RR_pytorch-Copy1-checkpoint.ipynb b/spurious_reconstruction/analysis/1_case_study/feature-decoding/.ipynb_checkpoints/RR_pytorch-Copy1-checkpoint.ipynb new file mode 100644 index 0000000000000000000000000000000000000000..af35eba40e6be8e9311996a48a8853afff752e2c --- /dev/null +++ b/spurious_reconstruction/analysis/1_case_study/feature-decoding/.ipynb_checkpoints/RR_pytorch-Copy1-checkpoint.ipynb @@ -0,0 +1,2073 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "id": "1ee75391-89d0-4450-b75b-9e6eaa3239ea", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "PID of this process = 3545099\n" + ] + } + ], + "source": [ + "# Import packages and setup gpu configuration.\n", + "# This code block shouldnt need to be adjusted!\n", + "import os\n", + "import sys\n", + "import json\n", + "import yaml\n", + "import numpy as np\n", + "import copy\n", + "import math\n", + "import time\n", + "import random\n", + "from tqdm.auto import tqdm\n", + "import matplotlib.pyplot as plt\n", + "\n", + "import torch\n", + "import torch.nn as nn\n", + "from torchvision import transforms\n", + "import h5py\n", + "import utils\n", + "\n", + "# tf32 data type is faster than standard float32\n", + "torch.backends.cuda.matmul.allow_tf32 = True\n", + "# following fixes a Conv3D CUDNN_NOT_SUPPORTED error\n", + "torch.backends.cudnn.benchmark = True\n", + "\n", + "\n", + "# outdir = os.path.abspath(f'checkpoints/{model_name}')\n", + "outdir = os.path.abspath(f'./decoding')\n", + "os.makedirs(outdir, exist_ok=True)\n", + "\n", + "current_features = 'features[2]'\n", + "\n", + "\n", + "\n", + "if utils.is_interactive():\n", + " # Following allows you to change functions in models.py or utils.py and \n", + " # have this notebook automatically update with your revisions\n", + " %load_ext autoreload\n", + " %autoreload 2\n", + "\n", + "batch_size = 128\n", + "num_epochs = 10\n", + "\n", + "data_type = torch.float32\n", + "\n", + "device = torch.device('cuda')\n", + "\n", + "save_ckpt = False\n", + "wandb_log = False\n", + "\n", + "\n", + "print(\"PID of this process =\",os.getpid())\n", + "seed = 42\n", + "utils.seed_everything(seed)" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "f731731e-cb9b-47a9-8368-ab4ff5258029", + "metadata": {}, + "outputs": [], + "source": [ + "# config paths\n", + "precomputed_path = '/weka/proj-fmri/ckadirt/spurious_reconstruction/analysis/0_preprocessing/features/pytorch/VGG19_ILSVRC_19_layers/'\n", + "precomputed_features_path = os.path.join(precomputed_path, current_features, '1.h5')\n", + "\n", + "# this is the number of ridge regression splits to perform bcz of memory constraints\n", + "num_split = 64\n", + "\n", + "# load precomputed features\n", + "f_features = h5py.File(precomputed_features_path, 'r')\n", + "features = f_features['dataset']" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "id": "88c31f89-5c95-4777-83d6-bff817a026b8", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "/weka/proj-medarc/shared/mindeyev2_dataset//wds/subj01/train/{0..39}.tar\n", + "/weka/proj-medarc/shared/mindeyev2_dataset//wds/subj01/new_test/0.tar\n", + "Loaded test dl for subj1!\n", + "\n" + ] + }, + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "80ac2638d1a540bd8bcce8652bb340c2", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "0it [00:00, ?it/s]" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "9049de07b004481fb4473d96bd3e793f", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "0it [00:00, ?it/s]" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "import webdataset as wds\n", + "import random\n", + "from tqdm.auto import tqdm\n", + "\n", + "def my_split_by_node(urls): return urls\n", + "data_path = '/weka/proj-medarc/shared/mindeyev2_dataset/'\n", + "subj_list = [1]\n", + "num_sessions = 40\n", + "multi_subject = False\n", + "subj = 1\n", + "\n", + "train_data = {}\n", + "train_dl = {}\n", + "num_voxels = {}\n", + "voxels = {}\n", + "\n", + "train_url = f\"{data_path}/wds/subj0{subj}/train/\" + \"{0..\" + f\"{num_sessions-1}\" + \"}.tar\"\n", + "print(train_url)\n", + "\n", + "train_data = wds.WebDataset(train_url,resampled=False,nodesplitter=my_split_by_node)\\\n", + " .decode(\"torch\")\\\n", + " .rename(behav=\"behav.npy\", past_behav=\"past_behav.npy\", future_behav=\"future_behav.npy\", olds_behav=\"olds_behav.npy\")\\\n", + " .to_tuple(*[\"behav\", \"past_behav\", \"future_behav\", \"olds_behav\"])\n", + "train_dl = torch.utils.data.DataLoader(train_data, batch_size=1, shuffle=False, drop_last=False, pin_memory=True)\n", + "\n", + "# f = h5py.File(f'{data_path}/betas_all_subj0{s}_fp32_renorm.hdf5', 'r')\n", + "# betas = f['betas'][:]\n", + "# betas = torch.Tensor(betas).to(\"cpu\").to(data_type)\n", + "# num_voxels_list.append(betas[0].shape[-1])\n", + "# num_voxels[f'subj0{s}'] = betas[0].shape[-1]\n", + "# voxels[f'subj0{s}'] = betas\n", + "# print(f\"num_voxels for subj0{s}: {num_voxels[f'subj0{s}']}\")\n", + "\n", + "\n", + "num_test=3000\n", + "test_url = f\"{data_path}/wds/subj0{subj}/new_test/\" + \"0.tar\"\n", + "print(test_url)\n", + "test_data = wds.WebDataset(test_url,resampled=False,nodesplitter=my_split_by_node)\\\n", + " .decode(\"torch\")\\\n", + " .rename(behav=\"behav.npy\", past_behav=\"past_behav.npy\", future_behav=\"future_behav.npy\", olds_behav=\"olds_behav.npy\")\\\n", + " .to_tuple(*[\"behav\", \"past_behav\", \"future_behav\", \"olds_behav\"])\n", + "test_dl = torch.utils.data.DataLoader(test_data, batch_size=1, shuffle=False, drop_last=True, pin_memory=True)\n", + "print(f\"Loaded test dl for subj{subj}!\\n\")\n", + "\n", + "all_indexes_train = []\n", + "all_betas_train = []\n", + "\n", + "for behav0, past_behav0, future_behav0, old_behav0 in tqdm(train_dl):\n", + " img_idx = behav0[:,0,0].cpu().long().numpy()[0]\n", + " betas_idx = behav0[:,0,5].cpu().long().numpy()[0]\n", + " all_indexes_train.append(img_idx)\n", + " all_betas_train.append(betas_idx)\n", + "\n", + "all_indexes_test = []\n", + "all_betas_test = []\n", + "\n", + "for behav0, past_behav0, future_behav0, old_behav0 in tqdm(test_dl):\n", + " img_idx = behav0[:,0,0].cpu().long().numpy()[0]\n", + " betas_idx = behav0[:,0,5].cpu().long().numpy()[0]\n", + " all_indexes_test.append(img_idx)\n", + " all_betas_test.append(betas_idx)\n" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "id": "61019c94-f8bd-468c-bbe1-5b9fa4a2b74e", + "metadata": {}, + "outputs": [], + "source": [ + "all_indexes_to_compute = set(all_indexes_train + list(set(all_indexes_test)))\n", + "all_indexes_to_compute = list(all_indexes_to_compute)" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "e3f62964-020c-4a3c-91fc-515cd0ab3fa8", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "loading_betas\n", + "betas_ loaded\n" + ] + } + ], + "source": [ + "f_betas = h5py.File(f'{data_path}/betas_all_subj0{subj}_fp32_renorm.hdf5', 'r')\n", + "print(\"loading_betas\")\n", + "betas = f_betas['betas'][:]\n", + "betas = torch.from_numpy(betas).to(\"cpu\")\n", + "print(\"betas_ loaded\")\n", + "x_train, valid_nsd_ids_train, x_test, test_nsd_ids = utils.load_nsd(subject=subj, betas=betas, data_path=data_path)" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "id": "48195a15-65f0-40f9-a19e-0fce47ae879c", + "metadata": {}, + "outputs": [], + "source": [ + "from torch.utils.data import Dataset, DataLoader\n", + "\n", + "class RRDataset(Dataset):\n", + " def __init__(self, x, valid_nsd_ids, current_features):\n", + " self.x = x\n", + " self.valid_nsd_ids = valid_nsd_ids\n", + " self.current_features = current_features\n", + "\n", + " def __len__(self):\n", + " return len(self.x)\n", + "\n", + " def __getitem__(self, idx):\n", + " if len(self.x) > 20000:\n", + " saved_index = random.randint(0,len(all_indexes_to_compute)-1)\n", + " else:\n", + " saved_index = all_indexes_to_compute.index(self.valid_nsd_ids[idx]) + 1\n", + " return self.x[idx], torch.Tensor(self.current_features[saved_index])\n", + " \n", + " \n", + "\n", + "# print(\"Moving datasets to ram\")\n", + "# # Loading to cpu for faster training, this can take several minutes. Remove this [:] if you want to move one at the time.\n", + "# train_dataset = RRDataset(x_train[:], valid_nsd_ids_train[:], features[:,0:4,:, :])\n", + "\n", + "# for data in train_dataset:\n", + "# break" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "id": "79697872-3f59-4e32-803c-323d16154583", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425])\n", + "torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425])\n" + ] + } + ], + "source": [ + "imagery_data_path = '/weka/proj-medarc/shared/umn-imagery'\n", + "# load nsd_imagery_data\n", + "voxels_vision, all_images_vision = utils.load_nsd_mental_imagery(subject=subj, mode='vision', stimtype=\"all\", average=False, nest=True, data_root=imagery_data_path)\n", + "voxels_imagery, all_images_imagery = utils.load_nsd_mental_imagery(subject=subj, mode='imagery', stimtype=\"all\", average=False, nest=True, data_root=imagery_data_path)" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "id": "4303321b-775a-42ae-aa86-4cb8fd316677", + "metadata": {}, + "outputs": [], + "source": [ + "class RidgeRegression(nn.Module):\n", + " def __init__(self, input_dim, output_dim_shape):\n", + " super(RidgeRegression, self).__init__()\n", + " self.input_dim = input_dim\n", + " self.output_dim_shape = output_dim_shape\n", + " self.output_dim = np.prod(output_dim_shape)\n", + " self.linear = nn.Linear(input_dim, self.output_dim)\n", + " \n", + " def forward(self, x):\n", + " # Flatten the input except for the batch dimension\n", + " x = x.view(x.size(0), -1)\n", + " out = self.linear(x)\n", + " out = out.view(-1, *self.output_dim_shape)\n", + " return out # Raw logits\n", + " \n", + " " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "872c3f2a-aacd-4ac2-bd9f-a21bdb8c0d36", + "metadata": {}, + "outputs": [ + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "731a679a07354e7ca3356cccc5356661", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + " 0%| | 0/64 [00:00\n", + "\n", + "\n", + "Traceback (most recent call last):\n", + "Traceback (most recent call last):\n", + "Traceback (most recent call last):\n", + " File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1478, in __del__\n", + "Exception ignored in: \n", + "Traceback (most recent call last):\n", + " File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1478, in __del__\n", + " self._shutdown_workers()\n", + " File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1424, in _shutdown_workers\n", + " self._pin_memory_thread.join()\n", + " File \"/usr/lib/python3.11/threading.py\", line 1116, in join\n", + " raise RuntimeError(\"cannot join current thread\")\n", + "RuntimeError: cannot join current thread\n", + " File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1478, in __del__\n", + " File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1478, in __del__\n", + " self._shutdown_workers()self._shutdown_workers()self._shutdown_workers()\n", + "\n", + "\n", + " File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1461, in _shutdown_workers\n", + " File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1461, in _shutdown_workers\n", + " File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1461, in _shutdown_workers\n", + " if w.is_alive():if w.is_alive():if w.is_alive():\n", + "\n", + "\n", + " ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "^\n", + "\n", + " File \"/usr/lib/python3.11/multiprocessing/process.py\", line 160, in is_alive\n", + " File \"/usr/lib/python3.11/multiprocessing/process.py\", line 160, in is_alive\n", + " File \"/usr/lib/python3.11/multiprocessing/process.py\", line 160, in is_alive\n", + " assert self._parent_pid == os.getpid(), 'can only test a child process'assert self._parent_pid == os.getpid(), 'can only test a child process'assert self._parent_pid == os.getpid(), 'can only test a child process'\n", + "\n", + "\n", + " ^ ^^^Exception ignored in: Exception ignored in: ^^^^^^\n", + "^\n", + "^^^Traceback (most recent call last):\n", + "Traceback (most recent call last):\n", + "^^^ File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1478, in __del__\n", + " File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1478, in __del__\n", + "^^^^^^^^ ^ ^^self._shutdown_workers()^self._shutdown_workers()^^\n", + "^^\n", + "^ File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1461, in _shutdown_workers\n", + "^ File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1461, in _shutdown_workers\n", + "^^^^^ ^ ^^if w.is_alive():^if w.is_alive():^^\n", + "\n", + "^^^ ^ ^^ ^^^ ^^ ^^^ ^^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "^^\n", + "^AssertionError^^AssertionError\n", + ": ^^: can only test a child processAssertionError^^can only test a child process\n", + ": \n", + "\n", + "\n", + " File \"/usr/lib/python3.11/multiprocessing/process.py\", line 160, in is_alive\n", + "can only test a child process File \"/usr/lib/python3.11/multiprocessing/process.py\", line 160, in is_alive\n", + "\n", + " assert self._parent_pid == os.getpid(), 'can only test a child process'\n", + "assert self._parent_pid == os.getpid(), 'can only test a child process'Exception ignored in: Exception ignored in: \n", + " \n", + "Exception ignored in: \n", + " Traceback (most recent call last):\n", + "Traceback (most recent call last):\n", + " File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1478, in __del__\n", + "\n", + " File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1478, in __del__\n", + " Traceback (most recent call last):\n", + " File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1478, in __del__\n", + " self._shutdown_workers() self._shutdown_workers() \n", + " \n", + " File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1461, in _shutdown_workers\n", + "self._shutdown_workers() File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1461, in _shutdown_workers\n", + "\n", + " ^ File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1461, in _shutdown_workers\n", + " if w.is_alive(): ^^\n", + " if w.is_alive():^^ if w.is_alive():\n", + "^^ \n", + "^ ^ ^^ ^^ ^^ ^ ^ ^^^ ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "^^\n", + "^ File \"/usr/lib/python3.11/multiprocessing/process.py\", line 160, in is_alive\n", + "^^^ File \"/usr/lib/python3.11/multiprocessing/process.py\", line 160, in is_alive\n", + " ^^\n", + " assert self._parent_pid == os.getpid(), 'can only test a child process'^^ File \"/usr/lib/python3.11/multiprocessing/process.py\", line 160, in is_alive\n", + "assert self._parent_pid == os.getpid(), 'can only test a child process'\n", + "^^ \n", + "^^ assert self._parent_pid == os.getpid(), 'can only test a child process'^^ \n", + "^^ ^ ^ \n", + " ^ AssertionError \n", + " : AssertionError can only test a child process : \n", + " can only test a child process \n", + " Exception ignored in: ^^ Exception ignored in: ^^ \n", + "^^^\n", + "Traceback (most recent call last):\n", + "^^^Traceback (most recent call last):\n", + " File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1478, in __del__\n", + "^^^ File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1478, in __del__\n", + "^^^ ^^ ^self._shutdown_workers()^^self._shutdown_workers()^\n", + "^^\n", + "^ File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1461, in _shutdown_workers\n", + "^^ File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1461, in _shutdown_workers\n", + "^^^ ^^^^ if w.is_alive():^^\n", + "if w.is_alive():^^^\n", + " ^^^ ^ ^^ ^ ^^ ^ ^^ ^ ^^ ^ ^^ ^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "^\n", + "^^AssertionError^AssertionError\n", + "\n", + ": \n", + ": File \"/usr/lib/python3.11/multiprocessing/process.py\", line 160, in is_alive\n", + "AssertionErrorcan only test a child process File \"/usr/lib/python3.11/multiprocessing/process.py\", line 160, in is_alive\n", + "can only test a child process: \n", + " \n", + "can only test a child processassert self._parent_pid == os.getpid(), 'can only test a child process'assert self._parent_pid == os.getpid(), 'can only test a child process'\n", + "\n", + "\n", + " Exception ignored in: Exception ignored in: \n", + " \n", + "Exception ignored in: Traceback (most recent call last):\n", + " File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1478, in __del__\n", + "Traceback (most recent call last):\n", + " File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1478, in __del__\n", + "\n", + " Traceback (most recent call last):\n", + " self._shutdown_workers() File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1478, in __del__\n", + " \n", + "self._shutdown_workers() \n", + " File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1461, in _shutdown_workers\n", + " self._shutdown_workers() File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1461, in _shutdown_workers\n", + "^\n", + "^ ^ File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1461, in _shutdown_workers\n", + "^ if w.is_alive():^^if w.is_alive(): \n", + "^^\n", + "if w.is_alive(): ^^ \n", + " ^^ ^^ ^^ ^ ^ ^^ ^^ ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "\n", + "^^ File \"/usr/lib/python3.11/multiprocessing/process.py\", line 160, in is_alive\n", + "\n", + " File \"/usr/lib/python3.11/multiprocessing/process.py\", line 160, in is_alive\n", + "^^ File \"/usr/lib/python3.11/multiprocessing/process.py\", line 160, in is_alive\n", + " ^^assert self._parent_pid == os.getpid(), 'can only test a child process'assert self._parent_pid == os.getpid(), 'can only test a child process'^ ^\n", + "\n", + "^assert self._parent_pid == os.getpid(), 'can only test a child process'^ ^\n", + "^ ^\n", + " \n", + " AssertionError : AssertionError : can only test a child process \n", + "can only test a child process \n", + " Exception ignored in: Exception ignored in: ^\n", + " ^\n", + "^Traceback (most recent call last):\n", + "^^^Traceback (most recent call last):\n", + " File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1478, in __del__\n", + "^^^ File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1478, in __del__\n", + "^^^^^ ^ ^^self._shutdown_workers()self._shutdown_workers()^^^\n", + "\n", + "^^^ File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1461, in _shutdown_workers\n", + " File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1461, in _shutdown_workers\n", + "^^^^^^ ^^ ^if w.is_alive():^^if w.is_alive():^\n", + "^^^\n", + " ^^^ ^^^ ^^ ^^^ ^ ^^ ^ ^^ ^ ^^ ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "^\n", + "^^^AssertionErrorAssertionError\n", + "\n", + "\n", + ": : File \"/usr/lib/python3.11/multiprocessing/process.py\", line 160, in is_alive\n", + "AssertionError File \"/usr/lib/python3.11/multiprocessing/process.py\", line 160, in is_alive\n", + "can only test a child processcan only test a child process: \n", + " \n", + "assert self._parent_pid == os.getpid(), 'can only test a child process'can only test a child processassert self._parent_pid == os.getpid(), 'can only test a child process'\n", + "\n", + "\n", + " Exception ignored in: Exception ignored in: Exception ignored in: \n", + " \n", + "Traceback (most recent call last):\n", + " \n", + " Traceback (most recent call last):\n", + " Traceback (most recent call last):\n", + " File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1478, in __del__\n", + " File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1478, in __del__\n", + " File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1478, in __del__\n", + " self._shutdown_workers() self._shutdown_workers()self._shutdown_workers()\n", + " \n", + " File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1461, in _shutdown_workers\n", + "\n", + " File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1461, in _shutdown_workers\n", + " File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1461, in _shutdown_workers\n", + " ^^if w.is_alive():if w.is_alive(): ^^\n", + "\n", + "if w.is_alive():^^ \n", + "^ ^ ^^ ^^ ^ ^ ^^ ^ ^ ^^ ^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "^^^^ File \"/usr/lib/python3.11/multiprocessing/process.py\", line 160, in is_alive\n", + "\n", + "^^^ File \"/usr/lib/python3.11/multiprocessing/process.py\", line 160, in is_alive\n", + "^\n", + "^assert self._parent_pid == os.getpid(), 'can only test a child process' File \"/usr/lib/python3.11/multiprocessing/process.py\", line 160, in is_alive\n", + "^^\n", + "assert self._parent_pid == os.getpid(), 'can only test a child process'^ ^ \n", + "^assert self._parent_pid == os.getpid(), 'can only test a child process' ^ ^\n", + " ^ ^ ^ ^ ^^ \n", + " ^ AssertionError \n", + " : AssertionError can only test a child process: \n", + "can only test a child process \n", + "^ ^^ ^Exception ignored in: ^^^^Exception ignored in: ^^^\n", + "^^^\n", + "Traceback (most recent call last):\n", + "^^^ File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1478, in __del__\n", + "Traceback (most recent call last):\n", + "^^^ File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1478, in __del__\n", + "^^^^ ^^ ^^self._shutdown_workers()^^self._shutdown_workers()^\n", + "^^\n", + "^ File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1461, in _shutdown_workers\n", + "^^ File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1461, in _shutdown_workers\n", + "^^^^ ^^ ^^if w.is_alive():^if w.is_alive():^^\n", + "^^\n", + "^ ^^ ^ ^^ ^ ^^ ^ ^^ ^ ^^ ^ ^^ ^ ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "^^^AssertionError^^^^: ^\n", + "\n", + "^can only test a child process^AssertionErrorAssertionError^^\n", + ": ^: ^can only test a child processcan only test a child process\n", + "\n", + "\n", + "\n", + " File \"/usr/lib/python3.11/multiprocessing/process.py\", line 160, in is_alive\n", + " File \"/usr/lib/python3.11/multiprocessing/process.py\", line 160, in is_alive\n", + "Exception ignored in: assert self._parent_pid == os.getpid(), 'can only test a child process'\n", + "\n", + "assert self._parent_pid == os.getpid(), 'can only test a child process'Exception ignored in: Traceback (most recent call last):\n", + "Exception ignored in: \n", + " File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1478, in __del__\n", + " \n", + "\n", + " Traceback (most recent call last):\n", + "Traceback (most recent call last):\n", + " File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1478, in __del__\n", + " File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1478, in __del__\n", + "self._shutdown_workers() \n", + " File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1461, in _shutdown_workers\n", + " self._shutdown_workers() \n", + "self._shutdown_workers() \n", + " File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1461, in _shutdown_workers\n", + " if w.is_alive(): File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1461, in _shutdown_workers\n", + " \n", + " ^ if w.is_alive(): ^^ \n", + "if w.is_alive():^^ \n", + "^^ ^^ ^^ ^^ ^^^ ^^^ ^ ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "^^^^ File \"/usr/lib/python3.11/multiprocessing/process.py\", line 160, in is_alive\n", + "\n", + "^^^ File \"/usr/lib/python3.11/multiprocessing/process.py\", line 160, in is_alive\n", + "\n", + "^^assert self._parent_pid == os.getpid(), 'can only test a child process' File \"/usr/lib/python3.11/multiprocessing/process.py\", line 160, in is_alive\n", + "^\n", + "^assert self._parent_pid == os.getpid(), 'can only test a child process' ^ ^\n", + "assert self._parent_pid == os.getpid(), 'can only test a child process'^^ \n", + "^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^^ \n", + "\n", + " AssertionErrorAssertionError : : ^can only test a child processcan only test a child process ^\n", + "\n", + "^ ^^^^^^^^Exception ignored in: ^^Exception ignored in: ^^^^^\n", + "^\n", + "^^Traceback (most recent call last):\n", + "^Traceback (most recent call last):\n", + "^^ File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1478, in __del__\n", + "^ File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1478, in __del__\n", + "^^^^^ ^^ ^self._shutdown_workers()^^self._shutdown_workers()^^\n", + "^^\n", + "^ File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1461, in _shutdown_workers\n", + "^^ File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1461, in _shutdown_workers\n", + "^^^^ ^^ ^if w.is_alive():^^if w.is_alive():^\n", + "^^\n", + "^ ^^ ^^ ^ ^^ ^ ^^^ ^^^ ^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^\n", + "^^^^AssertionError^^^^: \n", + "^^^can only test a child processAssertionError\n", + "^^\n", + ": ^AssertionError^can only test a child process^: ^\n", + "^can only test a child process^\n", + "Exception ignored in: \n", + " File \"/usr/lib/python3.11/multiprocessing/process.py\", line 160, in is_alive\n", + "\n", + " \n", + " File \"/usr/lib/python3.11/multiprocessing/process.py\", line 160, in is_alive\n", + "assert self._parent_pid == os.getpid(), 'can only test a child process'Traceback (most recent call last):\n", + "Exception ignored in: \n", + " File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1478, in __del__\n", + "Exception ignored in: assert self._parent_pid == os.getpid(), 'can only test a child process' \n", + "\n", + " \n", + " Traceback (most recent call last):\n", + "Traceback (most recent call last):\n", + "self._shutdown_workers() File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1478, in __del__\n", + " File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1478, in __del__\n", + " \n", + " File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1461, in _shutdown_workers\n", + " self._shutdown_workers() self._shutdown_workers()\n", + " \n", + " File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1461, in _shutdown_workers\n", + " if w.is_alive(): File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1461, in _shutdown_workers\n", + " \n", + " ^ if w.is_alive():^^if w.is_alive(): ^\n", + "^\n", + "^ ^ ^ ^ ^ ^ ^ ^ ^ ^^ ^ ^^ ^^ ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "^" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Epoch 3, Loss: 0.7128373980522156\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "^^^ File \"/usr/lib/python3.11/multiprocessing/process.py\", line 160, in is_alive\n", + "^^^^ ^^^\n", + "assert self._parent_pid == os.getpid(), 'can only test a child process'^\n", + "^ File \"/usr/lib/python3.11/multiprocessing/process.py\", line 160, in is_alive\n", + "\n", + "^ File \"/usr/lib/python3.11/multiprocessing/process.py\", line 160, in is_alive\n", + "^ ^^ assert self._parent_pid == os.getpid(), 'can only test a child process' ^^assert self._parent_pid == os.getpid(), 'can only test a child process' \n", + "^^\n", + " ^^ ^ ^ ^ ^ ^ \n", + " \n", + " AssertionErrorAssertionError : : can only test a child processcan only test a child process ^\n", + "\n", + " ^ ^ ^Exception ignored in: ^Exception ignored in: ^^^^^\n", + "^\n", + "^^Traceback (most recent call last):\n", + "^Traceback (most recent call last):\n", + "^^ File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1478, in __del__\n", + "^^ File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1478, in __del__\n", + "^^^ ^^^ self._shutdown_workers()^^^\n", + "self._shutdown_workers()^^^ File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1461, in _shutdown_workers\n", + "^\n", + "^^^ File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1461, in _shutdown_workers\n", + "^ ^^^if w.is_alive():^^\n", + "^ ^^ ^^if w.is_alive(): ^^^\n", + " ^^^ ^^^ ^^^ ^^ ^^^^ ^^^^ ^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "^^^^AssertionError^^\n", + "\n", + ": \n", + "AssertionError File \"/usr/lib/python3.11/multiprocessing/process.py\", line 160, in is_alive\n", + "^AssertionErrorcan only test a child process: ^\n", + ": can only test a child process assert self._parent_pid == os.getpid(), 'can only test a child process'^can only test a child process\n", + "\n", + "^\n", + " \n", + " File \"/usr/lib/python3.11/multiprocessing/process.py\", line 160, in is_alive\n", + " assert self._parent_pid == os.getpid(), 'can only test a child process' \n", + " ^ ^ ^^ ^ ^ ^^ ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "^AssertionError^: ^can only test a child process^\n", + "^^^^^^^\n", + "AssertionError: can only test a child process\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Epoch 3, Loss: 0.7299872636795044\n", + "Epoch 3, Loss: 0.7225807905197144\n" + ] + }, + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "f562d85b61f84ae6978a9c97bb85cb7e", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + " 0%| | 0/8 [00:00\n", + "\n", + "\n", + "Traceback (most recent call last):\n", + "Traceback (most recent call last):\n", + "Traceback (most recent call last):\n", + " File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1478, in __del__\n", + " File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1478, in __del__\n", + " File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1478, in __del__\n", + " self._shutdown_workers()self._shutdown_workers()self._shutdown_workers()\n", + "\n", + "\n", + " File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1461, in _shutdown_workers\n", + " File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1461, in _shutdown_workers\n", + " File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1461, in _shutdown_workers\n", + " if w.is_alive():if w.is_alive(): \n", + "\n", + "if w.is_alive(): \n", + " ^ ^^^^^^^^^^^Exception ignored in: Exception ignored in: ^^^^^^\n", + "\n", + "^^^Traceback (most recent call last):\n", + "^Traceback (most recent call last):\n", + "^^ File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1478, in __del__\n", + "^ File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1478, in __del__\n", + "^^^^^^ ^^ ^^self._shutdown_workers()\n", + "self._shutdown_workers()\n", + "^\n", + " File \"/usr/lib/python3.11/multiprocessing/process.py\", line 160, in is_alive\n", + "\n", + " File \"/usr/lib/python3.11/multiprocessing/process.py\", line 160, in is_alive\n", + "\n", + " File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1461, in _shutdown_workers\n", + " File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1461, in _shutdown_workers\n", + " File \"/usr/lib/python3.11/multiprocessing/process.py\", line 160, in is_alive\n", + " assert self._parent_pid == os.getpid(), 'can only test a child process'assert self._parent_pid == os.getpid(), 'can only test a child process' \n", + " \n", + "assert self._parent_pid == os.getpid(), 'can only test a child process' if w.is_alive():if w.is_alive(): \n", + " \n", + "\n", + " ^^ ^^ ^ ^^ ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "^^^\n", + " File \"/usr/lib/python3.11/multiprocessing/process.py\", line 160, in is_alive\n", + "^^^ File \"/usr/lib/python3.11/multiprocessing/process.py\", line 160, in is_alive\n", + " ^^^assert self._parent_pid == os.getpid(), 'can only test a child process' ^^^\n", + "assert self._parent_pid == os.getpid(), 'can only test a child process'^^^ \n", + "^^^ ^^^ ^^^ ^^^ ^^^ ^ ^^ ^^^ ^ ^^ ^^^ ^^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "^^^^AssertionError\n", + "^^^: ^\n", + "AssertionError^can only test a child process^AssertionError: ^\n", + "^: can only test a child process^can only test a child process^^\n", + "\n", + "^^Exception ignored in: ^^^\n", + "^^Traceback (most recent call last):\n", + "^^Exception ignored in: Exception ignored in: File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1478, in __del__\n", + "^^^^\n", + "\n", + "^ ^Traceback (most recent call last):\n", + "Traceback (most recent call last):\n", + "^self._shutdown_workers()^ File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1478, in __del__\n", + " File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1478, in __del__\n", + "^\n", + "^^ File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1461, in _shutdown_workers\n", + "^ ^ ^self._shutdown_workers()^self._shutdown_workers()^ \n", + "^\n", + "if w.is_alive():^ File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1461, in _shutdown_workers\n", + "^ File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1461, in _shutdown_workers\n", + "\n", + "^^ ^ ^ if w.is_alive():^if w.is_alive():^ \n", + "^\n", + "^ ^ ^ ^ \n", + " ^ AssertionError \n", + " : ^AssertionError can only test a child process ^: \n", + " can only test a child process^ \n", + "^^^^^Exception ignored in: Exception ignored in: ^^^^^^\n", + "\n", + "^^^^Traceback (most recent call last):\n", + "Traceback (most recent call last):\n", + "^^^ File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1478, in __del__\n", + " File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1478, in __del__\n", + "^^^^^^^\n", + " ^ ^ File \"/usr/lib/python3.11/multiprocessing/process.py\", line 160, in is_alive\n", + "self._shutdown_workers()^self._shutdown_workers()^ \n", + "^\n", + "^assert self._parent_pid == os.getpid(), 'can only test a child process' File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1461, in _shutdown_workers\n", + "^ File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1461, in _shutdown_workers\n", + "\n", + "\n", + "^ File \"/usr/lib/python3.11/multiprocessing/process.py\", line 160, in is_alive\n", + " \n", + " if w.is_alive():if w.is_alive(): File \"/usr/lib/python3.11/multiprocessing/process.py\", line 160, in is_alive\n", + "assert self._parent_pid == os.getpid(), 'can only test a child process' \n", + "\n", + "\n", + " assert self._parent_pid == os.getpid(), 'can only test a child process' \n", + " ^^^ ^^^ ^ ^^ ^ ^^ ^ ^^^^ ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "\n", + "^^^ File \"/usr/lib/python3.11/multiprocessing/process.py\", line 160, in is_alive\n", + " File \"/usr/lib/python3.11/multiprocessing/process.py\", line 160, in is_alive\n", + "^^^ ^ ^^^assert self._parent_pid == os.getpid(), 'can only test a child process'assert self._parent_pid == os.getpid(), 'can only test a child process'^^\n", + "^\n", + "^^ ^ ^^ ^ ^^ ^ ^^ ^ ^^^ ^^^ ^^^ ^^^ ^^^ ^ ^^ ^ ^^ ^ ^^^^^^^^^^^^^^^\n", + "^^^^AssertionError^^^^: ^^^^can only test a child process^^^^\n", + "^^^\n", + "^^^AssertionError^^: ^^\n", + "Exception ignored in: ^can only test a child processAssertionError^\n", + "^: ^\n", + "^can only test a child process^Traceback (most recent call last):\n", + "^^\n", + " File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1478, in __del__\n", + "Exception ignored in: ^^^^\n", + " ^^Exception ignored in: Traceback (most recent call last):\n", + "self._shutdown_workers()^^ File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1478, in __del__\n", + "\n", + "^^\n", + " File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1461, in _shutdown_workers\n", + "^^Traceback (most recent call last):\n", + " ^^ File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1478, in __del__\n", + " self._shutdown_workers()^^if w.is_alive():\n", + "^^\n", + " File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1461, in _shutdown_workers\n", + "^^ self._shutdown_workers()^^ \n", + " ^^ File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1461, in _shutdown_workers\n", + "if w.is_alive():^^ \n", + "^^ ^^ if w.is_alive(): ^^ \n", + " ^\n", + "^ \n", + "^AssertionError AssertionError^: can only test a child process^: \n", + "^can only test a child process ^^\n", + " ^^ ^^^^Exception ignored in: ^^^^^^Exception ignored in: \n", + "^^^Traceback (most recent call last):\n", + "^^^\n", + " File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1478, in __del__\n", + "^\n", + "^Traceback (most recent call last):\n", + "^ File \"/usr/lib/python3.11/multiprocessing/process.py\", line 160, in is_alive\n", + " File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1478, in __del__\n", + "^^ ^^self._shutdown_workers()assert self._parent_pid == os.getpid(), 'can only test a child process' ^\n", + "\n", + "\n", + "self._shutdown_workers()^ File \"/usr/lib/python3.11/multiprocessing/process.py\", line 160, in is_alive\n", + " File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1461, in _shutdown_workers\n", + " \n", + "^ File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1461, in _shutdown_workers\n", + "^assert self._parent_pid == os.getpid(), 'can only test a child process' \n", + "\n", + " if w.is_alive(): File \"/usr/lib/python3.11/multiprocessing/process.py\", line 160, in is_alive\n", + " if w.is_alive(): \n", + " \n", + " assert self._parent_pid == os.getpid(), 'can only test a child process' \n", + " ^ ^^ ^^^ ^^^^ ^^^^ ^^^^ ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "^^^ File \"/usr/lib/python3.11/multiprocessing/process.py\", line 160, in is_alive\n", + "\n", + "^^^ File \"/usr/lib/python3.11/multiprocessing/process.py\", line 160, in is_alive\n", + " ^^^assert self._parent_pid == os.getpid(), 'can only test a child process' ^^^\n", + "assert self._parent_pid == os.getpid(), 'can only test a child process'^^^ \n", + "^^^ ^^^ ^^^ ^^^ ^^^ ^^ ^ ^^ ^^^ ^^^ ^^^ ^^^ ^^^^^^^^^^^\n", + "^^^^AssertionError^^^^: \n", + "^^^can only test a child processAssertionError^^^: \n", + "^^^can only test a child process^^^\n", + "^^^\n", + "^Exception ignored in: ^^AssertionError^^Exception ignored in: \n", + ": ^^Traceback (most recent call last):\n", + "can only test a child process^^\n", + " File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1478, in __del__\n", + "\n", + "^^Traceback (most recent call last):\n", + "^^ File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1478, in __del__\n", + "^ ^^self._shutdown_workers()^Exception ignored in: ^\n", + "^self._shutdown_workers()^ File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1461, in _shutdown_workers\n", + "^\n", + "\n", + "^^ File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1461, in _shutdown_workers\n", + "Traceback (most recent call last):\n", + "^ ^ File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1478, in __del__\n", + "^if w.is_alive():^ ^\n", + "^if w.is_alive():^ ^\n", + "^self._shutdown_workers() ^ ^\n", + " ^ ^ File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1461, in _shutdown_workers\n", + " ^ ^ ^ ^ ^if w.is_alive():\n", + " ^\n", + "AssertionError^ ^ : ^^\n", + " can only test a child process^^AssertionError \n", + "^^: ^^can only test a child process ^^ ^\n", + "^Exception ignored in: ^^^^^\n", + "^^Exception ignored in: Traceback (most recent call last):\n", + "^^^^ File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1478, in __del__\n", + "^^\n", + "^\n", + "^^Traceback (most recent call last):\n", + " File \"/usr/lib/python3.11/multiprocessing/process.py\", line 160, in is_alive\n", + " ^^ File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1478, in __del__\n", + "self._shutdown_workers() \n", + "^\n", + "assert self._parent_pid == os.getpid(), 'can only test a child process' File \"/usr/lib/python3.11/multiprocessing/process.py\", line 160, in is_alive\n", + "^ File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1461, in _shutdown_workers\n", + "\n", + " ^self._shutdown_workers() assert self._parent_pid == os.getpid(), 'can only test a child process'\n", + "^ \n", + " ^ File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1461, in _shutdown_workers\n", + "if w.is_alive(): \n", + "\n", + " File \"/usr/lib/python3.11/multiprocessing/process.py\", line 160, in is_alive\n", + " if w.is_alive(): \n", + "assert self._parent_pid == os.getpid(), 'can only test a child process' \n", + " ^ ^ ^ ^ ^^ ^^^^ ^^^^^ ^^^^ ^^^ ^^^^ ^^^^^^^^^^^^^^^^^^^^^^\n", + "^^^^ File \"/usr/lib/python3.11/multiprocessing/process.py\", line 160, in is_alive\n", + "^^^^ ^^^\n", + "assert self._parent_pid == os.getpid(), 'can only test a child process'^^^ File \"/usr/lib/python3.11/multiprocessing/process.py\", line 160, in is_alive\n", + "\n", + "^^^ ^^^assert self._parent_pid == os.getpid(), 'can only test a child process' ^^^\n", + " ^^^ ^^^ ^^^ ^^ ^ ^^ ^ ^ ^^ ^^ ^ ^^ ^ ^^ ^^^^ ^^^^ ^^^^^^^^^^\n", + "^^^^AssertionError^\n", + "^^: ^AssertionError^^^can only test a child process: ^^^\n", + "can only test a child process^^^\n", + "^^^^^^\n", + "^^^^AssertionErrorException ignored in: Exception ignored in: ^: ^^can only test a child process^^\n", + "\n", + "\n", + "^^Traceback (most recent call last):\n", + "Traceback (most recent call last):\n", + "^^ File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1478, in __del__\n", + " File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1478, in __del__\n", + "^^Exception ignored in: ^^ ^^\n", + " ^self._shutdown_workers()self._shutdown_workers()Traceback (most recent call last):\n", + "^^\n", + "\n", + " File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1478, in __del__\n", + "^^ File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1461, in _shutdown_workers\n", + " File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1461, in _shutdown_workers\n", + "^^ ^^ self._shutdown_workers()if w.is_alive():^^if w.is_alive():\n", + "\n", + "^^ File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1461, in _shutdown_workers\n", + " ^\n", + "^ ^^ ^^ if w.is_alive():^ ^\n", + " \n", + " ^ AssertionError \n", + " : AssertionError can only test a child process^: \n", + " can only test a child process^ ^\n", + "^ ^^ ^^Exception ignored in: ^^^Exception ignored in: ^^^\n", + "^^^Traceback (most recent call last):\n", + "\n", + "^^^ File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1478, in __del__\n", + "Traceback (most recent call last):\n", + "^^^ File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1478, in __del__\n", + "^^^ ^^^ self._shutdown_workers()\n", + "^^self._shutdown_workers()\n", + " File \"/usr/lib/python3.11/multiprocessing/process.py\", line 160, in is_alive\n", + "^\n", + "^ File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1461, in _shutdown_workers\n", + " ^ File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1461, in _shutdown_workers\n", + "\n", + "assert self._parent_pid == os.getpid(), 'can only test a child process'^ File \"/usr/lib/python3.11/multiprocessing/process.py\", line 160, in is_alive\n", + "\n", + "^ if w.is_alive(): \n", + "if w.is_alive():\n", + " assert self._parent_pid == os.getpid(), 'can only test a child process' File \"/usr/lib/python3.11/multiprocessing/process.py\", line 160, in is_alive\n", + "\n", + " \n", + " assert self._parent_pid == os.getpid(), 'can only test a child process' \n", + " ^ ^ ^ ^^ ^^^ ^^^ ^ ^^ ^^^^ ^^^^ ^^^^^^^^^^^^^^^^^^^^\n", + "^^^ File \"/usr/lib/python3.11/multiprocessing/process.py\", line 160, in is_alive\n", + "^\n", + "^^^ File \"/usr/lib/python3.11/multiprocessing/process.py\", line 160, in is_alive\n", + " ^^^ assert self._parent_pid == os.getpid(), 'can only test a child process'^^^assert self._parent_pid == os.getpid(), 'can only test a child process'\n", + "^^^\n", + " ^^ ^^ ^ ^^^ ^^^ ^^^ ^ ^^ ^ ^^ ^ ^^^ ^^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "^^^^AssertionError^^^^: ^^^^can only test a child process^^^^\n", + "^^^^^\n", + "^\n", + "^AssertionError^AssertionError^: ^Exception ignored in: can only test a child process^: ^\n", + "^^^^\n", + "can only test a child process^^Traceback (most recent call last):\n", + "\n", + "^^ File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1478, in __del__\n", + "Exception ignored in: ^^^^\n", + "^ ^Traceback (most recent call last):\n", + "^Exception ignored in: self._shutdown_workers()^^ File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1478, in __del__\n", + "^\n", + "^^\n", + " File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1461, in _shutdown_workers\n", + "^ ^Traceback (most recent call last):\n", + "^^self._shutdown_workers() File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1478, in __del__\n", + " \n", + "^^if w.is_alive():^^ File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1461, in _shutdown_workers\n", + "\n", + "^^ ^^ self._shutdown_workers()\n", + " \n", + "if w.is_alive():\n", + " AssertionErrorAssertionError\n", + " File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1461, in _shutdown_workers\n", + ": : can only test a child processcan only test a child process \n", + "\n", + " if w.is_alive(): ^\n", + " ^Exception ignored in: Exception ignored in: ^ ^ \n", + "\n", + "^^ Traceback (most recent call last):\n", + "Traceback (most recent call last):\n", + "^^ File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1478, in __del__\n", + " File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1478, in __del__\n", + "^^ ^^ ^ ^ self._shutdown_workers()^self._shutdown_workers()^^^\n", + "\n", + "^^^ File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1461, in _shutdown_workers\n", + " File \"/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torch/utils/data/dataloader.py\", line 1461, in _shutdown_workers\n", + "^^\n", + "^ File \"/usr/lib/python3.11/multiprocessing/process.py\", line 160, in is_alive\n", + "^ ^if w.is_alive(): ^^if w.is_alive():\n", + "assert self._parent_pid == os.getpid(), 'can only test a child process'^\n", + "^\n", + " \n", + "^ File \"/usr/lib/python3.11/multiprocessing/process.py\", line 160, in is_alive\n", + "^ ^ assert self._parent_pid == os.getpid(), 'can only test a child process' ^ \n", + " ^ ^ \n", + "^ ^ File \"/usr/lib/python3.11/multiprocessing/process.py\", line 160, in is_alive\n", + "^ ^ ^ ^ ^assert self._parent_pid == os.getpid(), 'can only test a child process' ^^ \n", + "^ ^^ ^ ^^^ ^^^ ^^^ ^^^^ ^^^^ ^^^^ ^\n", + "\n", + "^ ^ File \"/usr/lib/python3.11/multiprocessing/process.py\", line 160, in is_alive\n", + " File \"/usr/lib/python3.11/multiprocessing/process.py\", line 160, in is_alive\n", + "^ ^ ^^ assert self._parent_pid == os.getpid(), 'can only test a child process'assert self._parent_pid == os.getpid(), 'can only test a child process'^^ \n", + "\n", + "^^^ ^ ^ ^^ ^ ^^ ^ ^^ ^^^ ^^^ ^^ ^ ^^ ^ ^^ ^ ^^^ ^^^ ^^^^^^^^^" + ] + } + ], + "source": [ + "num_cv_channels = features.shape[1]\n", + "\n", + "# divide the data into num_split splits\n", + "size_ridge_regressions = math.ceil(num_cv_channels / num_split)\n", + "\n", + "for current_rigde_regression in tqdm(range(num_split)):\n", + " # create the dataset and dataloader and rr model\n", + " start_features_rr = current_rigde_regression*size_ridge_regressions\n", + " if current_rigde_regression == num_split - 1:\n", + " end_features_rr = num_cv_channels\n", + " else:\n", + " end_features_rr = (current_rigde_regression+1)*size_ridge_regressions\n", + "\n", + " print(f'Starting split {current_rigde_regression} with features {start_features_rr} to {end_features_rr}')\n", + "\n", + " print(f'Creating datasets and dataloaders')\n", + " train_dataset = RRDataset(x_train[:], valid_nsd_ids_train[:], features[:,start_features_rr:end_features_rr,:, :])\n", + " train_dl = DataLoader(train_dataset, batch_size=batch_size, shuffle=True, drop_last=True, pin_memory=True, num_workers=5)\n", + " \n", + " test_dataset = RRDataset(x_test[:], test_nsd_ids[:], features[:,start_features_rr:end_features_rr,:, :])\n", + " test_dl = DataLoader(test_dataset, batch_size=batch_size, shuffle=False, drop_last=False, pin_memory=True, num_workers=5)\n", + "\n", + " print(f'Creating RR model')\n", + " rr_model = RidgeRegression(input_dim=x_train.shape[1], output_dim_shape=(end_features_rr-start_features_rr, features.shape[2], features.shape[3])).to(device).to(data_type)\n", + " utils.count_params(rr_model)\n", + "\n", + " def init_weights(m):\n", + " if isinstance(m, torch.nn.Linear):\n", + " torch.nn.init.xavier_uniform_(m.weight)\n", + " if m.bias is not None:\n", + " torch.nn.init.zeros_(m.bias)\n", + " \n", + " rr_model.apply(init_weights)\n", + "\n", + " criterion = nn.MSELoss()\n", + " optimizer = torch.optim.AdamW(rr_model.parameters(), lr=3e-5, weight_decay=1e-15)\n", + " torch.nn.utils.clip_grad_norm_(rr_model.parameters(), max_norm=1.0)\n", + "\n", + " # Train the model\n", + " best_loss = 100000\n", + " best_nsd_1000_predictions = None\n", + "\n", + " best_imagery_predictions = None\n", + " best_vision_predictions = None\n", + "\n", + " best_imagery_average_predictions = None\n", + " best_vision_average_predictions = None\n", + "\n", + " epochs_without_improvement = 0\n", + "\n", + " for epoch in tqdm(range(num_epochs)):\n", + " rr_model.train()\n", + " for i, (x, y) in enumerate(tqdm(train_dl)):\n", + " # do all the calculations on the gpu on the float16 data type\n", + " x = x.to(device).to(data_type)\n", + " y = y.to(device).to(data_type)\n", + "\n", + " assert torch.isnan(x).sum() == 0, \"features contain nan values\"\n", + " assert torch.isinf(y).sum() == 0, \"features contain inf values\"\n", + "\n", + " \n", + " y_pred = rr_model(x)\n", + " assert torch.isnan(y_pred).sum() == 0, \"features contain nan values\"\n", + " assert torch.isinf(y_pred).sum() == 0, \"features contain inf values\"\n", + " \n", + " # flatten the output and target to calculate the loss just keep the batch dimension\n", + " loss = criterion(y_pred.view(y_pred.size(0), -1), y.view(y.size(0), -1))\n", + " optimizer.zero_grad()\n", + " loss.backward()\n", + "\n", + " optimizer.step()\n", + " if i % 100 == 0:\n", + " print(f'Epoch {epoch}, Loss: {loss.item()}')\n", + "\n", + "\n", + " # Test the model\n", + " rr_model.eval()\n", + " test_loss = 0\n", + " current_nsd_1000_predictions = []\n", + " with torch.no_grad():\n", + " for i, (x, y) in enumerate(tqdm(test_dl)):\n", + " x = x.to(device).to(data_type)\n", + " y = y.to(device).to(data_type)\n", + " y_pred = rr_model(x)\n", + " test_loss += criterion(y_pred, y).item()\n", + "\n", + " current_nsd_1000_predictions.append(y_pred.cpu().numpy())\n", + "\n", + " test_loss /= len(test_dl)\n", + " print(f'Test Loss: {test_loss}')\n", + " if test_loss < best_loss:\n", + " print(f'New best loss: {test_loss}')\n", + " best_loss = test_loss\n", + " best_nsd_1000_predictions = current_nsd_1000_predictions\n", + " if save_ckpt:\n", + " torch.save(rr_model.state_dict(), f'{outdir}/rr_model_{str(current_rigde_regression)}.pt')\n", + "\n", + " # calculate the predictions for the imagery data and the vision data\n", + " with torch.no_grad():\n", + " current_imagery_predictions = []\n", + " for i, x in enumerate(tqdm(voxels_imagery)):\n", + " x = x.to(device).to(data_type)\n", + " y_pred = rr_model(x)\n", + " current_imagery_predictions.append(y_pred.cpu().numpy())\n", + "\n", + " current_vision_predictions = []\n", + " for i, x in enumerate(tqdm(voxels_vision)):\n", + " x = x.to(device).to(data_type)\n", + " y_pred = rr_model(x)\n", + " current_vision_predictions.append(y_pred.cpu().numpy())\n", + "\n", + " best_imagery_predictions = torch.Tensor(current_imagery_predictions)\n", + " best_vision_predictions = torch.Tensor(current_vision_predictions)\n", + "\n", + " average_vision_predictions = rr_model(torch.mean(voxels_vision, dim=1).to(device).to(data_type)).cpu().numpy()\n", + " average_imagery_predictions = rr_model(torch.mean(voxels_imagery, dim=1).to(device).to(data_type)).cpu().numpy()\n", + "\n", + " best_imagery_average_predictions = torch.Tensor(average_imagery_predictions)\n", + " best_vision_average_predictions = torch.Tensor(average_vision_predictions)\n", + "\n", + " # save the best predictions\n", + " torch.save(best_imagery_predictions, f'{outdir}/best_imagery_predictions_{str(current_rigde_regression)}.pt')\n", + " torch.save(best_vision_predictions, f'{outdir}/best_vision_predictions_{str(current_rigde_regression)}.pt')\n", + " torch.save(best_imagery_average_predictions, f'{outdir}/best_imagery_average_predictions_{str(current_rigde_regression)}.pt')\n", + " torch.save(best_vision_average_predictions, f'{outdir}/best_vision_average_predictions_{str(current_rigde_regression)}.pt')\n", + " # torch.save(torch.Tensor(best_nsd_1000_predictions), f'{outdir}/best_nsd_1000_predictions_{str(current_rigde_regression)}.pt')\n", + " print(f'Saved best predictions for split {current_rigde_regression}')\n", + "\n", + " epochs_without_improvement = 0\n", + "\n", + " else:\n", + " epochs_without_improvement += 1\n", + " if epochs_without_improvement == 3:\n", + " print(f'No improvement for 3 epochs. Stopping training for split {current_rigde_regression}')\n", + " break\n", + "\n", + " print(f'Finished split {current_rigde_regression}')\n", + "\n", + "print('Finished all splits')" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "b120ddc9-ec0d-460d-ac2c-3c7afd1c9fef", + "metadata": {}, + "outputs": [], + "source": [ + "len(best_nsd_1000_predictions)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "0d319511-f6f1-4a39-a53e-2a638b62707f", + "metadata": {}, + "outputs": [], + "source": [ + "random.randint(0,len(all_indexes_to_compute)-1)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "ad4556bb-e6aa-4162-9b4d-d55a42bc33ad", + "metadata": {}, + "outputs": [], + "source": [ + "# check how many nans are in my model parameters\n", + "nans = 0\n", + "for name, param in rr_model.named_parameters():\n", + " nans += torch.sum(torch.isnan(param)).item()\n", + " print(name, torch.sum(torch.isnan(param)).item())\n", + "print(f'Found {nans} nans in my model parameters')\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "390fe2bc-faae-4f1f-9df1-13719e41fd2c", + "metadata": {}, + "outputs": [], + "source": [ + "y_pred.shape" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "01cb9205-101c-43d0-aa29-a3537022ea32", + "metadata": {}, + "outputs": [], + "source": [ + "rr_model = rr_model.to(device).to(data_type)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "00e6cc12-6922-40c3-8ac5-30fbe0e5c9d7", + "metadata": {}, + "outputs": [], + "source": [ + "from bdpy.dl.torch.models import VGG19, layer_map, model_factory\n", + "from bdpy.recon.torch.modules import build_encoder, build_generator, TargetNormalizedMSE\n", + "from bdpy.dl.torch.domain import Domain, image_domain, ComposedDomain\n", + "\n", + "generator_network = model_factory('relu7generator')\n", + "generator_network.load_state_dict(torch.load('/weka/proj-fmri/ckadirt/spurious_reconstruction/analysis/bvlc_reference_caffenet_generator_ILSVRC2012_Training/generator_relu7.pt'))\n", + "generator_network = generator_network.to(device)\n", + "\n", + "generator = build_generator(\n", + " generator_network, \n", + " image_domain.BdPyVGGDomain(device=device, dtype=data_type)\n", + " )\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "01c814d9-2dfc-4450-b742-1512a52e3776", + "metadata": {}, + "outputs": [], + "source": [ + "feature_network = VGG19()\n", + "\n", + "feature_network.load_state_dict(torch.load('/weka/proj-fmri/ckadirt/spurious_reconstruction/analysis/VGG_ILSVRC_19_layers/VGG_ILSVRC_19_layers.pt'))\n", + "encoder = feature_network.to(device)\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "54002a0f-187e-4e46-895e-209dd9b04d5b", + "metadata": {}, + "outputs": [], + "source": [ + "generator" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "53b49e6f-f362-4c17-9eb9-357f374c817a", + "metadata": {}, + "outputs": [], + "source": [ + "import torch\n", + "import torch.nn as nn\n", + "import torch.optim as optim\n", + "from torchvision import transforms\n", + "from torchvision.transforms import ToPILImage\n", + "from tqdm.auto import tqdm\n", + "import matplotlib.pyplot as plt\n", + "import os\n", + "from PIL import Image\n", + "\n", + "\n", + "\n", + "\n", + "# Set models to evaluation mode and freeze parameters\n", + "generator.eval()\n", + "encoder.eval()\n", + "for param in generator.parameters():\n", + " param.requires_grad = True\n", + "for param in encoder.parameters():\n", + " param.requires_grad = True\n", + "\n", + "# Define feature extractor\n", + "class EncoderFeatureExtractor(nn.Module):\n", + " def __init__(self, encoder, target_layer=0):\n", + " super(EncoderFeatureExtractor, self).__init__()\n", + " self.encoder = encoder\n", + " self.target_layer = target_layer\n", + " self.features = nn.Sequential(*list(self.encoder.features.children())[:self.target_layer + 1])\n", + "\n", + " def forward(self, x):\n", + " return self.features(x)\n", + "\n", + "feature_extractor = EncoderFeatureExtractor(encoder, target_layer=0).to(device)\n", + "\n", + "\n", + "# from PIL import Image\n", + "# image_path = \"./im.jpg\"\n", + "# image = Image.open(image_path)\n", + "\n", + "# # Preprocess the image\n", + "# preprocess = transforms.Compose([\n", + "# transforms.Resize((256, 256)),\n", + "# transforms.ToTensor(),\n", + "# # transforms.Normalize(mean=[0.485, 0.456, 0.406], # Example normalization (ImageNet)\n", + "# # std=[0.229, 0.224, 0.225]),\n", + "# ])\n", + "\n", + "# # Preprocess the image\n", + "# image_tensor = preprocess(image).unsqueeze(0).to(device)\n", + "\n", + "# # show processed image\n", + "# to_pil = ToPILImage()\n", + "# pil_image = to_pil(image_tensor.squeeze())\n", + "# pil_image.show()\n", + "\n", + "\n", + "# # Generate features from the image\n", + "# with torch.no_grad():\n", + "# image_features = feature_extractor(image_tensor)\n", + "\n", + "# # Define target features\n", + "# target_features = torch.Tensor(torch.load('/weka/proj-fmri/ckadirt/spurious_reconstruction/analysis/0_preprocessing/ff.pt')).to(device).float()\n", + "\n", + "target_features = torch.Tensor(features[1,:,:,:]).unsqueeze(0).to(device)\n", + "print(target_features.shape)\n", + "# image_features.to(device).float()\n", + "\n", + "# Initialize latent vector z\n", + "z_dim = 4096 # Adjust based on your generator\n", + "# Initialize z with requires_grad=True to allow optimization\n", + "z = torch.randn(1, z_dim, device=device, requires_grad=True)\n", + "\n", + "# Set up optimizer\n", + "optimizer = optim.Adam([z], lr=0.03) # Reduced learning rate from 1 to 0.01\n", + "\n", + "# Set up learning rate scheduler\n", + "# scheduler = optim.lr_scheduler.StepLR(optimizer, step_size=5000, gamma=0.5) # Adjusted gamma to 0.5\n", + "\n", + "# Define loss function\n", + "loss_fn = nn.MSELoss()\n", + "\n", + "# For saving images\n", + "to_pil = ToPILImage()\n", + "\n", + "# Optimization loop parameters\n", + "num_steps = 1000\n", + "log_interval = 1000 # How often to log and save images\n", + "save_image_interval = 100 # Save image every 100 steps\n", + "\n", + "# Lists to store loss values and steps\n", + "loss_history = []\n", + "steps_list = []\n", + "\n", + "# Regularization strength\n", + "lambda_reg = 0 # Increased from 1e-14 to 1e-5\n", + "\n", + "# Define latent upper bound\n", + "latent_upperbound = 30.0 # Upper bound for z\n", + "\n", + "# Start optimization\n", + "for step in tqdm(range(1, num_steps + 1)):\n", + " optimizer.zero_grad()\n", + " \n", + " # Generate image from z\n", + " generated_image = generator(z)\n", + " if step == 1:\n", + " imm = to_pil(generated_image[0])\n", + " imm.show()\n", + " # Center crop the generated image to match encoder's input resolution\n", + " try:\n", + " generated_image_cropped = generated_image #= center_crop_tensor(generated_image, 224, 224)\n", + " except ValueError as e:\n", + " print(f\"Step [{step}]: {e}\")\n", + " # Optionally, handle smaller images by padding or skipping this step\n", + " # For simplicity, we'll skip the optimization step in this case\n", + " continue\n", + " \n", + " # Extract features\n", + " generated_features = feature_extractor(generated_image_cropped)\n", + " \n", + " # Compute loss with regularization\n", + " loss = loss_fn(generated_features, target_features) + lambda_reg * torch.norm(z)\n", + " \n", + " # Backpropagate\n", + " loss.backward()\n", + " \n", + " # Gradient clipping (optional but recommended)\n", + " torch.nn.utils.clip_grad_norm_([z], max_norm=1.0)\n", + " \n", + " # Update z\n", + " optimizer.step()\n", + " \n", + " # Step the scheduler\n", + " # scheduler.step()\n", + "\n", + " generated_image = generated_image.detach()\n", + " # Clamp z to enforce the latent upper bound\n", + " with torch.no_grad():\n", + " z.clamp_(-latent_upperbound, latent_upperbound)\n", + " \n", + " # Logging and storing loss\n", + " if step % log_interval == 0 or step == num_steps or step == 1:\n", + " current_loss = loss.item()\n", + " loss_history.append(current_loss)\n", + " steps_list.append(step)\n", + " # print(f\"Step [{step}/{num_steps}], Loss: {current_loss:.6f}\")\n", + " \n", + " # # Optional: Save intermediate images\n", + " # if step % save_image_interval == 0 or step == num_steps or step == 1:\n", + " # with torch.no_grad():\n", + " # final_image = generator(z).detach().cpu()\n", + " # # final_image = (final_image + 1) / 2 # If generator outputs in [-1, 1]\n", + " # # final_image = torch.clamp(final_image, 0, 1) # Ensure pixel values are in [0,1]\n", + " # pil_image = to_pil(final_image.squeeze())\n", + " # image_path = os.path.join(output_dir, f\"generated_step_{step}.png\")\n", + " # pil_image.save(image_path)\n", + " # # print(f\"Saved generated image at step {step} to {image_path}\")\n", + "\n", + "# Generate the final image\n", + "with torch.no_grad():\n", + " final_image = generator(z).detach().cpu()\n", + " # final_image = (final_image + 1) / 2 # If normalized\n", + " # final_image = torch.clamp(final_image, 0, 1) # Ensure pixel values are in [0,1]\n", + " pil_image = to_pil(final_image.squeeze())\n", + " pil_image.show()\n", + "\n", + "# Plot the loss curve\n", + "plt.figure(figsize=(10, 6))\n", + "plt.plot(steps_list, loss_history, label='MSE Loss')\n", + "plt.xlabel('Optimization Steps')\n", + "plt.ylabel('Loss')\n", + "plt.title('Loss Curve During Optimization')\n", + "plt.legend()\n", + "plt.grid(True)\n", + "plt.tight_layout()\n", + "plt.show()\n" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "mindeye", + "language": "python", + "name": "mindeye" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.10" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/spurious_reconstruction/analysis/1_case_study/feature-decoding/.ipynb_checkpoints/RR_pytorch-checkpoint.ipynb b/spurious_reconstruction/analysis/1_case_study/feature-decoding/.ipynb_checkpoints/RR_pytorch-checkpoint.ipynb new file mode 100644 index 0000000000000000000000000000000000000000..6e693b53c302822cc25c7da19d6f6fe2cc80c7b6 --- /dev/null +++ b/spurious_reconstruction/analysis/1_case_study/feature-decoding/.ipynb_checkpoints/RR_pytorch-checkpoint.ipynb @@ -0,0 +1,954 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "id": "1ee75391-89d0-4450-b75b-9e6eaa3239ea", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "PID of this process = 220963\n", + "Traning with config:\n", + "batch_size: 128\n", + "num_epochs: 20\n", + "weight_decay: 1e-05\n", + "lr: 0.001\n", + "device: cuda\n" + ] + } + ], + "source": [ + "# Import packages and setup gpu configuration.\n", + "# This code block shouldnt need to be adjusted!\n", + "import os\n", + "import sys\n", + "import json\n", + "import yaml\n", + "import numpy as np\n", + "import copy\n", + "import math\n", + "import time\n", + "import random\n", + "from tqdm.auto import tqdm\n", + "import matplotlib.pyplot as plt\n", + "\n", + "import torch\n", + "import torch.nn as nn\n", + "from torchvision import transforms\n", + "import h5py\n", + "import utils\n", + "\n", + "# tf32 data type is faster than standard float32\n", + "torch.backends.cuda.matmul.allow_tf32 = True\n", + "# following fixes a Conv3D CUDNN_NOT_SUPPORTED error\n", + "torch.backends.cudnn.benchmark = True\n", + "\n", + "\n", + "# outdir = os.path.abspath(f'checkpoints/{model_name}')\n", + "\n", + "\n", + "current_features = 'features[2]'\n", + "outdir = os.path.abspath(f'./decoding_of/{current_features}')\n", + "os.makedirs(outdir, exist_ok=True)\n", + "\n", + "\n", + "if utils.is_interactive():\n", + " # Following allows you to change functions in models.py or utils.py and \n", + " # have this notebook automatically update with your revisions\n", + " %load_ext autoreload\n", + " %autoreload 2\n", + "\n", + "batch_size = 128\n", + "num_epochs = 20\n", + "weight_decay = 1e-5\n", + "lr = 1e-3\n", + "\n", + "data_type = torch.float32\n", + "\n", + "device = torch.device('cuda')\n", + "\n", + "save_ckpt = False\n", + "wandb_log = False\n", + "\n", + "\n", + "print(\"PID of this process =\",os.getpid())\n", + "seed = 42\n", + "utils.seed_everything(seed)\n", + "\n", + "\n", + "print(\"Traning with config:\")\n", + "print(f\"batch_size: {batch_size}\")\n", + "print(f\"num_epochs: {num_epochs}\")\n", + "print(f\"weight_decay: {weight_decay}\")\n", + "print(f\"lr: {lr}\")\n", + "\n", + "print(f\"device: {device}\")\n" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "f731731e-cb9b-47a9-8368-ab4ff5258029", + "metadata": {}, + "outputs": [], + "source": [ + "# config paths\n", + "precomputed_path = '/weka/proj-fmri/ckadirt/spurious_reconstruction/analysis/0_preprocessing/features/pytorch/VGG19_ILSVRC_19_layers/'\n", + "precomputed_features_path = os.path.join(precomputed_path, current_features, '1.h5')\n", + "\n", + "num_split = 30\n", + "\n", + "\n", + "\n", + "# load precomputed features\n", + "f_features = h5py.File(precomputed_features_path, 'r')\n", + "features = f_features['dataset']" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "id": "88c31f89-5c95-4777-83d6-bff817a026b8", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "/weka/proj-medarc/shared/mindeyev2_dataset//wds/subj01/train/{0..39}.tar\n", + "/weka/proj-medarc/shared/mindeyev2_dataset//wds/subj01/new_test/0.tar\n", + "Loaded test dl for subj1!\n", + "\n" + ] + }, + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "55b6612f7cea48e4a68603d6d80fbc2e", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "0it [00:00, ?it/s]" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "2c04a95c091246be861a7f046370aa4f", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "0it [00:00, ?it/s]" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "import webdataset as wds\n", + "import random\n", + "from tqdm.auto import tqdm\n", + "\n", + "def my_split_by_node(urls): return urls\n", + "data_path = '/weka/proj-medarc/shared/mindeyev2_dataset/'\n", + "subj_list = [1]\n", + "num_sessions = 40\n", + "multi_subject = False\n", + "subj = 1\n", + "\n", + "train_data = {}\n", + "train_dl = {}\n", + "num_voxels = {}\n", + "voxels = {}\n", + "\n", + "train_url = f\"{data_path}/wds/subj0{subj}/train/\" + \"{0..\" + f\"{num_sessions-1}\" + \"}.tar\"\n", + "print(train_url)\n", + "\n", + "train_data = wds.WebDataset(train_url,resampled=False,nodesplitter=my_split_by_node)\\\n", + " .decode(\"torch\")\\\n", + " .rename(behav=\"behav.npy\", past_behav=\"past_behav.npy\", future_behav=\"future_behav.npy\", olds_behav=\"olds_behav.npy\")\\\n", + " .to_tuple(*[\"behav\", \"past_behav\", \"future_behav\", \"olds_behav\"])\n", + "train_dl = torch.utils.data.DataLoader(train_data, batch_size=1, shuffle=False, drop_last=False, pin_memory=True)\n", + "\n", + "# f = h5py.File(f'{data_path}/betas_all_subj0{s}_fp32_renorm.hdf5', 'r')\n", + "# betas = f['betas'][:]\n", + "# betas = torch.Tensor(betas).to(\"cpu\").to(data_type)\n", + "# num_voxels_list.append(betas[0].shape[-1])\n", + "# num_voxels[f'subj0{s}'] = betas[0].shape[-1]\n", + "# voxels[f'subj0{s}'] = betas\n", + "# print(f\"num_voxels for subj0{s}: {num_voxels[f'subj0{s}']}\")\n", + "\n", + "\n", + "num_test=3000\n", + "test_url = f\"{data_path}/wds/subj0{subj}/new_test/\" + \"0.tar\"\n", + "print(test_url)\n", + "test_data = wds.WebDataset(test_url,resampled=False,nodesplitter=my_split_by_node)\\\n", + " .decode(\"torch\")\\\n", + " .rename(behav=\"behav.npy\", past_behav=\"past_behav.npy\", future_behav=\"future_behav.npy\", olds_behav=\"olds_behav.npy\")\\\n", + " .to_tuple(*[\"behav\", \"past_behav\", \"future_behav\", \"olds_behav\"])\n", + "test_dl = torch.utils.data.DataLoader(test_data, batch_size=1, shuffle=False, drop_last=True, pin_memory=True)\n", + "print(f\"Loaded test dl for subj{subj}!\\n\")\n", + "\n", + "all_indexes_train = []\n", + "all_betas_train = []\n", + "\n", + "for behav0, past_behav0, future_behav0, old_behav0 in tqdm(train_dl):\n", + " img_idx = behav0[:,0,0].cpu().long().numpy()[0]\n", + " betas_idx = behav0[:,0,5].cpu().long().numpy()[0]\n", + " all_indexes_train.append(img_idx)\n", + " all_betas_train.append(betas_idx)\n", + "\n", + "all_indexes_test = []\n", + "all_betas_test = []\n", + "\n", + "for behav0, past_behav0, future_behav0, old_behav0 in tqdm(test_dl):\n", + " img_idx = behav0[:,0,0].cpu().long().numpy()[0]\n", + " betas_idx = behav0[:,0,5].cpu().long().numpy()[0]\n", + " all_indexes_test.append(img_idx)\n", + " all_betas_test.append(betas_idx)\n" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "id": "61019c94-f8bd-468c-bbe1-5b9fa4a2b74e", + "metadata": {}, + "outputs": [], + "source": [ + "all_indexes_to_compute = set(all_indexes_train + list(set(all_indexes_test)))\n", + "all_indexes_to_compute = list(all_indexes_to_compute)" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "e3f62964-020c-4a3c-91fc-515cd0ab3fa8", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "loading_betas\n", + "betas_ loaded\n" + ] + } + ], + "source": [ + "f_betas = h5py.File(f'{data_path}/betas_all_subj0{subj}_fp32_renorm.hdf5', 'r')\n", + "print(\"loading_betas\")\n", + "betas = f_betas['betas'][:]\n", + "betas = torch.from_numpy(betas).to(\"cpu\")\n", + "print(\"betas_ loaded\")\n", + "x_train, valid_nsd_ids_train, x_test, test_nsd_ids = utils.load_nsd(subject=subj, betas=betas, data_path=data_path)" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "id": "48195a15-65f0-40f9-a19e-0fce47ae879c", + "metadata": {}, + "outputs": [], + "source": [ + "from torch.utils.data import Dataset, DataLoader\n", + "\n", + "class RRDataset(Dataset):\n", + " def __init__(self, x, valid_nsd_ids):\n", + " self.x = x\n", + " self.valid_nsd_ids = valid_nsd_ids\n", + "\n", + " def __len__(self):\n", + " return len(self.x)\n", + "\n", + " def __getitem__(self, idx):\n", + " # print(self.x[idx].shape, torch.Tensor(self.current_features[saved_index]).shape, torch.Tensor(self.valid_nsd_ids[idx]).shape)\n", + " return self.x[idx], torch.Tensor([self.valid_nsd_ids[idx]])\n", + " \n", + " \n", + "\n", + "# print(\"Moving datasets to ram\")\n", + "# # Loading to cpu for faster training, this can take several minutes. Remove this [:] if you want to move one at the time.\n", + "# train_dataset = RRDataset(x_train[:], valid_nsd_ids_train[:], features[:,0:4,:, :])\n", + "\n", + "# for data in train_dataset:\n", + "# break" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "id": "16315ea8-2dfb-4df9-88a0-683eedc00a2d", + "metadata": {}, + "outputs": [], + "source": [ + "train_dataset = RRDataset(x_train[:], valid_nsd_ids_train[:])\n", + "train_dl = DataLoader(train_dataset, batch_size=128, shuffle=True, drop_last=True, pin_memory=True, num_workers=5)\n", + "for x,ine in train_dl:\n", + " break" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "id": "a6c19ff5-013b-4290-9791-b8b0564c314a", + "metadata": {}, + "outputs": [], + "source": [ + "# ine.squeeze().shape" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "id": "79697872-3f59-4e32-803c-323d16154583", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425])\n", + "torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425])\n" + ] + } + ], + "source": [ + "imagery_data_path = '/weka/proj-medarc/shared/umn-imagery'\n", + "# load nsd_imagery_data\n", + "voxels_vision, all_images_vision = utils.load_nsd_mental_imagery(subject=subj, mode='vision', stimtype=\"all\", average=False, nest=True, data_root=imagery_data_path)\n", + "voxels_imagery, all_images_imagery = utils.load_nsd_mental_imagery(subject=subj, mode='imagery', stimtype=\"all\", average=False, nest=True, data_root=imagery_data_path)" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "id": "4303321b-775a-42ae-aa86-4cb8fd316677", + "metadata": {}, + "outputs": [], + "source": [ + "class RidgeRegression(nn.Module):\n", + " def __init__(self, input_dim, output_dim_shape):\n", + " super(RidgeRegression, self).__init__()\n", + " self.input_dim = input_dim\n", + " self.output_dim_shape = output_dim_shape\n", + " self.output_dim = np.prod(output_dim_shape)\n", + " self.linear = nn.Linear(input_dim, self.output_dim)\n", + " \n", + " def forward(self, x):\n", + " # Flatten the input except for the batch dimension\n", + " x = x.view(x.size(0), -1)\n", + " out = self.linear(x)\n", + " out = out.view(-1, *self.output_dim_shape)\n", + " return out # Raw logits\n", + " \n", + " " + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "id": "dc7d98c7-a33f-49bd-8332-4ef7ba343c26", + "metadata": {}, + "outputs": [], + "source": [ + "from bdpy.dl.torch.models import VGG19, layer_map, model_factory\n", + "from bdpy.recon.torch.modules import build_encoder, build_generator, TargetNormalizedMSE\n", + "from bdpy.dl.torch.domain import Domain, image_domain, ComposedDomain\n", + "\n", + "feature_network = VGG19()\n", + "\n", + "feature_network.load_state_dict(torch.load('/weka/proj-fmri/ckadirt/spurious_reconstruction/analysis/VGG_ILSVRC_19_layers/VGG_ILSVRC_19_layers.pt'))\n", + "encoder = feature_network.to(device)\n", + "\n", + "encoder.eval()\n", + "for param in encoder.parameters():\n", + " param.requires_grad = True\n", + "\n", + "# Define feature extractor\n", + "class EncoderFeatureExtractor(nn.Module):\n", + " def __init__(self, encoder, target_layer=0):\n", + " super(EncoderFeatureExtractor, self).__init__()\n", + " self.encoder = encoder\n", + " self.target_layer = target_layer\n", + " self.features = nn.Sequential(*list(self.encoder.features.children())[:self.target_layer + 1])\n", + "\n", + " def forward(self, x):\n", + " return self.features(x)\n", + "\n", + "feature_extractor = EncoderFeatureExtractor(encoder, target_layer=2).to(device)" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "id": "3f22d84f-c189-48e1-9827-d8fb70fa934d", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224])\n", + "Resized images torch.Size([73000, 3, 256, 256])\n" + ] + } + ], + "source": [ + "f = h5py.File(f'{data_path}/coco_images_224_float16.hdf5', 'r')\n", + "images = f['images']\n", + "\n", + "\n", + "images = torch.Tensor(images[:])\n", + "print(\"Loaded all 73k possible NSD images to cpu!\", images.shape)\n", + "\n", + "\n", + "# 73k, 3, 224, 224\n", + "# resize to 256, 256\n", + "\n", + "from torchvision import transforms\n", + "\n", + "transform = transforms.Compose([\n", + " transforms.Resize((256, 256))\n", + "])\n", + "\n", + "images = torch.stack([transform(img) for img in images])\n", + "print(\"Resized images\", images.shape)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "848f97ba-1a60-43a3-a048-5b3531529393", + "metadata": {}, + "outputs": [], + "source": [ + "# # plot images[0]\n", + "\n", + "# plt.imshow(images[72999].permute(1, 2, 0).numpy())" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "872c3f2a-aacd-4ac2-bd9f-a21bdb8c0d36", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Number of cv channels: 64\n", + "Size of ridge regressions: 3\n", + "Number of ridge regressions: 22\n" + ] + }, + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "1ffdc1af41b84d62b0c88569264f468a", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + " 0%| | 0/22 [00:00 12\u001b[0m \u001b[43mridge\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mfit\u001b[49m\u001b[43m(\u001b[49m\u001b[43mx_train\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mreshape\u001b[49m\u001b[43m(\u001b[49m\u001b[43mx_train\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mshape\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;241;43m0\u001b[39;49m\u001b[43m]\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m-\u001b[39;49m\u001b[38;5;241;43m1\u001b[39;49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mtrain_features\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mreshape\u001b[49m\u001b[43m(\u001b[49m\u001b[43mtrain_features\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mshape\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;241;43m0\u001b[39;49m\u001b[43m]\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m-\u001b[39;49m\u001b[38;5;241;43m1\u001b[39;49m\u001b[43m)\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 13\u001b[0m \u001b[38;5;28mprint\u001b[39m(\u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mFinished, now scoring\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[1;32m 14\u001b[0m train_score \u001b[38;5;241m=\u001b[39m ridge\u001b[38;5;241m.\u001b[39mscore(x_train\u001b[38;5;241m.\u001b[39mreshape(x_train\u001b[38;5;241m.\u001b[39mshape[\u001b[38;5;241m0\u001b[39m], \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m1\u001b[39m), train_features\u001b[38;5;241m.\u001b[39mreshape(train_features\u001b[38;5;241m.\u001b[39mshape[\u001b[38;5;241m0\u001b[39m], \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m1\u001b[39m))\n", + "File \u001b[0;32m~/mindeye/lib/python3.11/site-packages/sklearn/base.py:1474\u001b[0m, in \u001b[0;36m_fit_context..decorator..wrapper\u001b[0;34m(estimator, *args, **kwargs)\u001b[0m\n\u001b[1;32m 1467\u001b[0m estimator\u001b[38;5;241m.\u001b[39m_validate_params()\n\u001b[1;32m 1469\u001b[0m \u001b[38;5;28;01mwith\u001b[39;00m config_context(\n\u001b[1;32m 1470\u001b[0m skip_parameter_validation\u001b[38;5;241m=\u001b[39m(\n\u001b[1;32m 1471\u001b[0m prefer_skip_nested_validation \u001b[38;5;129;01mor\u001b[39;00m global_skip_validation\n\u001b[1;32m 1472\u001b[0m )\n\u001b[1;32m 1473\u001b[0m ):\n\u001b[0;32m-> 1474\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mfit_method\u001b[49m\u001b[43m(\u001b[49m\u001b[43mestimator\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n", + "File \u001b[0;32m~/mindeye/lib/python3.11/site-packages/sklearn/linear_model/_ridge.py:1175\u001b[0m, in \u001b[0;36mRidge.fit\u001b[0;34m(self, X, y, sample_weight)\u001b[0m\n\u001b[1;32m 1166\u001b[0m _accept_sparse \u001b[38;5;241m=\u001b[39m _get_valid_accept_sparse(sparse\u001b[38;5;241m.\u001b[39missparse(X), \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39msolver)\n\u001b[1;32m 1167\u001b[0m X, y \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_validate_data(\n\u001b[1;32m 1168\u001b[0m X,\n\u001b[1;32m 1169\u001b[0m y,\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 1173\u001b[0m y_numeric\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mTrue\u001b[39;00m,\n\u001b[1;32m 1174\u001b[0m )\n\u001b[0;32m-> 1175\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43msuper\u001b[39;49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mfit\u001b[49m\u001b[43m(\u001b[49m\u001b[43mX\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43my\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43msample_weight\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43msample_weight\u001b[49m\u001b[43m)\u001b[49m\n", + "File \u001b[0;32m~/mindeye/lib/python3.11/site-packages/sklearn/linear_model/_ridge.py:927\u001b[0m, in \u001b[0;36m_BaseRidge.fit\u001b[0;34m(self, X, y, sample_weight)\u001b[0m\n\u001b[1;32m 923\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 924\u001b[0m \u001b[38;5;66;03m# for dense matrices or when intercept is set to 0\u001b[39;00m\n\u001b[1;32m 925\u001b[0m params \u001b[38;5;241m=\u001b[39m {}\n\u001b[0;32m--> 927\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mcoef_, \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mn_iter_ \u001b[38;5;241m=\u001b[39m \u001b[43m_ridge_regression\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 928\u001b[0m \u001b[43m \u001b[49m\u001b[43mX\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 929\u001b[0m \u001b[43m \u001b[49m\u001b[43my\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 930\u001b[0m \u001b[43m \u001b[49m\u001b[43malpha\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43malpha\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 931\u001b[0m \u001b[43m \u001b[49m\u001b[43msample_weight\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43msample_weight\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 932\u001b[0m \u001b[43m \u001b[49m\u001b[43mmax_iter\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mmax_iter\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 933\u001b[0m \u001b[43m \u001b[49m\u001b[43mtol\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mtol\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 934\u001b[0m \u001b[43m \u001b[49m\u001b[43msolver\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43msolver\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 935\u001b[0m \u001b[43m \u001b[49m\u001b[43mpositive\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mpositive\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 936\u001b[0m \u001b[43m \u001b[49m\u001b[43mrandom_state\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mrandom_state\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 937\u001b[0m \u001b[43m \u001b[49m\u001b[43mreturn_n_iter\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43;01mTrue\u001b[39;49;00m\u001b[43m,\u001b[49m\n\u001b[1;32m 938\u001b[0m \u001b[43m \u001b[49m\u001b[43mreturn_intercept\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43;01mFalse\u001b[39;49;00m\u001b[43m,\u001b[49m\n\u001b[1;32m 939\u001b[0m \u001b[43m \u001b[49m\u001b[43mcheck_input\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43;01mFalse\u001b[39;49;00m\u001b[43m,\u001b[49m\n\u001b[1;32m 940\u001b[0m \u001b[43m \u001b[49m\u001b[43mfit_intercept\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mfit_intercept\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 941\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mparams\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 942\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 943\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_set_intercept(X_offset, y_offset, X_scale)\n\u001b[1;32m 945\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28mself\u001b[39m\n", + "File \u001b[0;32m~/mindeye/lib/python3.11/site-packages/sklearn/linear_model/_ridge.py:727\u001b[0m, in \u001b[0;36m_ridge_regression\u001b[0;34m(X, y, alpha, sample_weight, solver, max_iter, tol, verbose, positive, random_state, return_n_iter, return_intercept, X_scale, X_offset, check_input, fit_intercept)\u001b[0m\n\u001b[1;32m 725\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m solver \u001b[38;5;241m==\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mcholesky\u001b[39m\u001b[38;5;124m\"\u001b[39m:\n\u001b[1;32m 726\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m n_features \u001b[38;5;241m>\u001b[39m n_samples:\n\u001b[0;32m--> 727\u001b[0m K \u001b[38;5;241m=\u001b[39m \u001b[43msafe_sparse_dot\u001b[49m\u001b[43m(\u001b[49m\u001b[43mX\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mX\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mT\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mdense_output\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43;01mTrue\u001b[39;49;00m\u001b[43m)\u001b[49m\n\u001b[1;32m 728\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[1;32m 729\u001b[0m dual_coef \u001b[38;5;241m=\u001b[39m _solve_cholesky_kernel(K, y, alpha)\n", + "File \u001b[0;32m~/mindeye/lib/python3.11/site-packages/sklearn/utils/extmath.py:211\u001b[0m, in \u001b[0;36msafe_sparse_dot\u001b[0;34m(a, b, dense_output)\u001b[0m\n\u001b[1;32m 207\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 208\u001b[0m ret \u001b[38;5;241m=\u001b[39m a \u001b[38;5;241m@\u001b[39m b\n\u001b[1;32m 210\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m (\n\u001b[0;32m--> 211\u001b[0m \u001b[43msparse\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43missparse\u001b[49m\u001b[43m(\u001b[49m\u001b[43ma\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 212\u001b[0m \u001b[38;5;129;01mand\u001b[39;00m sparse\u001b[38;5;241m.\u001b[39missparse(b)\n\u001b[1;32m 213\u001b[0m \u001b[38;5;129;01mand\u001b[39;00m dense_output\n\u001b[1;32m 214\u001b[0m \u001b[38;5;129;01mand\u001b[39;00m \u001b[38;5;28mhasattr\u001b[39m(ret, \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mtoarray\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[1;32m 215\u001b[0m ):\n\u001b[1;32m 216\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m ret\u001b[38;5;241m.\u001b[39mtoarray()\n\u001b[1;32m 217\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m ret\n", + "File \u001b[0;32m~/mindeye/lib/python3.11/site-packages/scipy/sparse/_base.py:1461\u001b[0m, in \u001b[0;36missparse\u001b[0;34m(x)\u001b[0m\n\u001b[1;32m 1456\u001b[0m \u001b[38;5;28;01mpass\u001b[39;00m\n\u001b[1;32m 1458\u001b[0m sparray\u001b[38;5;241m.\u001b[39m\u001b[38;5;18m__doc__\u001b[39m \u001b[38;5;241m=\u001b[39m _spbase\u001b[38;5;241m.\u001b[39m\u001b[38;5;18m__doc__\u001b[39m\n\u001b[0;32m-> 1461\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21missparse\u001b[39m(x):\n\u001b[1;32m 1462\u001b[0m \u001b[38;5;250m \u001b[39m\u001b[38;5;124;03m\"\"\"Is `x` of a sparse array type?\u001b[39;00m\n\u001b[1;32m 1463\u001b[0m \n\u001b[1;32m 1464\u001b[0m \u001b[38;5;124;03m Parameters\u001b[39;00m\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 1485\u001b[0m \u001b[38;5;124;03m False\u001b[39;00m\n\u001b[1;32m 1486\u001b[0m \u001b[38;5;124;03m \"\"\"\u001b[39;00m\n\u001b[1;32m 1487\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(x, _spbase)\n", + "\u001b[0;31mKeyboardInterrupt\u001b[0m: " + ] + } + ], + "source": [ + "outdir_for_feature = os.path.join(outdir, current_features)\n", + "os.makedirs(outdir_for_feature, exist_ok=True)\n", + "\n", + "# iterate over the splits\n", + "for calc_rn_split in tqdm(range(18,splits_per_layer[current_features]+1)):\n", + " print(f\"Calculating split {calc_rn_split} of {splits_per_layer[current_features]}\")\n", + " train_features, test_features = get_numpy_subset_of_features(train_loader, test_loader, encoder, current_features, calc_rn_split)\n", + " size_of_features_for_split = math.ceil(layer_sizes[current_features] / splits_per_layer[current_features])\n", + " \n", + " print(f\"Starting ridge regression for split {calc_rn_split} with alpha {alpha_per_layer[current_features]}\")\n", + " ridge = Ridge(alpha=alpha_per_layer[current_features])\n", + " ridge.fit(x_train.reshape(x_train.shape[0], -1), train_features.reshape(train_features.shape[0], -1))\n", + " print(f\"Finished, now scoring\")\n", + " train_score = ridge.score(x_train.reshape(x_train.shape[0], -1), train_features.reshape(train_features.shape[0], -1))\n", + " test_score = ridge.score(x_test.reshape(x_test.shape[0], -1), test_features.reshape(test_features.shape[0], -1))\n", + " print(f\"train_score: {train_score}, test_score: {test_score}\")\n", + "\n", + " if current_features in ['classifier[0]', 'classifier[3]', 'classifier[6]']:\n", + " target_feature_shape = (size_of_features_for_split,)\n", + " else:\n", + " target_feature_shape = (size_of_features_for_split,) + tuple(features_shapes[current_features][1:])\n", + "\n", + " y_mean = compute_mean_keepdims(train_features)\n", + " # save the mean\n", + " np.save(f'{outdir_for_feature}/ridge_y_mean_{current_features}_{calc_rn_split}.npy', y_mean.astype(np.float16))\n", + "\n", + " # save the scores\n", + " with open(f'{outdir_for_feature}/ridge_scores_{current_features}_{calc_rn_split}.json', 'w') as f:\n", + " json.dump({'train_score': train_score, 'test_score': test_score}, f)\n", + " # save the weights\n", + " if save_ckpt:\n", + " np.save(f'{outdir_for_feature}/ridge_weights_{current_features}_{calc_rn_split}.npy', ridge.coef_.astype(np.float16))\n", + " # save the intercept\n", + " if save_ckpt:\n", + " np.save(f'{outdir_for_feature}/ridge_intercept_{current_features}_{calc_rn_split}.npy', ridge.intercept_.astype(np.float16))\n", + "\n", + " # save the test predictions\n", + " test_predictions = ridge.predict(x_test.reshape(x_test.shape[0], -1))\n", + " np.save(f'{outdir_for_feature}/ridge_test_predictions_{current_features}_{calc_rn_split}.npy', test_predictions.reshape(tuple([test_predictions.shape[0]] + list(target_feature_shape))).astype(np.float16))\n", + "\n", + " # vision_preds = None\n", + " # # get predictions for the imagery data: vision\n", + " # for i, (voxel, image) in enumerate(tqdm(zip(voxels_vision, all_images_vision))):\n", + " # voxel = voxel # 8, 15724\n", + " # pred = ridge.predict(voxel.cpu().numpy())\n", + "\n", + " # if vision_preds is None:\n", + " # vision_preds = np.expand_dims(pred, axis=0)\n", + " # else:\n", + " # vision_preds = np.concatenate((vision_preds, np.expand_dims(pred, axis=0)), axis=0)\n", + "\n", + " # np.save(f'{outdir_for_feature}/ridge_vision_preds_{current_features}_{calc_rn_split}.npy', vision_preds.reshape(tuple([vision_preds.shape[0]] + [vision_preds.shape[1]] + list(target_feature_shape))).astype(np.float16))\n", + "\n", + " # # get the predictions for the imagery data: imagery\n", + " # imagery_preds = None\n", + " # for i, (voxel, image) in enumerate(tqdm(zip(voxels_imagery, all_images_imagery))):\n", + " # voxel = voxel # 8, 15724\n", + " # pred = ridge.predict(voxel.cpu().numpy())\n", + "\n", + " # if imagery_preds is None:\n", + " # imagery_preds = np.expand_dims(pred, axis=0)\n", + " # else:\n", + " # imagery_preds = np.concatenate((imagery_preds, np.expand_dims(pred, axis=0)), axis=0)\n", + "\n", + " # np.save(f'{outdir_for_feature}/ridge_imagery_preds_{current_features}_{calc_rn_split}.npy', imagery_preds.reshape(tuple([imagery_preds.shape[0]] + [imagery_preds.shape[1]] + list(target_feature_shape))).astype(np.float16))\n", + "\n", + " # get the predictions for averaged imagery data: vision\n", + " vision_averaged_voxels = np.mean(np.array(voxels_vision), axis=1)\n", + " vision_averaged_preds = ridge.predict(vision_averaged_voxels)\n", + " np.save(f'{outdir_for_feature}/ridge_vision_averaged_preds_{current_features}_{calc_rn_split}.npy', vision_averaged_preds.reshape(tuple([vision_averaged_preds.shape[0]] + list(target_feature_shape))).astype(np.float16))\n", + "\n", + " # get the predictions for averaged imagery data: imagery\n", + " imagery_averaged_voxels = np.mean(np.array(voxels_imagery), axis=1)\n", + " imagery_averaged_preds = ridge.predict(imagery_averaged_voxels)\n", + " np.save(f'{outdir_for_feature}/ridge_imagery_averaged_preds_{current_features}_{calc_rn_split}.npy', imagery_averaged_preds.reshape(tuple([imagery_averaged_preds.shape[0]] + list(target_feature_shape))).astype(np.float16))\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "0a2179a2-6d54-437b-8b5a-3acdae3e1359", + "metadata": {}, + "outputs": [], + "source": [ + "# train_score: 0.36801715559650683, test_score: 0.1672737750357223\n", + "# train_score: 0.40319354674904023, test_score: 0.14771963878285566" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "c8f25b4c-bd79-4e9d-b5e4-1d9424056478", + "metadata": {}, + "outputs": [], + "source": [ + "# size_of_features_for_split = 2\n", + "# rsp = test_predictions.reshape(tuple([test_predictions.shape[0]] + [size_of_features_for_split] + list(features_shapes[current_features][1:])))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "23e51433-c191-481b-bba1-135efdec5bb6", + "metadata": {}, + "outputs": [], + "source": [ + "# # rsp.shape\n", + "\n", + "# Error displaying widget: model not found\n", + "# Calculating split 1 of 2\n", + "# start_feature_index: 0, end_feature_index: 256\n", + "# Error displaying widget: model not found\n", + "# Error displaying widget: model not found\n", + "# Starting ridge regression for split 1\n", + "# Finished, now scoring\n", + "# train_score: 0.47192760353898633, test_score: 0.17910965480278365\n", + "# Error displaying widget: model not found\n", + "# Error displaying widget: model not found\n", + "# Calculating split 2 of 2\n", + "# start_feature_index: 256, end_feature_index: 512\n", + "# Error displaying widget: model not found\n", + "# Error displaying widget: model not found\n", + "# Starting ridge regression for split 2\n", + "# Finished, now scoring\n", + "# train_score: 0.47058061967151404, test_score: 0.17653868688099578\n", + "# Error displaying widget: model not found\n", + "# Error displaying widget: model not found" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "39b8ad50-dd93-4076-b3d1-7f21f3802985", + "metadata": {}, + "outputs": [], + "source": [ + "# # rsp.shape\n", + "\n", + "# Error displaying widget: model not found\n", + "# Calculating split 1 of 2\n", + "# start_feature_index: 0, end_feature_index: 256\n", + "# Error displaying widget: model not found\n", + "# Error displaying widget: model not found\n", + "# Starting ridge regression for split 1\n", + "# Finished, now scoring\n", + "# train_score: 0.47192760353898633, test_score: 0.17910965480278365\n", + "# Error displaying widget: model not found\n", + "# Error displaying widget: model not found\n", + "# Calculating split 2 of 2\n", + "# start_feature_index: 256, end_feature_index: 512\n", + "# Error displaying widget: model not found\n", + "# Error displaying widget: model not found\n", + "# Starting ridge regression for split 2\n", + "# Finished, now scoring\n", + "# train_score: 0.47058061967151404, test_score: 0.17653868688099578\n", + "# Error displaying widget: model not found\n", + "# Error displaying widget: model not found" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "525b58bc-611f-44db-a138-78d6ee25ada1", + "metadata": {}, + "outputs": [], + "source": [ + "# 100.000\n", + "# # 100%\n", + "# #  2/2 [07:02<00:00, 205.79s/it]\n", + "# # Calculating split 1 of 2\n", + "# # start_feature_index: 0, end_feature_index: 256\n", + "# # 100%\n", + "# #  211/211 [00:28<00:00, 12.92it/s]\n", + "# # 100%\n", + "# #  8/8 [00:12<00:00,  1.23it/s]\n", + "# # Starting ridge regression for split 1\n", + "# # Finished, now scoring\n", + "# # train_score: 0.25576497027366507, test_score: 0.17944773415519444\n", + "# #  18/? [00:02<00:00,  9.75it/s]\n", + "# #  18/? [00:01<00:00, 10.16it/s]\n", + "# # Calculating split 2 of 2\n", + "# # start_feature_index: 256, end_feature_index: 512\n", + "# # 100%\n", + "# #  211/211 [00:25<00:00, 14.23it/s]\n", + "# # 100%\n", + "# #  8/8 [00:11<00:00,  1.35it/s]\n", + "# # Starting ridge regression for split 2\n", + "# # Finished, now scoring\n", + "# # train_score: 0.2538025531233917, test_score: 0.17658538319863515\n", + "# #  18/? [00:02<00:00,  7.65it/s]\n", + "# #  18/? [00:01<00:00, 10.60it/s]\n", + "\n", + "# 60.000\n", + "# # Calculating split 1 of 2\n", + "# # start_feature_index: 0, end_feature_index: 256\n", + "# # 100%\n", + "# #  211/211 [00:28<00:00, 12.19it/s]\n", + "# # 100%\n", + "# #  8/8 [00:12<00:00,  1.24it/s]\n", + "# # Starting ridge regression for split 1\n", + "# # Finished, now scoring\n", + "# # train_score: 0.29882922368878595, test_score: 0.1865818620210305\n", + "# #  18/? [00:03<00:00,  6.38it/s]\n", + "# #  18/? [00:02<00:00,  7.63it/s]\n", + "# # Calculating split 2 of 2\n", + "# # start_feature_index: 256, end_feature_index: 512\n", + "# # 100%\n", + "# #  211/211 [00:28<00:00, 12.74it/s]\n", + "# # 100%\n", + "# #  8/8 [00:14<00:00,  1.07it/s]\n", + "# # Starting ridge regression for split 2\n", + "# # Finished, now scoring\n", + "# # train_score: 0.29697740748685114, test_score: 0.18380820114650484\n", + "# #  18/? [00:03<00:00,  6.08it/s]\n", + "# #  18/? [00:02<00:00,  7.28it/s]\n", + "\n", + "# 3.000\n", + "# # 100%\n", + "# #  2/2 [05:16<00:00, 158.05s/it]\n", + "# # Calculating split 1 of 2\n", + "# # start_feature_index: 0, end_feature_index: 256\n", + "# # 100%\n", + "# #  211/211 [00:26<00:00, 13.16it/s]\n", + "# # 100%\n", + "# #  8/8 [00:11<00:00,  1.28it/s]\n", + "# # Starting ridge regression for split 1\n", + "# # Finished, now scoring\n", + "# # train_score: 0.5698654322488805, test_score: 0.13571111344383577\n", + "# #  18/? [00:02<00:00,  6.78it/s]\n", + "# #  18/? [00:02<00:00,  7.33it/s]\n", + "# # Calculating split 2 of 2\n", + "# # start_feature_index: 256, end_feature_index: 512\n", + "# # 100%\n", + "# #  211/211 [00:26<00:00, 13.34it/s]\n", + "# # 100%\n", + "# #  8/8 [00:11<00:00,  1.30it/s]\n", + "# # Starting ridge regression for split 2\n", + "# # Finished, now scoring\n", + "# # train_score: 0.5688183958383461, test_score: 0.13313861189424853\n", + "# #  18/? [00:03<00:00,  5.49it/s]\n", + "# #  18/? [00:02<00:00,  6.20it/s]\n", + "\n", + "# 30.000\n", + "# # 100%\n", + "# #  2/2 [06:36<00:00, 191.34s/it]\n", + "# # Calculating split 1 of 2\n", + "# # start_feature_index: 0, end_feature_index: 256\n", + "# # 100%\n", + "# #  211/211 [00:27<00:00, 12.63it/s]\n", + "# # 100%\n", + "# #  8/8 [00:12<00:00,  1.29it/s]\n", + "# # Starting ridge regression for split 1\n", + "# # Finished, now scoring\n", + "# # train_score: 0.364419577220044, test_score: 0.19057156925390528\n", + "# #  18/? [00:02<00:00,  7.21it/s]\n", + "# #  18/? [00:01<00:00,  9.08it/s]\n", + "# # Calculating split 2 of 2\n", + "# # start_feature_index: 256, end_feature_index: 512\n", + "# # 100%\n", + "# #  211/211 [00:26<00:00, 13.14it/s]\n", + "# # 100%\n", + "# #  8/8 [00:11<00:00,  1.28it/s]\n", + "# # Starting ridge regression for split 2\n", + "# # Finished, now scoring\n", + "# # train_score: 0.3627511765041596, test_score: 0.18790273193089738\n", + "# #  18/? [00:03<00:00,  8.05it/s]\n", + "# #  18/? [00:02<00:00,  8.58it/s]\n", + "\n", + "# 40.000\n", + "# # 100%\n", + "# #  8/8 [00:14<00:00,  1.05it/s]\n", + "# # Starting ridge regression for split 2\n", + "# # Finished, now scoring\n", + "# # train_score: 0.3347034806338601, test_score: 0.1871069173521844\n", + "# #  18/? [00:03<00:00,  5.37it/s]\n", + "# #  18/? [00:02<00:00,  7.88it/s]\n", + "# # 100%\n", + "# #  8/8 [00:14<00:00,  1.05it/s]\n", + "# # Starting ridge regression for split 2\n", + "# # Finished, now scoring\n", + "# # train_score: 0.3347034806338601, test_score: 0.1871069173521844\n", + "# #  18/? [00:03<00:00,  5.37it/s]\n", + "# #  18/? [00:02<00:00,  7.88it/s]\n", + "\n", + "# 20.000\n", + "# # 100%\n", + "# #  2/2 [05:22<00:00, 161.87s/it]\n", + "# # Calculating split 1 of 2\n", + "# # start_feature_index: 0, end_feature_index: 256\n", + "# # 100%\n", + "# #  211/211 [00:27<00:00, 13.28it/s]\n", + "# # 100%\n", + "# #  8/8 [00:12<00:00,  1.27it/s]\n", + "# # Starting ridge regression for split 1\n", + "# # Finished, now scoring\n", + "# # train_score: 0.4046410458211125, test_score: 0.18916135958044172\n", + "# #  18/? [00:03<00:00,  5.01it/s]\n", + "# #  18/? [00:02<00:00,  6.18it/s]\n", + "# # Calculating split 2 of 2\n", + "# # start_feature_index: 256, end_feature_index: 512\n", + "# # 100%\n", + "# #  211/211 [00:26<00:00, 12.82it/s]\n", + "# # 100%\n", + "# #  8/8 [00:13<00:00,  1.13it/s]\n", + "# # Starting ridge regression for split 2\n", + "# # Finished, now scoring\n", + "# # train_score: 0.4030907987701695, test_score: 0.18653935361366922\n", + "# #  18/? [00:02<00:00,  7.51it/s]\n", + "# #  18/? [00:01<00:00,  8.18it/s]" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "4e523bf2-6f6a-44f2-a2bb-464d5338b7a9", + "metadata": {}, + "outputs": [], + "source": [ + "# 30.000 0.33\n", + "# 1672 30" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "mindeye", + "language": "python", + "name": "mindeye" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.10" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/spurious_reconstruction/analysis/1_case_study/feature-decoding/.ipynb_checkpoints/RR_sklearn-checkpoint.py b/spurious_reconstruction/analysis/1_case_study/feature-decoding/.ipynb_checkpoints/RR_sklearn-checkpoint.py new file mode 100644 index 0000000000000000000000000000000000000000..528752dbafe9688f3e009d086e3b68c2df25fc60 --- /dev/null +++ b/spurious_reconstruction/analysis/1_case_study/feature-decoding/.ipynb_checkpoints/RR_sklearn-checkpoint.py @@ -0,0 +1,403 @@ +#!/usr/bin/env python +# coding: utf-8 + +# In[25]: + + +# Import packages and setup gpu configuration. +# This code block shouldnt need to be adjusted! +import os +import sys +import json +import yaml +import numpy as np +import copy +import math +import time +import random +from tqdm.auto import tqdm +import matplotlib.pyplot as plt + +import torch +import torch.nn as nn +from torchvision import transforms +import h5py +import utils +# here we import ridge regression from sklearn + +from sklearn.linear_model import Ridge + +# tf32 data type is faster than standard float32 +torch.backends.cuda.matmul.allow_tf32 = True +# following fixes a Conv3D CUDNN_NOT_SUPPORTED error +torch.backends.cudnn.benchmark = True + + +# outdir = os.path.abspath(f'checkpoints/{model_name}') +outdir = os.path.abspath(f'./decoding_sklearn') +os.makedirs(outdir, exist_ok=True) + + +# take the current features as the first argument of the script otherwise take the first feature +current_feature = sys.argv[1] if len(sys.argv) > 1 else 'features[0]' + + + +if utils.is_interactive(): + # Following allows you to change functions in models.py or utils.py and + # have this notebook automatically update with your revisions + get_ipython().run_line_magic('load_ext', 'autoreload') + get_ipython().run_line_magic('autoreload', '2') + + +save_ckpt = False + + +print("PID of this process =",os.getpid()) +seed = 42 +utils.seed_everything(seed) +data_type = torch.float32 +device = torch.device('cuda' if torch.cuda.is_available() else 'cpu') + + +# In[11]: + + +# load the feature_encoder + +from bdpy.dl.torch.models import VGG19, layer_map, model_factory +from bdpy.recon.torch.modules import build_encoder, build_generator, TargetNormalizedMSE +from bdpy.dl.torch.domain import Domain, image_domain, ComposedDomain + +all_features = ['features[0]', 'features[2]', 'features[5]', 'features[7]', 'features[10]', 'features[12]', 'features[14]', 'features[16]', 'features[19]', 'features[21]', 'features[23]', 'features[25]', 'features[28]', 'features[30]', 'features[32]', 'features[34]', 'classifier[0]', 'classifier[3]', 'classifier[6]'] + +feature_network = VGG19() + +feature_network.load_state_dict(torch.load('/weka/proj-fmri/ckadirt/spurious_reconstruction/analysis/VGG_ILSVRC_19_layers/VGG_ILSVRC_19_layers.pt')) +encoder = feature_network.to(device) + +# encoder.eval() +# for param in encoder.parameters(): +# param.requires_grad = True + +# # Define feature extractor +# class EncoderFeatureExtractor(nn.Module): +# def __init__(self, encoder, target_layers): +# super(EncoderFeatureExtractor, self).__init__() +# self.encoder = encoder +# self.target_layers = target_layers +# self.features_layers = list(self.encoder.features.children()) +# self.classifier_layers = list(self.encoder.classifier.children()) + +# def forward(self, x): +# outputs = {} + +# for idx, layer in enumerate(self.features_layers): +# x = layer(x) +# layer_name = f'features[{idx}]' +# if layer_name in self.target_layers: +# outputs[layer_name] = x + +# if 'avgpool' in self.target_layers: +# x = self.encoder.avgpool(x) +# outputs['avgpool'] = x +# else: +# x = self.encoder.avgpool(x) + +# x = torch.flatten(x, 1) + +# for idx, layer in enumerate(self.classifier_layers): +# x = layer(x) +# layer_name = f'classifier[{idx}]' +# if layer_name in self.target_layers: +# outputs[layer_name] = x + +# return outputs + +# if features == 'all': +# feature_extractor = EncoderFeatureExtractor(encoder, target_layers=all_features) +# else: +# feature_extractor = EncoderFeatureExtractor(encoder, target_layers=features) + +if current_features == 'all': + layer_names = all_features +else: + layer_names = [current_features] + + +encoder = build_encoder(feature_network, layer_names, + domain= ComposedDomain([image_domain.BdPyVGGDomain(device=device,dtype=data_type), + image_domain.FixedResolutionDomain((224, 224))]), + ) + + +# In[12]: + + +# this is the number of ridge regression splits to perform bcz of memory constraints +num_split = 64 +data_path = '/weka/proj-medarc/shared/mindeyev2_dataset/' +num_sessions = 40 +multi_subject = False +subj = 1 + + +# In[13]: + + +f_betas = h5py.File(f'{data_path}/betas_all_subj0{subj}_fp32_renorm.hdf5', 'r') +print("loading_betas") +betas = f_betas['betas'][:] +betas = torch.from_numpy(betas).to("cpu") +print("betas_ loaded") +x_train, valid_nsd_ids_train, x_test, test_nsd_ids = utils.load_nsd(subject=subj, betas=betas, data_path=data_path) + + +# In[14]: + + +f_images = h5py.File(f'{data_path}/coco_images_224_float16.hdf5', 'r') +images = f_images['images'] + + +images = torch.Tensor(images[:]) +print("Loaded all 73k possible NSD images to cpu!", images.shape) + + +# In[36]: + + +from torch.utils.data import Dataset, DataLoader + +class RRDataset(Dataset): + def __init__(self, x, valid_nsd_ids): + self.x = x + self.valid_nsd_ids = valid_nsd_ids + + def __len__(self): + return len(self.x) + + def __getitem__(self, idx): + betas = self.x[idx] + nsd_id = self.valid_nsd_ids[idx] + c_image = images[nsd_id] + return betas, c_image, nsd_id + +batch_size = 128 + +train_dataset = RRDataset(x_train, valid_nsd_ids_train) +train_loader = DataLoader(train_dataset, batch_size=batch_size, shuffle=False, num_workers=4) + +test_dataset = RRDataset(x_test, test_nsd_ids) +test_loader = DataLoader(test_dataset, batch_size=batch_size, shuffle=False, num_workers=4) + + +# In[40]: + + +# Define for the RR subdivision +splits_per_layer = { + 'features[0]': 32, + 'features[2]': 32, + 'features[5]': 16, + 'features[7]': 16, + 'features[10]': 8, + 'features[12]': 8, + 'features[14]': 8, + 'features[16]': 8, + 'features[19]': 4, + 'features[21]': 4, + 'features[23]': 4, + 'features[25]': 4, + 'features[28]': 2, + 'features[30]': 2, + 'features[32]': 2, + 'features[34]': 2, + 'classifier[0]': 1, + 'classifier[3]': 1, + 'classifier[6]': 1, +} + +layer_sizes = { + 'features[0]': 64, + 'features[2]': 64, + 'features[5]': 128, + 'features[7]': 128, + 'features[10]': 256, + 'features[12]': 256, + 'features[14]': 256, + 'features[16]': 256, + 'features[19]': 512, + 'features[21]': 512, + 'features[23]': 512, + 'features[25]': 512, + 'features[28]': 512, + 'features[30]': 512, + 'features[32]': 512, + 'features[34]': 512, + 'classifier[0]': 4096, + 'classifier[3]': 4096, + 'classifier[6]': 1000, +} + +features_shapes = { + 'features[0]': (64, 224, 224), + 'features[2]': (64, 224, 224), + 'features[5]': (128, 112, 112), + 'features[7]': (128, 112, 112), + 'features[10]': (256, 56, 56), + 'features[12]': (256, 56, 56), + 'features[14]': (256, 56, 56), + 'features[16]': (256, 56, 56), + 'features[19]': (512, 28, 28), + 'features[21]': (512, 28, 28), + 'features[23]': (512, 28, 28), + 'features[25]': (512, 28, 28), + 'features[28]': (512, 14, 14), + 'features[30]': (512, 14, 14), + 'features[32]': (512, 14, 14), + 'features[34]': (512, 14, 14), + 'classifier[0]': (4096,), + 'classifier[3]': (4096,), + 'classifier[6]': (1000,), +} + + +# In[70]: + + +feature_extractor = feature_extractor.to(device) +feature_extractor.eval() +def get_numpy_subset_of_features(train_loader, test_loader, feature_extractor, current_features, current_split): + # check that the num_split is less than the splits_per_layer + assert current_split <= splits_per_layer[current_features], "num_split is greater than splits_per_layer" + + size_of_features_for_split = math.ceil(layer_sizes[current_features] / splits_per_layer[current_features]) + start_feature_index = size_of_features_for_split * (current_split - 1) + end_feature_index = size_of_features_for_split * current_split + print(f"start_feature_index: {start_feature_index}, end_feature_index: {end_feature_index}") + with torch.no_grad(): + if current_features in ['classifier[0]', 'classifier[3]', 'classifier[6]']: + train_features = np.zeros(tuple([len(train_loader.dataset)] + [size_of_features_for_split])).astype(np.float32) + test_features = np.zeros(tuple([len(test_loader.dataset)] + [size_of_features_for_split])).astype(np.float32) + else: + train_features = np.zeros(tuple([len(train_loader.dataset)] + [size_of_features_for_split] + list(features_shapes[current_features][1:]))).astype(np.float32) + test_features = np.zeros(tuple([len(test_loader.dataset)] + [size_of_features_for_split] + list(features_shapes[current_features][1:]))).astype(np.float32) + + for i, (betas, c_image, nsd_id) in enumerate(tqdm(train_loader)): + c_image = c_image.to(device) + features = feature_extractor(c_image) + train_features[i * batch_size:features[current_features].shape[0] + i * batch_size] = features[current_features][:, start_feature_index:end_feature_index].cpu().numpy() + + for i, (betas, c_image, nsd_id) in enumerate(tqdm(test_loader)): + c_image = c_image.to(device) + features = feature_extractor(c_image) + test_features[i * batch_size:features[current_features].shape[0] + i * batch_size] = features[current_features][:, start_feature_index:end_feature_index].cpu().numpy() + + + return train_features, test_features + + +# In[42]: + + +# train_features, test_features = get_numpy_subset_of_features(train_loader, test_loader, feature_extractor, current_features, 1) + + +# In[60]: + + +imagery_data_path = '/weka/proj-medarc/shared/umn-imagery' +# load nsd_imagery_data +voxels_vision, all_images_vision = utils.load_nsd_mental_imagery(subject=subj, mode='vision', stimtype="all", average=False, nest=True, data_root=imagery_data_path) +voxels_imagery, all_images_imagery = utils.load_nsd_mental_imagery(subject=subj, mode='imagery', stimtype="all", average=False, nest=True, data_root=imagery_data_path) + + +# In[ ]: + + +outdir_for_feature = os.path.join(outdir, current_features) +os.makedirs(outdir_for_feature, exist_ok=True) + +# iterate over the splits +for calc_rn_split in tqdm(range(1,splits_per_layer[current_features]+1)): + print(f"Calculating split {calc_rn_split} of {splits_per_layer[current_features]}") + train_features, test_features = get_numpy_subset_of_features(train_loader, test_loader, feature_extractor, current_features, calc_rn_split) + size_of_features_for_split = math.ceil(layer_sizes[current_features] / splits_per_layer[current_features]) + + print(f"Starting ridge regression for split {calc_rn_split}") + ridge = Ridge(alpha=10000) + ridge.fit(x_train.reshape(x_train.shape[0], -1), train_features.reshape(train_features.shape[0], -1)) + print(f"Finished, now scoring") + train_score = ridge.score(x_train.reshape(x_train.shape[0], -1), train_features.reshape(train_features.shape[0], -1)) + test_score = ridge.score(x_test.reshape(x_test.shape[0], -1), test_features.reshape(test_features.shape[0], -1)) + print(f"train_score: {train_score}, test_score: {test_score}") + + if current_features in ['classifier[0]', 'classifier[3]', 'classifier[6]']: + target_feature_shape = (size_of_features_for_split,) + else: + target_feature_shape = (size_of_features_for_split,) + tuple(features_shapes[current_features][1:]) + + # save the scores + with open(f'{outdir_for_feature}/ridge_scores_{current_features}_{calc_rn_split}.json', 'w') as f: + json.dump({'train_score': train_score, 'test_score': test_score}, f) + # save the weights + if save_ckpt: + np.save(f'{outdir_for_feature}/ridge_weights_{current_features}_{calc_rn_split}.npy', ridge.coef_) + # save the intercept + if save_ckpt: + np.save(f'{outdir_for_feature}/ridge_intercept_{current_features}_{calc_rn_split}.npy', ridge.intercept_) + + # save the test predictions + test_predictions = ridge.predict(x_test.reshape(x_test.shape[0], -1)) + np.save(f'{outdir_for_feature}/ridge_test_predictions_{current_features}_{calc_rn_split}.npy', test_predictions.reshape(tuple([test_predictions.shape[0]] + list(target_feature_shape)))) + + vision_preds = None + # get predictions for the imagery data: vision + for i, (voxel, image) in enumerate(tqdm(zip(voxels_vision, all_images_vision))): + voxel = voxel # 8, 15724 + pred = ridge.predict(voxel.cpu().numpy()) + + if vision_preds is None: + vision_preds = np.expand_dims(pred, axis=0) + else: + vision_preds = np.concatenate((vision_preds, np.expand_dims(pred, axis=0)), axis=0) + + np.save(f'{outdir_for_feature}/ridge_vision_preds_{current_features}_{calc_rn_split}.npy', vision_preds.reshape(tuple([vision_preds.shape[0]] + [vision_preds.shape[1]] + list(target_feature_shape)))) + + # get the predictions for the imagery data: imagery + imagery_preds = None + for i, (voxel, image) in enumerate(tqdm(zip(voxels_imagery, all_images_imagery))): + voxel = voxel # 8, 15724 + pred = ridge.predict(voxel.cpu().numpy()) + + if imagery_preds is None: + imagery_preds = np.expand_dims(pred, axis=0) + else: + imagery_preds = np.concatenate((imagery_preds, np.expand_dims(pred, axis=0)), axis=0) + + np.save(f'{outdir_for_feature}/ridge_imagery_preds_{current_features}_{calc_rn_split}.npy', imagery_preds.reshape(tuple([imagery_preds.shape[0]] + [imagery_preds.shape[1]] + list(target_feature_shape)))) + + # get the predictions for averaged imagery data: vision + vision_averaged_voxels = np.mean(np.array(voxels_vision), axis=1) + vision_averaged_preds = ridge.predict(vision_averaged_voxels) + np.save(f'{outdir_for_feature}/ridge_vision_averaged_preds_{current_features}_{calc_rn_split}.npy', vision_averaged_preds.reshape(tuple([vision_averaged_preds.shape[0]] + list(target_feature_shape)))) + + # get the predictions for averaged imagery data: imagery + imagery_averaged_voxels = np.mean(np.array(voxels_imagery), axis=1) + imagery_averaged_preds = ridge.predict(imagery_averaged_voxels) + np.save(f'{outdir_for_feature}/ridge_imagery_averaged_preds_{current_features}_{calc_rn_split}.npy', imagery_averaged_preds.reshape(tuple([imagery_averaged_preds.shape[0]] + list(target_feature_shape)))) + + +# In[68]: + + +# size_of_features_for_split = 2 +# rsp = test_predictions.reshape(tuple([test_predictions.shape[0]] + [size_of_features_for_split] + list(features_shapes[current_features][1:]))) + + +# In[69]: + + +# rsp.shape + diff --git a/spurious_reconstruction/analysis/1_case_study/feature-decoding/.ipynb_checkpoints/average_cv_train_feat-checkpoint.py b/spurious_reconstruction/analysis/1_case_study/feature-decoding/.ipynb_checkpoints/average_cv_train_feat-checkpoint.py new file mode 100644 index 0000000000000000000000000000000000000000..aff7109ff3616f9c921c19f044d005166b7c0f1e --- /dev/null +++ b/spurious_reconstruction/analysis/1_case_study/feature-decoding/.ipynb_checkpoints/average_cv_train_feat-checkpoint.py @@ -0,0 +1,259 @@ +'''DNN Feature decoding (corss-validation) training program''' + + +from __future__ import print_function + +from itertools import product +import os +import shutil +from time import time +import warnings +import argparse + +import bdpy +from bdpy.dataform import Features, save_array +from bdpy.distcomp import DistComp +from bdpy.ml import ModelTraining +from bdpy.ml.crossvalidation import make_cvindex_generator +from bdpy.util import makedir_ifnot +#from fastl2lir import FastL2LiR +import numpy as np +import yaml + + +# Main ####################################################################### + +def average_cv_train_feat( + fmri_data_files, + features_dir, + output_dir='./feature_decoding_cv', + rois_list=None, + num_voxel=None, + label_key=None, + cv_key='Run', + cv_folds=None, + cv_exclusive=None, + features_list=None, + feature_index_file=None, + excluded_labels=[], + alpha=100, + chunk_axis=1 +): + '''Cross-validation feature decoding. + + Input: + + - fmri_data_files + - features_dir + + Output: + + - output_dir + + Parameters: + + TBA + + Note: + + If Y.ndim >= 3, Y is divided into chunks along `chunk_axis`. + Note that Y[0] should be sample dimension. + ''' + + analysis_basename = os.path.splitext(os.path.basename(__file__))[0] + '-' + conf['__filename__'] + + features_list = features_list[::-1] # Start training from deep layers + + # Print info ------------------------------------------------------------- + print('Subjects: %s' % list(fmri_data_files.keys())) + print('ROIs: %s' % list(rois_list.keys())) + print('Target features: %s' % features_dir) + print('Layers: %s' % features_list) + print('CV: %s' % cv_key) + print('') + + # Load data -------------------------------------------------------------- + print('----------------------------------------') + print('Loading data') + + data_brain = { + sbj: bdpy.BData(dat_file[0]) + for sbj, dat_file in fmri_data_files.items() + } + + if feature_index_file is not None: + data_features = Features(os.path.join(features_dir), feature_index=feature_index_file) + else: + data_features = Features(os.path.join(features_dir)) + + # Initialize directories ------------------------------------------------- + makedir_ifnot(output_dir) + makedir_ifnot('tmp') + + # Save feature index ----------------------------------------------------- + if feature_index_file is not None: + feature_index_save_file = os.path.join(output_dir, 'feature_index.mat') + shutil.copy(feature_index_file, feature_index_save_file) + print('Saved %s' % feature_index_save_file) + + # Distributed computation setup ------------------------------------------ + distcomp_db = os.path.join('./tmp', analysis_basename + '.db') + distcomp = DistComp(backend='sqlite3', db_path=distcomp_db) + + # Analysis loop ---------------------------------------------------------- + print('----------------------------------------') + print('Analysis loop') + + upd_cv_folds = [] + for cv_fold in cv_folds: + if 'target' in cv_fold: + test_cv = cv_fold['target'] + else: + test_cv = cv_fold['test'] + upd_cv_fold = {'train': [test_cv[0] + 100], + 'test': test_cv} + upd_cv_folds.append(upd_cv_fold) + + + for feat, sbj, roi in product(features_list, fmri_data_files, rois_list): + print('--------------------') + print('Feature: %s' % feat) + print('Subject: %s' % sbj) + print('ROI: %s' % roi) + print('Num voxels: %d' % num_voxel[roi]) + + # Cross-validation setup + if cv_exclusive is not None: + cv_exclusive_array = data_brain[sbj].select(cv_exclusive) + else: + cv_exclusive_array = None + + cv_index = make_cvindex_generator( + data_brain[sbj].select(cv_key), + folds=upd_cv_folds, + exclusive=cv_exclusive_array + ) + + for icv, (train_index, test_index) in enumerate(cv_index): + print('CV fold: {} ({} training; {} test)'.format(icv + 1, len(train_index), len(test_index))) + + # Setup + # ----- + analysis_id = analysis_basename + '-' + sbj + '-' + roi + '-' + str(icv + 1) + '-' + feat + decoded_feature_dir = os.path.join(output_dir, feat, sbj, roi, 'cv-fold{}'.format(icv + 1), 'ave_decoded_features') + os.makedirs(decoded_feature_dir, exist_ok=True) + + # Preparing data + # -------------- + print('Preparing data') + + start_time = time() + + # Brain data + #x = data_brain[sbj].select(rois_list[roi]) # Brain data + x_labels = data_brain[sbj].get_label(label_key) # Labels + x_train_labels = np.array(x_labels)[train_index] + + + # Y index to sort Y by X (matching samples) + y_labels_unique = np.unique(x_train_labels) + y_train_unique = data_features.get(feat, label=y_labels_unique) # Target DNN features + y_train_ave = np.mean(y_train_unique, 0, keepdims=True) + # Save file name + save_file = os.path.join(decoded_feature_dir, f'cv_fold{icv+1}.mat') + + # Save + save_array(save_file, y_train_ave, key='feat', dtype=np.float32, sparse=False) + + + # # Brain data + # #x = data_brain[sbj].select(rois_list[roi]) # Brain data + # x_test_labels = np.array(x_labels)[test_index] + + + # # Y index to sort Y by X (matching samples) + # y_labels_unique_test = np.unique(x_test_labels) + # y_test_unique = data_features.get(feat, label=y_labels_unique_test) # Target DNN features + # y_test_ave = np.mean(y_test_unique, 0, keepdims=True) + # # Save file name + # save_file = os.path.join(decoded_feature_dir, f'test_cv_fold{icv+1}.mat') + # # Save + # save_array(save_file, y_test_ave, key='feat', dtype=np.float32, sparse=False) + + print('Elapsed time (data preparation): %f' % (time() - start_time)) + + + + print('%s finished.' % analysis_basename) + + return output_dir + + +# Entry point ################################################################ + +if __name__ == '__main__': + parser = argparse.ArgumentParser() + parser.add_argument( + 'conf', + type=str, + help='analysis configuration file', + ) + args = parser.parse_args() + + conf_file = args.conf + + with open(conf_file, 'r') as f: + conf = yaml.safe_load(f) + + conf.update({ + '__filename__': os.path.splitext(os.path.basename(conf_file))[0] + }) + + if 'analysis name' in conf: + feature_decoders_dir = os.path.join(conf['feature decoder dir'], 'foldwise_ave_feature', conf['analysis name'], conf['network']) + else: + feature_decoders_dir = os.path.join(conf['feature decoder dir'], 'foldwise_ave_feature', conf['network']) + + if 'feature index file' in conf: + feature_index_file = os.path.join( + conf['training feature dir'][0], + conf['network'], + conf['feature index file'] + ) + else: + feature_index_file = None + + if 'exclude test label' in conf: + excluded_labels = conf['exclude test label'] + else: + excluded_labels = [] + + if 'cv folds' in conf: + cv_folds = conf['cv folds'] + else: + cv_folds = None + + if 'cv exclusive key' in conf: + cv_exclusive = conf['cv exclusive key'] + else: + cv_exclusive = None + + average_cv_train_feat( + conf['fmri'], + os.path.join( + conf['feature dir'][0], + conf['network'] + ), + output_dir=feature_decoders_dir, + rois_list=conf['rois'], + num_voxel=conf['rois voxel num'], + label_key=conf['label key'], + cv_key=conf['cv key'], + cv_folds=cv_folds, + cv_exclusive=cv_exclusive, + features_list=conf['layers'], + feature_index_file=feature_index_file, + excluded_labels=excluded_labels, + alpha=conf['alpha'], + chunk_axis=conf['chunk axis'] + ) diff --git a/spurious_reconstruction/analysis/1_case_study/feature-decoding/.ipynb_checkpoints/decode_features-checkpoint.ipynb b/spurious_reconstruction/analysis/1_case_study/feature-decoding/.ipynb_checkpoints/decode_features-checkpoint.ipynb new file mode 100644 index 0000000000000000000000000000000000000000..3462e6e6fef11dc32c1c176b66ea17feff370083 --- /dev/null +++ b/spurious_reconstruction/analysis/1_case_study/feature-decoding/.ipynb_checkpoints/decode_features-checkpoint.ipynb @@ -0,0 +1,807 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "id": "3bb7a04d-1915-428a-a931-85d77d40c379", + "metadata": {}, + "outputs": [], + "source": [ + "from __future__ import print_function\n", + "\n", + "from itertools import product\n", + "import os\n", + "import shutil\n", + "from time import time\n", + "import warnings\n", + "import argparse\n", + "\n", + "import bdpy\n", + "from bdpy.dataform import Features, save_array\n", + "from bdpy.distcomp import DistComp\n", + "from bdpy.ml import ModelTraining\n", + "from bdpy.util import makedir_ifnot\n", + "from fastl2lir import FastL2LiR\n", + "import numpy as np\n", + "import yaml\n", + "import torch\n", + "import h5py" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "fe5a2900-ef2e-4b03-91a5-02861fd5ea7a", + "metadata": {}, + "outputs": [], + "source": [ + "def featdec_fastl2lir_train(\n", + " fmri_data_files,\n", + " features_dir,\n", + " output_dir='./feature_decoders',\n", + " rois_list=None, num_voxel=None, label_key=None,\n", + " features_list=None, feature_index_file=None,\n", + " alpha=100, chunk_axis=1\n", + "):\n", + " '''Feature decoder training.\n", + "\n", + " Input:\n", + "\n", + " - fmri_data_files\n", + " - features_dir\n", + "\n", + " Output:\n", + "\n", + " - output_dir\n", + "\n", + " Parameters:\n", + "\n", + " TBA\n", + "\n", + " Note:\n", + "\n", + " If Y.ndim >= 3, Y is divided into chunks along `chunk_axis`.\n", + " Note that Y[0] should be sample dimension.\n", + " '''\n", + "\n", + " analysis_basename = 'train' + '-' + conf['__filename__']\n", + "\n", + " features_list = features_list[::-1] # Start training from deep layers\n", + "\n", + " # Print info -------------------------------------------------------------\n", + " print('Subjects: %s' % list(fmri_data_files.keys()))\n", + " print('ROIs: %s' % list(rois_list.keys()))\n", + " print('Target features: %s' % features_dir)\n", + " print('Layers: %s' % features_list)\n", + " print('')\n", + "\n", + " # Load data --------------------------------------------------------------\n", + " print('----------------------------------------')\n", + " print('Loading data')\n", + "\n", + " # data_brain = {sbj: bdpy.BData(dat_file[0])\n", + " # for sbj, dat_file in fmri_data_files.items()}\n", + "\n", + " data_brain_path = f'betas_all_subj01.hdf5'\n", + " print(fmri_data_files)\n", + " s = 1\n", + " f = h5py.File(f'{fmri_data_files[\"nsd-01\"][0]}/betas_all_subj0{s}_fp32_renorm.hdf5', 'r')\n", + " betas = f['betas'][:]\n", + " \n", + " if feature_index_file is not None:\n", + " data_features = Features(os.path.join(features_dir), feature_index=feature_index_file)\n", + " else:\n", + " data_features = Features(os.path.join(features_dir))\n", + "\n", + " \n", + " # Initialize directories -------------------------------------------------\n", + " makedir_ifnot(output_dir)\n", + " makedir_ifnot('tmp')\n", + "\n", + " # Save feature index -----------------------------------------------------\n", + " if feature_index_file is not None:\n", + " feature_index_save_file = os.path.join(output_dir, 'feature_index.mat')\n", + " shutil.copy(feature_index_file, feature_index_save_file)\n", + " print('Saved %s' % feature_index_save_file)\n", + "\n", + " # Analysis loop ----------------------------------------------------------\n", + " print('----------------------------------------')\n", + " print('Analysis loop')\n", + "\n", + " # for a, b, c in product(features_list, fmri_data_files, rois_list):\n", + " # print(a,b,c)\n", + " \n", + " for feat, sbj, roi in product(features_list, fmri_data_files, rois_list):\n", + " print('--------------------')\n", + " print('Feature: %s' % feat)\n", + " print('Subject: %s' % sbj)\n", + " print('ROI: %s' % roi)\n", + " print('Num voxels: %d' % num_voxel[roi])\n", + "\n", + " # Setup\n", + " # -----\n", + " analysis_id = analysis_basename + '-' + sbj + '-' + roi + '-' + feat\n", + " results_dir = os.path.join(output_dir, feat, sbj, roi, 'model')\n", + " makedir_ifnot(results_dir)\n", + "\n", + " # Check whether the analysis has been done or not.\n", + " info_file = os.path.join(results_dir, 'info.yaml')\n", + " if os.path.exists(info_file):\n", + " with open(info_file, 'r') as f:\n", + " info = yaml.safe_load(f)\n", + " while info is None:\n", + " warnings.warn('Failed to load info from %s. Retrying...'\n", + " % info_file)\n", + " with open(info_file, 'r') as f:\n", + " info = yaml.safe_load(f)\n", + " if '_status' in info and 'computation_status' in info['_status']:\n", + " if info['_status']['computation_status'] == 'done':\n", + " print('%s is already done and skipped' % analysis_id)\n", + " continue\n", + "\n", + " # Preparing data\n", + " # --------------\n", + " print('Preparing data')\n", + "\n", + " start_time = time()\n", + "\n", + " # Brain data\n", + " # x = data_brain[sbj].select(rois_list[roi]) # Brain data\n", + " # x_labels = data_brain[sbj].get_label(label_key) # Labels\n", + "\n", + " # # Target features and image labels (file names)\n", + " # y_labels = np.unique(x_labels)\n", + " # y = data_features.get(feat, label=y_labels) # Target DNN features\n", + "\n", + " # # Use x that has a label included in y\n", + " # x = np.vstack([_x for _x, xl in zip(x, x_labels) if xl in y_labels])\n", + " # x_labels = [xl for xl in x_labels if xl in y_labels]\n", + "\n", + " x = betas\n", + " \n", + " yf = h5py.File(os.path.join(features_dir, feat, f'{s}.h5'), 'r')\n", + " y = yf['dataset'][:]\n", + "\n", + " print(y.shape)\n", + " print(x.shape)\n", + " print('Elapsed time (data preparation): %f' % (time() - start_time))\n", + "\n", + " # Calculate normalization parameters\n", + " # ----------------------------------\n", + "\n", + " # Normalize X (fMRI data)\n", + " x_mean = np.mean(x, axis=0)[np.newaxis, :] # np.newaxis was added to match Matlab outputs\n", + " x_norm = np.std(x, axis=0, ddof=1)[np.newaxis, :]\n", + "\n", + " # Normalize Y (DNN features)\n", + " y_mean = np.mean(y, axis=0)[np.newaxis, :]\n", + " y_norm = np.std(y, axis=0, ddof=1)[np.newaxis, :]\n", + "\n", + " # Y index to sort Y by X (matching samples)\n", + " # -----------------------------------------\n", + " y_index = np.array([np.where(np.array(y_labels) == xl) for xl in x_labels]).flatten()\n", + "\n", + " # Save normalization parameters\n", + " # -----------------------------\n", + " print('Saving normalization parameters.')\n", + " norm_param = {'x_mean': x_mean, 'y_mean': y_mean,\n", + " 'x_norm': x_norm, 'y_norm': y_norm}\n", + " save_targets = [u'x_mean', u'y_mean', u'x_norm', u'y_norm']\n", + " for sv in save_targets:\n", + " save_file = os.path.join(results_dir, sv + '.mat')\n", + " if not os.path.exists(save_file):\n", + " try:\n", + " save_array(save_file, norm_param[sv], key=sv, dtype=np.float32, sparse=False)\n", + " print('Saved %s' % save_file)\n", + " except Exception:\n", + " warnings.warn('Failed to save %s. Possibly double running.' % save_file)\n", + "\n", + " # Preparing learning\n", + " # ------------------\n", + " model = FastL2LiR()\n", + " model_param = {'alpha': alpha,\n", + " 'n_feat': num_voxel[roi],\n", + " 'dtype': np.float32}\n", + "\n", + " # Distributed computation setup\n", + " # -----------------------------\n", + " makedir_ifnot('./tmp')\n", + " distcomp_db = os.path.join('./tmp', analysis_basename + '.db')\n", + " distcomp = DistComp(backend='sqlite3', db_path=distcomp_db)\n", + "\n", + " # Model training\n", + " # --------------\n", + " print('Model training')\n", + " start_time = time()\n", + "\n", + " train = ModelTraining(model, x, y)\n", + " train.id = analysis_basename + '-' + sbj + '-' + roi + '-' + feat\n", + " train.model_parameters = model_param\n", + "\n", + " train.X_normalize = {'mean': x_mean,\n", + " 'std': x_norm}\n", + " train.Y_normalize = {'mean': y_mean,\n", + " 'std': y_norm}\n", + " train.Y_sort = {'index': y_index}\n", + "\n", + " train.dtype = np.float32\n", + " train.chunk_axis = chunk_axis\n", + " train.save_format = 'bdmodel'\n", + " train.save_path = results_dir\n", + " train.distcomp = distcomp\n", + "\n", + " train.run()\n", + "\n", + " print('Total elapsed time (model training): %f' % (time() - start_time))\n", + "\n", + " print('%s finished.' % analysis_basename)\n", + "\n", + " return output_dir\n" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "id": "7715c7bb-6d3e-41f1-a533-b1197c6c794f", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "/weka/proj-medarc/shared/mindeyev2_dataset//wds/subj01/train/{0..39}.tar\n", + "/weka/proj-medarc/shared/mindeyev2_dataset//wds/subj01/new_test/0.tar\n", + "Loaded test dl for subj1!\n", + "\n" + ] + }, + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "3c736abd5c904b588a9fd6eef9085fac", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "0it [00:00, ?it/s]" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "a93ef97d0ebc4ff5aea1f53a9440b45c", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "0it [00:00, ?it/s]" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "import webdataset as wds\n", + "import random\n", + "from tqdm.auto import tqdm\n", + "\n", + "def my_split_by_node(urls): return urls\n", + "data_path = '/weka/proj-medarc/shared/mindeyev2_dataset/'\n", + "subj_list = [1]\n", + "num_sessions = 40\n", + "multi_subject = False\n", + "batch_size = 1\n", + "data_type = torch.float16\n", + "subj = 1\n", + "\n", + "train_data = {}\n", + "train_dl = {}\n", + "num_voxels = {}\n", + "voxels = {}\n", + "\n", + "train_url = f\"{data_path}/wds/subj0{subj}/train/\" + \"{0..\" + f\"{num_sessions-1}\" + \"}.tar\"\n", + "print(train_url)\n", + "\n", + "train_data = wds.WebDataset(train_url,resampled=False,nodesplitter=my_split_by_node)\\\n", + " .decode(\"torch\")\\\n", + " .rename(behav=\"behav.npy\", past_behav=\"past_behav.npy\", future_behav=\"future_behav.npy\", olds_behav=\"olds_behav.npy\")\\\n", + " .to_tuple(*[\"behav\", \"past_behav\", \"future_behav\", \"olds_behav\"])\n", + "train_dl = torch.utils.data.DataLoader(train_data, batch_size=batch_size, shuffle=False, drop_last=False, pin_memory=True)\n", + "\n", + "# f = h5py.File(f'{data_path}/betas_all_subj0{s}_fp32_renorm.hdf5', 'r')\n", + "# betas = f['betas'][:]\n", + "# betas = torch.Tensor(betas).to(\"cpu\").to(data_type)\n", + "# num_voxels_list.append(betas[0].shape[-1])\n", + "# num_voxels[f'subj0{s}'] = betas[0].shape[-1]\n", + "# voxels[f'subj0{s}'] = betas\n", + "# print(f\"num_voxels for subj0{s}: {num_voxels[f'subj0{s}']}\")\n", + "\n", + "\n", + "num_test=3000\n", + "test_url = f\"{data_path}/wds/subj0{subj}/new_test/\" + \"0.tar\"\n", + "print(test_url)\n", + "test_data = wds.WebDataset(test_url,resampled=False,nodesplitter=my_split_by_node)\\\n", + " .decode(\"torch\")\\\n", + " .rename(behav=\"behav.npy\", past_behav=\"past_behav.npy\", future_behav=\"future_behav.npy\", olds_behav=\"olds_behav.npy\")\\\n", + " .to_tuple(*[\"behav\", \"past_behav\", \"future_behav\", \"olds_behav\"])\n", + "test_dl = torch.utils.data.DataLoader(test_data, batch_size=1, shuffle=False, drop_last=True, pin_memory=True)\n", + "print(f\"Loaded test dl for subj{subj}!\\n\")\n", + "\n", + "all_indexes_train = []\n", + "all_betas_train = []\n", + "\n", + "for behav0, past_behav0, future_behav0, old_behav0 in tqdm(train_dl):\n", + " img_idx = behav0[:,0,0].cpu().long().numpy()[0]\n", + " betas_idx = behav0[:,0,5].cpu().long().numpy()[0]\n", + " all_indexes_train.append(img_idx)\n", + " all_betas_train.append(betas_idx)\n", + "\n", + "all_indexes_test = []\n", + "all_betas_test = []\n", + "\n", + "for behav0, past_behav0, future_behav0, old_behav0 in tqdm(test_dl):\n", + " img_idx = behav0[:,0,0].cpu().long().numpy()[0]\n", + " betas_idx = behav0[:,0,5].cpu().long().numpy()[0]\n", + " all_indexes_test.append(img_idx)\n", + " all_betas_test.append(betas_idx)" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "id": "d2d1c060-6892-4d23-b131-969c35425087", + "metadata": {}, + "outputs": [], + "source": [ + "all_indexes_to_compute = set(all_indexes_train + list(set(all_indexes_test)))\n", + "all_indexes_to_compute = list(all_indexes_to_compute)" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "f3eb5455-bc9c-4b80-84bd-5f69ff6c93e5", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "10000" + ] + }, + "execution_count": 5, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "len(all_indexes_to_compute)" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "id": "58eea517-0188-4270-a21f-df2a166194fd", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "loading_betas\n", + "betas_ loaded\n" + ] + } + ], + "source": [ + "import utils\n", + "f = h5py.File(f'{data_path}/betas_all_subj0{subj}_fp32_renorm.hdf5', 'r')\n", + "print(\"loading_betas\")\n", + "betas = f['betas'][:]\n", + "betas = torch.from_numpy(betas).to(\"cpu\")\n", + "print(\"betas_ loaded\")\n", + "x_train, valid_nsd_ids_train, x_test, test_nsd_ids = utils.load_nsd(subject=subj, betas=betas, data_path=data_path)" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "id": "9b492d47-ac12-47d2-a1c5-718923340385", + "metadata": {}, + "outputs": [], + "source": [ + "# Define the path to your configuration YAML file\n", + "conf_file = 'config/nsd-37ses_func1pt8mm_betas_fithrf_GLMdenoise_RR_testshared1000_trainnoave_testave_fastl2lir_a100_vgg19_allunits.yaml' # Replace with your actual config file path\n", + "\n", + "# Load the configuration\n", + "with open(conf_file, 'r') as f:\n", + " conf = yaml.safe_load(f)\n", + "\n", + "conf.update({\n", + " '__filename__': os.path.splitext(os.path.basename(conf_file))[0]\n", + "})\n", + "\n", + "if 'analysis name' in conf:\n", + " feature_decoders_dir = os.path.join(conf['feature decoder dir'], conf['analysis name'], conf['network'])\n", + "else:\n", + " feature_decoders_dir = os.path.join(conf['feature decoder dir'], conf['network'])\n", + "\n", + "if 'feature index file' in conf:\n", + " feature_index_file = os.path.join(\n", + " conf['training feature dir'][0],\n", + " conf['network'],\n", + " conf['feature index file']\n", + " )\n", + "else:\n", + " feature_index_file = None" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "id": "ec23d0bd-f4f8-412d-8890-558c064ceb46", + "metadata": {}, + "outputs": [], + "source": [ + "features_dir=os.path.join(\n", + " conf['training feature dir'][0],\n", + " conf['network']\n", + " )\n", + "yf = h5py.File(os.path.join(features_dir, 'features[0]', f'{1}.h5'), 'r')\n", + "features = yf['dataset']\n", + "# features = torch.from_numpy(features).to(\"cpu\")" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "id": "f9ce9d84-6f77-408c-9257-fe7b4ef015c2", + "metadata": {}, + "outputs": [], + "source": [ + "y_train = torch.zeros((len(x_train),)+ features.shape[1:], dtype = torch.float16)" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "id": "365a2465-f7c8-4c47-8a03-8b64392578a5", + "metadata": {}, + "outputs": [ + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "d0e33befe26a4f4b81b8c5cab7b4d594", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + " 0%| | 0/27000 [00:00 27\u001b[0m output_directory \u001b[38;5;241m=\u001b[39m \u001b[43mfeatdec_fastl2lir_train\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 28\u001b[0m \u001b[43m \u001b[49m\u001b[43mfmri_data_files\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mconf\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mtraining fmri\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m]\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 29\u001b[0m \u001b[43m \u001b[49m\u001b[43mfeatures_dir\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mos\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mpath\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mjoin\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 30\u001b[0m \u001b[43m \u001b[49m\u001b[43mconf\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mtraining feature dir\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m]\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;241;43m0\u001b[39;49m\u001b[43m]\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 31\u001b[0m \u001b[43m \u001b[49m\u001b[43mconf\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mnetwork\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m]\u001b[49m\n\u001b[1;32m 32\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 33\u001b[0m \u001b[43m \u001b[49m\u001b[43moutput_dir\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mfeature_decoders_dir\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 34\u001b[0m \u001b[43m \u001b[49m\u001b[43mrois_list\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mconf\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mrois\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m]\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 35\u001b[0m \u001b[43m \u001b[49m\u001b[43mnum_voxel\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mconf\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mrois voxel num\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m]\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 36\u001b[0m \u001b[43m \u001b[49m\u001b[43mlabel_key\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mconf\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mlabel key\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m]\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 37\u001b[0m \u001b[43m \u001b[49m\u001b[43mfeatures_list\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mconf\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mlayers\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m]\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 38\u001b[0m \u001b[43m \u001b[49m\u001b[43mfeature_index_file\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mfeature_index_file\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 39\u001b[0m \u001b[43m \u001b[49m\u001b[43malpha\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mconf\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43malpha\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m]\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 40\u001b[0m \u001b[43m \u001b[49m\u001b[43mchunk_axis\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mconf\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mchunk axis\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m]\u001b[49m\n\u001b[1;32m 41\u001b[0m \u001b[43m)\u001b[49m\n\u001b[1;32m 43\u001b[0m \u001b[38;5;28mprint\u001b[39m(\u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mFeature decoders trained and saved to: \u001b[39m\u001b[38;5;132;01m{\u001b[39;00moutput_directory\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m\"\u001b[39m)\n", + "Cell \u001b[0;32mIn[49], line 141\u001b[0m, in \u001b[0;36mfeatdec_fastl2lir_train\u001b[0;34m(fmri_data_files, features_dir, output_dir, rois_list, num_voxel, label_key, features_list, feature_index_file, alpha, chunk_axis)\u001b[0m\n\u001b[1;32m 139\u001b[0m \u001b[38;5;66;03m# Normalize Y (DNN features)\u001b[39;00m\n\u001b[1;32m 140\u001b[0m y_mean \u001b[38;5;241m=\u001b[39m np\u001b[38;5;241m.\u001b[39mmean(y, axis\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m0\u001b[39m)[np\u001b[38;5;241m.\u001b[39mnewaxis, :]\n\u001b[0;32m--> 141\u001b[0m y_norm \u001b[38;5;241m=\u001b[39m \u001b[43mnp\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mstd\u001b[49m\u001b[43m(\u001b[49m\u001b[43my\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43maxis\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;241;43m0\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mddof\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;241;43m1\u001b[39;49m\u001b[43m)\u001b[49m[np\u001b[38;5;241m.\u001b[39mnewaxis, :]\n\u001b[1;32m 143\u001b[0m \u001b[38;5;66;03m# Y index to sort Y by X (matching samples)\u001b[39;00m\n\u001b[1;32m 144\u001b[0m \u001b[38;5;66;03m# -----------------------------------------\u001b[39;00m\n\u001b[1;32m 145\u001b[0m y_index \u001b[38;5;241m=\u001b[39m np\u001b[38;5;241m.\u001b[39marray([np\u001b[38;5;241m.\u001b[39mwhere(np\u001b[38;5;241m.\u001b[39marray(y_labels) \u001b[38;5;241m==\u001b[39m xl) \u001b[38;5;28;01mfor\u001b[39;00m xl \u001b[38;5;129;01min\u001b[39;00m x_labels])\u001b[38;5;241m.\u001b[39mflatten()\n", + "File \u001b[0;32m~/mindeye/lib/python3.11/site-packages/numpy/core/fromnumeric.py:3645\u001b[0m, in \u001b[0;36mstd\u001b[0;34m(a, axis, dtype, out, ddof, keepdims, where)\u001b[0m\n\u001b[1;32m 3642\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 3643\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m std(axis\u001b[38;5;241m=\u001b[39maxis, dtype\u001b[38;5;241m=\u001b[39mdtype, out\u001b[38;5;241m=\u001b[39mout, ddof\u001b[38;5;241m=\u001b[39mddof, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs)\n\u001b[0;32m-> 3645\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43m_methods\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_std\u001b[49m\u001b[43m(\u001b[49m\u001b[43ma\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43maxis\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43maxis\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mdtype\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mdtype\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mout\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mout\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mddof\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mddof\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 3646\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n", + "File \u001b[0;32m~/mindeye/lib/python3.11/site-packages/numpy/core/_methods.py:206\u001b[0m, in \u001b[0;36m_std\u001b[0;34m(a, axis, dtype, out, ddof, keepdims, where)\u001b[0m\n\u001b[1;32m 204\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21m_std\u001b[39m(a, axis\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mNone\u001b[39;00m, dtype\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mNone\u001b[39;00m, out\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mNone\u001b[39;00m, ddof\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m0\u001b[39m, keepdims\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mFalse\u001b[39;00m, \u001b[38;5;241m*\u001b[39m,\n\u001b[1;32m 205\u001b[0m where\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mTrue\u001b[39;00m):\n\u001b[0;32m--> 206\u001b[0m ret \u001b[38;5;241m=\u001b[39m \u001b[43m_var\u001b[49m\u001b[43m(\u001b[49m\u001b[43ma\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43maxis\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43maxis\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mdtype\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mdtype\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mout\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mout\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mddof\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mddof\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 207\u001b[0m \u001b[43m \u001b[49m\u001b[43mkeepdims\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mkeepdims\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mwhere\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mwhere\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 209\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(ret, mu\u001b[38;5;241m.\u001b[39mndarray):\n\u001b[1;32m 210\u001b[0m ret \u001b[38;5;241m=\u001b[39m um\u001b[38;5;241m.\u001b[39msqrt(ret, out\u001b[38;5;241m=\u001b[39mret)\n", + "File \u001b[0;32m~/mindeye/lib/python3.11/site-packages/numpy/core/_methods.py:152\u001b[0m, in \u001b[0;36m_var\u001b[0;34m(a, axis, dtype, out, ddof, keepdims, where)\u001b[0m\n\u001b[1;32m 147\u001b[0m dtype \u001b[38;5;241m=\u001b[39m mu\u001b[38;5;241m.\u001b[39mdtype(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mf8\u001b[39m\u001b[38;5;124m'\u001b[39m)\n\u001b[1;32m 149\u001b[0m \u001b[38;5;66;03m# Compute the mean.\u001b[39;00m\n\u001b[1;32m 150\u001b[0m \u001b[38;5;66;03m# Note that if dtype is not of inexact type then arraymean will\u001b[39;00m\n\u001b[1;32m 151\u001b[0m \u001b[38;5;66;03m# not be either.\u001b[39;00m\n\u001b[0;32m--> 152\u001b[0m arrmean \u001b[38;5;241m=\u001b[39m \u001b[43mumr_sum\u001b[49m\u001b[43m(\u001b[49m\u001b[43marr\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43maxis\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mdtype\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mkeepdims\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43;01mTrue\u001b[39;49;00m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mwhere\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mwhere\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 153\u001b[0m \u001b[38;5;66;03m# The shape of rcount has to match arrmean to not change the shape of out\u001b[39;00m\n\u001b[1;32m 154\u001b[0m \u001b[38;5;66;03m# in broadcasting. Otherwise, it cannot be stored back to arrmean.\u001b[39;00m\n\u001b[1;32m 155\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m rcount\u001b[38;5;241m.\u001b[39mndim \u001b[38;5;241m==\u001b[39m \u001b[38;5;241m0\u001b[39m:\n\u001b[1;32m 156\u001b[0m \u001b[38;5;66;03m# fast-path for default case when where is True\u001b[39;00m\n", + "\u001b[0;31mKeyboardInterrupt\u001b[0m: " + ] + } + ], + "source": [ + "\n", + "\n", + "# Start training\n", + "output_directory = featdec_fastl2lir_train(\n", + " fmri_data_files=conf['training fmri'],\n", + " features_dir=os.path.join(\n", + " conf['training feature dir'][0],\n", + " conf['network']\n", + " ),\n", + " output_dir=feature_decoders_dir,\n", + " rois_list=conf['rois'],\n", + " num_voxel=conf['rois voxel num'],\n", + " label_key=conf['label key'],\n", + " features_list=conf['layers'],\n", + " feature_index_file=feature_index_file,\n", + " alpha=conf['alpha'],\n", + " chunk_axis=conf['chunk axis']\n", + ")\n", + "\n", + "print(f\"Feature decoders trained and saved to: {output_directory}\")\n" + ] + }, + { + "cell_type": "code", + "execution_count": 62, + "id": "6101d9b4-ba46-4f95-967b-372a5844efb5", + "metadata": {}, + "outputs": [], + "source": [ + "features_dir=os.path.join(\n", + " conf['training feature dir'][0],\n", + " conf['network']\n", + " )\n", + "yf = h5py.File(os.path.join(features_dir, 'features[2]', f'{1}.h5'), 'r')\n", + "features = yf['dataset']" + ] + }, + { + "cell_type": "code", + "execution_count": 64, + "id": "b4726cee-484d-4046-8923-6ef4513a575a", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([[[ 2.1348e+00, 1.8594e+00, 1.7734e+00, ..., 2.1816e+00,\n", + " 1.7783e+00, 7.6025e-01],\n", + " [ 3.8633e+00, 2.1602e+00, 2.3047e+00, ..., 4.2539e+00,\n", + " 3.1465e+00, 1.6113e+00],\n", + " [ 2.7500e+00, 3.8306e-01, 5.7080e-01, ..., 1.2881e+00,\n", + " -4.7827e-01, -1.0527e+00],\n", + " ...,\n", + " [ 2.6416e-01, -6.8896e-01, -1.3789e+00, ..., -1.1973e+00,\n", + " -9.8242e-01, -1.6687e-01],\n", + " [ 3.2129e+00, 3.5703e+00, 1.6211e+00, ..., 4.2773e-01,\n", + " 1.9104e-01, 8.0957e-01],\n", + " [ 4.0469e+00, 4.0078e+00, 2.3105e+00, ..., 1.1641e+00,\n", + " 6.6895e-01, 9.6484e-01]],\n", + "\n", + " [[-1.5557e+00, -2.6328e+00, -2.1309e+00, ..., -2.1445e+00,\n", + " -1.8594e+00, -2.3516e+00],\n", + " [-6.0352e-01, -1.1729e+00, -5.9033e-01, ..., -9.4727e-01,\n", + " -8.2324e-01, -1.8555e+00],\n", + " [-7.2363e-01, -1.0186e+00, -4.2261e-01, ..., -1.4248e+00,\n", + " -1.6514e+00, -2.4707e+00],\n", + " ...,\n", + " [-1.0625e+00, -2.0586e+00, -1.9531e+00, ..., -1.6943e+00,\n", + " -1.7754e+00, -1.1943e+00],\n", + " [-8.2666e-01, -1.6113e+00, -1.5264e+00, ..., -1.4697e+00,\n", + " -1.3887e+00, -8.7158e-01],\n", + " [-3.0664e-01, -7.8369e-01, -5.4541e-01, ..., -1.1484e+00,\n", + " -1.0684e+00, -6.7188e-01]],\n", + "\n", + " [[-7.3584e-01, -1.3418e+00, -5.9619e-01, ..., 2.8091e-02,\n", + " 1.7798e-01, 3.8647e-01],\n", + " [-1.2314e+00, -2.5215e+00, -2.3496e+00, ..., -4.1016e-01,\n", + " 5.0537e-02, 1.3342e-01],\n", + " [-1.1836e+00, -2.8574e+00, -2.8926e+00, ..., -9.0186e-01,\n", + " 4.1357e-01, 4.3848e-01],\n", + " ...,\n", + " [ 1.7432e+00, 4.5288e-01, 2.1936e-01, ..., 4.5312e-01,\n", + " 6.2500e-01, -2.2705e-01],\n", + " [ 1.9316e+00, 4.8047e-01, 1.0513e-02, ..., 8.0627e-02,\n", + " 2.4866e-01, -5.3711e-01],\n", + " [ 1.8037e+00, 1.6504e+00, 1.2188e+00, ..., 1.2295e+00,\n", + " 1.2168e+00, 3.9575e-01]],\n", + "\n", + " ...,\n", + "\n", + " [[ 4.8594e+00, 4.0273e+00, 4.6875e+00, ..., 3.1973e+00,\n", + " -2.3438e-01, -5.5469e-01],\n", + " [ 1.8740e+00, -1.5625e+00, -9.7852e-01, ..., 6.4990e-01,\n", + " -4.6406e+00, -1.9102e+00],\n", + " [ 2.5312e+00, 1.0107e+00, -2.3413e-01, ..., -4.2480e-01,\n", + " -4.7148e+00, -1.5557e+00],\n", + " ...,\n", + " [-2.4844e+00, 1.3457e+00, 6.2793e-01, ..., 5.1514e-01,\n", + " 1.3975e+00, 1.8457e+00],\n", + " [-1.4326e+00, 3.0781e+00, 1.9619e+00, ..., 2.1504e+00,\n", + " 2.6621e+00, 2.5820e+00],\n", + " [ 6.5674e-01, 4.5273e+00, 2.7461e+00, ..., 3.4629e+00,\n", + " 3.8789e+00, 2.7930e+00]],\n", + "\n", + " [[-2.1914e+00, -4.3672e+00, -4.4805e+00, ..., -2.7012e+00,\n", + " -2.9980e+00, -1.0654e+00],\n", + " [-3.2754e+00, -6.5547e+00, -6.6797e+00, ..., -4.6055e+00,\n", + " -4.7500e+00, -1.9258e+00],\n", + " [-2.2090e+00, -5.0938e+00, -4.8750e+00, ..., -2.5020e+00,\n", + " -4.7148e+00, -2.5742e+00],\n", + " ...,\n", + " [-7.9590e-01, -1.0566e+00, -1.2773e+00, ..., 2.1399e-01,\n", + " 1.8872e-01, -2.8152e-03],\n", + " [-3.2623e-02, 6.6260e-01, 8.8379e-01, ..., -1.6614e-01,\n", + " 2.6294e-01, -4.7211e-02],\n", + " [-4.6478e-02, 1.7444e-01, 3.0054e-01, ..., -9.6680e-01,\n", + " -9.9170e-01, -8.7939e-01]],\n", + "\n", + " [[-2.4219e+00, -2.7852e+00, -1.3184e+00, ..., -1.4463e+00,\n", + " -3.8633e+00, -2.9688e+00],\n", + " [ 2.0527e+00, -1.1689e+00, 1.8701e-01, ..., -3.4692e-01,\n", + " 9.5020e-01, -4.1211e+00],\n", + " [ 1.6816e+00, -1.5605e+00, -2.3169e-01, ..., -3.0098e+00,\n", + " -2.7109e+00, -5.3320e-01],\n", + " ...,\n", + " [-2.0293e+00, -3.1621e+00, -2.6270e+00, ..., -7.1387e-01,\n", + " -3.8574e-01, 1.9702e-01],\n", + " [-4.3701e-01, -1.8633e+00, -2.4414e+00, ..., 1.6016e+00,\n", + " 4.0820e-01, -1.0371e+00],\n", + " [ 2.3262e+00, -3.3081e-01, 1.9375e+00, ..., -2.6685e-01,\n", + " 2.0723e+00, 1.1885e+00]]], dtype=float16)" + ] + }, + "execution_count": 64, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "features[1]" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "mindeye", + "language": "python", + "name": "mindeye" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.10" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/spurious_reconstruction/analysis/1_case_study/feature-decoding/.ipynb_checkpoints/featdec_fastl2lir_predict-checkpoint.py b/spurious_reconstruction/analysis/1_case_study/feature-decoding/.ipynb_checkpoints/featdec_fastl2lir_predict-checkpoint.py new file mode 100644 index 0000000000000000000000000000000000000000..b9a0be2d7919b6cbf1fc95d52b65a97727792bf9 --- /dev/null +++ b/spurious_reconstruction/analysis/1_case_study/feature-decoding/.ipynb_checkpoints/featdec_fastl2lir_predict-checkpoint.py @@ -0,0 +1,250 @@ +'''DNN Feature decoding - decoders test (prediction) script''' + + +from __future__ import print_function + +from itertools import product +import os +import shutil +from time import time +import argparse + +import bdpy +from bdpy.dataform import load_array, save_array +from bdpy.distcomp import DistComp +from bdpy.ml import ModelTest +from bdpy.util import makedir_ifnot +from fastl2lir import FastL2LiR +import numpy as np +import yaml + + +# Main ####################################################################### + +def featdec_fastl2lir_predict( + fmri_data_files, + feature_decoders_dir, + output_dir='./decoded_features', + rois_list=None, label_key=None, + features_list=None, feature_index_file=None, + excluded_labels=[], + average_sample=True, + chunk_axis=1 +): + '''Feature prediction. + + Input: + + - fmri_data_files + - feature_decoder_dir + + Output: + + - output_dir + + Parameters: + + TBA + ''' + + analysis_basename = os.path.splitext(os.path.basename(__file__))[0] + '-' + conf['__filename__'] + + features_list = features_list[::-1] # Start training from deep layers + + # Print info ------------------------------------------------------------- + print('Subjects: %s' % list(fmri_data_files.keys())) + print('ROIs: %s' % list(rois_list.keys())) + print('Decoders: %s' % feature_decoders_dir) + print('Layers: %s' % features_list) + print('') + + # Load data -------------------------------------------------------- + print('----------------------------------------') + print('Loading data') + + data_brain = {sbj: bdpy.BData(dat_file[0]) + for sbj, dat_file in fmri_data_files.items()} + + # Initialize directories ------------------------------------------- + makedir_ifnot(output_dir) + makedir_ifnot('tmp') + + # Save feature index ----------------------------------------------------- + if feature_index_file is not None: + feature_index_save_file = os.path.join(output_dir, 'feature_index.mat') + shutil.copy(feature_index_file, feature_index_save_file) + print('Saved %s' % feature_index_save_file) + + # Analysis loop ---------------------------------------------------- + print('----------------------------------------') + print('Analysis loop') + + for feat, sbj, roi in product(features_list, fmri_data_files, rois_list): + print('--------------------') + print('Feature: %s' % feat) + print('Subject: %s' % sbj) + print('ROI: %s' % roi) + + # Distributed computation setup + # ----------------------------- + analysis_id = analysis_basename + '-' + sbj + '-' + roi + '-' + feat + results_dir_prediction = os.path.join(output_dir, feat, sbj, roi) + + if os.path.exists(results_dir_prediction): + print('%s is already done. Skipped.' % analysis_id) + continue + + makedir_ifnot(results_dir_prediction) + + distcomp_db = os.path.join('./tmp', analysis_basename + '.db') + distcomp = DistComp(backend='sqlite3', db_path=distcomp_db) + if not distcomp.lock(analysis_id): + print('%s is already running. Skipped.' % analysis_id) + continue + + # Preparing data + # -------------- + print('Preparing data') + + start_time = time() + + # Brain data + x = data_brain[sbj].select(rois_list[roi]) # Brain data + # TODO: Dirty solution. FIXME! + try: + x_labels = data_brain[sbj].get_label(label_key) # Labels + except ValueError: + print(f'{label_key} not found in vmap. Select numerical values of {label_key} as labels.') + x_labels = list(data_brain[sbj].select(label_key).flatten()) + + # Averaging brain data + if average_sample: + x_labels_unique = np.unique(x_labels) + x_labels_unique = [lb for lb in x_labels_unique if lb not in excluded_labels] + x = np.vstack([np.mean(x[(np.array(x_labels) == lb).flatten(), :], axis=0) for lb in x_labels_unique]) + else: + # Trial No. + Label + # TODO: This should be changed as 'sample No. + label' since single row can be not only trial but also volume. + x_labels_unique = ['sample{:06}-{}'.format(i + 1, lb) for i, lb in enumerate(x_labels)] + + print('Elapsed time (data preparation): %f' % (time() - start_time)) + + # Model directory + # --------------- + model_dir = os.path.join(feature_decoders_dir, feat, sbj, roi, 'model') + + # Preprocessing + # ------------- + x_mean = load_array(os.path.join(model_dir, 'x_mean.mat'), key='x_mean') # shape = (1, n_voxels) + x_norm = load_array(os.path.join(model_dir, 'x_norm.mat'), key='x_norm') # shape = (1, n_voxels) + y_mean = load_array(os.path.join(model_dir, 'y_mean.mat'), key='y_mean') # shape = (1, shape_features) + y_norm = load_array(os.path.join(model_dir, 'y_norm.mat'), key='y_norm') # shape = (1, shape_features) + + x = (x - x_mean) / x_norm + + # Prediction + # ---------- + print('Prediction') + + start_time = time() + + model = FastL2LiR() + + test = ModelTest(model, x) + test.model_format = 'bdmodel' + test.model_path = model_dir + test.dtype = np.float32 + test.chunk_axis = chunk_axis + + y_pred = test.run() + + print('Total elapsed time (prediction): %f' % (time() - start_time)) + + # Postprocessing + # -------------- + y_pred = y_pred * y_norm + y_mean + + # Save results + # ------------ + print('Saving results') + + start_time = time() + + # Predicted features + for i, label in enumerate(x_labels_unique): + # Predicted features + feat = np.array([y_pred[i,]]) # To make feat shape 1 x M x N x ... + + # Save file name + save_file = os.path.join(results_dir_prediction, '%s.mat' % label) + + # Save + save_array(save_file, feat, key='feat', dtype=np.float32, sparse=False) + + print('Saved %s' % results_dir_prediction) + + print('Elapsed time (saving results): %f' % (time() - start_time)) + + distcomp.unlock(analysis_id) + + print('%s finished.' % analysis_basename) + + return output_dir + + +# Entry point ################################################################ + +if __name__ == '__main__': + parser = argparse.ArgumentParser() + parser.add_argument( + 'conf', + type=str, + help='analysis configuration file', + ) + args = parser.parse_args() + + conf_file = args.conf + + with open(conf_file, 'r') as f: + conf = yaml.safe_load(f) + + conf.update({ + '__filename__': os.path.splitext(os.path.basename(conf_file))[0] + }) + + if 'analysis name' in conf: + analysis_name = conf['analysis name'] + else: + analysis_name = '' + + if 'feature index file' in conf: + feature_index_file = os.path.join( + conf['training feature dir'][0], + conf['network'], + conf['feature index file'] + ) + else: + feature_index_file = None + + if 'exclude test label' in conf: + excluded_labels = conf['exclude test label'] + else: + excluded_labels = [] + + if 'test single trial' in conf: + average_sample = not conf['test single trial'] + else: + average_sample = True + + featdec_fastl2lir_predict( + conf['test fmri'], + os.path.join(conf['feature decoder dir'], analysis_name, conf['network']), + output_dir=os.path.join(conf['decoded feature dir'], analysis_name, 'decoded_features', conf['network']), + rois_list=conf['rois'], + label_key=conf['label key'], + features_list=conf['layers'], + feature_index_file=feature_index_file, + excluded_labels=excluded_labels, + average_sample=average_sample, + chunk_axis=conf['chunk axis'] + ) diff --git a/spurious_reconstruction/analysis/1_case_study/feature-decoding/.ipynb_checkpoints/featdec_fastl2lir_train-checkpoint.py b/spurious_reconstruction/analysis/1_case_study/feature-decoding/.ipynb_checkpoints/featdec_fastl2lir_train-checkpoint.py new file mode 100644 index 0000000000000000000000000000000000000000..d1069f7566e7d6e64fe591b80860f8426cca2b22 --- /dev/null +++ b/spurious_reconstruction/analysis/1_case_study/feature-decoding/.ipynb_checkpoints/featdec_fastl2lir_train-checkpoint.py @@ -0,0 +1,260 @@ +'''DNN Feature decoding - decoders training script''' + + +from __future__ import print_function + +from itertools import product +import os +import shutil +from time import time +import warnings +import argparse + +import bdpy +from bdpy.dataform import Features, save_array +from bdpy.distcomp import DistComp +from bdpy.ml import ModelTraining +from bdpy.util import makedir_ifnot +from fastl2lir import FastL2LiR +import numpy as np +import yaml + + +# Main ####################################################################### + +def featdec_fastl2lir_train( + fmri_data_files, + features_dir, + output_dir='./feature_decoders', + rois_list=None, num_voxel=None, label_key=None, + features_list=None, feature_index_file=None, + alpha=100, chunk_axis=1 +): + '''Feature decoder training. + + Input: + + - fmri_data_files + - features_dir + + Output: + + - output_dir + + Parameters: + + TBA + + Note: + + If Y.ndim >= 3, Y is divided into chunks along `chunk_axis`. + Note that Y[0] should be sample dimension. + ''' + + analysis_basename = os.path.splitext(os.path.basename(__file__))[0] + '-' + conf['__filename__'] + + features_list = features_list[::-1] # Start training from deep layers + + # Print info ------------------------------------------------------------- + print('Subjects: %s' % list(fmri_data_files.keys())) + print('ROIs: %s' % list(rois_list.keys())) + print('Target features: %s' % features_dir) + print('Layers: %s' % features_list) + print('') + + # Load data -------------------------------------------------------------- + print('----------------------------------------') + print('Loading data') + + data_brain = {sbj: bdpy.BData(dat_file[0]) + for sbj, dat_file in fmri_data_files.items()} + + if feature_index_file is not None: + data_features = Features(os.path.join(features_dir), feature_index=feature_index_file) + else: + data_features = Features(os.path.join(features_dir)) + + # Initialize directories ------------------------------------------------- + makedir_ifnot(output_dir) + makedir_ifnot('tmp') + + # Save feature index ----------------------------------------------------- + if feature_index_file is not None: + feature_index_save_file = os.path.join(output_dir, 'feature_index.mat') + shutil.copy(feature_index_file, feature_index_save_file) + print('Saved %s' % feature_index_save_file) + + # Analysis loop ---------------------------------------------------------- + print('----------------------------------------') + print('Analysis loop') + + for feat, sbj, roi in product(features_list, fmri_data_files, rois_list): + print('--------------------') + print('Feature: %s' % feat) + print('Subject: %s' % sbj) + print('ROI: %s' % roi) + print('Num voxels: %d' % num_voxel[roi]) + + # Setup + # ----- + analysis_id = analysis_basename + '-' + sbj + '-' + roi + '-' + feat + results_dir = os.path.join(output_dir, feat, sbj, roi, 'model') + makedir_ifnot(results_dir) + + # Check whether the analysis has been done or not. + info_file = os.path.join(results_dir, 'info.yaml') + if os.path.exists(info_file): + with open(info_file, 'r') as f: + info = yaml.safe_load(f) + while info is None: + warnings.warn('Failed to load info from %s. Retrying...' + % info_file) + with open(info_file, 'r') as f: + info = yaml.safe_load(f) + if '_status' in info and 'computation_status' in info['_status']: + if info['_status']['computation_status'] == 'done': + print('%s is already done and skipped' % analysis_id) + continue + + # Preparing data + # -------------- + print('Preparing data') + + start_time = time() + + # Brain data + x = data_brain[sbj].select(rois_list[roi]) # Brain data + x_labels = data_brain[sbj].get_label(label_key) # Labels + + # Target features and image labels (file names) + y_labels = np.unique(x_labels) + y = data_features.get(feat, label=y_labels) # Target DNN features + + # Use x that has a label included in y + x = np.vstack([_x for _x, xl in zip(x, x_labels) if xl in y_labels]) + x_labels = [xl for xl in x_labels if xl in y_labels] + + print('Elapsed time (data preparation): %f' % (time() - start_time)) + + # Calculate normalization parameters + # ---------------------------------- + + # Normalize X (fMRI data) + x_mean = np.mean(x, axis=0)[np.newaxis, :] # np.newaxis was added to match Matlab outputs + x_norm = np.std(x, axis=0, ddof=1)[np.newaxis, :] + + # Normalize Y (DNN features) + y_mean = np.mean(y, axis=0)[np.newaxis, :] + y_norm = np.std(y, axis=0, ddof=1)[np.newaxis, :] + + # Y index to sort Y by X (matching samples) + # ----------------------------------------- + y_index = np.array([np.where(np.array(y_labels) == xl) for xl in x_labels]).flatten() + + # Save normalization parameters + # ----------------------------- + print('Saving normalization parameters.') + norm_param = {'x_mean': x_mean, 'y_mean': y_mean, + 'x_norm': x_norm, 'y_norm': y_norm} + save_targets = [u'x_mean', u'y_mean', u'x_norm', u'y_norm'] + for sv in save_targets: + save_file = os.path.join(results_dir, sv + '.mat') + if not os.path.exists(save_file): + try: + save_array(save_file, norm_param[sv], key=sv, dtype=np.float32, sparse=False) + print('Saved %s' % save_file) + except Exception: + warnings.warn('Failed to save %s. Possibly double running.' % save_file) + + # Preparing learning + # ------------------ + model = FastL2LiR() + model_param = {'alpha': alpha, + 'n_feat': num_voxel[roi], + 'dtype': np.float32} + + # Distributed computation setup + # ----------------------------- + makedir_ifnot('./tmp') + distcomp_db = os.path.join('./tmp', analysis_basename + '.db') + distcomp = DistComp(backend='sqlite3', db_path=distcomp_db) + + # Model training + # -------------- + print('Model training') + start_time = time() + + train = ModelTraining(model, x, y) + train.id = analysis_basename + '-' + sbj + '-' + roi + '-' + feat + train.model_parameters = model_param + + train.X_normalize = {'mean': x_mean, + 'std': x_norm} + train.Y_normalize = {'mean': y_mean, + 'std': y_norm} + train.Y_sort = {'index': y_index} + + train.dtype = np.float32 + train.chunk_axis = chunk_axis + train.save_format = 'bdmodel' + train.save_path = results_dir + train.distcomp = distcomp + + train.run() + + print('Total elapsed time (model training): %f' % (time() - start_time)) + + print('%s finished.' % analysis_basename) + + return output_dir + + +# Entry point ################################################################ + +if __name__ == '__main__': + parser = argparse.ArgumentParser() + parser.add_argument( + 'conf', + type=str, + help='analysis configuration file', + ) + args = parser.parse_args() + + conf_file = args.conf + + with open(conf_file, 'r') as f: + conf = yaml.safe_load(f) + + conf.update({ + '__filename__': os.path.splitext(os.path.basename(conf_file))[0] + }) + + if 'analysis name' in conf: + feature_decoders_dir = os.path.join(conf['feature decoder dir'], conf['analysis name'], conf['network']) + else: + feature_decoders_dir = os.path.join(conf['feature decoder dir'], conf['network']) + + if 'feature index file' in conf: + feature_index_file = os.path.join( + conf['training feature dir'][0], + conf['network'], + conf['feature index file'] + ) + else: + feature_index_file = None + + featdec_fastl2lir_train( + conf['training fmri'], + os.path.join( + conf['training feature dir'][0], + conf['network'] + ), + output_dir=feature_decoders_dir, + rois_list=conf['rois'], + num_voxel=conf['rois voxel num'], + label_key=conf['label key'], + features_list=conf['layers'], + feature_index_file=feature_index_file, + alpha=conf['alpha'], + chunk_axis=conf['chunk axis'] + ) diff --git a/spurious_reconstruction/analysis/1_case_study/feature-decoding/.ipynb_checkpoints/utils-checkpoint.py b/spurious_reconstruction/analysis/1_case_study/feature-decoding/.ipynb_checkpoints/utils-checkpoint.py new file mode 100644 index 0000000000000000000000000000000000000000..0e7b97997dda33cf1cb81cde8311ccaa3fc63aff --- /dev/null +++ b/spurious_reconstruction/analysis/1_case_study/feature-decoding/.ipynb_checkpoints/utils-checkpoint.py @@ -0,0 +1,1303 @@ +import numpy as np +import pandas as pd +from torchvision import transforms +import torch +import torch.nn as nn +import torch.nn.functional as F +import PIL +import random +import os +import pickle +from scipy.io import loadmat +import matplotlib.pyplot as plt +import math +import webdataset as wds +from tqdm import tqdm +import nibabel as nb +import os.path as op + +import json +from PIL import Image +import requests +import time +import h5py + +device = torch.device('cuda' if torch.cuda.is_available() else 'cpu') + +def is_interactive(): + import __main__ as main + return not hasattr(main, '__file__') + +def seed_everything(seed=0, cudnn_deterministic=True): + random.seed(seed) + os.environ['PYTHONHASHSEED'] = str(seed) + np.random.seed(seed) + torch.manual_seed(seed) + torch.cuda.manual_seed(seed) + torch.cuda.manual_seed_all(seed) + if cudnn_deterministic: + torch.backends.cudnn.deterministic = True + else: + ## needs to be False to use conv3D + print('Note: not using cudnn.deterministic') + +def np_to_Image(x): + if x.ndim==4: + x=x[0] + return PIL.Image.fromarray((x.transpose(1, 2, 0)*127.5+128).clip(0,255).astype('uint8')) + +def torch_to_Image(x): + if x.ndim==4: + x=x[0] + return transforms.ToPILImage()(x) + +def Image_to_torch(x): + try: + x = (transforms.ToTensor()(x)[:3].unsqueeze(0)-.5)/.5 + except: + x = (transforms.ToTensor()(x[0])[:3].unsqueeze(0)-.5)/.5 + return x + +def torch_to_matplotlib(x,device=device): + if torch.mean(x)>10: + x = (x.permute(0, 2, 3, 1)).clamp(0, 255).to(torch.uint8) + else: + x = (x.permute(0, 2, 3, 1) * 255).clamp(0, 255).to(torch.uint8) + if device=='cpu': + return x[0] + else: + return x.cpu().numpy()[0] + +def batchwise_pearson_correlation(Z, B): + # Calculate means + Z_mean = torch.mean(Z, dim=1, keepdim=True) + B_mean = torch.mean(B, dim=1, keepdim=True) + + # Subtract means + Z_centered = Z - Z_mean + B_centered = B - B_mean + + # Calculate Pearson correlation coefficient + numerator = Z_centered @ B_centered.T + Z_centered_norm = torch.linalg.norm(Z_centered, dim=1, keepdim=True) + B_centered_norm = torch.linalg.norm(B_centered, dim=1, keepdim=True) + denominator = Z_centered_norm @ B_centered_norm.T + + pearson_correlation = (numerator / denominator) + return pearson_correlation + +def batchwise_cosine_similarity(Z,B): + Z = Z.flatten(1) + B = B.flatten(1).T + Z_norm = torch.linalg.norm(Z, dim=1, keepdim=True) # Size (n, 1). + B_norm = torch.linalg.norm(B, dim=0, keepdim=True) # Size (1, b). + cosine_similarity = ((Z @ B) / (Z_norm @ B_norm)).T + return cosine_similarity + +def prenormed_batchwise_cosine_similarity(Z,B): + return (Z @ B.T).T + +def cosine_similarity(Z,B,l=0): + Z = nn.functional.normalize(Z, p=2, dim=1) + B = nn.functional.normalize(B, p=2, dim=1) + # if l>0, use distribution normalization + # https://twitter.com/YifeiZhou02/status/1716513495087472880 + Z = Z - l * torch.mean(Z,dim=0) + B = B - l * torch.mean(B,dim=0) + cosine_similarity = (Z @ B.T).T + return cosine_similarity + +def topk(similarities,labels,k=5): + if k > similarities.shape[0]: + k = similarities.shape[0] + topsum=0 + for i in range(k): + topsum += torch.sum(torch.argsort(similarities,axis=1)[:,-(i+1)] == labels)/len(labels) + return topsum + +def get_non_diagonals(a): + a = torch.triu(a,diagonal=1)+torch.tril(a,diagonal=-1) + # make diagonals -1 + a=a.fill_diagonal_(-1) + return a + +def gather_features(image_features, voxel_features, accelerator): + all_image_features = accelerator.gather(image_features.contiguous()) + if voxel_features is not None: + all_voxel_features = accelerator.gather(voxel_features.contiguous()) + return all_image_features, all_voxel_features + return all_image_features + +def soft_clip_loss(preds, targs, temp=0.125): + clip_clip = (targs @ targs.T)/temp + brain_clip = (preds @ targs.T)/temp + loss1 = -(brain_clip.log_softmax(-1) * clip_clip.softmax(-1)).sum(-1).mean() + loss2 = -(brain_clip.T.log_softmax(-1) * clip_clip.softmax(-1)).sum(-1).mean() + + loss = (loss1 + loss2)/2 + return loss + +def soft_siglip_loss(preds, targs, temp, bias): + temp = torch.exp(temp) + + logits = (preds @ targs.T) * temp + bias + # diagonals (aka paired samples) should be >0 and off-diagonals <0 + labels = (targs @ targs.T) - 1 + (torch.eye(len(targs)).to(targs.dtype).to(targs.device)) + + loss1 = -torch.sum(nn.functional.logsigmoid(logits * labels[:len(preds)])) / len(preds) + loss2 = -torch.sum(nn.functional.logsigmoid(logits.T * labels[:,:len(preds)])) / len(preds) + loss = (loss1 + loss2)/2 + return loss + +def mixco_hard_siglip_loss(preds, targs, temp, bias, perm, betas): + temp = torch.exp(temp) + + probs = torch.diag(betas) + probs[torch.arange(preds.shape[0]).to(preds.device), perm] = 1 - betas + + logits = (preds @ targs.T) * temp + bias + labels = probs * 2 - 1 + #labels = torch.eye(len(targs)).to(targs.dtype).to(targs.device) * 2 - 1 + + loss1 = -torch.sum(nn.functional.logsigmoid(logits * labels)) / len(preds) + loss2 = -torch.sum(nn.functional.logsigmoid(logits.T * labels)) / len(preds) + loss = (loss1 + loss2)/2 + return loss + +def mixco(voxels, beta=0.15, s_thresh=0.5, perm=None, betas=None, select=None): + if perm is None: + perm = torch.randperm(voxels.shape[0]) + voxels_shuffle = voxels[perm].to(voxels.device,dtype=voxels.dtype) + if betas is None: + betas = torch.distributions.Beta(beta, beta).sample([voxels.shape[0]]).to(voxels.device,dtype=voxels.dtype) + if select is None: + select = (torch.rand(voxels.shape[0]) <= s_thresh).to(voxels.device) + betas_shape = [-1] + [1]*(len(voxels.shape)-1) + voxels[select] = voxels[select] * betas[select].reshape(*betas_shape) + \ + voxels_shuffle[select] * (1 - betas[select]).reshape(*betas_shape) + betas[~select] = 1 + return voxels, perm, betas, select + +def mixco_clip_target(clip_target, perm, select, betas): + clip_target_shuffle = clip_target[perm] + clip_target[select] = clip_target[select] * betas[select].reshape(-1, 1) + \ + clip_target_shuffle[select] * (1 - betas[select]).reshape(-1, 1) + return clip_target + +def mixco_nce(preds, targs, temp=0.1, perm=None, betas=None, select=None, distributed=False, + accelerator=None, local_rank=None, bidirectional=True): + brain_clip = (preds @ targs.T)/temp + + if perm is not None and betas is not None and select is not None: + probs = torch.diag(betas) + probs[torch.arange(preds.shape[0]).to(preds.device), perm] = 1 - betas + + loss = -(brain_clip.log_softmax(-1) * probs).sum(-1).mean() + if bidirectional: + loss2 = -(brain_clip.T.log_softmax(-1) * probs.T).sum(-1).mean() + loss = (loss + loss2)/2 + return loss + else: + loss = F.cross_entropy(brain_clip, torch.arange(brain_clip.shape[0]).to(brain_clip.device)) + if bidirectional: + loss2 = F.cross_entropy(brain_clip.T, torch.arange(brain_clip.shape[0]).to(brain_clip.device)) + loss = (loss + loss2)/2 + return loss + +def count_params(model): + total = sum(p.numel() for p in model.parameters()) + trainable = sum(p.numel() for p in model.parameters() if p.requires_grad) + print(f'param counts:\n{total:,} total\n{trainable:,} trainable') + return trainable + +def check_loss(loss): + if loss.isnan().any(): + raise ValueError('NaN loss') + +def cosine_anneal(start, end, steps): + return end + (start - end)/2 * (1 + torch.cos(torch.pi*torch.arange(steps)/(steps-1))) + +def resize(img, img_size=128): + if img.ndim == 3: img = img[None] + return nn.functional.interpolate(img, size=(img_size, img_size), mode='nearest') + +pixcorr_preprocess = transforms.Compose([ + transforms.Resize(425, interpolation=transforms.InterpolationMode.BILINEAR), +]) +def pixcorr(images,brains,nan=True): + all_images_flattened = pixcorr_preprocess(images).reshape(len(images), -1) + all_brain_recons_flattened = pixcorr_preprocess(brains).view(len(brains), -1) + if nan: + corrmean = torch.nanmean(torch.diag(batchwise_pearson_correlation(all_images_flattened, all_brain_recons_flattened))) + else: + corrmean = torch.mean(torch.diag(batchwise_pearson_correlation(all_images_flattened, all_brain_recons_flattened))) + return corrmean + +def select_annotations(annots, random=True): + """ + There are 5 annotations per image. Select one of them for each image. + """ + for i, b in enumerate(annots): + t = '' + if random: + # select random non-empty annotation + while t == '': + rand = torch.randint(5, (1,1))[0][0] + t = b[rand] + else: + # select first non-empty annotation + for j in range(5): + if b[j] != '': + t = b[j] + break + if i == 0: + txt = np.array(t) + else: + txt = np.vstack((txt, t)) + txt = txt.flatten() + return txt + +# from generative_models.sgm.util import append_dims + +# def unclip_recon(x, diffusion_engine, vector_suffix, +# num_samples=1, offset_noise_level=0.04): +# assert x.ndim==3 +# if x.shape[0]==1: +# x = x[[0]] +# with torch.no_grad(), torch.cuda.amp.autocast(dtype=torch.float16), diffusion_engine.ema_scope(): +# z = torch.randn(num_samples,4,96,96).to(device) # starting noise, can change to VAE outputs of initial image for img2img + +# # clip_img_tokenized = clip_img_embedder(image) +# # tokens = clip_img_tokenized +# token_shape = x.shape +# tokens = x +# c = {"crossattn": tokens.repeat(num_samples,1,1), "vector": vector_suffix.repeat(num_samples,1)} + +# tokens = torch.randn_like(x) +# uc = {"crossattn": tokens.repeat(num_samples,1,1), "vector": vector_suffix.repeat(num_samples,1)} + +# for k in c: +# c[k], uc[k] = map(lambda y: y[k][:num_samples].to(device), (c, uc)) + +# noise = torch.randn_like(z) +# sigmas = diffusion_engine.sampler.discretization(diffusion_engine.sampler.num_steps) +# sigma = sigmas[0].to(z.device) + +# if offset_noise_level > 0.0: +# noise = noise + offset_noise_level * append_dims( +# torch.randn(z.shape[0], device=z.device), z.ndim +# ) +# noised_z = z + noise * append_dims(sigma, z.ndim) +# noised_z = noised_z / torch.sqrt( +# 1.0 + sigmas[0] ** 2.0 +# ) # Note: hardcoded to DDPM-like scaling. need to generalize later. + +# def denoiser(x, sigma, c): +# return diffusion_engine.denoiser(diffusion_engine.model, x, sigma, c) + +# samples_z = diffusion_engine.sampler(denoiser, noised_z, cond=c, uc=uc) +# samples_x = diffusion_engine.decode_first_stage(samples_z) +# samples = torch.clamp((samples_x*.8+.2), min=0.0, max=1.0) +# # samples = torch.clamp((samples_x + .5) / 2.0, min=0.0, max=1.0) +# return samples + +def prepare_low_level_latents(img_lowlevel, + img2img_strength, + vae, + noise_scheduler, + generator, + num_inference_steps, + recons_per_sample=16): + # 5b. Prepare latent variables + normalize = transforms.Normalize(np.array([0.48145466, 0.4578275, 0.40821073]), np.array([0.26862954, 0.26130258, 0.27577711])) + # use img_lowlevel for img2img initialization + img_lowlevel = transforms.Resize((512, 512))(img_lowlevel) + # img_lowlevel = normalize(img_lowlevel) + init_latents = vae.encode(img_lowlevel.to(device).to(vae.dtype)).latent_dist.sample(generator) + init_latents = vae.config.scaling_factor * init_latents + init_latents = init_latents.repeat(recons_per_sample, 1, 1, 1) + + init_timestep = min(int(num_inference_steps * img2img_strength), num_inference_steps) + t_start = max(num_inference_steps - init_timestep, 0) + timesteps = noise_scheduler.timesteps[t_start:] + latent_timestep = timesteps[:1].repeat(recons_per_sample) + + noise = torch.randn([recons_per_sample, 4, 64, 64], device=device, + generator=generator, dtype=init_latents.dtype) + latents = noise_scheduler.add_noise(init_latents, noise, latent_timestep.int()) + return latents + +def versatile_diffusion_recon(brain_clip_embeddings, + proj_embeddings, + img_lowlevel, + text_token, + img2img_strength, + clip_extractor, + vae, + unet, + noise_scheduler, + generator, + num_inference_steps, + recons_per_sample=16, + guidance_scale = 3.5, + seed=42): + for samp in range(len(brain_clip_embeddings)): + brain_clip_embeddings[samp] = brain_clip_embeddings[samp]/(brain_clip_embeddings[samp,0].norm(dim=-1).reshape(-1, 1, 1) + 1e-6) + + input_embedding = brain_clip_embeddings + if text_token is not None: + prompt_embeds = text_token + # prompt_embeds = text_token.repeat(recons_per_sample, 1, 1) + # for samp in range(len(prompt_embeds)): + # prompt_embeds[samp] = prompt_embeds[samp]/(prompt_embeds[samp,0].norm(dim=-1).reshape(-1, 1, 1) + 1e-6) + else: + prompt_embeds = torch.zeros(len(input_embedding),77,768) + + if unet is not None: + do_classifier_free_guidance = guidance_scale > 1.0 + vae_scale_factor = 2 ** (len(vae.config.block_out_channels) - 1) + height = unet.config.sample_size * vae_scale_factor + width = unet.config.sample_size * vae_scale_factor + + if do_classifier_free_guidance: + input_embedding = torch.cat([torch.zeros_like(input_embedding), input_embedding]).to(device).to(unet.dtype) + prompt_embeds = torch.cat([torch.zeros_like(prompt_embeds), prompt_embeds]).to(device).to(unet.dtype) + + # dual_prompt_embeddings + # print(prompt_embeds.shape) + # print(input_embedding.shape) + input_embedding = torch.cat([prompt_embeds, input_embedding], dim=1) + # 4. Prepare timesteps + noise_scheduler.set_timesteps(num_inference_steps=num_inference_steps, device=device) + + # 5b. Prepare latent variables + batch_size = input_embedding.shape[0] // 2 # divide by 2 bc we doubled it for classifier-free guidance + shape = (batch_size, unet.in_channels, height // vae_scale_factor, width // vae_scale_factor) + if img_lowlevel is not None: # use img_lowlevel for img2img initialization + img_lowlevel = torch.nn.functional.interpolate(img_lowlevel, size=(512, 512), mode='bilinear', align_corners=False) + init_timestep = min(int(num_inference_steps * img2img_strength), num_inference_steps) + t_start = max(num_inference_steps - init_timestep, 0) + timesteps = noise_scheduler.timesteps[t_start:] + latent_timestep = timesteps[:1].repeat(batch_size) + + img_lowlevel_embeddings = clip_extractor.normalize(img_lowlevel) + init_latents = vae.encode(img_lowlevel_embeddings.to(device).to(vae.dtype)).latent_dist.sample(generator) + init_latents = vae.config.scaling_factor * init_latents + init_latents = init_latents.repeat(recons_per_sample, 1, 1, 1) + + noise = torch.randn([recons_per_sample, 4, 64, 64], device=device, + generator=generator, dtype=input_embedding.dtype) + init_latents = noise_scheduler.add_noise(init_latents, noise, latent_timestep) + latents = init_latents + else: + timesteps = noise_scheduler.timesteps + latents = torch.randn([recons_per_sample, 4, 64, 64], device=device, + generator=generator, dtype=input_embedding.dtype) + latents = latents * noise_scheduler.init_noise_sigma + # 7. Denoising loop + for i, t in enumerate(timesteps): + # expand the latents if we are doing classifier free guidance + latent_model_input = torch.cat([latents] * 2) if do_classifier_free_guidance else latents + latent_model_input = noise_scheduler.scale_model_input(latent_model_input, t).to(device) + noise_pred = unet(latent_model_input, t, encoder_hidden_states=input_embedding).sample + # perform guidance + if do_classifier_free_guidance: + noise_pred_uncond, noise_pred_text = noise_pred.chunk(2) + noise_pred = noise_pred_uncond + guidance_scale * (noise_pred_text - noise_pred_uncond) + # compute the previous noisy sample x_t -> x_t-1 + latents = noise_scheduler.step(noise_pred, t, latents).prev_sample + recons = decode_latents(latents,vae).detach().cpu() + + brain_recons = recons.unsqueeze(0) + + # pick best reconstruction out of several + best_picks = np.zeros(1).astype(np.int16) + + v2c_reference_out = nn.functional.normalize(proj_embeddings.view(len(proj_embeddings),-1),dim=-1) + sims=[] + for im in range(recons_per_sample): + currecon = clip_extractor.embed_image(brain_recons[0,[im]].float()).to(proj_embeddings.device).to(proj_embeddings.dtype) + currecon = nn.functional.normalize(currecon.view(len(currecon),-1),dim=-1) + cursim = batchwise_cosine_similarity(v2c_reference_out,currecon) + sims.append(cursim.item()) + best_picks[0] = int(np.nanargmax(sims)) + + recon_img = brain_recons[:, best_picks[0]] + + return recon_img, brain_recons, best_picks + +def pick_best_recon(brain_recons, proj_embeddings, clip_extractor): + # pick best reconstruction out of several + best_picks = np.zeros(1).astype(np.int16) + v2c_reference_out = nn.functional.normalize(proj_embeddings.view(len(proj_embeddings),-1),dim=-1) + sims=[] + for im in range(len(brain_recons)): + currecon = clip_extractor.embed_image(brain_recons[im]).to(proj_embeddings.device).to(proj_embeddings.dtype) + currecon = nn.functional.normalize(currecon.view(len(currecon),-1),dim=-1) + cursim = batchwise_cosine_similarity(v2c_reference_out,currecon) + sims.append(cursim.item()) + best_picks[0] = int(np.nanargmax(sims)) + + recon_img = brain_recons[best_picks[0]] + + return recon_img + +def decode_latents(latents,vae): + latents = 1 / 0.18215 * latents + image = vae.decode(latents).sample + image = (image / 2 + 0.5).clamp(0, 1) + return image + +# Numpy Utility +def iterate_range(start, length, batchsize): + batch_count = int(length // batchsize ) + residual = int(length % batchsize) + for i in range(batch_count): + yield range(start+i*batchsize, start+(i+1)*batchsize),batchsize + if(residual>0): + yield range(start+batch_count*batchsize,start+length),residual + +# Torch fwRF +def get_value(_x): + return np.copy(_x.data.cpu().numpy()) + +def soft_cont_loss(student_preds, teacher_preds, teacher_aug_preds, temp=0.125): + teacher_teacher_aug = (teacher_preds @ teacher_aug_preds.T)/temp + teacher_teacher_aug_t = (teacher_aug_preds @ teacher_preds.T)/temp + student_teacher_aug = (student_preds @ teacher_aug_preds.T)/temp + student_teacher_aug_t = (teacher_aug_preds @ student_preds.T)/temp + + loss1 = -(student_teacher_aug.log_softmax(-1) * teacher_teacher_aug.softmax(-1)).sum(-1).mean() + loss2 = -(student_teacher_aug_t.log_softmax(-1) * teacher_teacher_aug_t.softmax(-1)).sum(-1).mean() + + loss = (loss1 + loss2)/2 + return loss + +def format_tiled_figure(images, captions, rows, cols, red_line_index=None, buffer=10, mode=0, title=None, font_size=60): + """ + Assembles a tiled figure of images with optional captions and a red background behind a specified column or row. + + :param images: List of PIL Image objects, ordered row-wise. + :param captions: List of captions, length and usage depends on mode. + :param rows: Number of rows in the image grid. + :param cols: Number of columns in the image grid. + :param red_line_index: Index of the row or column to highlight with a red background (0-indexed). + :param buffer: Buffer value in pixels for space between images. + :param mode: Mode of the figure assembly. + :param title: Title of the figure, used in mode 1 and mode 3. + :return: PIL Image object of the assembled figure. + """ + + # Find the smallest width and height among all images + min_width, min_height = min(img.size for img in images) + + # Resize all images to the smallest dimensions + images = [img.resize((min_width, min_height), Image.ANTIALIAS) for img in images] + + # Font setup + # font_size = 60 # Base font size for readability + row_caption_font_size = font_size + title_font_size = int(1.3 * font_size) + title_font = ImageFont.truetype("arial.ttf", title_font_size) + row_caption_font = ImageFont.truetype("arial.ttf", row_caption_font_size) + + # Calculate dimensions for the entire canvas + caption_height = row_caption_font_size if mode in [0, 1] else 0 + title_height = int(title_font_size * 1.3) if mode in [1, 3] and title is not None or mode in [2] and captions is not None else 0 # Adjusted to include mode 3 + row_title_width = int(row_caption_font_size * 1.5) if mode == 3 else 0 + extra_buffer_w = buffer if (red_line_index is not None and mode in [0, 1, 2]) else 0 + extra_buffer_h = buffer if (red_line_index is not None and mode == 3) else 0 + + # Calculate the total canvas width and height + total_width = cols * (min_width + buffer) + row_title_width + buffer + extra_buffer_w + total_height = rows * (min_height + buffer) + title_height + rows * caption_height + buffer + extra_buffer_h + + # Create a new image with a white background + canvas = Image.new('RGB', (total_width, total_height), color='white') + + # Prepare the drawing context + draw = ImageDraw.Draw(canvas) + + # Draw the title for modes 1 and 3 + if mode in [1, 3] and title is not None: # Adjusted to include mode 3 + text_width, text_height = draw.textsize(title, font=title_font) + draw.text(((total_width - text_width) // 2, (title_height - text_height) // 2), title, font=title_font, fill='black') + + # Draw red background before placing images if a red line index is specified + if red_line_index is not None: + if mode in [0, 1, 2]: # Red column + red_x = row_title_width + red_line_index * (min_width + buffer) + red_y = title_height + red_width = min_width + buffer * 2 + red_height = total_height - title_height + canvas.paste(Image.new('RGB', (red_width, red_height), color='red'), (red_x, red_y)) + elif mode == 3: # Red row + red_x = row_title_width + red_y = title_height + red_line_index * (min_height + buffer) + red_width = total_width - row_title_width + red_height = min_height + buffer * 2 + canvas.paste(Image.new('RGB', (red_width, red_height), color='red'), (red_x, red_y)) + + # Insert images into the canvas + for row in range(rows): + for col in range(cols): + idx = row * cols + col + if idx >= len(images): + continue + + img = images[idx] + x = col * (min_width + buffer) + row_title_width + buffer + y = row * (min_height + buffer) + title_height + buffer + + # Adjust the x position if there is a red column + if mode in [0, 1, 2] and red_line_index is not None and col > red_line_index: + x += extra_buffer_w + + # Adjust the y position if there is a red row + if mode == 3 and red_line_index is not None and row > red_line_index: + y += extra_buffer_h + + # Paste the image + canvas.paste(img, (x, y)) + # Draw the vertical text for row titles if mode is 3 + if mode == 3: + for row, caption in enumerate(captions): + # Calculate the caption size using the default font + width, height = row_caption_font.getsize(caption) + + text_image = Image.new('RGBA', (width, height), (0, 0, 0, 0)) + draw = ImageDraw.Draw(text_image) + draw.text((0, 0), text=caption, font=row_caption_font, fill='black') + + # Rotate the text image to be vertical + text_image = text_image.rotate(90, expand=1) + + # Calculate the y position for the vertical text + y = row * (min_height + buffer) + (min_width - width )//2 + title_height + if row > 0: + y += buffer + + # Calculate the x position, accounting for the increased text size + x = 0 + + # Paste the rotated text image onto the canvas + canvas.paste(text_image, (x, y), text_image) + + # Draw captions for each image for modes 0 and 1 + if mode in [0, 1]: + for idx, caption in enumerate(captions): + col = idx % cols + row = idx // cols + text_width, text_height = draw.textsize(caption, font=row_caption_font) + x = col * (min_width + buffer) + row_title_width + buffer + (min_width - text_width) // 2 + y = (row + 1) * (min_height + buffer) + title_height - text_height // 2 + draw.text((x, y), caption, font=row_caption_font, fill='black') + + # Draw column titles if mode is 2 + if mode == 2: + for col, caption in enumerate(captions): + text_width, text_height = draw.textsize(caption, font=row_caption_font) + x = col * (min_width + buffer) + row_title_width + buffer + (min_width - text_width) // 2 + y = buffer + draw.text((x, y), caption, font=row_caption_font, fill='black') + + return canvas + +def condition_average(x, y, cond, nest=False): + idx, idx_count = np.unique(cond, return_counts=True) + idx_list = [np.array(cond)==i for i in np.sort(idx)] + if nest: + avg_x = torch.zeros((len(idx), idx_count.max(), x.shape[1]), dtype=torch.float32) + else: + avg_x = torch.zeros((len(idx), 1, x.shape[1]), dtype=torch.float32) + arranged_y = torch.zeros((len(idx)), y.shape[1], y.shape[2], y.shape[3]) + for i, m in enumerate(idx_list): + if nest: + if np.sum(m) == idx_count.max(): + avg_x[i] = x[m] + else: + avg_x[i,:np.sum(m)] = x[m] + else: + avg_x[i] = torch.mean(x[m], axis=0) + arranged_y[i] = y[m[0]] + + return avg_x, y, len(idx_count) + +def condition_average_old(x, y, cond, nest=False): + idx, idx_count = np.unique(cond, return_counts=True) + idx_list = [np.array(cond)==i for i in np.sort(idx)] + if nest: + avg_x = torch.zeros((len(idx), idx_count.max(), x.shape[1]), dtype=torch.float32) + else: + avg_x = torch.zeros((len(idx), 1, x.shape[1]), dtype=torch.float32) + arranged_y = torch.zeros((len(idx)), y.shape[1], y.shape[2], y.shape[3]) + for i, m in enumerate(idx_list): + if nest: + if np.sum(m) == idx_count.max(): + avg_x[i] = x[m] + else: + avg_x[i,:np.sum(m)] = x[m] + else: + avg_x[i] = torch.mean(x[m], axis=0) + arranged_y[i] = y[m[0]] + + return avg_x, y, len(idx_count) + +#subject: nsd subject index between 1-8 +#mode: vision, imagery +#stimtype: all, simple, complex, concepts +#average: whether to average across trials, will produce x that is (stimuli, 1, voxels) +#nest: whether to nest the data according to stimuli, will produce x that is (stimuli, trials, voxels) +#data_root: path to where the dataset is saved. +def load_nsd_mental_imagery(subject, mode, stimtype="all", average=False, num_reps = 16, nest=False, snr=-1, data_root="../dataset/"): + # This file has a bunch of information about the stimuli and cue associations that will make loading it easier + img_stim_file = f"{data_root}/nsddata_stimuli/stimuli/nsdimagery_stimuli.pkl3" + ex_file = open(img_stim_file, 'rb') + imagery_dict = pickle.load(ex_file) + ex_file.close() + # Indicates what experiments trials belong to + exps = imagery_dict['exps'] + # Indicates the cues for different stimuli + cues = imagery_dict['cues'] + # Maps the cues to the stimulus image information + image_map = imagery_dict['image_map'] + # Organize the indices of the trials according to the modality and the type of stimuli + cond_idx = { + 'visionsimple': np.arange(len(exps))[exps=='visA'], + 'visioncomplex': np.arange(len(exps))[exps=='visB'], + 'visionconcepts': np.arange(len(exps))[exps=='visC'], + 'visionall': np.arange(len(exps))[np.logical_or(np.logical_or(exps=='visA', exps=='visB'), exps=='visC')], + 'imagerysimple': np.arange(len(exps))[np.logical_or(exps=='imgA_1', exps=='imgA_2')], + 'imagerycomplex': np.arange(len(exps))[np.logical_or(exps=='imgB_1', exps=='imgB_2')], + 'imageryconcepts': np.arange(len(exps))[np.logical_or(exps=='imgC_1', exps=='imgC_2')], + 'imageryall': np.arange(len(exps))[np.logical_or( + np.logical_or( + np.logical_or(exps=='imgA_1', exps=='imgA_2'), + np.logical_or(exps=='imgB_1', exps=='imgB_2')), + np.logical_or(exps=='imgC_1', exps=='imgC_2'))]} + # Load normalized betas + if snr == -1.0: + x = torch.load(f"{data_root}/preprocessed_data/subject{subject}/nsd_imagery.pt").requires_grad_(False).to("cpu") + else: + if not os.path.exists(f"{data_root}/preprocessed_data/subject{subject}/nsd_imagery_whole_brain.pt"): + create_whole_region_imagery_unnormalized(subject = subject, mask=False, data_path=data_root) + create_whole_region_imagery_normalized(subject = subject, mask=False, data_path=data_root) + x = torch.load(f"{data_root}/preprocessed_data/subject{subject}/nsd_imagery_whole_brain.pt") + snr_mask = calculate_snr_mask(subject, snr, data_path=data_root) + x = x[:,snr_mask] + # Find the trial indices conditioned on the type of trials we want to load + cond_im_idx = {n: [image_map[c] for c in cues[idx]] for n,idx in cond_idx.items()} + conditionals = cond_im_idx[mode+stimtype] + # Stimuli file is of shape (18,3,425,425), these can be converted back into PIL images using transforms.ToPILImage() + y = torch.load(f"{data_root}/nsddata_stimuli/stimuli/imagery_stimuli_18.pt").requires_grad_(False).to("cpu") + # Prune the beta file down to specific experimental mode/stimuli type + x = x[cond_idx[mode+stimtype]] + # # If stimtype is not all, then prune the image data down to the specific stimuli type + if stimtype == "simple": + y = y[:6] + elif stimtype == "complex": + y = y[6:12] + elif stimtype == "concepts": + y = y[12:] + + # Average or nest the betas across trials + if average or nest: + x, y, sample_count = condition_average(x, y, conditionals, nest=nest) + else: + x = x.reshape((x.shape[0], 1, x.shape[1])) + y = y[conditionals] + + print(x.shape, y.shape) + return x, y + +#subject: nsd subject index between 1-8 +#average: whether to average across trials, will produce x that is (stimuli, 1, voxels) +#nest: whether to nest the data according to stimuli, will produce x that is (stimuli, trials, voxels) +#data_root: path to where the dataset is saved. +def load_nsd_synthetic(subject, average=False, nest=False, data_root="../dataset/"): + y = torch.zeros((284, 3, 714, 1360)) + y[:220] = torch.load(f"{data_root}/nsddata_stimuli/stimuli/nsdsynthetic/nsd_synthetic_stim_part1.pt") + #The last 64 stimuli are slightly different for each subject, so we load these separately for each subject + y[220:] = torch.load(f"{data_root}/nsddata_stimuli/stimuli/nsdsynthetic/nsd_synthetic_stim_part2_sub{subject}.pt") + + x = torch.load(f"{data_root}/preprocessed_data/subject{subject}/nsd_synthetic.pt").requires_grad_(False).to("cpu") + conditionals = loadmat(f'{data_root}/nsddata/experiments/nsdsynthetic/nsdsynthetic_expdesign.mat')['masterordering'][0].astype(int) - 1 + + if average or nest: + x, y, sample_count = condition_average(x, y, conditionals, nest=nest) + else: + x = x.reshape((x.shape[0], 1, x.shape[1])) + y = y[conditionals] + print(x.shape, y.shape) + return x, y + +#subject: subject index between 1-3, or the subject identifier: subj01, subj02, subj03. These are NOT the NSD subjects as this is a different datasets +#mode: vision, imagery +#mask: True or False, if true masks the betas to visual cortex, otherwise returns the whole scanned region +#stimtype: stimuli, cue, object + # - stimuli will return the images with content that was either seen or imagined, this is what was presented to the subject in vision trials + # - cue will return only the background images with the cue and no content, this is what was presented to the subject in imagery trials + # - object will return only the object in the image with no cue or location brackets. This should be used for model training where we dont want the model to learn the brackets or the cue. +#average: whether to average across trials, will produce x that is (stimuli, 1, voxels) +#nest: whether to nest the data according to stimuli, will produce x that is (stimuli, trials, voxels) + # WARNING: Not all stimuli have the same number of repeats, so the middle dimension for the trial repetitions will contain empty values for some stimuli, be sure to account for this when loading +def load_imageryrf(subject, mode, mask=True, stimtype="object", average=False, nest=False, split=False, data_root="../dataset/"): + + # This file has a bunch of information about the stimuli and cue associations that will make loading it easier + img_conditional_file = f"{data_root}/imageryrf_single_trial/stimuli/imageryrf_conditions.pkl3" + ex_file = open(img_conditional_file, 'rb') + conditional_dict = pd.compat.pickle_compat.load(ex_file) + ex_file.close() + stimuli_metadata = conditional_dict['stimuli_metadata'] + # If subject identifier is int, grab the string identifer + if isinstance(subject, int): + subject = f"subj0{subject}" + subject_cond = conditional_dict[subject] + # Indicates what experiments trials belong to + exps = subject_cond['experiment_cond'] + # Maps the cues to the stimulus image information + image_map = subject_cond['stimuli_cond'].to(int) + # Identify and condition on the stimuli that will be the test set + test_idx = torch.tensor([0,7,15,23,35,47,51,63]) + object_idx = torch.tensor(stimuli_metadata['object_idx'].values) + test_indices = [idx for idx, value in enumerate(object_idx) if value in test_idx] + + # Organize the indices of the trials according to the modality and the type of stimuli + cond_idx = { + 'vision': np.arange(len(exps))[np.char.find(exps, 'pcp') != -1], + 'imagery': np.arange(len(exps))[np.char.find(exps, 'img') != -1], + 'all': np.arange(len(exps)), + 'visiontrain': np.arange(len(exps))[np.logical_and(np.char.find(exps, 'pcp') != -1, ~np.isin(image_map, test_indices))], + 'visiontest': np.arange(len(exps))[np.logical_and(np.char.find(exps, 'pcp') != -1, np.isin(image_map, test_indices))], + 'imagerytrain': np.arange(len(exps))[np.logical_and(np.char.find(exps, 'img') != -1, ~np.isin(image_map, test_indices))], + 'imagerytest': np.arange(len(exps))[np.logical_and(np.char.find(exps, 'img') != -1, np.isin(image_map, test_indices))], + 'alltrain': np.arange(len(exps))[~np.isin(image_map, test_indices)], + 'alltest': np.arange(len(exps))[np.isin(image_map, test_indices)]} + # Load normalized betas + if mask: + x = torch.load(f"{data_root}/imageryrf_single_trial/{subject}/single_trial_betas_masked.pt").requires_grad_(False).to("cpu") + else: + x = torch.load(f"{data_root}/imageryrf_single_trial/{subject}/single_trial_betas.pt").requires_grad_(False).to("cpu") + y = torch.load(f"{data_root}/imageryrf_single_trial/stimuli/{stimtype}_images.pt").requires_grad_(False).to("cpu") + # Find the stimuli indices conditioned on the mode of trials we want to load + if split: + conditionals_train = image_map[cond_idx[mode+'train']] + conditionals_test = image_map[cond_idx[mode+'test']] + x_train = x[cond_idx[mode+'train']] + x_test = x[cond_idx[mode+'test']] + y_train = y[~torch.isin(torch.arange(len(y)), torch.tensor(test_indices))] + y_test = y[test_indices] + else: + conditionals = image_map[cond_idx[mode]] + # Prune the beta file down to specific experimental mode/stimuli type + x = x[cond_idx[mode]] + + # Average or nest the betas across trials + if average or nest: + if split: + x_train, y_train, sample_count = condition_average_old(x_train, y_train, conditionals_train, nest=nest) + x_test, y_test, sample_count = condition_average_old(x_test, y_test, conditionals_test, nest=nest) + else: + x, y, sample_count = condition_average_old(x, y, conditionals, nest=nest) + else: + if split: + x_train = x_train.reshape((x_train.shape[0], x_train.shape[1])) + x_test = x_test.reshape((x_test.shape[0], x_test.shape[1])) + y_train = y[conditionals_train] + y_test = y[conditionals_test] + + else: + x = x.reshape((x.shape[0], x.shape[1])) + y = y[conditionals] + + if split: + print(x_train.shape, y_train.shape, x_test.shape, y_test.shape) + return x_train, y_train, x_test, y_test + else: + print(x.shape, y.shape) + return x, y + + +def read_betas(subject, session_index, trial_index=[], data_type='betas_fithrf_GLMdenoise_RR', data_format='fsaverage', mask=None, data_path="../dataset"): + """read_betas read betas from MRI files + + Parameters + ---------- + subject : str + subject identifier, such as 'subj01' + session_index : int + which session, counting from 1 + trial_index : list, optional + which trials from this session's file to return, by default [], which returns all trials + data_type : str, optional + which type of beta values to return from ['betas_assumehrf', 'betas_fithrf', 'betas_fithrf_GLMdenoise_RR', 'restingbetas_fithrf'], by default 'betas_fithrf_GLMdenoise_RR' + data_format : str, optional + what type of data format, from ['fsaverage', 'func1pt8mm', 'func1mm'], by default 'fsaverage' + mask : numpy.ndarray, if defined, selects 'mat' data_format, needs volumetric data_format + binary/boolean mask into mat file beta data format. + + Returns + ------- + numpy.ndarray, 2D (fsaverage) or 4D (other data formats) + the requested per-trial beta values + """ + + data_folder = f'{data_path}/nsddata_betas/ppdata/{subject}/{data_format}/{data_type}' + + si_str = str(session_index).zfill(2) + + out_data = nb.load( + op.join(data_folder, f'betas_session{si_str}.nii.gz')).get_fdata() + + if len(trial_index) == 0: + trial_index = slice(0, out_data.shape[-1]) + + return out_data[..., trial_index] + + +def create_whole_region_unnormalized(subject: int = 1, include_heldout: bool = True, + mask_nsd_general: bool = False, data_path="../dataset") -> None: + """Creates and saves an unnormalized whole region tensor for a given subject. + + This function loads, processes, and saves whole region neural data for a given subject. + The data can be optionally masked using the NSD general mask, and include held-out sessions. + + Args: + subject (int, optional): The subject number (1-8). Defaults to 1. + include_heldout (bool, optional): Whether to include held-out data. Defaults to True. + mask_nsd_general (bool, optional): Whether to apply the NSD general mask. Defaults to False. + data_path (str, optional): The path to the data directory. Defaults to "../dataset". + + Returns: + None: The function saves the processed tensor to a file and does not return anything. + """ + + os.makedirs(f"{data_path}/preprocessed_data/subject{subject}/", exist_ok=True) + + # Determine the output file path and the number of scans based on function parameters. + if include_heldout and mask_nsd_general: + file_path = f"{data_path}/preprocessed_data/subject{subject}/nsd_general_unnormalized_include_heldout.pt" + num_scans = {1: 40, 2: 40, 3: 32, 4: 30, 5: 40, 6: 32, 7: 40, 8: 30} + elif include_heldout and not mask_nsd_general: + file_path = f"{data_path}/preprocessed_data/subject{subject}/whole_brain_unnormalized_include_heldout.pt" + num_scans = {1: 40, 2: 40, 3: 32, 4: 30, 5: 40, 6: 32, 7: 40, 8: 30} + elif not include_heldout and not mask_nsd_general: + file_path = f"{data_path}/preprocessed_data/subject{subject}/whole_brain_unnormalized.pt" + num_scans = {1: 40, 2: 40, 3: 32, 4: 30, 5: 40, 6: 32, 7: 40, 8: 30} + else: + file_path = f"{data_path}/preprocessed_data/subject{subject}/nsd_general_unnormalized.pt" + num_scans = {1: 37, 2: 37, 3: 32, 4: 30, 5: 37, 6: 32, 7: 37, 8: 30} + + # If the file already exists, exit the function + if os.path.exists(file_path): + return + + # Apply the NSD general mask if required. + if mask_nsd_general: + nsd_general = nb.load(f"{data_path}/nsddata/ppdata/subj0{subject}/func1pt8mm/roi/nsdgeneral.nii.gz").get_fdata() + nsd_general = np.nan_to_num(nsd_general) + mask = nsd_general == 1.0 + else: + brainmask_inflated = nb.load(f"{data_path}/nsddata/ppdata/subj0{subject}/func1pt8mm/roi/brainmask_inflated_1.0.nii").get_fdata() + brainmask_inflated = np.nan_to_num(brainmask_inflated) + mask = brainmask_inflated == 1.0 + + layer_size = np.sum(mask == True) + + data = num_scans[subject] + whole_region = torch.zeros((750 * data, layer_size)) + + mask = np.nan_to_num(mask) + mask = np.array(mask.flatten(), dtype=bool) + + # Loads the full collection of beta sessions for subject 1 + for i in tqdm(range(1, data + 1), desc="Loading raw scanning session data"): + beta = read_betas(subject="subj0" + str(subject), + session_index=i, + trial_index=[], # Empty list as index means get all 750 scans for this session (trial --> scan) + data_type="betas_fithrf_GLMdenoise_RR", + data_format='func1pt8mm', + data_path=data_path) + + # Reshape the beta trails to be flattened. + beta = beta.reshape((mask.shape[0], beta.shape[3])) + + for j in range(beta.shape[1]): + + # Grab the current beta trail. + current_scan = beta[:, j] + + # One scan session. + single_scan = torch.from_numpy(current_scan) + + # Discard the unmasked values and keeps the masked values. + whole_region[j + (i-1)*beta.shape[1]] = single_scan[mask] + + # Save the tensor into the data directory. + torch.nan_to_num(whole_region) + torch.save(whole_region, file_path) + +def zscore(x, mean=None, stddev=None, return_stats=False): + if mean is not None: + m = mean + else: + m = torch.mean(x, axis=0, keepdims=True) + if stddev is not None: + s = stddev + else: + s = torch.std(x, axis=0, keepdims=True) + if return_stats: + return (x - m)/(s+1e-6), m, s + else: + return (x - m)/(s+1e-6) + +def create_whole_region_normalized(subject = 1, include_heldout=False, mask_nsd_general=False, data_path="../dataset/"): + + if include_heldout and mask_nsd_general: + file = f"{data_path}/preprocessed_data/subject{subject}/nsd_general_include_heldout.pt" + + # File has already been created + if os.path.exists(file): return + + whole_region = torch.load(f"{data_path}/preprocessed_data/subject{subject}/nsd_general_unnormalized_include_heldout.pt") + numScans = {1: 40, 2: 40, 3:32, 4: 30, 5:40, 6:32, 7:40, 8:30} + + elif include_heldout and not mask_nsd_general: + file = f"{data_path}/preprocessed_data/subject{subject}/whole_brain_include_heldout.pt" + + # File has already been created + if os.path.exists(file): return + + whole_region = torch.load(f"{data_path}/preprocessed_data/subject{subject}/whole_brain_unnormalized_include_heldout.pt") + numScans = {1: 40, 2: 40, 3:32, 4: 30, 5:40, 6:32, 7:40, 8:30} + + elif not include_heldout and not mask_nsd_general: + file = f"{data_path}/preprocessed_data/subject{subject}/whole_brain.pt" + + # File has already been created + if os.path.exists(file): return + + whole_region = torch.load(f"{data_path}/preprocessed_data/subject{subject}/whole_brain_unnormalized.pt") + numScans = {1: 40, 2: 40, 3:32, 4: 30, 5:40, 6:32, 7:40, 8:30} + + else: + file = f"{data_path}/preprocessed_data/subject{subject}/nsd_general.pt" + + # File has already been created + if os.path.exists(file): return + + whole_region = torch.load(f"{data_path}/preprocessed_data/subject{subjec}/nsd_general_unnormalized.pt") + numScans = {1: 37, 2: 37, 3:32, 4: 30, 5:37, 6:32, 7:37, 8:30} + + whole_region_norm = torch.zeros_like(whole_region) + + stim_descriptions = pd.read_csv(f'{data_path}/nsddata/experiments/nsd/nsd_stim_info_merged.csv', index_col=0) + subj_train = stim_descriptions[(stim_descriptions[f'subject{subject}'] != 0) & (stim_descriptions['shared1000'] == False)] + train_ids = [] + + for i in range(subj_train.shape[0]): + for j in range(3): + scanID = subj_train.iloc[i][f'subject{subject}_rep{j}'] - 1 + if scanID < numScans[subject]*750: + train_ids.append(scanID) + normalizing_data = whole_region[torch.tensor(train_ids)] + print(normalizing_data.shape, whole_region.shape) + + # Normalize the data using Z scoring method for each voxel + for i in range(normalizing_data.shape[1]): + voxel_mean, voxel_std = torch.mean(normalizing_data[:, i]), torch.std(normalizing_data[:, i]) + normalized_voxel = (whole_region[:, i] - voxel_mean) / voxel_std + whole_region_norm[:, i] = normalized_voxel + + # Save the tensor of normalized data + torch.save(whole_region_norm, file) + convert_from_pt_to_hdf5(file, f"{data_path}/betas_all_whole_brain_subj{subject:02d}_fp32_renorm.hdf5") + +def create_whole_region_imagery_unnormalized(subject = 1, mask=True, GLMdenoise=True, data_path="../dataset/"): + + os.makedirs(f"{data_path}/preprocessed_data/subject{subject}/", exist_ok=True) + if GLMdenoise: + beta_file = f"{data_path}/nsddata_betas/ppdata/subj0{subject}/func1pt8mm/nsdimagerybetas_fithrf_GLMdenoise_RR/betas_nsdimagery.nii.gz" + else: + file += "_b2" + beta_file = f"{data_path}/nsddata_betas/ppdata/subj0{subject}/func1pt8mm/nsdimagerybetas_fithrf/betas_nsdimagery.nii.gz" + + imagery_betas = nb.load(beta_file).get_fdata() + + imagery_betas = imagery_betas.transpose((3,0,1,2)) + if mask: + file = f"{data_path}/preprocessed_data/subject{subject}/nsd_imagery_unnormalized.pt" + nsd_general = nb.load(f"{data_path}/nsddata/ppdata/subj0{subject}/func1pt8mm/roi/nsdgeneral.nii.gz").get_fdata() + nsd_general = np.where(nsd_general==1.0, True, False) + nsd_general_mask = np.nan_to_num(nsd_general) + nsd_mask = np.array(nsd_general_mask.flatten(), dtype=bool) + whole_region = torch.from_numpy(imagery_betas.reshape((len(imagery_betas), -1))[:,nsd_general.flatten()].astype(np.float32)) + else: + file = f"{data_path}/preprocessed_data/subject{subject}/nsd_imagery_unnormalized_whole_brain.pt" + whole_brain = nb.load(f"{data_path}/nsddata/ppdata/subj0{subject}/func1pt8mm/roi/brainmask_inflated_1.0.nii").get_fdata() + whole_brain = np.where(whole_brain==1.0, True, False) + whole_brain_mask = np.nan_to_num(whole_brain) + whole_brain_mask = np.array(whole_brain_mask.flatten(), dtype=bool) + whole_region = torch.from_numpy(imagery_betas.reshape((len(imagery_betas), -1))[:,whole_brain_mask.flatten()].astype(np.float32)) + + torch.save(whole_region, file) + return whole_region + +def convert_from_pt_to_hdf5(load_data_path="../dataset/", save_data_path="../dataset/"): + + # Load the tensor + tensor = torch.load(load_data_path).requires_grad_(False).to("cpu") + + # Convert the tensor to a numpy array (h5py works with numpy arrays) + tensor_numpy = tensor.numpy() + + # Save the tensor to the specified HDF5 format + with h5py.File(save_data_path, 'w') as hdf: + hdf.create_dataset('betas', data=tensor_numpy) + + +def create_whole_region_imagery_normalized(subject = 1, mask=True, GLMdenoise=True, data_path="../dataset/"): + img_stim_file = f"{data_path}/nsddata_stimuli/stimuli/nsd/nsdimagery_stimuli.pkl3" + ex_file = open(img_stim_file, 'rb') + imagery_dict = pickle.load(ex_file) + ex_file.close() + exps = imagery_dict['exps'] + cues = imagery_dict['cues'] + meta_cond_idx = { + 'visA': np.arange(len(exps))[exps=='visA'], + 'visB': np.arange(len(exps))[exps=='visB'], + 'visC': np.arange(len(exps))[exps=='visC'], + 'imgA_1': np.arange(len(exps))[exps=='imgA_1'], + 'imgA_2': np.arange(len(exps))[exps=='imgA_2'], + 'imgB_1': np.arange(len(exps))[exps=='imgB_1'], + 'imgB_2': np.arange(len(exps))[exps=='imgB_2'], + 'imgC_1': np.arange(len(exps))[exps=='imgC_1'], + 'imgC_2': np.arange(len(exps))[exps=='imgC_2'], + 'attA': np.arange(len(exps))[exps=='attA'], + 'attB': np.arange(len(exps))[exps=='attB'], + 'attC': np.arange(len(exps))[exps=='attC'], + } + unnormalized_file = f"{data_path}/preprocessed_data/subject{subject}/nsd_imagery_unnormalized" + output_file = f"{data_path}/preprocessed_data/subject{subject}/nsd_imagery" + if not GLMdenoise: + unnormalized_file += "_b2" + output_file += "_b2" + if not mask: + unnormalized_file += "_whole_brain" + output_file += "_whole_brain" + whole_region = torch.load(unnormalized_file + ".pt") + whole_region = whole_region / 300. + whole_region_norm = torch.zeros_like(whole_region) + + # Normalize the data using Z scoring method for each voxel + for c,idx in meta_cond_idx.items(): + whole_region_norm[idx] = zscore(whole_region[idx]) + + # Save the tensor of normalized data + torch.save(whole_region_norm, output_file + ".pt") + # Delete NSD unnormalized file after the normalized data is created. + if(os.path.exists(unnormalized_file + ".pt")): + os.remove(unnormalized_file + ".pt") + +def calculate_snr(betas): + averaged_betas = torch.mean(betas, dim=1) + signal = torch.var(averaged_betas, dim=0) + trial_variance = torch.var(betas, dim=1) + noise = torch.mean(trial_variance, dim=0) + snr = signal / noise + snr = torch.nan_to_num(snr) + return snr, signal, noise + +def create_snr_betas(subject=1, data_type=torch.float16, data_path="../dataset/", threshold=-1.0): + + if threshold != -1.0: + create_whole_region_unnormalized(subject = subject, include_heldout=True, mask_nsd_general=False, data_path=data_path) + create_whole_region_normalized(subject = subject, include_heldout=True, mask_nsd_general=False, data_path=data_path) + # Load the tensor from the HDF5 file + with h5py.File(f'{data_path}/betas_all_whole_brain_subj{subject:02d}_fp32_renorm.hdf5', 'r') as f: + betas = f['betas'][:] + betas = torch.from_numpy(betas).to("cpu") + + snr_mask = calculate_snr_mask(subject, threshold, betas=betas, data_path=data_path) + + # Filter out the zero columns + betas = betas[:, snr_mask] + + else: + with h5py.File(f'{data_path}/betas_all_subj{subject:02d}_fp32_renorm.hdf5', 'r') as f: + betas = f['betas'][:] + betas = torch.from_numpy(betas).to("cpu") + + return betas.to(data_type) + +def load_nsd(subject, betas=None, data_path="../dataset/"): + # Load betas if not provided + if betas is None: + with h5py.File(f'{data_path}/betas_all_subj{subject:02d}_fp32_renorm.hdf5', 'r') as f: + betas = f['betas'][:] + betas = torch.from_numpy(betas).to("cpu") + + # Load stimulus descriptions + stim_descriptions = pd.read_csv( + os.path.join(data_path, "nsd_stim_info_merged.csv"), index_col=0 + ) + + # Define repeat columns + rep_columns = [f"subject{subject}_rep{j}" for j in range(3)] + + # Filter training data (exclude shared1000 trials) + subj_train = stim_descriptions[ + (stim_descriptions[f"subject{subject}"] != 0) & (stim_descriptions["shared1000"] == False) + ] + + # Get the scan IDs for the three repeats in training data + scan_ids_train = subj_train[rep_columns].values - 1 # Convert to zero-based indices + + # Flatten the scan IDs for training data + flat_scan_ids_train = scan_ids_train.flatten() + + # Create an array of nsd IDs repeated for each repeat in training data + nsd_ids_train = subj_train["nsdId"].values + repeated_nsd_ids_train = np.repeat(nsd_ids_train, 3) + + # Handle missing values and invalid indices in training data + valid_mask_train = ( + (~np.isnan(flat_scan_ids_train)) + & (flat_scan_ids_train >= 0) + & (flat_scan_ids_train < betas.shape[0]) + ) + valid_scan_ids_train = flat_scan_ids_train[valid_mask_train].astype(int) + valid_nsd_ids_train = repeated_nsd_ids_train[valid_mask_train].astype(int) + + # Extract the corresponding brain activity data for training data + x_train = betas[valid_scan_ids_train] + + # Filter test data (include shared1000 trials) + subj_test = stim_descriptions[ + (stim_descriptions[f"subject{subject}"] != 0) & (stim_descriptions["shared1000"] == True) + ] + + # Get the scan IDs for the three repeats in test data + scan_ids_test = subj_test[rep_columns].values - 1 # Convert to zero-based indices + + # Handle missing values and invalid indices in test data + valid_mask_test = ( + (~np.isnan(scan_ids_test)) + & (scan_ids_test >= 0) + & (scan_ids_test < betas.shape[0]) + ) + scan_ids_test[~valid_mask_test] = -1 # Mark invalid indices with -1 + + # Prepare to extract betas for test data + num_test_trials, num_repeats = scan_ids_test.shape + betas_test = torch.zeros((num_test_trials, num_repeats, betas.shape[1]), dtype=betas.dtype) + + # Extract betas for valid scan IDs + for i in range(num_test_trials): + for j in range(num_repeats): + scan_id = scan_ids_test[i, j] + if scan_id >= 0: + betas_test[i, j] = betas[int(scan_id)] + + # Create a mask tensor for valid betas + valid_mask_test_tensor = torch.from_numpy(valid_mask_test.astype(np.float32)) + + # Sum over repeats + betas_test_sum = betas_test.sum(dim=1) # Shape: (1000, voxels) + + # Count valid repeats for each trial + valid_counts = valid_mask_test.sum(axis=1) # Shape: (1000,) + valid_counts_tensor = torch.from_numpy(valid_counts).float().unsqueeze(1) + + # Avoid division by zero + valid_counts_tensor[valid_counts_tensor == 0] = 1 + + # Compute the average over valid repeats + x_test = betas_test_sum / valid_counts_tensor + + # Set x_test to zero where there are no valid repeats + zero_counts = (valid_counts == 0) + if zero_counts.any(): + x_test[zero_counts] = 0 + + # Get nsd IDs for test data + test_nsd_ids = subj_test["nsdId"].values.astype(int) + + return x_train, valid_nsd_ids_train, x_test, test_nsd_ids + + +def calculate_snr_mask(subject, threshold, betas=None, data_path="../dataset/"): + + if betas is None: + beta_file = f"{data_path}/preprocessed_data/subject{subject}/whole_brain_include_heldout.pt" + x = torch.load(beta_file).requires_grad_(False).to("cpu") + else: + x = betas + + # Load stimulus descriptions + stim_descriptions = pd.read_csv(f"{data_path}/nsddata/experiments/nsd/nsd_stim_info_merged.csv", index_col=0) + + # Filter training and testing data + subj_train = stim_descriptions[ + (stim_descriptions[f'subject{subject}'] != 0) & (stim_descriptions['shared1000'] == False) + ] + subj_test = stim_descriptions[ + (stim_descriptions[f'subject{subject}'] != 0) & (stim_descriptions['shared1000'] == True) + ] + + # Prepare the scan IDs + rep_columns = [f'subject{subject}_rep{j}' for j in range(3)] + scanIds = subj_train[rep_columns].values - 1 # Convert to zero-based indices + + # Handle missing values and invalid indices + scanIds = np.where(np.isnan(scanIds), -1, scanIds).astype(int) + valid_mask = (scanIds >= 0) & (scanIds < x.shape[0]) + + # Flatten arrays for advanced indexing + flat_scanIds = scanIds.flatten() + flat_valid_mask = valid_mask.flatten() + + # Indices of valid scan IDs + valid_indices = np.where(flat_valid_mask)[0] + valid_scanIds = flat_scanIds[valid_indices] + + # Map valid_indices back to (i, j) indices + i_indices = valid_indices // 3 + j_indices = valid_indices % 3 + + # Retrieve corresponding x values + x_values = x[valid_scanIds] + + # Initialize x_train tensor + x_train = torch.zeros((subj_train.shape[0], 3, x.shape[1]), dtype=x.dtype) + + # Assign x_values to x_train at the correct positions + x_train[i_indices, j_indices, :] = x_values + + snr, signal, noise = calculate_snr(x_train) + condition = snr > threshold + snr_tensor = torch.where(condition, x, torch.tensor(0.0)) + snr_mask = (snr_tensor != 0.0).any(dim=0) + + return snr_mask + + +def get_kastner_masks(subject, data_path): + kastner_labels = f"{data_path}/nsddata/freesurfer/subj0{subject}/label/Kastner2015.mgz.ctab" + brainmask_inflated = nib.load(f"{data_path}/nsddata/ppdata/subj0{subject}/func1pt8mm/roi/brainmask_inflated_1.0.nii").get_fdata() + brainmask_inflated = np.nan_to_num(brainmask_inflated) + brainmask_inflated = np.where(brainmask_inflated==1.0, True, False) + + masks = [] + for hemi in ["lh", "rh"]: + masks.append(nib.load(f"{data_path}/nsddata/ppdata/subj0{subject}/func1pt8mm/roi/{hemi}.Kastner2015.nii.gz").get_fdata()) + kastner_mask = masks[0] + masks[1] + kastner_mask = kastner_mask[brainmask_inflated] + with open(kastner_labels, 'r') as file: + labels = file.read().splitlines() + kastner_mask_labeled = {} + for label in labels[1:]: + label = label.split(" ") + kastner_mask_labeled[label[1].strip()] = np.where(kastner_mask==int(label[0]), True, False) + + return kastner_mask_labeled \ No newline at end of file diff --git a/spurious_reconstruction/analysis/1_case_study/feature-decoding/config/.ipynb_checkpoints/ArtificialShapes_from_deeprecon_fmriprep_rep5_500voxel_caffe_vgg19_allunits_fastl2lir_alpha100-checkpoint.yaml b/spurious_reconstruction/analysis/1_case_study/feature-decoding/config/.ipynb_checkpoints/ArtificialShapes_from_deeprecon_fmriprep_rep5_500voxel_caffe_vgg19_allunits_fastl2lir_alpha100-checkpoint.yaml new file mode 100644 index 0000000000000000000000000000000000000000..1a42a27d7e366c16116288054d39abe26183fd4c --- /dev/null +++ b/spurious_reconstruction/analysis/1_case_study/feature-decoding/config/.ipynb_checkpoints/ArtificialShapes_from_deeprecon_fmriprep_rep5_500voxel_caffe_vgg19_allunits_fastl2lir_alpha100-checkpoint.yaml @@ -0,0 +1,65 @@ +analysis name: deeprecon_fmriprep_rep5_500voxel_allunits_fastl2lir_alpha100 + +# fMRI data +training fmri: + sub01: + - ./data/fmri_data/sub01_ImageNetTraining_volume_native.h5 + +test fmri: + sub01: + - ./data/fmri_data/sub01_ImageNetTest_volume_native.h5 + +rois: + VC: ROI_VC = 1 + +rois voxel num: + VC: 500 + +label key: + stimulus_name + +# DNN features +training feature dir: + - ./data/ImageNetTraining/derivatives/features + +test feature dir: + - ./data/ArtificialShapes/derivatives/features + +network: + caffe/VGG_ILSVRC_19_layers + +layers: + - conv1_1 + - conv1_2 + - conv2_1 + - conv2_2 + - conv3_1 + - conv3_2 + - conv3_3 + - conv3_4 + - conv4_1 + - conv4_2 + - conv4_3 + - conv4_4 + - conv5_1 + - conv5_2 + - conv5_3 + - conv5_4 + - fc6 + - fc7 + - fc8 + #- relu6 + #- relu7 + +# Feature decoders +feature decoder dir: + ./data/ImageNetTraining/derivatives/feature_decoders + +# Decoded features +decoded feature dir: + ./data/ArtificialShapes/derivatives/decoded_features +# Learning parameters +alpha: 100 +chunk axis: 1 + +save_training_decoded_feat: 1 \ No newline at end of file diff --git a/spurious_reconstruction/analysis/1_case_study/feature-decoding/config/.ipynb_checkpoints/NSD_fmriprep_rep3_trialaverage_allvoxel_pytorch_braindiffuser_allunits_fastl2lir_alpha100000-checkpoint.yaml b/spurious_reconstruction/analysis/1_case_study/feature-decoding/config/.ipynb_checkpoints/NSD_fmriprep_rep3_trialaverage_allvoxel_pytorch_braindiffuser_allunits_fastl2lir_alpha100000-checkpoint.yaml new file mode 100644 index 0000000000000000000000000000000000000000..49bce5e1085f20ad4ed09ad8511fbae33c29a084 --- /dev/null +++ b/spurious_reconstruction/analysis/1_case_study/feature-decoding/config/.ipynb_checkpoints/NSD_fmriprep_rep3_trialaverage_allvoxel_pytorch_braindiffuser_allunits_fastl2lir_alpha100000-checkpoint.yaml @@ -0,0 +1,51 @@ +analysis name: nsd-betasfithrfGLMdenoiseRR_trainnoave_testave_fastl2lir_alpha_100000 + +# This is the same as the Brain diffusers paper. +training fmri: + nsd-01: + - ./data/fmri_data/nsd-37ses_sub-01_func1pt8mm_betas_fithrf_GLMdenoise_RR_roifixed_20230425_unique.h5 + + #- /home/nu/data/fmri_shared/datasets/NSD/nsd-37ses_sub-01_func1pt8mm_betas_fithrf_GLMdenoise_RR_roifixed_20230425_unique.h5 + # sub-05: + + # sub-07: + +test fmri: + nsd-01: + - ./data/fmri_data/nsd-37ses_sub-01_func1pt8mm_betas_fithrf_GLMdenoise_RR_roifixed_20230425_shared1000.h5 + #- /home/nu/data/fmri_shared/datasets/NSD/nsd-37ses_sub-01_func1pt8mm_betas_fithrf_GLMdenoise_RR_roifixed_20230425_shared1000.h5 + +rois: + NSDgeneral: ROI_lh.nsdgeneral_nsdgeneral + ROI_rh.nsdgeneral_nsdgeneral + +rois voxel num: + NSDgeneral: 0 + +label key: + stimulus_name + +# DNN features +training feature dir: + - ./data/NSD-stimuli/derivatives/features/ + +test feature dir: + - ./data/NSD-stimuli/derivatives/features/ + +network: + pytorch/brain_diffuser_versatile_diffusion + +layers: + - vision_encoder + - text_encoder + +# Feature decoders +feature decoder dir: + ./data/NSD-stimuli/derivatives/feature_decoders + +# Decoded features +decoded feature dir: + ./data/NSD-stimuli/derivatives/decoded_features + +# Learning parameters +alpha: 100000 +chunk axis: 1 diff --git a/spurious_reconstruction/analysis/1_case_study/feature-decoding/config/.ipynb_checkpoints/deeprecon_fmriprep_rep5_500voxel_caffe_VGG19_allunits_fastl2lir_alpha100-checkpoint.yaml b/spurious_reconstruction/analysis/1_case_study/feature-decoding/config/.ipynb_checkpoints/deeprecon_fmriprep_rep5_500voxel_caffe_VGG19_allunits_fastl2lir_alpha100-checkpoint.yaml new file mode 100644 index 0000000000000000000000000000000000000000..db867fb31d6a209ebc8f5ce6f6d75ef93c3e7045 --- /dev/null +++ b/spurious_reconstruction/analysis/1_case_study/feature-decoding/config/.ipynb_checkpoints/deeprecon_fmriprep_rep5_500voxel_caffe_VGG19_allunits_fastl2lir_alpha100-checkpoint.yaml @@ -0,0 +1,67 @@ +analysis name: deeprecon_fmriprep_rep5_500voxel_allunits_fastl2lir_alpha100 + +# fMRI data +training fmri: + sub01: + - ./data/fmri_data/sub01_ImageNetTraining_volume_native.h5 + +test fmri: + sub01: + - ./data/fmri_data/sub01_ImageNetTest_volume_native.h5 + +rois: + VC: ROI_VC = 1 + + +rois voxel num: + VC: 500 + + +label key: + stimulus_name + +# DNN features +training feature dir: + - /data/ImageNetTraining/derivatives/features + +test feature dir: + - ./data/ImageNetTest/derivatives/features + +network: + caffe/VGG_ILSVRC_19_layers + +layers: + - conv1_1 + - conv1_2 + - conv2_1 + - conv2_2 + - conv3_1 + - conv3_2 + - conv3_3 + - conv3_4 + - conv4_1 + - conv4_2 + - conv4_3 + - conv4_4 + - conv5_1 + - conv5_2 + - conv5_3 + - conv5_4 + - fc6 + - fc7 + - fc8 + + +# Feature decoders +feature decoder dir: + ./data/ImageNetTraining/derivatives/feature_decoders + +# Decoded features +decoded feature dir: + ./data/ImageNetTest/derivatives/decoded_features + +# Learning parameters +alpha: 100 +chunk axis: 1 + +save_training_decoded_feat: 1 \ No newline at end of file diff --git a/spurious_reconstruction/analysis/1_case_study/feature-decoding/config/.ipynb_checkpoints/deeprecon_testImageNet_trainnoave_testave_fastl2lir_alpha_100000_versatile_diffusion-checkpoint.yaml b/spurious_reconstruction/analysis/1_case_study/feature-decoding/config/.ipynb_checkpoints/deeprecon_testImageNet_trainnoave_testave_fastl2lir_alpha_100000_versatile_diffusion-checkpoint.yaml new file mode 100644 index 0000000000000000000000000000000000000000..d07cf1c4cff41b6afe1834a0c597ea3c1606e75d --- /dev/null +++ b/spurious_reconstruction/analysis/1_case_study/feature-decoding/config/.ipynb_checkpoints/deeprecon_testImageNet_trainnoave_testave_fastl2lir_alpha_100000_versatile_diffusion-checkpoint.yaml @@ -0,0 +1,45 @@ +analysis name: deeprecon_testImageNet_trainnoave_testave_fastl2lir_alpha_100000 + +# fMRI data +training fmri: + sub01: + - ./data/fmri_data/sub01_ImageNetTraining_volume_native.h5 +test fmri: + sub01: + - ./data/fmri_data/sub01_ImageNetTest_volume_native.h5 + + +rois: + VC: ROI_VC = 1 + +rois voxel num: + VC: 0 + +label key: + stimulus_name + +# DNN features +training feature dir: + - ./data/ImageNetTraining/derivatives/features + +test feature dir: + - ./data/ImageNetTest/derivatives/features + +network: + pytorch/brain_diffuser_versatile_diffusion + +layers: + - vision_encoder + - text_encoder + +# Feature decoders +feature decoder dir: + ./data/ImageNetTraining/derivatives/feature_decoders + +# Decoded features +decoded feature dir: + ./data/ImageNetTest/derivatives/decoded_features + +# Learning parameters +alpha: 100000 +chunk axis: 1 diff --git a/spurious_reconstruction/analysis/1_case_study/feature-decoding/config/.ipynb_checkpoints/nsd-37ses_func1pt8mm_betas_fithrf_GLMdenoise_RR_testshared1000_trainnoave_testave_fastl2lir_a100_vgg19_allunits-checkpoint.yaml b/spurious_reconstruction/analysis/1_case_study/feature-decoding/config/.ipynb_checkpoints/nsd-37ses_func1pt8mm_betas_fithrf_GLMdenoise_RR_testshared1000_trainnoave_testave_fastl2lir_a100_vgg19_allunits-checkpoint.yaml new file mode 100644 index 0000000000000000000000000000000000000000..7be97066de9014d145f7990bc9cc6dba8f5d637c --- /dev/null +++ b/spurious_reconstruction/analysis/1_case_study/feature-decoding/config/.ipynb_checkpoints/nsd-37ses_func1pt8mm_betas_fithrf_GLMdenoise_RR_testshared1000_trainnoave_testave_fastl2lir_a100_vgg19_allunits-checkpoint.yaml @@ -0,0 +1,87 @@ +analysis name: nsd-37ses_func1pt8mm_betas_fithrf_GLMdenoise_RR_testshared1000_trainnoave_testave_fastl2lir_a100 + +# fMRI data ################################################################## + +training fmri: + nsd-01: + - /weka/proj-medarc/shared/mindeyev2_dataset/ + # - ./data/fmri_data/datasets/NSD/nsd-37ses_sub-01_func1pt8mm_betas_fithrf_GLMdenoise_RR_roifixed_20230425_unique.h5 + + + # - /home/kiss/data/fmri_shared/datasets/NSD/nsd-37ses_sub-02_fmriprep_preproc_shift2vol_avequivol_unique.h5 + # sub-05: + + # sub-07: + +test fmri: + nsd-01: + - ./data/fmri_data/datasets/NSD/nsd-37ses_sub-01_func1pt8mm_betas_fithrf_GLMdenoise_RR_roifixed_20230425_shared1000.h5 + # sub-02: + # - /home/kiss/data/fmri_shared/datasets/NSD/nsd-37ses_sub-02_fmriprep_preproc_shift2vol_avequivol_shared1000.h5 + +rois: + #WholeVC: ROI_HCP_MMP1_WholeVC + nsdgeneral: ROI_lh.nsdgeneral_nsdgeneral + ROI_rh.nsdgeneral_nsdgeneral + +# The number of voxels used in feature decoding +rois voxel num: + WholeVC: 500 + nsdgeneral: 500 + +label key: + stimulus_name + +# DNN features ############################################################### + +training feature dir: + - /weka/proj-fmri/ckadirt/spurious_reconstruction/analysis/0_preprocessing/features/ + +test feature dir: + - ./data/NSD-stimuli/derivatives/features + +network: + pytorch/vgg19_torchvision + +layers: + - features[0] + - features[2] + # - conv1_1 + # - conv1_2 + # - conv2_1 + # - conv2_2 + # - conv3_1 + # - conv3_2 + # - conv3_3 + # - conv3_4 + # - conv4_1 + # - conv4_2 + # - conv4_3 + # - conv4_4 + # - conv5_1 + # - conv5_2 + # - conv5_3 + # - conv5_4 + # - fc6 + # - fc7 + # - fc8 + +# Feature decoding ########################################################### + +feature decoder dir: + ./data/NSD-stimuli/derivatives/feature_decoders + + +# Decoded features +decoded feature dir: + ./data/NSD-stimuli/derivatives/decoded_features + + +test single trial: false + +# Learning parameters +alpha: 100 +chunk axis: 1 + +# Figure output +decoding figure dir: + ./data/NSD-stimuli/derivatives/figures/feature_decoding diff --git a/spurious_reconstruction/analysis/1_case_study/feature-decoding/config/ArtificialShapes_from_deeprecon_fmriprep_rep5_500voxel_caffe_vgg19_allunits_fastl2lir_alpha100.yaml b/spurious_reconstruction/analysis/1_case_study/feature-decoding/config/ArtificialShapes_from_deeprecon_fmriprep_rep5_500voxel_caffe_vgg19_allunits_fastl2lir_alpha100.yaml new file mode 100644 index 0000000000000000000000000000000000000000..1a42a27d7e366c16116288054d39abe26183fd4c --- /dev/null +++ b/spurious_reconstruction/analysis/1_case_study/feature-decoding/config/ArtificialShapes_from_deeprecon_fmriprep_rep5_500voxel_caffe_vgg19_allunits_fastl2lir_alpha100.yaml @@ -0,0 +1,65 @@ +analysis name: deeprecon_fmriprep_rep5_500voxel_allunits_fastl2lir_alpha100 + +# fMRI data +training fmri: + sub01: + - ./data/fmri_data/sub01_ImageNetTraining_volume_native.h5 + +test fmri: + sub01: + - ./data/fmri_data/sub01_ImageNetTest_volume_native.h5 + +rois: + VC: ROI_VC = 1 + +rois voxel num: + VC: 500 + +label key: + stimulus_name + +# DNN features +training feature dir: + - ./data/ImageNetTraining/derivatives/features + +test feature dir: + - ./data/ArtificialShapes/derivatives/features + +network: + caffe/VGG_ILSVRC_19_layers + +layers: + - conv1_1 + - conv1_2 + - conv2_1 + - conv2_2 + - conv3_1 + - conv3_2 + - conv3_3 + - conv3_4 + - conv4_1 + - conv4_2 + - conv4_3 + - conv4_4 + - conv5_1 + - conv5_2 + - conv5_3 + - conv5_4 + - fc6 + - fc7 + - fc8 + #- relu6 + #- relu7 + +# Feature decoders +feature decoder dir: + ./data/ImageNetTraining/derivatives/feature_decoders + +# Decoded features +decoded feature dir: + ./data/ArtificialShapes/derivatives/decoded_features +# Learning parameters +alpha: 100 +chunk axis: 1 + +save_training_decoded_feat: 1 \ No newline at end of file diff --git a/spurious_reconstruction/analysis/1_case_study/feature-decoding/config/NSD_fmriprep_rep3_trialaverage_allvoxel_pytorch_braindiffuser_allunits_fastl2lir_alpha100000.yaml b/spurious_reconstruction/analysis/1_case_study/feature-decoding/config/NSD_fmriprep_rep3_trialaverage_allvoxel_pytorch_braindiffuser_allunits_fastl2lir_alpha100000.yaml new file mode 100644 index 0000000000000000000000000000000000000000..49bce5e1085f20ad4ed09ad8511fbae33c29a084 --- /dev/null +++ b/spurious_reconstruction/analysis/1_case_study/feature-decoding/config/NSD_fmriprep_rep3_trialaverage_allvoxel_pytorch_braindiffuser_allunits_fastl2lir_alpha100000.yaml @@ -0,0 +1,51 @@ +analysis name: nsd-betasfithrfGLMdenoiseRR_trainnoave_testave_fastl2lir_alpha_100000 + +# This is the same as the Brain diffusers paper. +training fmri: + nsd-01: + - ./data/fmri_data/nsd-37ses_sub-01_func1pt8mm_betas_fithrf_GLMdenoise_RR_roifixed_20230425_unique.h5 + + #- /home/nu/data/fmri_shared/datasets/NSD/nsd-37ses_sub-01_func1pt8mm_betas_fithrf_GLMdenoise_RR_roifixed_20230425_unique.h5 + # sub-05: + + # sub-07: + +test fmri: + nsd-01: + - ./data/fmri_data/nsd-37ses_sub-01_func1pt8mm_betas_fithrf_GLMdenoise_RR_roifixed_20230425_shared1000.h5 + #- /home/nu/data/fmri_shared/datasets/NSD/nsd-37ses_sub-01_func1pt8mm_betas_fithrf_GLMdenoise_RR_roifixed_20230425_shared1000.h5 + +rois: + NSDgeneral: ROI_lh.nsdgeneral_nsdgeneral + ROI_rh.nsdgeneral_nsdgeneral + +rois voxel num: + NSDgeneral: 0 + +label key: + stimulus_name + +# DNN features +training feature dir: + - ./data/NSD-stimuli/derivatives/features/ + +test feature dir: + - ./data/NSD-stimuli/derivatives/features/ + +network: + pytorch/brain_diffuser_versatile_diffusion + +layers: + - vision_encoder + - text_encoder + +# Feature decoders +feature decoder dir: + ./data/NSD-stimuli/derivatives/feature_decoders + +# Decoded features +decoded feature dir: + ./data/NSD-stimuli/derivatives/decoded_features + +# Learning parameters +alpha: 100000 +chunk axis: 1 diff --git a/spurious_reconstruction/analysis/1_case_study/feature-decoding/config/deeprecon_fmriprep_rep5_500voxel_caffe_VGG19_allunits_fastl2lir_alpha100.yaml b/spurious_reconstruction/analysis/1_case_study/feature-decoding/config/deeprecon_fmriprep_rep5_500voxel_caffe_VGG19_allunits_fastl2lir_alpha100.yaml new file mode 100644 index 0000000000000000000000000000000000000000..db867fb31d6a209ebc8f5ce6f6d75ef93c3e7045 --- /dev/null +++ b/spurious_reconstruction/analysis/1_case_study/feature-decoding/config/deeprecon_fmriprep_rep5_500voxel_caffe_VGG19_allunits_fastl2lir_alpha100.yaml @@ -0,0 +1,67 @@ +analysis name: deeprecon_fmriprep_rep5_500voxel_allunits_fastl2lir_alpha100 + +# fMRI data +training fmri: + sub01: + - ./data/fmri_data/sub01_ImageNetTraining_volume_native.h5 + +test fmri: + sub01: + - ./data/fmri_data/sub01_ImageNetTest_volume_native.h5 + +rois: + VC: ROI_VC = 1 + + +rois voxel num: + VC: 500 + + +label key: + stimulus_name + +# DNN features +training feature dir: + - /data/ImageNetTraining/derivatives/features + +test feature dir: + - ./data/ImageNetTest/derivatives/features + +network: + caffe/VGG_ILSVRC_19_layers + +layers: + - conv1_1 + - conv1_2 + - conv2_1 + - conv2_2 + - conv3_1 + - conv3_2 + - conv3_3 + - conv3_4 + - conv4_1 + - conv4_2 + - conv4_3 + - conv4_4 + - conv5_1 + - conv5_2 + - conv5_3 + - conv5_4 + - fc6 + - fc7 + - fc8 + + +# Feature decoders +feature decoder dir: + ./data/ImageNetTraining/derivatives/feature_decoders + +# Decoded features +decoded feature dir: + ./data/ImageNetTest/derivatives/decoded_features + +# Learning parameters +alpha: 100 +chunk axis: 1 + +save_training_decoded_feat: 1 \ No newline at end of file diff --git a/spurious_reconstruction/analysis/1_case_study/feature-decoding/config/deeprecon_testArtificialShapes_trainnoave_testave_fastl2lir_alpha_100000_versatile_diffusion.yaml b/spurious_reconstruction/analysis/1_case_study/feature-decoding/config/deeprecon_testArtificialShapes_trainnoave_testave_fastl2lir_alpha_100000_versatile_diffusion.yaml new file mode 100644 index 0000000000000000000000000000000000000000..63d57c25a13aa796f53aa3095d24879c3acb903e --- /dev/null +++ b/spurious_reconstruction/analysis/1_case_study/feature-decoding/config/deeprecon_testArtificialShapes_trainnoave_testave_fastl2lir_alpha_100000_versatile_diffusion.yaml @@ -0,0 +1,45 @@ +analysis name: deeprecon_testArtificialShapes_trainnoave_testave_fastl2lir_alpha_100000 + +# fMRI data +training fmri: + sub01: + - ./data/fmri_data/sub01_ImageNetTraining_volume_native.h5 + +test fmri: + sub01: + - ./data/fmri_data/sub01_ArtificialShapes_volume_native.h5 + +rois: + VC: ROI_VC = 1 + +rois voxel num: + VC: 0 + +label key: + stimulus_name + +# DNN features +training feature dir: + - ./data/ImageNetTraining/derivatives/features + +test feature dir: + - ./data/ArtificialShapes/derivatives/features + +network: + pytorch/brain_diffuser_versatile_diffusion + +layers: + - vision_encoder + - text_encoder + +# Feature decoders +feature decoder dir: + ./data/ImageNetTraining/derivatives/feature_decoders + +# Decoded features +decoded feature dir: + ./data/ArtificialShapes/derivatives/decoded_features + +# Learning parameters +alpha: 100000 +chunk axis: 1 diff --git a/spurious_reconstruction/analysis/1_case_study/feature-decoding/config/deeprecon_testImageNet_trainnoave_testave_fastl2lir_alpha_100000_versatile_diffusion.yaml b/spurious_reconstruction/analysis/1_case_study/feature-decoding/config/deeprecon_testImageNet_trainnoave_testave_fastl2lir_alpha_100000_versatile_diffusion.yaml new file mode 100644 index 0000000000000000000000000000000000000000..d07cf1c4cff41b6afe1834a0c597ea3c1606e75d --- /dev/null +++ b/spurious_reconstruction/analysis/1_case_study/feature-decoding/config/deeprecon_testImageNet_trainnoave_testave_fastl2lir_alpha_100000_versatile_diffusion.yaml @@ -0,0 +1,45 @@ +analysis name: deeprecon_testImageNet_trainnoave_testave_fastl2lir_alpha_100000 + +# fMRI data +training fmri: + sub01: + - ./data/fmri_data/sub01_ImageNetTraining_volume_native.h5 +test fmri: + sub01: + - ./data/fmri_data/sub01_ImageNetTest_volume_native.h5 + + +rois: + VC: ROI_VC = 1 + +rois voxel num: + VC: 0 + +label key: + stimulus_name + +# DNN features +training feature dir: + - ./data/ImageNetTraining/derivatives/features + +test feature dir: + - ./data/ImageNetTest/derivatives/features + +network: + pytorch/brain_diffuser_versatile_diffusion + +layers: + - vision_encoder + - text_encoder + +# Feature decoders +feature decoder dir: + ./data/ImageNetTraining/derivatives/feature_decoders + +# Decoded features +decoded feature dir: + ./data/ImageNetTest/derivatives/decoded_features + +# Learning parameters +alpha: 100000 +chunk axis: 1 diff --git a/spurious_reconstruction/analysis/1_case_study/feature-decoding/config/nsd-37ses_func1pt8mm_betas_fithrf_GLMdenoise_RR_testshared1000_trainnoave_testave_fastl2lir_a100_vgg19_allunits.yaml b/spurious_reconstruction/analysis/1_case_study/feature-decoding/config/nsd-37ses_func1pt8mm_betas_fithrf_GLMdenoise_RR_testshared1000_trainnoave_testave_fastl2lir_a100_vgg19_allunits.yaml new file mode 100644 index 0000000000000000000000000000000000000000..7be97066de9014d145f7990bc9cc6dba8f5d637c --- /dev/null +++ b/spurious_reconstruction/analysis/1_case_study/feature-decoding/config/nsd-37ses_func1pt8mm_betas_fithrf_GLMdenoise_RR_testshared1000_trainnoave_testave_fastl2lir_a100_vgg19_allunits.yaml @@ -0,0 +1,87 @@ +analysis name: nsd-37ses_func1pt8mm_betas_fithrf_GLMdenoise_RR_testshared1000_trainnoave_testave_fastl2lir_a100 + +# fMRI data ################################################################## + +training fmri: + nsd-01: + - /weka/proj-medarc/shared/mindeyev2_dataset/ + # - ./data/fmri_data/datasets/NSD/nsd-37ses_sub-01_func1pt8mm_betas_fithrf_GLMdenoise_RR_roifixed_20230425_unique.h5 + + + # - /home/kiss/data/fmri_shared/datasets/NSD/nsd-37ses_sub-02_fmriprep_preproc_shift2vol_avequivol_unique.h5 + # sub-05: + + # sub-07: + +test fmri: + nsd-01: + - ./data/fmri_data/datasets/NSD/nsd-37ses_sub-01_func1pt8mm_betas_fithrf_GLMdenoise_RR_roifixed_20230425_shared1000.h5 + # sub-02: + # - /home/kiss/data/fmri_shared/datasets/NSD/nsd-37ses_sub-02_fmriprep_preproc_shift2vol_avequivol_shared1000.h5 + +rois: + #WholeVC: ROI_HCP_MMP1_WholeVC + nsdgeneral: ROI_lh.nsdgeneral_nsdgeneral + ROI_rh.nsdgeneral_nsdgeneral + +# The number of voxels used in feature decoding +rois voxel num: + WholeVC: 500 + nsdgeneral: 500 + +label key: + stimulus_name + +# DNN features ############################################################### + +training feature dir: + - /weka/proj-fmri/ckadirt/spurious_reconstruction/analysis/0_preprocessing/features/ + +test feature dir: + - ./data/NSD-stimuli/derivatives/features + +network: + pytorch/vgg19_torchvision + +layers: + - features[0] + - features[2] + # - conv1_1 + # - conv1_2 + # - conv2_1 + # - conv2_2 + # - conv3_1 + # - conv3_2 + # - conv3_3 + # - conv3_4 + # - conv4_1 + # - conv4_2 + # - conv4_3 + # - conv4_4 + # - conv5_1 + # - conv5_2 + # - conv5_3 + # - conv5_4 + # - fc6 + # - fc7 + # - fc8 + +# Feature decoding ########################################################### + +feature decoder dir: + ./data/NSD-stimuli/derivatives/feature_decoders + + +# Decoded features +decoded feature dir: + ./data/NSD-stimuli/derivatives/decoded_features + + +test single trial: false + +# Learning parameters +alpha: 100 +chunk axis: 1 + +# Figure output +decoding figure dir: + ./data/NSD-stimuli/derivatives/figures/feature_decoding diff --git a/spurious_reconstruction/analysis/1_case_study/feature-decoding/config/umap_space_holdout_split_cv_nsd-betasfithrfGLMdenoiseRR_testshared1000_trainnoave_testave_fastl2lir_alpha_100000_versatile_diffusion.yaml b/spurious_reconstruction/analysis/1_case_study/feature-decoding/config/umap_space_holdout_split_cv_nsd-betasfithrfGLMdenoiseRR_testshared1000_trainnoave_testave_fastl2lir_alpha_100000_versatile_diffusion.yaml new file mode 100644 index 0000000000000000000000000000000000000000..c6176296c27bdab9c83b01f0d9e22825b4694003 --- /dev/null +++ b/spurious_reconstruction/analysis/1_case_study/feature-decoding/config/umap_space_holdout_split_cv_nsd-betasfithrfGLMdenoiseRR_testshared1000_trainnoave_testave_fastl2lir_alpha_100000_versatile_diffusion.yaml @@ -0,0 +1,419 @@ +analysis name: nsd-betasfithrfGLMdenoiseRR_trainnoave_testave_fastl2lir_alpha_100000_umap_space_holdout_split_cv + +#### Leave one cluster out feature decoding +# fMRI data ################################################################## +#In supplementary material > In this study, we used the version named betasfithrfGLMdenoiseRR. +# > The beta weights were z-scored across runs separately for each voxel in each subject. +# This is the same as the Brain diffusers paper. +fmri: + nsd-01: + - ./data/fmri_data/nsd-37ses_sub-01_func1pt8mm_betas_fithrf_GLMdenoise_RR_roifixedadd_cluster_index.h5 + +rois: + NSDgeneral: ROI_lh.nsdgeneral_nsdgeneral + ROI_rh.nsdgeneral_nsdgeneral + +# The number of voxels used in feature decoding +rois voxel num: + NSDgeneral: 0 + +label key: + stimulus_name + +# DNN features ############################################################### + +feature dir: + - ./data/NSD-stimuli/derivatives/features + +network: + pytorch/brain_diffuser_versatile_diffusion + +layers: + - text_encoder + - vision_encoder + +# Feature decoding ########################################################### + +feature decoder dir: + ./data/NSD-stimuli/derivatives/feature_decoding_cv + +# Decoded features +decoded feature dir: + ./data/NSD-stimuli/derivatives/feature_decoding_cv + + +# Cross-validation ----------------------------------------------------------- + +cv key: UMAP_space_hold_out_split +#cv exclusive key: category_index + + # 40fold cross validation for 0 ~ 39 clusters +cv folds: + # 0: + - train: [101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139] + test: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39] + target: [0] + # 1: + - train: [100, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139] + test: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39] + target: [1] + # 2: + - train: [100, 101, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139] + test: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39] + target: [2] + # 3: + - train: [100, 101, 102, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139] + test: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39] + target: [3] + # 4: + - train: [100, 101, 102, 103, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139] + test: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39] + target: [4] + # 5: + - train: [100, 101, 102, 103, 104, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139] + test: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39] + target: [5] + # 6: + - train: [100, 101, 102, 103, 104, 105, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139] + test: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39] + target: [6] + # 7: + - train: [100, 101, 102, 103, 104, 105, 106, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139] + test: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39] + target: [7] + # 8: + - train: [100, 101, 102, 103, 104, 105, 106, 107, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139] + test: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39] + target: [8] + # 9: + - train: [100, 101, 102, 103, 104, 105, 106, 107, 108, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139] + test: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39] + target: [9] + # 10: + - train: [100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139] + test: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39] + target: [10] + # 11: + - train: [100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139] + test: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39] + target: [11] + # 12: + - train: [100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139] + test: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39] + target: [12] + # 13: + - train: [100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139] + test: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39] + target: [13] + # 14: + - train: [100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139] + test: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39] + target: [14] + # 15: + - train: [100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139] + test: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39] + target: [15] + # 16: + - train: [100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139] + test: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39] + target: [16] + # 17: + - train: [100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139] + test: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39] + target: [17] + # 18 + - train: [100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139] + test: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39] + target: [18] + # 19: + - train: [100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139] + test: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39] + target: [19] + # 20: + - train: [100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139] + test: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39] + target: [20] + # 21: + - train: [100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139] + test: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39] + target: [21] + # 22: + - train: [100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139] + test: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39] + target: [22] + # 23: + - train: [100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139] + test: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39] + target: [23] + # 24: + - train: [100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139] + test: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39] + target: [24] + # 25: + - train: [100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139] + test: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39] + target: [25] + # 26: + - train: [100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139] + test: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39] + target: [26] + # 27: + - train: [100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139] + test: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39] + target: [27] + # 28: + - train: [100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139] + test: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39] + target: [28] + # 29: + - train: [100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139] + test: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39] + target: [29] + # 30: + - train: [100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 131, 132, 133, 134, 135, 136, 137, 138, 139] + test: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39] + target: [30] + # 31: + - train: [100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 132, 133, 134, 135, 136, 137, 138, 139] + test: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39] + target: [31] + # 32: + - train: [100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 133, 134, 135, 136, 137, 138, 139] + test: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39] + target: [32] + # 33: + - train: [100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 134, 135, 136, 137, 138, 139] + test: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39] + target: [33] + # 34: + - train: [100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 135, 136, 137, 138, 139] + test: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39] + target: [34] + # 35: + - train: [100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 136, 137, 138, 139] + test: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39] + target: [35] + # 36: + - train: [100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 137, 138, 139] + test: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39] + target: [36] + # 37: + - train: [100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 138, 139] + test: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39] + target: [37] + # 38: + - train: [100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 139] + test: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39] + target: [38] + # 39: + - train: [100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138] + test: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39] + target: [39] + + +# Learning parameters +alpha: 100000 +chunk axis: 1 + +# Figure output +decoding figure dir: + ./data/NSD-stimuli/derivatives/figures/feature_decoding_cv diff --git a/spurious_reconstruction/analysis/1_case_study/feature-decoding/config/umap_space_naive_split_cv_nsd-betasfithrfGLMdenoiseRR_testshared1000_trainnoave_testave_fastl2lir_alpha_100000_versatile_diffusion.yaml b/spurious_reconstruction/analysis/1_case_study/feature-decoding/config/umap_space_naive_split_cv_nsd-betasfithrfGLMdenoiseRR_testshared1000_trainnoave_testave_fastl2lir_alpha_100000_versatile_diffusion.yaml new file mode 100644 index 0000000000000000000000000000000000000000..3cfbab489fe5a131143b747ff9f1c8d87767211b --- /dev/null +++ b/spurious_reconstruction/analysis/1_case_study/feature-decoding/config/umap_space_naive_split_cv_nsd-betasfithrfGLMdenoiseRR_testshared1000_trainnoave_testave_fastl2lir_alpha_100000_versatile_diffusion.yaml @@ -0,0 +1,418 @@ +analysis name: nsd-betasfithrfGLMdenoiseRR_trainnoave_testave_fastl2lir_alpha_100000_umap_space_naive_split_cv + +#### Leave one cluster out feature decoding +# fMRI data ################################################################## +#In supplementary material > In this study, we used the version named betasfithrfGLMdenoiseRR. +# > The beta weights were z-scored across runs separately for each voxel in each subject. +# This is the same as the Brain diffusers paper. +fmri: + nsd-01: + - ./data/fmri_data/nsd-37ses_sub-01_func1pt8mm_betas_fithrf_GLMdenoise_RR_roifixedadd_cluster_index.h5 + +rois: + NSDgeneral: ROI_lh.nsdgeneral_nsdgeneral + ROI_rh.nsdgeneral_nsdgeneral + +# The number of voxels used in feature decoding +rois voxel num: + NSDgeneral: 0 + +label key: + stimulus_name + +# DNN features ############################################################### + +feature dir: + - ./data/NSD-stimuli/derivatives/features + +network: + pytorch/brain_diffuser_versatile_diffusion + +layers: + - text_encoder + - vision_encoder + +# Feature decoding ########################################################### + +feature decoder dir: + ./data/NSD-stimuli/derivatives/feature_decoding_cv + +# Decoded features +decoded feature dir: + ./data/NSD-stimuli/derivatives/feature_decoding_cv + + +# Cross-validation ----------------------------------------------------------- + +cv key: UMAP_space_naive_split +#cv exclusive key: category_index + +cv folds: + # 0: + - train: [101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139] + test: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39] + target: [0] + # 1: + - train: [100, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139] + test: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39] + target: [1] + # 2: + - train: [100, 101, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139] + test: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39] + target: [2] + # 3: + - train: [100, 101, 102, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139] + test: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39] + target: [3] + # 4: + - train: [100, 101, 102, 103, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139] + test: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39] + target: [4] + # 5: + - train: [100, 101, 102, 103, 104, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139] + test: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39] + target: [5] + # 6: + - train: [100, 101, 102, 103, 104, 105, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139] + test: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39] + target: [6] + # 7: + - train: [100, 101, 102, 103, 104, 105, 106, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139] + test: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39] + target: [7] + # 8: + - train: [100, 101, 102, 103, 104, 105, 106, 107, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139] + test: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39] + target: [8] + # 9: + - train: [100, 101, 102, 103, 104, 105, 106, 107, 108, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139] + test: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39] + target: [9] + # 10: + - train: [100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139] + test: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39] + target: [10] + # 11: + - train: [100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139] + test: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39] + target: [11] + # 12: + - train: [100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139] + test: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39] + target: [12] + # 13: + - train: [100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139] + test: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39] + target: [13] + # 14: + - train: [100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139] + test: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39] + target: [14] + # 15: + - train: [100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139] + test: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39] + target: [15] + # 16: + - train: [100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139] + test: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39] + target: [16] + # 17: + - train: [100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139] + test: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39] + target: [17] + # 18 + - train: [100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139] + test: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39] + target: [18] + # 19: + - train: [100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139] + test: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39] + target: [19] + # 20: + - train: [100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139] + test: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39] + target: [20] + # 21: + - train: [100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139] + test: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39] + target: [21] + # 22: + - train: [100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139] + test: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39] + target: [22] + # 23: + - train: [100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139] + test: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39] + target: [23] + # 24: + - train: [100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139] + test: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39] + target: [24] + # 25: + - train: [100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139] + test: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39] + target: [25] + # 26: + - train: [100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139] + test: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39] + target: [26] + # 27: + - train: [100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139] + test: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39] + target: [27] + # 28: + - train: [100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139] + test: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39] + target: [28] + # 29: + - train: [100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139] + test: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39] + target: [29] + # 30: + - train: [100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 131, 132, 133, 134, 135, 136, 137, 138, 139] + test: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39] + target: [30] + # 31: + - train: [100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 132, 133, 134, 135, 136, 137, 138, 139] + test: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39] + target: [31] + # 32: + - train: [100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 133, 134, 135, 136, 137, 138, 139] + test: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39] + target: [32] + # 33: + - train: [100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 134, 135, 136, 137, 138, 139] + test: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39] + target: [33] + # 34: + - train: [100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 135, 136, 137, 138, 139] + test: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39] + target: [34] + # 35: + - train: [100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 136, 137, 138, 139] + test: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39] + target: [35] + # 36: + - train: [100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 137, 138, 139] + test: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39] + target: [36] + # 37: + - train: [100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 138, 139] + test: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39] + target: [37] + # 38: + - train: [100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 139] + test: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39] + target: [38] + # 39: + - train: [100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138] + test: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39] + target: [39] + + +# Learning parameters +alpha: 100000 +chunk axis: 1 + +# Figure output +decoding figure dir: + ./data/NSD-stimuli/derivatives/figures/feature_decoding_cv diff --git a/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/529544.err b/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/529544.err new file mode 100644 index 0000000000000000000000000000000000000000..32fe5c33e392e7288bb7c2ac6a0b42263b281649 --- /dev/null +++ b/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/529544.err @@ -0,0 +1,212 @@ +[NbConvertApp] Converting notebook RR_pytorch.ipynb to python +[NbConvertApp] Writing 23198 bytes to RR_pytorch.py + 0it [00:00, ?it/s] 1it [00:00, 3.08it/s] 147it [00:00, 447.68it/s] 296it [00:00, 764.10it/s] 449it [00:00, 995.15it/s] 603it [00:00, 1157.29it/s] 743it [00:00, 1230.25it/s] 894it [00:00, 1312.98it/s] 1047it [00:01, 1376.17it/s] 1201it [00:01, 1422.61it/s] 1355it [00:01, 1455.85it/s] 1505it [00:01, 1402.56it/s] 1659it [00:01, 1440.85it/s] 1812it [00:01, 1464.41it/s] 1966it [00:01, 1483.95it/s] 2116it [00:01, 1460.37it/s] 2268it [00:01, 1477.43it/s] 2422it [00:01, 1493.62it/s] 2575it [00:02, 1502.44it/s] 2726it [00:02, 1473.96it/s] 2879it [00:02, 1487.78it/s] 3032it [00:02, 1498.25it/s] 3185it [00:02, 1506.17it/s] 3338it [00:02, 1510.43it/s] 3490it [00:02, 1426.77it/s] 3638it [00:02, 1441.35it/s] 3790it [00:02, 1462.86it/s] 3942it [00:02, 1477.31it/s] 4091it [00:03, 1462.64it/s] 4243it [00:03, 1477.69it/s] 4393it [00:03, 1482.70it/s] 4542it [00:03, 1425.96it/s] 4696it [00:03, 1457.01it/s] 4843it [00:03, 1440.85it/s] 4996it [00:03, 1464.13it/s] 5148it [00:03, 1478.72it/s] 5301it [00:03, 1492.40it/s] 5451it [00:04, 1423.57it/s] 5602it [00:04, 1447.39it/s] 5754it [00:04, 1468.21it/s] 5907it [00:04, 1483.90it/s] 6060it [00:04, 1496.14it/s] 6210it [00:04, 1473.58it/s] 6361it [00:04, 1482.15it/s] 6513it [00:04, 1493.00it/s] 6666it [00:04, 1501.58it/s] 6817it [00:04, 1471.61it/s] 6968it [00:05, 1482.45it/s] 7121it [00:05, 1495.42it/s] 7274it [00:05, 1504.86it/s] 7428it [00:05, 1515.06it/s] 7580it [00:05, 1448.73it/s] 7733it [00:05, 1472.23it/s] 7885it [00:05, 1485.87it/s] 8039it [00:05, 1499.68it/s] 8190it [00:05, 1473.40it/s] 8342it [00:05, 1486.34it/s] 8495it [00:06, 1496.60it/s] 8646it [00:06, 1499.84it/s] 8798it [00:06, 1505.04it/s] 8949it [00:06, 1480.76it/s] 9102it [00:06, 1493.63it/s] 9255it [00:06, 1502.74it/s] 9408it [00:06, 1508.42it/s] 9559it [00:06, 1444.08it/s] 9712it [00:06, 1468.46it/s] 9865it [00:06, 1484.21it/s] 10019it [00:07, 1499.18it/s] 10170it [00:07, 1475.79it/s] 10322it [00:07, 1487.68it/s] 10475it [00:07, 1498.01it/s] 10629it [00:07, 1507.70it/s] 10782it [00:07, 1511.56it/s] 10934it [00:07, 1483.46it/s] 11087it [00:07, 1495.08it/s] 11240it [00:07, 1503.67it/s] 11393it [00:08, 1509.12it/s] 11544it [00:08, 1443.64it/s] 11697it [00:08, 1466.25it/s] 11850it [00:08, 1482.98it/s] 12000it [00:08, 1486.34it/s] 12153it [00:08, 1498.40it/s] 12304it [00:08, 1473.33it/s] 12458it [00:08, 1491.20it/s] 12612it [00:08, 1502.82it/s] 12766it [00:08, 1511.59it/s] 12918it [00:09, 1486.47it/s] 13071it [00:09, 1497.13it/s] 13224it [00:09, 1504.02it/s] 13377it [00:09, 1510.30it/s] 13529it [00:09, 1441.10it/s] 13676it [00:09, 1448.19it/s] 13829it [00:09, 1470.53it/s] 13977it [00:09, 1428.78it/s] 14121it [00:09, 1415.26it/s] 14263it [00:09, 1382.46it/s] 14415it [00:10, 1420.93it/s] 14569it [00:10, 1454.70it/s] 14720it [00:10, 1469.42it/s] 14872it [00:10, 1482.04it/s] 15021it [00:10, 1454.40it/s] 15173it [00:10, 1470.96it/s] 15324it [00:10, 1481.04it/s] 15475it [00:10, 1488.75it/s] 15624it [00:10, 1427.03it/s] 15777it [00:11, 1456.00it/s] 15931it [00:11, 1479.15it/s] 16085it [00:11, 1495.70it/s] 16238it [00:11, 1503.04it/s] 16389it [00:11, 1471.85it/s] 16540it [00:11, 1482.29it/s] 16693it [00:11, 1493.77it/s] 16843it [00:11, 1495.21it/s] 16993it [00:11, 1469.13it/s] 17144it [00:11, 1478.35it/s] 17295it [00:12, 1487.33it/s] 17445it [00:12, 1491.04it/s] 17595it [00:12, 1409.37it/s] 17746it [00:12, 1436.16it/s] 17897it [00:12, 1456.99it/s] 18047it [00:12, 1466.89it/s] 18198it [00:12, 1476.89it/s] 18347it [00:12, 1445.02it/s] 18500it [00:12, 1468.85it/s] 18652it [00:12, 1481.81it/s] 18801it [00:13, 1479.18it/s] 18950it [00:13, 1464.66it/s] 19102it [00:13, 1478.21it/s] 19255it [00:13, 1492.36it/s] 19405it [00:13, 1494.08it/s] 19556it [00:13, 1497.09it/s] 19706it [00:13, 1393.70it/s] 19859it [00:13, 1431.76it/s] 20006it [00:13, 1441.90it/s] 20158it [00:13, 1462.37it/s] 20309it [00:14, 1474.67it/s] 20457it [00:14, 1446.56it/s] 20608it [00:14, 1463.53it/s] 20761it [00:14, 1481.19it/s] 20914it [00:14, 1495.33it/s] 21064it [00:14, 1461.37it/s] 21215it [00:14, 1474.05it/s] 21368it [00:14, 1489.56it/s] 21519it [00:14, 1493.58it/s] 21669it [00:15, 1425.54it/s] 21820it [00:15, 1447.51it/s] 21973it [00:15, 1469.50it/s] 22126it [00:15, 1486.09it/s] 22276it [00:15, 1489.70it/s] 22426it [00:15, 1463.51it/s] 22578it [00:15, 1479.61it/s] 22731it [00:15, 1492.34it/s] 22883it [00:15, 1500.47it/s] 23034it [00:16, 1014.58it/s] 23185it [00:16, 1124.47it/s] 23337it [00:16, 1219.84it/s] 23491it [00:16, 1300.49it/s] 23645it [00:16, 1363.52it/s] 23791it [00:16, 1340.76it/s] 23939it [00:16, 1377.48it/s] 24090it [00:16, 1414.52it/s] 24241it [00:16, 1441.79it/s] 24388it [00:17, 1417.16it/s] 24532it [00:17, 1412.66it/s] 24678it [00:17, 1424.66it/s] 24829it [00:17, 1449.66it/s] 24980it [00:17, 1444.34it/s] 25125it [00:17, 1444.58it/s] 25270it [00:17, 1442.62it/s] 25420it [00:17, 1458.96it/s] 25572it [00:17, 1474.46it/s] 25720it [00:17, 1412.92it/s] 25862it [00:18, 1405.71it/s] 26003it [00:18, 1404.66it/s] 26147it [00:18, 1414.38it/s] 26301it [00:18, 1449.65it/s] 26447it [00:18, 1436.94it/s] 26601it [00:18, 1465.52it/s] 26755it [00:18, 1485.63it/s] 26908it [00:18, 1497.82it/s] 27000it [00:18, 1435.74it/s] + 0it [00:00, ?it/s] 137it [00:00, 1367.62it/s] 291it [00:00, 1466.73it/s] 441it [00:00, 1478.35it/s] 595it [00:00, 1500.55it/s] 750it [00:00, 1516.16it/s] 902it [00:00, 1516.55it/s] 1054it [00:00, 1513.91it/s] 1206it [00:00, 1509.18it/s] 1359it [00:00, 1512.91it/s] 1511it [00:01, 1508.21it/s] 1663it [00:01, 1511.12it/s] 1816it [00:01, 1514.86it/s] 1970it [00:01, 1521.79it/s] 2124it [00:01, 1525.06it/s] 2277it [00:01, 1511.73it/s] 2429it [00:01, 1493.03it/s] 2580it [00:01, 1497.26it/s] 2731it [00:01, 1499.98it/s] 2883it [00:01, 1504.56it/s] 3000it [00:01, 1504.83it/s] +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/torchvision/transforms/functional.py:1603: UserWarning: The default value of the antialias parameter of all the resizing transforms (Resize(), RandomResizedCrop(), etc.) will change from None to True in v0.17, in order to be consistent across the PIL and Tensor backends. To suppress this warning, directly pass antialias=True (recommended, future default), antialias=None (current default, which means False for Tensors and True for PIL), or antialias=False (only works on Tensors - PIL will still use antialiasing). This also applies if you are using the inference transforms from the models weights: update the call to weights.transforms(antialias=True). + warnings.warn( + 0%| | 0/22 [00:00 + encoder = feature_network.to(device) + ^^^^^^ +NameError: name 'device' is not defined diff --git a/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/530262.out b/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/530262.out new file mode 100644 index 0000000000000000000000000000000000000000..e00190b96b846a239b6044397d996f5457f0b630 --- /dev/null +++ b/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/530262.out @@ -0,0 +1,8 @@ +NUM_GPUS=1 +MASTER_ADDR=ip-10-0-136-246 +MASTER_PORT=17106 +WORLD_SIZE=1 +PID of this process = 3666463 +loading_betas +betas_ loaded +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) diff --git a/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/530263.out b/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/530263.out new file mode 100644 index 0000000000000000000000000000000000000000..9c648228f16ae266208ea27a7c9ded16fffcff5b --- /dev/null +++ b/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/530263.out @@ -0,0 +1,42 @@ +NUM_GPUS=1 +MASTER_ADDR=ip-10-0-136-246 +MASTER_PORT=11697 +WORLD_SIZE=1 +PID of this process = 3668242 +loading_betas +betas_ loaded +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Calculating split 1 of 32 +start_feature_index: 0, end_feature_index: 2 +Starting ridge regression for split 1 +Finished, now scoring +train_score: 0.43961797280593967, test_score: 0.12262898746321124 +Calculating split 2 of 32 +start_feature_index: 2, end_feature_index: 4 +Starting ridge regression for split 2 +Finished, now scoring +train_score: 0.4420609533471814, test_score: 0.11955063578140628 +Calculating split 3 of 32 +start_feature_index: 4, end_feature_index: 6 +Starting ridge regression for split 3 +Finished, now scoring +train_score: 0.409733075482219, test_score: 0.06866881191540422 +Calculating split 4 of 32 +start_feature_index: 6, end_feature_index: 8 +Starting ridge regression for split 4 +Finished, now scoring +train_score: 0.3892719657212026, test_score: 0.02508124625178609 +Calculating split 5 of 32 +start_feature_index: 8, end_feature_index: 10 +Starting ridge regression for split 5 +Finished, now scoring +train_score: 0.4208839458512488, test_score: 0.10279477262031175 +Calculating split 6 of 32 +start_feature_index: 10, end_feature_index: 12 +Starting ridge regression for split 6 +Finished, now scoring +train_score: 0.35805379655677927, test_score: -0.038708591591389285 +Calculating split 7 of 32 +start_feature_index: 12, end_feature_index: 14 diff --git a/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/530265.err b/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/530265.err new file mode 100644 index 0000000000000000000000000000000000000000..83b0691a308fcfa2b0a4ae794dc26a4648464ba4 --- /dev/null +++ b/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/530265.err @@ -0,0 +1,16131 @@ +[NbConvertApp] Converting notebook RR_sklearn.ipynb to python +[NbConvertApp] Writing 15084 bytes to RR_sklearn.py +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/32 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/32 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable diff --git a/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/530265.out b/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/530265.out new file mode 100644 index 0000000000000000000000000000000000000000..3c51e9ad15e35177fbe8330113becc1282ce3c84 --- /dev/null +++ b/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/530265.out @@ -0,0 +1,343 @@ +NUM_GPUS=1 +MASTER_ADDR=ip-10-0-136-246 +MASTER_PORT=16152 +WORLD_SIZE=1 +Running RR_sklearn.py with argument: features[0] +Calculating for: features[0] +PID of this process = 3701162 +loading_betas +betas_ loaded +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Calculating split 1 of 32 +start_feature_index: 0, end_feature_index: 2 +Starting ridge regression for split 1 +Finished, now scoring +train_score: 0.43961797280593967, test_score: 0.12262898746321124 +Calculating split 2 of 32 +start_feature_index: 2, end_feature_index: 4 +Starting ridge regression for split 2 +Finished, now scoring +train_score: 0.4420609533471814, test_score: 0.11955063578140628 +Calculating split 3 of 32 +start_feature_index: 4, end_feature_index: 6 +Starting ridge regression for split 3 +Finished, now scoring +train_score: 0.409733075482219, test_score: 0.06866881191540422 +Calculating split 4 of 32 +start_feature_index: 6, end_feature_index: 8 +Starting ridge regression for split 4 +Finished, now scoring +train_score: 0.3892719657212026, test_score: 0.02508124625178609 +Calculating split 5 of 32 +start_feature_index: 8, end_feature_index: 10 +Starting ridge regression for split 5 +Finished, now scoring +train_score: 0.4208839458512488, test_score: 0.10279477262031175 +Calculating split 6 of 32 +start_feature_index: 10, end_feature_index: 12 +Starting ridge regression for split 6 +Finished, now scoring +train_score: 0.35805379655677927, test_score: -0.038708591591389285 +Calculating split 7 of 32 +start_feature_index: 12, end_feature_index: 14 +Starting ridge regression for split 7 +Finished, now scoring +train_score: 0.4207197892487834, test_score: 0.10048904668959208 +Calculating split 8 of 32 +start_feature_index: 14, end_feature_index: 16 +Starting ridge regression for split 8 +Finished, now scoring +train_score: 0.4098594740325463, test_score: 0.06536864971748335 +Calculating split 9 of 32 +start_feature_index: 16, end_feature_index: 18 +Starting ridge regression for split 9 +Finished, now scoring +train_score: 0.41730492580185424, test_score: 0.09224790185239921 +Calculating split 10 of 32 +start_feature_index: 18, end_feature_index: 20 +Starting ridge regression for split 10 +Finished, now scoring +train_score: 0.43073432879436785, test_score: 0.11311658655391234 +Calculating split 11 of 32 +start_feature_index: 20, end_feature_index: 22 +Starting ridge regression for split 11 +Finished, now scoring +train_score: 0.3772301143936657, test_score: 0.004609601128898212 +Calculating split 12 of 32 +start_feature_index: 22, end_feature_index: 24 +Starting ridge regression for split 12 +Finished, now scoring +train_score: 0.4198640024285322, test_score: 0.09425590098177483 +Calculating split 13 of 32 +start_feature_index: 24, end_feature_index: 26 +Starting ridge regression for split 13 +Finished, now scoring +train_score: 0.46970390962193437, test_score: 0.18703424542169075 +Calculating split 14 of 32 +start_feature_index: 26, end_feature_index: 28 +Starting ridge regression for split 14 +Finished, now scoring +train_score: 0.4186803932719928, test_score: 0.08878830026459318 +Calculating split 15 of 32 +start_feature_index: 28, end_feature_index: 30 +Starting ridge regression for split 15 +Finished, now scoring +train_score: 0.4623357623303884, test_score: 0.16564646143182157 +Calculating split 16 of 32 +start_feature_index: 30, end_feature_index: 32 +Starting ridge regression for split 16 +Finished, now scoring +train_score: 0.4428224403603844, test_score: 0.11693052108362997 +Calculating split 17 of 32 +start_feature_index: 32, end_feature_index: 34 +Starting ridge regression for split 17 +Finished, now scoring +train_score: 0.45899741707496394, test_score: 0.1565140407692051 +Calculating split 18 of 32 +start_feature_index: 34, end_feature_index: 36 +Starting ridge regression for split 18 +Finished, now scoring +train_score: 0.3532377813277374, test_score: -0.05156226196028894 +Calculating split 19 of 32 +start_feature_index: 36, end_feature_index: 38 +Starting ridge regression for split 19 +Finished, now scoring +train_score: 0.40761129783399613, test_score: 0.050691843856702605 +Calculating split 20 of 32 +start_feature_index: 38, end_feature_index: 40 +Starting ridge regression for split 20 +Finished, now scoring +train_score: 0.4296591323164001, test_score: 0.08860133576903324 +Calculating split 21 of 32 +start_feature_index: 40, end_feature_index: 42 +Starting ridge regression for split 21 +Finished, now scoring +train_score: 0.3711052575252575, test_score: -0.0035224087742689756 +Calculating split 22 of 32 +start_feature_index: 42, end_feature_index: 44 +Starting ridge regression for split 22 +Finished, now scoring +train_score: 0.354009871788245, test_score: -0.05000653266306271 +Calculating split 23 of 32 +start_feature_index: 44, end_feature_index: 46 +Starting ridge regression for split 23 +Finished, now scoring +train_score: 0.35543293990103786, test_score: -0.04642792882744893 +Calculating split 24 of 32 +start_feature_index: 46, end_feature_index: 48 +Starting ridge regression for split 24 +Finished, now scoring +train_score: 0.37367918383547694, test_score: -0.005020636912495178 +Calculating split 25 of 32 +start_feature_index: 48, end_feature_index: 50 +Starting ridge regression for split 25 +Finished, now scoring +train_score: 0.39907295343192484, test_score: 0.05041171929512466 +Calculating split 26 of 32 +start_feature_index: 50, end_feature_index: 52 +Starting ridge regression for split 26 +Finished, now scoring +train_score: 0.4028137256755264, test_score: 0.042913552944783946 +Calculating split 27 of 32 +start_feature_index: 52, end_feature_index: 54 +Starting ridge regression for split 27 +Finished, now scoring +train_score: 0.45884494931390063, test_score: 0.15962847204647632 +Calculating split 28 of 32 +start_feature_index: 54, end_feature_index: 56 +Starting ridge regression for split 28 +Finished, now scoring +train_score: 0.3803549826025851, test_score: 0.012550539058368584 +Calculating split 29 of 32 +start_feature_index: 56, end_feature_index: 58 +Starting ridge regression for split 29 +Finished, now scoring +train_score: 0.36286917868255814, test_score: -0.026640139876911766 +Calculating split 30 of 32 +start_feature_index: 58, end_feature_index: 60 +Starting ridge regression for split 30 +Finished, now scoring +train_score: 0.40234166830880486, test_score: 0.041680097046297576 +Calculating split 31 of 32 +start_feature_index: 60, end_feature_index: 62 +Starting ridge regression for split 31 +Finished, now scoring +train_score: 0.4412064713895805, test_score: 0.11307768196158473 +Calculating split 32 of 32 +start_feature_index: 62, end_feature_index: 64 +Starting ridge regression for split 32 +Finished, now scoring +train_score: 0.3630363331715003, test_score: -0.033548713619885456 +Successfully processed features[0]. +Running RR_sklearn.py with argument: features[2] +Calculating for: features[2] +PID of this process = 103591 +loading_betas +betas_ loaded +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Calculating split 1 of 32 +start_feature_index: 0, end_feature_index: 2 +Starting ridge regression for split 1 +Finished, now scoring +train_score: 0.3624036285673384, test_score: -0.03539947618990537 +Calculating split 2 of 32 +start_feature_index: 2, end_feature_index: 4 +Starting ridge regression for split 2 +Finished, now scoring +train_score: 0.4346528822417684, test_score: 0.13258213786513892 +Calculating split 3 of 32 +start_feature_index: 4, end_feature_index: 6 +Starting ridge regression for split 3 +Finished, now scoring +train_score: 0.43194250025498176, test_score: 0.107280601400451 +Calculating split 4 of 32 +start_feature_index: 6, end_feature_index: 8 +Starting ridge regression for split 4 +Finished, now scoring +train_score: 0.3819760151999601, test_score: 0.01327553597893753 +Calculating split 5 of 32 +start_feature_index: 8, end_feature_index: 10 +Starting ridge regression for split 5 +Finished, now scoring +train_score: 0.3895919565662315, test_score: 0.01487295540560621 +Calculating split 6 of 32 +start_feature_index: 10, end_feature_index: 12 +Starting ridge regression for split 6 +Finished, now scoring +train_score: 0.38955038030020317, test_score: 0.026193178722417543 +Calculating split 7 of 32 +start_feature_index: 12, end_feature_index: 14 +Starting ridge regression for split 7 +Finished, now scoring +train_score: 0.35639489563669313, test_score: -0.04727371466909555 +Calculating split 8 of 32 +start_feature_index: 14, end_feature_index: 16 +Starting ridge regression for split 8 +Finished, now scoring +train_score: 0.40302726540884115, test_score: 0.06795598143590816 +Calculating split 9 of 32 +start_feature_index: 16, end_feature_index: 18 +Starting ridge regression for split 9 +Finished, now scoring +train_score: 0.39246329591021073, test_score: 0.02511025930472783 +Calculating split 10 of 32 +start_feature_index: 18, end_feature_index: 20 +Starting ridge regression for split 10 +Finished, now scoring +train_score: 0.39999263264892876, test_score: 0.04651816121749825 +Calculating split 11 of 32 +start_feature_index: 20, end_feature_index: 22 +Starting ridge regression for split 11 +Finished, now scoring +train_score: 0.35310356325424, test_score: -0.05161772602486059 +Calculating split 12 of 32 +start_feature_index: 22, end_feature_index: 24 +Starting ridge regression for split 12 +Finished, now scoring +train_score: 0.44347836766227455, test_score: 0.12040177171864166 +Calculating split 13 of 32 +start_feature_index: 24, end_feature_index: 26 +Starting ridge regression for split 13 +Finished, now scoring +train_score: 0.46313092503250225, test_score: 0.17195627016161757 +Calculating split 14 of 32 +start_feature_index: 26, end_feature_index: 28 +Starting ridge regression for split 14 +Finished, now scoring +train_score: 0.400685344548867, test_score: 0.05032763219343996 +Calculating split 15 of 32 +start_feature_index: 28, end_feature_index: 30 +Starting ridge regression for split 15 +Finished, now scoring +train_score: 0.3543547824678142, test_score: -0.05118139115051435 +Calculating split 16 of 32 +start_feature_index: 30, end_feature_index: 32 +Starting ridge regression for split 16 +Finished, now scoring +train_score: 0.4052975387721661, test_score: 0.05940322838974442 +Calculating split 17 of 32 +start_feature_index: 32, end_feature_index: 34 +Starting ridge regression for split 17 +Finished, now scoring +train_score: 0.356428811997295, test_score: -0.047999235730142205 +Calculating split 18 of 32 +start_feature_index: 34, end_feature_index: 36 +Starting ridge regression for split 18 +Finished, now scoring +train_score: 0.359934647998418, test_score: -0.0387195926624678 +Calculating split 19 of 32 +start_feature_index: 36, end_feature_index: 38 +Starting ridge regression for split 19 +Finished, now scoring +train_score: 0.36846163315445707, test_score: -0.025178351966862935 +Calculating split 20 of 32 +start_feature_index: 38, end_feature_index: 40 +Starting ridge regression for split 20 +Finished, now scoring +train_score: 0.47410422339228825, test_score: 0.17445089367826963 +Calculating split 21 of 32 +start_feature_index: 40, end_feature_index: 42 +Starting ridge regression for split 21 +Finished, now scoring +train_score: 0.35836351078273504, test_score: -0.04415152629542872 +Calculating split 22 of 32 +start_feature_index: 42, end_feature_index: 44 +Starting ridge regression for split 22 +Finished, now scoring +train_score: 0.4107298096205943, test_score: 0.056498674084921124 +Calculating split 23 of 32 +start_feature_index: 44, end_feature_index: 46 +Starting ridge regression for split 23 +Finished, now scoring +train_score: 0.4053873150179038, test_score: 0.060770868238355064 +Calculating split 24 of 32 +start_feature_index: 46, end_feature_index: 48 +Starting ridge regression for split 24 +Finished, now scoring +train_score: 0.35807739059677884, test_score: -0.04242363596711866 +Calculating split 25 of 32 +start_feature_index: 48, end_feature_index: 50 +Starting ridge regression for split 25 +Finished, now scoring +train_score: 0.4318204246635732, test_score: 0.11587061490873361 +Calculating split 26 of 32 +start_feature_index: 50, end_feature_index: 52 +Starting ridge regression for split 26 +Finished, now scoring +train_score: 0.377655147194052, test_score: -0.009532760010315127 +Calculating split 27 of 32 +start_feature_index: 52, end_feature_index: 54 +Starting ridge regression for split 27 +Finished, now scoring +train_score: 0.38349249278436975, test_score: 0.014447708125006235 +Calculating split 28 of 32 +start_feature_index: 54, end_feature_index: 56 +Starting ridge regression for split 28 +Finished, now scoring +train_score: 0.4243438510543538, test_score: 0.08678420643136765 +Calculating split 29 of 32 +start_feature_index: 56, end_feature_index: 58 +Starting ridge regression for split 29 +Finished, now scoring +train_score: 0.35669086340731265, test_score: -0.04340399605072896 +Calculating split 30 of 32 +start_feature_index: 58, end_feature_index: 60 +Starting ridge regression for split 30 +Finished, now scoring +train_score: 0.3559870811514849, test_score: -0.04645014811754101 +Calculating split 31 of 32 +start_feature_index: 60, end_feature_index: 62 +Starting ridge regression for split 31 +Finished, now scoring +train_score: 0.45867791638772654, test_score: 0.18367642919558672 +Calculating split 32 of 32 +start_feature_index: 62, end_feature_index: 64 +Starting ridge regression for split 32 +Finished, now scoring +train_score: 0.3710079053285374, test_score: -0.01827864730817343 +Successfully processed features[2]. +All features have been processed. diff --git a/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/530266.out b/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/530266.out new file mode 100644 index 0000000000000000000000000000000000000000..bcf2703e2127ea78e925b6da3428df3baf01c449 --- /dev/null +++ b/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/530266.out @@ -0,0 +1,281 @@ +NUM_GPUS=1 +MASTER_ADDR=ip-10-0-136-246 +MASTER_PORT=13096 +WORLD_SIZE=1 +Running RR_sklearn.py with argument: features[5] +Calculating for: features[5] +PID of this process = 3705612 +loading_betas +betas_ loaded +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Calculating split 1 of 16 +start_feature_index: 0, end_feature_index: 8 +Starting ridge regression for split 1 +Finished, now scoring +train_score: 0.3932262985848484, test_score: 0.023062815188333908 +Calculating split 2 of 16 +start_feature_index: 8, end_feature_index: 16 +Starting ridge regression for split 2 +Finished, now scoring +train_score: 0.3737181908772974, test_score: -0.013923470510410853 +Calculating split 3 of 16 +start_feature_index: 16, end_feature_index: 24 +Starting ridge regression for split 3 +Finished, now scoring +train_score: 0.37149439861050276, test_score: -0.017519647813456374 +Calculating split 4 of 16 +start_feature_index: 24, end_feature_index: 32 +Starting ridge regression for split 4 +Finished, now scoring +train_score: 0.38843616862732383, test_score: 0.014723911738631081 +Calculating split 5 of 16 +start_feature_index: 32, end_feature_index: 40 +Starting ridge regression for split 5 +Finished, now scoring +train_score: 0.38853738083827005, test_score: 0.020335364527211745 +Calculating split 6 of 16 +start_feature_index: 40, end_feature_index: 48 +Starting ridge regression for split 6 +Finished, now scoring +train_score: 0.397867315658967, test_score: 0.035411738600218796 +Calculating split 7 of 16 +start_feature_index: 48, end_feature_index: 56 +Starting ridge regression for split 7 +Finished, now scoring +train_score: 0.42147469661963727, test_score: 0.08198641577367435 +Calculating split 8 of 16 +start_feature_index: 56, end_feature_index: 64 +Starting ridge regression for split 8 +Finished, now scoring +train_score: 0.4002436486228073, test_score: 0.03923087758632674 +Calculating split 9 of 16 +start_feature_index: 64, end_feature_index: 72 +Starting ridge regression for split 9 +Finished, now scoring +train_score: 0.39164996952449677, test_score: 0.025612544757627077 +Calculating split 10 of 16 +start_feature_index: 72, end_feature_index: 80 +Starting ridge regression for split 10 +Finished, now scoring +train_score: 0.39124884041559327, test_score: 0.023374037637645985 +Calculating split 11 of 16 +start_feature_index: 80, end_feature_index: 88 +Starting ridge regression for split 11 +Finished, now scoring +train_score: 0.3924443293945909, test_score: 0.02602607708418652 +Calculating split 12 of 16 +start_feature_index: 88, end_feature_index: 96 +Starting ridge regression for split 12 +Finished, now scoring +train_score: 0.39886897111592373, test_score: 0.03940158158001644 +Calculating split 13 of 16 +start_feature_index: 96, end_feature_index: 104 +Starting ridge regression for split 13 +Finished, now scoring +train_score: 0.3770909977160112, test_score: -0.0058721385465031126 +Calculating split 14 of 16 +start_feature_index: 104, end_feature_index: 112 +Starting ridge regression for split 14 +Finished, now scoring +train_score: 0.4011619593126505, test_score: 0.045125094953395416 +Calculating split 15 of 16 +start_feature_index: 112, end_feature_index: 120 +Starting ridge regression for split 15 +Finished, now scoring +train_score: 0.40476604476188793, test_score: 0.05369501827910649 +Calculating split 16 of 16 +start_feature_index: 120, end_feature_index: 128 +Starting ridge regression for split 16 +Finished, now scoring +train_score: 0.39160233147071444, test_score: 0.026291764482168932 +Successfully processed features[5]. +Running RR_sklearn.py with argument: features[7] +Calculating for: features[7] +PID of this process = 3875379 +loading_betas +betas_ loaded +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Calculating split 1 of 16 +start_feature_index: 0, end_feature_index: 8 +Starting ridge regression for split 1 +Finished, now scoring +train_score: 0.3654774707388178, test_score: -0.03002294941735648 +Calculating split 2 of 16 +start_feature_index: 8, end_feature_index: 16 +Starting ridge regression for split 2 +Finished, now scoring +train_score: 0.3607662639660527, test_score: -0.03649377202305062 +Calculating split 3 of 16 +start_feature_index: 16, end_feature_index: 24 +Starting ridge regression for split 3 +Finished, now scoring +train_score: 0.3658511422236684, test_score: -0.02662606525999305 +Calculating split 4 of 16 +start_feature_index: 24, end_feature_index: 32 +Starting ridge regression for split 4 +Finished, now scoring +train_score: 0.3745635734295981, test_score: -0.010530890105902234 +Calculating split 5 of 16 +start_feature_index: 32, end_feature_index: 40 +Starting ridge regression for split 5 +Finished, now scoring +train_score: 0.3793573421318025, test_score: -0.0018379671815309047 +Calculating split 6 of 16 +start_feature_index: 40, end_feature_index: 48 +Starting ridge regression for split 6 +Finished, now scoring +train_score: 0.3646138418008031, test_score: -0.029274266331508456 +Calculating split 7 of 16 +start_feature_index: 48, end_feature_index: 56 +Starting ridge regression for split 7 +Finished, now scoring +train_score: 0.36197408175014223, test_score: -0.03523541090144053 +Calculating split 8 of 16 +start_feature_index: 56, end_feature_index: 64 +Starting ridge regression for split 8 +Finished, now scoring +train_score: 0.3700203675830763, test_score: -0.017586948858360138 +Calculating split 9 of 16 +start_feature_index: 64, end_feature_index: 72 +Starting ridge regression for split 9 +Finished, now scoring +train_score: 0.39076885068375916, test_score: 0.019833501082105246 +Calculating split 10 of 16 +start_feature_index: 72, end_feature_index: 80 +Starting ridge regression for split 10 +Finished, now scoring +train_score: 0.3752828915840107, test_score: -0.009091295221482628 +Calculating split 11 of 16 +start_feature_index: 80, end_feature_index: 88 +Starting ridge regression for split 11 +Finished, now scoring +train_score: 0.37004296785605634, test_score: -0.01735964778903483 +Calculating split 12 of 16 +start_feature_index: 88, end_feature_index: 96 +Starting ridge regression for split 12 +Finished, now scoring +train_score: 0.36727045418126614, test_score: -0.024325933696777692 +Calculating split 13 of 16 +start_feature_index: 96, end_feature_index: 104 +Starting ridge regression for split 13 +Finished, now scoring +train_score: 0.3765988059062598, test_score: -0.006210222132471914 +Calculating split 14 of 16 +start_feature_index: 104, end_feature_index: 112 +Starting ridge regression for split 14 +Finished, now scoring +train_score: 0.3771669860278652, test_score: -0.004918386745153531 +Calculating split 15 of 16 +start_feature_index: 112, end_feature_index: 120 +Starting ridge regression for split 15 +Finished, now scoring +train_score: 0.36694916012273404, test_score: -0.024648562878712 +Calculating split 16 of 16 +start_feature_index: 120, end_feature_index: 128 +Starting ridge regression for split 16 +Finished, now scoring +train_score: 0.379853378931127, test_score: -0.0007158655305310092 +Successfully processed features[7]. +Running RR_sklearn.py with argument: features[10] +Calculating for: features[10] +PID of this process = 4019151 +loading_betas +betas_ loaded +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Calculating split 1 of 8 +start_feature_index: 0, end_feature_index: 32 +Starting ridge regression for split 1 +Finished, now scoring +train_score: 0.39279512291191526, test_score: 0.025677673481974594 +Calculating split 2 of 8 +start_feature_index: 32, end_feature_index: 64 +Starting ridge regression for split 2 +Finished, now scoring +train_score: 0.3871178610040388, test_score: 0.013335177712753686 +Calculating split 3 of 8 +start_feature_index: 64, end_feature_index: 96 +Starting ridge regression for split 3 +Finished, now scoring +train_score: 0.397383314266614, test_score: 0.03248006882017379 +Calculating split 4 of 8 +start_feature_index: 96, end_feature_index: 128 +Starting ridge regression for split 4 +Finished, now scoring +train_score: 0.4008067331689941, test_score: 0.04103283934627476 +Calculating split 5 of 8 +start_feature_index: 128, end_feature_index: 160 +Starting ridge regression for split 5 +Finished, now scoring +train_score: 0.3930204670189207, test_score: 0.025514930908819667 +Calculating split 6 of 8 +start_feature_index: 160, end_feature_index: 192 +Starting ridge regression for split 6 +Finished, now scoring +train_score: 0.39834686892802224, test_score: 0.03363314674152546 +Calculating split 7 of 8 +start_feature_index: 192, end_feature_index: 224 +Starting ridge regression for split 7 +Finished, now scoring +train_score: 0.3969647378616903, test_score: 0.032764157557018524 +Calculating split 8 of 8 +start_feature_index: 224, end_feature_index: 256 +Starting ridge regression for split 8 +Finished, now scoring +train_score: 0.39968393794516066, test_score: 0.035395799810350216 +Successfully processed features[10]. +Running RR_sklearn.py with argument: features[12] +Calculating for: features[12] +PID of this process = 58297 +loading_betas +betas_ loaded +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Calculating split 1 of 8 +start_feature_index: 0, end_feature_index: 32 +Starting ridge regression for split 1 +Finished, now scoring +train_score: 0.4029983783552536, test_score: 0.04607356615459111 +Calculating split 2 of 8 +start_feature_index: 32, end_feature_index: 64 +Starting ridge regression for split 2 +Finished, now scoring +train_score: 0.4087279952557753, test_score: 0.0559147370193226 +Calculating split 3 of 8 +start_feature_index: 64, end_feature_index: 96 +Starting ridge regression for split 3 +Finished, now scoring +train_score: 0.4008230649828104, test_score: 0.04325857917101085 +Calculating split 4 of 8 +start_feature_index: 96, end_feature_index: 128 +Starting ridge regression for split 4 +Finished, now scoring +train_score: 0.4011900340143493, test_score: 0.04078424408837236 +Calculating split 5 of 8 +start_feature_index: 128, end_feature_index: 160 +Starting ridge regression for split 5 +Finished, now scoring +train_score: 0.4006072165986175, test_score: 0.04071349553727029 +Calculating split 6 of 8 +start_feature_index: 160, end_feature_index: 192 +Starting ridge regression for split 6 +Finished, now scoring +train_score: 0.4050970431251038, test_score: 0.05134565624864545 +Calculating split 7 of 8 +start_feature_index: 192, end_feature_index: 224 +Starting ridge regression for split 7 +Finished, now scoring +train_score: 0.402545136381703, test_score: 0.0436122230172333 +Calculating split 8 of 8 +start_feature_index: 224, end_feature_index: 256 +Starting ridge regression for split 8 +Finished, now scoring +train_score: 0.3991305969747884, test_score: 0.037915705686554516 +Successfully processed features[12]. +All features have been processed. diff --git a/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/530267.err b/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/530267.err new file mode 100644 index 0000000000000000000000000000000000000000..b185faf0a603770eafb42e624ba2be19c35eebd8 --- /dev/null +++ b/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/530267.err @@ -0,0 +1,8038 @@ +[NbConvertApp] Converting notebook RR_sklearn.ipynb to python +[NbConvertApp] Writing 15084 bytes to RR_sklearn.py +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/8 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/8 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/4 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/4 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/4 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/4 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable diff --git a/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/530267.out b/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/530267.out new file mode 100644 index 0000000000000000000000000000000000000000..895fa92d14aca9687f5632e51588fad8c7f12982 --- /dev/null +++ b/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/530267.out @@ -0,0 +1,219 @@ +NUM_GPUS=1 +MASTER_ADDR=ip-10-0-136-246 +MASTER_PORT=15360 +WORLD_SIZE=1 +Running RR_sklearn.py with argument: features[14] +Calculating for: features[14] +PID of this process = 3708048 +loading_betas +betas_ loaded +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Calculating split 1 of 8 +start_feature_index: 0, end_feature_index: 32 +Starting ridge regression for split 1 +Finished, now scoring +train_score: 0.41975830332070835, test_score: 0.07930406571427671 +Calculating split 2 of 8 +start_feature_index: 32, end_feature_index: 64 +Starting ridge regression for split 2 +Finished, now scoring +train_score: 0.4229696412461102, test_score: 0.08585148139375297 +Calculating split 3 of 8 +start_feature_index: 64, end_feature_index: 96 +Starting ridge regression for split 3 +Finished, now scoring +train_score: 0.4252610944913884, test_score: 0.09077524027607417 +Calculating split 4 of 8 +start_feature_index: 96, end_feature_index: 128 +Starting ridge regression for split 4 +Finished, now scoring +train_score: 0.42182072693321715, test_score: 0.08206476243691338 +Calculating split 5 of 8 +start_feature_index: 128, end_feature_index: 160 +Starting ridge regression for split 5 +Finished, now scoring +train_score: 0.4289940521673865, test_score: 0.09846107336322436 +Calculating split 6 of 8 +start_feature_index: 160, end_feature_index: 192 +Starting ridge regression for split 6 +Finished, now scoring +train_score: 0.41603296415722785, test_score: 0.0732216250882181 +Calculating split 7 of 8 +start_feature_index: 192, end_feature_index: 224 +Starting ridge regression for split 7 +Finished, now scoring +train_score: 0.430305268864236, test_score: 0.10126445617377543 +Calculating split 8 of 8 +start_feature_index: 224, end_feature_index: 256 +Starting ridge regression for split 8 +Finished, now scoring +train_score: 0.42579766573446914, test_score: 0.08812158884469198 +Successfully processed features[14]. +Running RR_sklearn.py with argument: features[16] +Calculating for: features[16] +PID of this process = 3809435 +loading_betas +betas_ loaded +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Calculating split 1 of 8 +start_feature_index: 0, end_feature_index: 32 +Starting ridge regression for split 1 +Finished, now scoring +train_score: 0.41689806178071087, test_score: 0.07179704710885827 +Calculating split 2 of 8 +start_feature_index: 32, end_feature_index: 64 +Starting ridge regression for split 2 +Finished, now scoring +train_score: 0.4223710802993549, test_score: 0.08311730138492043 +Calculating split 3 of 8 +start_feature_index: 64, end_feature_index: 96 +Starting ridge regression for split 3 +Finished, now scoring +train_score: 0.4104352885509226, test_score: 0.05876356923923965 +Calculating split 4 of 8 +start_feature_index: 96, end_feature_index: 128 +Starting ridge regression for split 4 +Finished, now scoring +train_score: 0.4214350103222247, test_score: 0.08502744597940179 +Calculating split 5 of 8 +start_feature_index: 128, end_feature_index: 160 +Starting ridge regression for split 5 +Finished, now scoring +train_score: 0.41615574163376057, test_score: 0.07059651885112239 +Calculating split 6 of 8 +start_feature_index: 160, end_feature_index: 192 +Starting ridge regression for split 6 +Finished, now scoring +train_score: 0.41190282907894626, test_score: 0.06455226931604495 +Calculating split 7 of 8 +start_feature_index: 192, end_feature_index: 224 +Starting ridge regression for split 7 +Finished, now scoring +train_score: 0.4212980180503417, test_score: 0.08516738680485267 +Calculating split 8 of 8 +start_feature_index: 224, end_feature_index: 256 +Starting ridge regression for split 8 +Finished, now scoring +train_score: 0.4099365652898937, test_score: 0.05834294887482613 +Successfully processed features[16]. +Running RR_sklearn.py with argument: features[19] +Calculating for: features[19] +PID of this process = 3863365 +loading_betas +betas_ loaded +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Calculating split 1 of 4 +start_feature_index: 0, end_feature_index: 128 +Starting ridge regression for split 1 +Finished, now scoring +train_score: 0.4501400507407548, test_score: 0.1353674210058801 +Calculating split 2 of 4 +start_feature_index: 128, end_feature_index: 256 +Starting ridge regression for split 2 +Finished, now scoring +train_score: 0.45199545034829447, test_score: 0.13933925520776025 +Calculating split 3 of 4 +start_feature_index: 256, end_feature_index: 384 +Starting ridge regression for split 3 +Finished, now scoring +train_score: 0.4552284561002871, test_score: 0.14568685141989807 +Calculating split 4 of 4 +start_feature_index: 384, end_feature_index: 512 +Starting ridge regression for split 4 +Finished, now scoring +train_score: 0.4477854375752618, test_score: 0.13159352559782164 +Successfully processed features[19]. +Running RR_sklearn.py with argument: features[21] +Calculating for: features[21] +PID of this process = 3907515 +loading_betas +betas_ loaded +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Calculating split 1 of 4 +start_feature_index: 0, end_feature_index: 128 +Starting ridge regression for split 1 +Finished, now scoring +train_score: 0.44978588643000095, test_score: 0.1357335358396508 +Calculating split 2 of 4 +start_feature_index: 128, end_feature_index: 256 +Starting ridge regression for split 2 +Finished, now scoring +train_score: 0.4417129080960223, test_score: 0.11981491682849309 +Calculating split 3 of 4 +start_feature_index: 256, end_feature_index: 384 +Starting ridge regression for split 3 +Finished, now scoring +train_score: 0.4467301384843588, test_score: 0.12902189704580594 +Calculating split 4 of 4 +start_feature_index: 384, end_feature_index: 512 +Starting ridge regression for split 4 +Finished, now scoring +train_score: 0.4383607736120311, test_score: 0.11455146602673799 +Successfully processed features[21]. +Running RR_sklearn.py with argument: features[23] +Calculating for: features[23] +PID of this process = 3937556 +loading_betas +betas_ loaded +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Calculating split 1 of 4 +start_feature_index: 0, end_feature_index: 128 +Starting ridge regression for split 1 +Finished, now scoring +train_score: 0.42073122967021104, test_score: 0.08188404815619431 +Calculating split 2 of 4 +start_feature_index: 128, end_feature_index: 256 +Starting ridge regression for split 2 +Finished, now scoring +train_score: 0.42942715839978923, test_score: 0.09859541937893006 +Calculating split 3 of 4 +start_feature_index: 256, end_feature_index: 384 +Starting ridge regression for split 3 +Finished, now scoring +train_score: 0.42335075860849036, test_score: 0.08571061305054423 +Calculating split 4 of 4 +start_feature_index: 384, end_feature_index: 512 +Starting ridge regression for split 4 +Finished, now scoring +train_score: 0.4335759784371312, test_score: 0.10561094178956236 +Successfully processed features[23]. +Running RR_sklearn.py with argument: features[25] +Calculating for: features[25] +PID of this process = 3986012 +loading_betas +betas_ loaded +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Calculating split 1 of 4 +start_feature_index: 0, end_feature_index: 128 +Starting ridge regression for split 1 +Finished, now scoring +train_score: 0.42706347355357194, test_score: 0.0937504638032461 +Calculating split 2 of 4 +start_feature_index: 128, end_feature_index: 256 +Starting ridge regression for split 2 +Finished, now scoring +train_score: 0.42420616814382367, test_score: 0.08920230661561457 +Calculating split 3 of 4 +start_feature_index: 256, end_feature_index: 384 +Starting ridge regression for split 3 +Finished, now scoring +train_score: 0.42381031601453223, test_score: 0.08833546173101327 +Calculating split 4 of 4 +start_feature_index: 384, end_feature_index: 512 +Starting ridge regression for split 4 +Finished, now scoring +train_score: 0.42686155204640436, test_score: 0.09376286916853005 +Successfully processed features[25]. +All features have been processed. diff --git a/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/530542.err b/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/530542.err new file mode 100644 index 0000000000000000000000000000000000000000..c5ef8e6ae3934aca539515741730964966726f92 --- /dev/null +++ b/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/530542.err @@ -0,0 +1,1538 @@ +[NbConvertApp] Converting notebook RR_sklearn.ipynb to python +[NbConvertApp] Writing 21906 bytes to RR_sklearn.py +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/2 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/2 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/2 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/2 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/1 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/1 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/1 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable diff --git a/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/530545.err b/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/530545.err new file mode 100644 index 0000000000000000000000000000000000000000..334772f909ded1e0a1ef15154d552ad2ceb6f41c --- /dev/null +++ b/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/530545.err @@ -0,0 +1,14395 @@ +[NbConvertApp] Converting notebook RR_sklearn.ipynb to python +[NbConvertApp] Writing 21906 bytes to RR_sklearn.py +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/32 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/32 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/16 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable diff --git a/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/530548.out b/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/530548.out new file mode 100644 index 0000000000000000000000000000000000000000..a814ff964c29801d17de7fbc76ceeba996cf1faf --- /dev/null +++ b/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/530548.out @@ -0,0 +1,132 @@ +NUM_GPUS=1 +MASTER_ADDR=ip-10-0-129-21 +MASTER_PORT=17266 +WORLD_SIZE=1 +Running RR_sklearn.py with argument: features[14] +Calculating for: features[14] +PID of this process = 1058732 +loading_betas +betas_ loaded +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Calculating split 1 of 8 +start_feature_index: 0, end_feature_index: 32 +Starting ridge regression for split 1 with alpha 30000 +Finished, now scoring +train_score: 0.3039170124339965, test_score: 0.09703129207944823 +Calculating split 2 of 8 +start_feature_index: 32, end_feature_index: 64 +Starting ridge regression for split 2 with alpha 30000 +Finished, now scoring +train_score: 0.3071713861621104, test_score: 0.10221726449050858 +Calculating split 3 of 8 +start_feature_index: 64, end_feature_index: 96 +Starting ridge regression for split 3 with alpha 30000 +Finished, now scoring +train_score: 0.3106900112391069, test_score: 0.10844027855167522 +Calculating split 4 of 8 +start_feature_index: 96, end_feature_index: 128 +Starting ridge regression for split 4 with alpha 30000 +Finished, now scoring +train_score: 0.30630011804401436, test_score: 0.09984576472723872 +Calculating split 5 of 8 +start_feature_index: 128, end_feature_index: 160 +Starting ridge regression for split 5 with alpha 30000 +Finished, now scoring +train_score: 0.3144098177395672, test_score: 0.11486362358148182 +Calculating split 6 of 8 +start_feature_index: 160, end_feature_index: 192 +Starting ridge regression for split 6 with alpha 30000 +Finished, now scoring +train_score: 0.2995545292765363, test_score: 0.09103941731058346 +Calculating split 7 of 8 +start_feature_index: 192, end_feature_index: 224 +Starting ridge regression for split 7 with alpha 30000 +Finished, now scoring +train_score: 0.31590856347640084, test_score: 0.11718718495608195 +Calculating split 8 of 8 +start_feature_index: 224, end_feature_index: 256 +Starting ridge regression for split 8 with alpha 30000 +Finished, now scoring +train_score: 0.3107493604699906, test_score: 0.10499543361741727 +Successfully processed features[14]. +Running RR_sklearn.py with argument: features[16] +Calculating for: features[16] +PID of this process = 1163185 +loading_betas +betas_ loaded +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Calculating split 1 of 8 +start_feature_index: 0, end_feature_index: 32 +Starting ridge regression for split 1 with alpha 25000 +Finished, now scoring +train_score: 0.3198084878501734, test_score: 0.08839753144600444 +Calculating split 2 of 8 +start_feature_index: 32, end_feature_index: 64 +Starting ridge regression for split 2 with alpha 25000 +Finished, now scoring +train_score: 0.32558992022490213, test_score: 0.09863721524032024 +Calculating split 3 of 8 +start_feature_index: 64, end_feature_index: 96 +Starting ridge regression for split 3 with alpha 25000 +Finished, now scoring +train_score: 0.31290319398497274, test_score: 0.07719215900934497 +Calculating split 4 of 8 +start_feature_index: 96, end_feature_index: 128 +Starting ridge regression for split 4 with alpha 25000 +Finished, now scoring +train_score: 0.32509602252333447, test_score: 0.10128713530887412 +Calculating split 5 of 8 +start_feature_index: 128, end_feature_index: 160 +Starting ridge regression for split 5 with alpha 25000 +Finished, now scoring +train_score: 0.3190559521892192, test_score: 0.08734468559565273 +Calculating split 6 of 8 +start_feature_index: 160, end_feature_index: 192 +Starting ridge regression for split 6 with alpha 25000 +Finished, now scoring +train_score: 0.31440732394147336, test_score: 0.08195280716476207 +Calculating split 7 of 8 +start_feature_index: 192, end_feature_index: 224 +Starting ridge regression for split 7 with alpha 25000 +Finished, now scoring +train_score: 0.3243751032058899, test_score: 0.09998310040940542 +Calculating split 8 of 8 +start_feature_index: 224, end_feature_index: 256 +Starting ridge regression for split 8 with alpha 25000 +Finished, now scoring +train_score: 0.3120982425997971, test_score: 0.07616174311008846 +Successfully processed features[16]. +Running RR_sklearn.py with argument: features[19] +Calculating for: features[19] +PID of this process = 1206870 +loading_betas +betas_ loaded +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Calculating split 1 of 4 +start_feature_index: 0, end_feature_index: 128 +Starting ridge regression for split 1 with alpha 25000 +Finished, now scoring +train_score: 0.35588138538393493, test_score: 0.14610418869369898 +Calculating split 2 of 4 +start_feature_index: 128, end_feature_index: 256 +Starting ridge regression for split 2 with alpha 25000 +Finished, now scoring +train_score: 0.35794716721946707, test_score: 0.1494784278122834 +Calculating split 3 of 4 +start_feature_index: 256, end_feature_index: 384 +Starting ridge regression for split 3 with alpha 25000 +Finished, now scoring +train_score: 0.36154527903744166, test_score: 0.15560310522104687 +Calculating split 4 of 4 +start_feature_index: 384, end_feature_index: 512 +Starting ridge regression for split 4 with alpha 25000 +Finished, now scoring +train_score: 0.353437014367081, test_score: 0.14267995270543896 +Successfully processed features[19]. +All features have been processed. diff --git a/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/530549.out b/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/530549.out new file mode 100644 index 0000000000000000000000000000000000000000..3cb718f02ead3318b91feb0b304e59d2c59562ee --- /dev/null +++ b/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/530549.out @@ -0,0 +1,92 @@ +NUM_GPUS=1 +MASTER_ADDR=ip-10-0-129-21 +MASTER_PORT=17079 +WORLD_SIZE=1 +Running RR_sklearn.py with argument: features[21] +Calculating for: features[21] +PID of this process = 1058972 +loading_betas +betas_ loaded +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Calculating split 1 of 4 +start_feature_index: 0, end_feature_index: 128 +Starting ridge regression for split 1 with alpha 25000 +Finished, now scoring +train_score: 0.3557710222242138, test_score: 0.14651215027011466 +Calculating split 2 of 4 +start_feature_index: 128, end_feature_index: 256 +Starting ridge regression for split 2 with alpha 25000 +Finished, now scoring +train_score: 0.3466741485637169, test_score: 0.1315351011465747 +Calculating split 3 of 4 +start_feature_index: 256, end_feature_index: 384 +Starting ridge regression for split 3 with alpha 25000 +Finished, now scoring +train_score: 0.3522197377142293, test_score: 0.14005278910934277 +Calculating split 4 of 4 +start_feature_index: 384, end_feature_index: 512 +Starting ridge regression for split 4 with alpha 25000 +Finished, now scoring +train_score: 0.342968012418379, test_score: 0.12670730004600983 +Successfully processed features[21]. +Running RR_sklearn.py with argument: features[23] +Calculating for: features[23] +PID of this process = 1105345 +loading_betas +betas_ loaded +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Calculating split 1 of 4 +start_feature_index: 0, end_feature_index: 128 +Starting ridge regression for split 1 with alpha 25000 +Finished, now scoring +train_score: 0.323880273335967, test_score: 0.09712435351246448 +Calculating split 2 of 4 +start_feature_index: 128, end_feature_index: 256 +Starting ridge regression for split 2 with alpha 25000 +Finished, now scoring +train_score: 0.333362757345953, test_score: 0.11240278880679647 +Calculating split 3 of 4 +start_feature_index: 256, end_feature_index: 384 +Starting ridge regression for split 3 with alpha 25000 +Finished, now scoring +train_score: 0.3267272326701222, test_score: 0.10069870206141474 +Calculating split 4 of 4 +start_feature_index: 384, end_feature_index: 512 +Starting ridge regression for split 4 with alpha 25000 +Finished, now scoring +train_score: 0.33803289697729655, test_score: 0.1191444663434752 +Successfully processed features[23]. +Running RR_sklearn.py with argument: features[25] +Calculating for: features[25] +PID of this process = 1131731 +loading_betas +betas_ loaded +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Calculating split 1 of 4 +start_feature_index: 0, end_feature_index: 128 +Starting ridge regression for split 1 with alpha 25000 +Finished, now scoring +train_score: 0.3315549870273136, test_score: 0.10930747943273669 +Calculating split 2 of 4 +start_feature_index: 128, end_feature_index: 256 +Starting ridge regression for split 2 with alpha 25000 +Finished, now scoring +train_score: 0.32826385576666306, test_score: 0.10502679195668997 +Calculating split 3 of 4 +start_feature_index: 256, end_feature_index: 384 +Starting ridge regression for split 3 with alpha 25000 +Finished, now scoring +train_score: 0.3279579924893389, test_score: 0.10445404431519516 +Calculating split 4 of 4 +start_feature_index: 384, end_feature_index: 512 +Starting ridge regression for split 4 with alpha 25000 +Finished, now scoring +train_score: 0.33137681060432267, test_score: 0.10964299920356073 +Successfully processed features[25]. +All features have been processed. diff --git a/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/530892.err b/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/530892.err new file mode 100644 index 0000000000000000000000000000000000000000..717040089bd90b2f5ef6e0275f230d490392720f --- /dev/null +++ b/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/530892.err @@ -0,0 +1,21383 @@ +[NbConvertApp] Converting notebook RR_sklearn.ipynb to python +[NbConvertApp] Writing 24321 bytes to RR_sklearn.py +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/32 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/32 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/16 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/16 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/32 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/16 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable diff --git a/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/530966.out b/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/530966.out new file mode 100644 index 0000000000000000000000000000000000000000..fc35ddb4a35abce09db3b2889f129fd32ea3baa1 --- /dev/null +++ b/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/530966.out @@ -0,0 +1,447 @@ +NUM_GPUS=1 +MASTER_ADDR=ip-10-0-129-21 +MASTER_PORT=13610 +WORLD_SIZE=1 +Running RR_sklearn.py with argument: features[0] +Configured run_name = subj2_40 +Configured current_features = features[0] +Configured num_sessions = 40.0 +Configured subj = 2 +PID of this process = 383630 +loading_betas +betas_ loaded +Number of zeros in valid_nsd_ids_full tensor(0) +Num train examples torch.Size([27000, 14278]) +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 14278]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 14278]) torch.Size([18, 3, 425, 425]) +Calculating split 1 of 32 +start_feature_index: 0, end_feature_index: 2 +Starting ridge regression for split 1 with alpha 30000 +Finished, now scoring +train_score: 0.29661377371882686, test_score: 0.117035033791301 +Calculating split 2 of 32 +start_feature_index: 2, end_feature_index: 4 +Starting ridge regression for split 2 with alpha 30000 +Finished, now scoring +train_score: 0.2883429135130446, test_score: 0.10647384031742065 +Calculating split 3 of 32 +start_feature_index: 4, end_feature_index: 6 +Starting ridge regression for split 3 with alpha 30000 +Finished, now scoring +train_score: 0.26508258790215844, test_score: 0.06804317118104179 +Calculating split 4 of 32 +start_feature_index: 6, end_feature_index: 8 +Starting ridge regression for split 4 with alpha 30000 +Finished, now scoring +train_score: 0.24403915140018612, test_score: 0.03916115256888393 +Calculating split 5 of 32 +start_feature_index: 8, end_feature_index: 10 +Starting ridge regression for split 5 with alpha 30000 +Finished, now scoring +train_score: 0.27873069567176423, test_score: 0.10057921220242752 +Calculating split 6 of 32 +start_feature_index: 10, end_feature_index: 12 +Starting ridge regression for split 6 with alpha 30000 +Finished, now scoring +train_score: 0.2133691529600274, test_score: -0.009321117460244355 +Calculating split 7 of 32 +start_feature_index: 12, end_feature_index: 14 +Starting ridge regression for split 7 with alpha 30000 +Finished, now scoring +train_score: 0.2795400990417848, test_score: 0.10062385058073804 +Calculating split 8 of 32 +start_feature_index: 14, end_feature_index: 16 +Starting ridge regression for split 8 with alpha 30000 +Finished, now scoring +train_score: 0.259123719454417, test_score: 0.06762848456734173 +Calculating split 9 of 32 +start_feature_index: 16, end_feature_index: 18 +Starting ridge regression for split 9 with alpha 30000 +Finished, now scoring +train_score: 0.2781985959845623, test_score: 0.09190245365275242 +Calculating split 10 of 32 +start_feature_index: 18, end_feature_index: 20 +Starting ridge regression for split 10 with alpha 30000 +Finished, now scoring +train_score: 0.2764895518068757, test_score: 0.09283311536708519 +Calculating split 11 of 32 +start_feature_index: 20, end_feature_index: 22 +Starting ridge regression for split 11 with alpha 30000 +Finished, now scoring +train_score: 0.23501277067883694, test_score: 0.024577279617801207 +Calculating split 12 of 32 +start_feature_index: 22, end_feature_index: 24 +Starting ridge regression for split 12 with alpha 30000 +Finished, now scoring +train_score: 0.28219821608829326, test_score: 0.09510822258598477 +Calculating split 13 of 32 +start_feature_index: 24, end_feature_index: 26 +Starting ridge regression for split 13 with alpha 30000 +Finished, now scoring +train_score: 0.32705264848898474, test_score: 0.1677273319498503 +Calculating split 14 of 32 +start_feature_index: 26, end_feature_index: 28 +Starting ridge regression for split 14 with alpha 30000 +Finished, now scoring +train_score: 0.27821261807184955, test_score: 0.09020328639146968 +Calculating split 15 of 32 +start_feature_index: 28, end_feature_index: 30 +Starting ridge regression for split 15 with alpha 30000 +Finished, now scoring +train_score: 0.31514059130784267, test_score: 0.1465490571210528 +Calculating split 16 of 32 +start_feature_index: 30, end_feature_index: 32 +Starting ridge regression for split 16 with alpha 30000 +Finished, now scoring +train_score: 0.28307896590044346, test_score: 0.09610011009896706 +Calculating split 17 of 32 +start_feature_index: 32, end_feature_index: 34 +Starting ridge regression for split 17 with alpha 30000 +Finished, now scoring +train_score: 0.3030914411704542, test_score: 0.1315195140903464 +Calculating split 18 of 32 +start_feature_index: 34, end_feature_index: 36 +Starting ridge regression for split 18 with alpha 30000 +Finished, now scoring +train_score: 0.20903804988061253, test_score: -0.018429069261017055 +Calculating split 19 of 32 +start_feature_index: 36, end_feature_index: 38 +Starting ridge regression for split 19 with alpha 30000 +Finished, now scoring +train_score: 0.25388155491228, test_score: 0.045553721166678204 +Calculating split 20 of 32 +start_feature_index: 38, end_feature_index: 40 +Starting ridge regression for split 20 with alpha 30000 +Finished, now scoring +train_score: 0.27232892434079575, test_score: 0.07399431125251806 +Calculating split 21 of 32 +start_feature_index: 40, end_feature_index: 42 +Starting ridge regression for split 21 with alpha 30000 +Finished, now scoring +train_score: 0.2252031700505435, test_score: 0.016474920684846787 +Calculating split 22 of 32 +start_feature_index: 42, end_feature_index: 44 +Starting ridge regression for split 22 with alpha 30000 +Finished, now scoring +train_score: 0.2095416004366277, test_score: -0.01757992785408543 +Calculating split 23 of 32 +start_feature_index: 44, end_feature_index: 46 +Starting ridge regression for split 23 with alpha 30000 +Finished, now scoring +train_score: 0.21112676525229704, test_score: -0.014323715402226853 +Calculating split 24 of 32 +start_feature_index: 46, end_feature_index: 48 +Starting ridge regression for split 24 with alpha 30000 +Finished, now scoring +train_score: 0.23123228880749783, test_score: 0.018268354359106835 +Calculating split 25 of 32 +start_feature_index: 48, end_feature_index: 50 +Starting ridge regression for split 25 with alpha 30000 +Finished, now scoring +train_score: 0.25716357270359247, test_score: 0.06101032130560987 +Calculating split 26 of 32 +start_feature_index: 50, end_feature_index: 52 +Starting ridge regression for split 26 with alpha 30000 +Finished, now scoring +train_score: 0.25002484946115205, test_score: 0.04129464434376521 +Calculating split 27 of 32 +start_feature_index: 52, end_feature_index: 54 +Starting ridge regression for split 27 with alpha 30000 +Finished, now scoring +train_score: 0.3108060597035888, test_score: 0.1433621829814515 +Calculating split 28 of 32 +start_feature_index: 54, end_feature_index: 56 +Starting ridge regression for split 28 with alpha 30000 +Finished, now scoring +train_score: 0.2383764535248934, test_score: 0.032092918350825415 +Calculating split 29 of 32 +start_feature_index: 56, end_feature_index: 58 +Starting ridge regression for split 29 with alpha 30000 +Finished, now scoring +train_score: 0.21799214954788562, test_score: -4.552445893904962e-05 +Calculating split 30 of 32 +start_feature_index: 58, end_feature_index: 60 +Starting ridge regression for split 30 with alpha 30000 +Finished, now scoring +train_score: 0.252499320371154, test_score: 0.04297735651524747 +Calculating split 31 of 32 +start_feature_index: 60, end_feature_index: 62 +Starting ridge regression for split 31 with alpha 30000 +Finished, now scoring +train_score: 0.2815672465284072, test_score: 0.09338036547478293 +Calculating split 32 of 32 +start_feature_index: 62, end_feature_index: 64 +Starting ridge regression for split 32 with alpha 30000 +Finished, now scoring +train_score: 0.2165275827215471, test_score: -0.0071216615411541645 +Successfully processed features[0]. +Running RR_sklearn.py with argument: features[2] +Configured run_name = subj2_40 +Configured current_features = features[2] +Configured num_sessions = 40.0 +Configured subj = 2 +PID of this process = 659586 +loading_betas +betas_ loaded +Number of zeros in valid_nsd_ids_full tensor(0) +Num train examples torch.Size([27000, 14278]) +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 14278]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 14278]) torch.Size([18, 3, 425, 425]) +Calculating split 1 of 32 +start_feature_index: 0, end_feature_index: 2 +Starting ridge regression for split 1 with alpha 30000 +Finished, now scoring +train_score: 0.21756602590164, test_score: -0.006536801871035412 +Calculating split 2 of 32 +start_feature_index: 2, end_feature_index: 4 +Starting ridge regression for split 2 with alpha 30000 +Finished, now scoring +train_score: 0.2954343551830813, test_score: 0.12622337856834628 +Calculating split 3 of 32 +start_feature_index: 4, end_feature_index: 6 +Starting ridge regression for split 3 with alpha 30000 +Finished, now scoring +train_score: 0.2856373997668443, test_score: 0.10322646566448092 +Calculating split 4 of 32 +start_feature_index: 6, end_feature_index: 8 +Starting ridge regression for split 4 with alpha 30000 +Finished, now scoring +train_score: 0.2404111216718812, test_score: 0.03657066538718986 +Calculating split 5 of 32 +start_feature_index: 8, end_feature_index: 10 +Starting ridge regression for split 5 with alpha 30000 +Finished, now scoring +train_score: 0.2450115032053342, test_score: 0.03282927830623215 +Calculating split 6 of 32 +start_feature_index: 10, end_feature_index: 12 +Starting ridge regression for split 6 with alpha 30000 +Finished, now scoring +train_score: 0.23979201157091998, test_score: 0.03320329924875125 +Calculating split 7 of 32 +start_feature_index: 12, end_feature_index: 14 +Starting ridge regression for split 7 with alpha 30000 +Finished, now scoring +train_score: 0.2118144543404889, test_score: -0.015011767879130826 +Calculating split 8 of 32 +start_feature_index: 14, end_feature_index: 16 +Starting ridge regression for split 8 with alpha 30000 +Finished, now scoring +train_score: 0.2626058926654124, test_score: 0.07820428217081844 +Calculating split 9 of 32 +start_feature_index: 16, end_feature_index: 18 +Starting ridge regression for split 9 with alpha 30000 +Finished, now scoring +train_score: 0.24854360270180306, test_score: 0.04252557424971517 +Calculating split 10 of 32 +start_feature_index: 18, end_feature_index: 20 +Starting ridge regression for split 10 with alpha 30000 +Finished, now scoring +train_score: 0.2603714735344176, test_score: 0.06215603006257122 +Calculating split 11 of 32 +start_feature_index: 20, end_feature_index: 22 +Starting ridge regression for split 11 with alpha 30000 +Finished, now scoring +train_score: 0.20941845752804708, test_score: -0.017943211495370794 +Calculating split 12 of 32 +start_feature_index: 22, end_feature_index: 24 +Starting ridge regression for split 12 with alpha 30000 +Finished, now scoring +train_score: 0.2998460669622156, test_score: 0.11506825369148407 +Calculating split 13 of 32 +start_feature_index: 24, end_feature_index: 26 +Starting ridge regression for split 13 with alpha 30000 +Finished, now scoring +train_score: 0.3128333450310069, test_score: 0.14475626962509144 +Calculating split 14 of 32 +start_feature_index: 26, end_feature_index: 28 +Starting ridge regression for split 14 with alpha 30000 +Finished, now scoring +train_score: 0.2626021308420645, test_score: 0.0651014757442701 +Calculating split 15 of 32 +start_feature_index: 28, end_feature_index: 30 +Starting ridge regression for split 15 with alpha 30000 +Finished, now scoring +train_score: 0.21042871811206534, test_score: -0.01667911886977619 +Calculating split 16 of 32 +start_feature_index: 30, end_feature_index: 32 +Starting ridge regression for split 16 with alpha 30000 +Finished, now scoring +train_score: 0.2664788932428403, test_score: 0.06839962083200117 +Calculating split 17 of 32 +start_feature_index: 32, end_feature_index: 34 +Starting ridge regression for split 17 with alpha 30000 +Finished, now scoring +train_score: 0.2113787000482321, test_score: -0.01566727362129687 +Calculating split 18 of 32 +start_feature_index: 34, end_feature_index: 36 +Starting ridge regression for split 18 with alpha 30000 +Finished, now scoring +train_score: 0.2155698259127883, test_score: -0.008182049056388179 +Calculating split 19 of 32 +start_feature_index: 36, end_feature_index: 38 +Starting ridge regression for split 19 with alpha 30000 +Finished, now scoring +train_score: 0.22549733791022095, test_score: 0.004406596783261528 +Calculating split 20 of 32 +start_feature_index: 38, end_feature_index: 40 +Starting ridge regression for split 20 with alpha 30000 +Finished, now scoring +train_score: 0.3112439880352868, test_score: 0.13591258386397895 +Calculating split 21 of 32 +start_feature_index: 40, end_feature_index: 42 +Starting ridge regression for split 21 with alpha 30000 +Finished, now scoring +train_score: 0.213748508744438, test_score: -0.011822397331711391 +Calculating split 22 of 32 +start_feature_index: 42, end_feature_index: 44 +Starting ridge regression for split 22 with alpha 30000 +Finished, now scoring +train_score: 0.2634146249657941, test_score: 0.056138760862047624 +Calculating split 23 of 32 +start_feature_index: 44, end_feature_index: 46 +Starting ridge regression for split 23 with alpha 30000 +Finished, now scoring +train_score: 0.2668349748886921, test_score: 0.07087542201905228 +Calculating split 24 of 32 +start_feature_index: 46, end_feature_index: 48 +Starting ridge regression for split 24 with alpha 30000 +Finished, now scoring +train_score: 0.21426049666578942, test_score: -0.010615452694057132 +Calculating split 25 of 32 +start_feature_index: 48, end_feature_index: 50 +Starting ridge regression for split 25 with alpha 30000 +Finished, now scoring +train_score: 0.29442602025829123, test_score: 0.1157553740325009 +Calculating split 26 of 32 +start_feature_index: 50, end_feature_index: 52 +Starting ridge regression for split 26 with alpha 30000 +Finished, now scoring +train_score: 0.23049690507535583, test_score: 0.010204918733192106 +Calculating split 27 of 32 +start_feature_index: 52, end_feature_index: 54 +Starting ridge regression for split 27 with alpha 30000 +Finished, now scoring +train_score: 0.23894266808574674, test_score: 0.02986800289137591 +Calculating split 28 of 32 +start_feature_index: 54, end_feature_index: 56 +Starting ridge regression for split 28 with alpha 30000 +Finished, now scoring +train_score: 0.2701241931958689, test_score: 0.07981336897170824 +Calculating split 29 of 32 +start_feature_index: 56, end_feature_index: 58 +Starting ridge regression for split 29 with alpha 30000 +Finished, now scoring +train_score: 0.21308201759549605, test_score: -0.01227950163395631 +Calculating split 30 of 32 +start_feature_index: 58, end_feature_index: 60 +Starting ridge regression for split 30 with alpha 30000 +Finished, now scoring +train_score: 0.21192546484042193, test_score: -0.014123708641704508 +Calculating split 31 of 32 +start_feature_index: 60, end_feature_index: 62 +Starting ridge regression for split 31 with alpha 30000 +Finished, now scoring +train_score: 0.3246690415023649, test_score: 0.16792779674778058 +Calculating split 32 of 32 +start_feature_index: 62, end_feature_index: 64 +Starting ridge regression for split 32 with alpha 30000 +Finished, now scoring +train_score: 0.22879222353993864, test_score: 0.010831030093807228 +Successfully processed features[2]. +Running RR_sklearn.py with argument: features[5] +Configured run_name = subj2_40 +Configured current_features = features[5] +Configured num_sessions = 40.0 +Configured subj = 2 +PID of this process = 858097 +loading_betas +betas_ loaded +Number of zeros in valid_nsd_ids_full tensor(0) +Num train examples torch.Size([27000, 14278]) +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 14278]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 14278]) torch.Size([18, 3, 425, 425]) +Calculating split 1 of 16 +start_feature_index: 0, end_feature_index: 8 +Starting ridge regression for split 1 with alpha 30000 +Finished, now scoring +train_score: 0.25209233543697507, test_score: 0.04618632352472393 +Calculating split 2 of 16 +start_feature_index: 8, end_feature_index: 16 +Starting ridge regression for split 2 with alpha 30000 +Finished, now scoring +train_score: 0.2287968564247837, test_score: 0.011077103378602512 +Calculating split 3 of 16 +start_feature_index: 16, end_feature_index: 24 +Starting ridge regression for split 3 with alpha 30000 +Finished, now scoring +train_score: 0.22775484392885856, test_score: 0.00977476795798389 +Calculating split 4 of 16 +start_feature_index: 24, end_feature_index: 32 +Starting ridge regression for split 4 with alpha 30000 +Finished, now scoring +train_score: 0.24461491814471947, test_score: 0.034766565928056097 +Calculating split 5 of 16 +start_feature_index: 32, end_feature_index: 40 +Starting ridge regression for split 5 with alpha 30000 +Finished, now scoring +train_score: 0.24532753453668668, test_score: 0.03873537896745718 +Calculating split 6 of 16 +start_feature_index: 40, end_feature_index: 48 +Starting ridge regression for split 6 with alpha 30000 +Finished, now scoring +train_score: 0.25359075545343057, test_score: 0.050609116638537704 +Calculating split 7 of 16 +start_feature_index: 48, end_feature_index: 56 +Starting ridge regression for split 7 with alpha 30000 +Finished, now scoring +train_score: 0.2799787712976364, test_score: 0.08738814943808329 +Calculating split 8 of 16 +start_feature_index: 56, end_feature_index: 64 +Starting ridge regression for split 8 with alpha 30000 +Finished, now scoring +train_score: 0.25350895480373464, test_score: 0.051527443441038885 +Calculating split 9 of 16 +start_feature_index: 64, end_feature_index: 72 +Starting ridge regression for split 9 with alpha 30000 +Finished, now scoring +train_score: 0.25065678660005175, test_score: 0.04595813193487069 +Calculating split 10 of 16 +start_feature_index: 72, end_feature_index: 80 +Starting ridge regression for split 10 with alpha 30000 +Finished, now scoring +train_score: 0.24829911826960355, test_score: 0.03910357263603341 +Calculating split 11 of 16 +start_feature_index: 80, end_feature_index: 88 +Starting ridge regression for split 11 with alpha 30000 +Finished, now scoring +train_score: 0.2490133920601102, test_score: 0.044761075981347924 +Calculating split 12 of 16 +start_feature_index: 88, end_feature_index: 96 +Starting ridge regression for split 12 with alpha 30000 +Finished, now scoring +train_score: 0.251620297726349, test_score: 0.04830882529387548 +Calculating split 13 of 16 +start_feature_index: 96, end_feature_index: 104 +Starting ridge regression for split 13 with alpha 30000 +Finished, now scoring +train_score: 0.23415794799959888, test_score: 0.019138204344023236 +Calculating split 14 of 16 +start_feature_index: 104, end_feature_index: 112 +Starting ridge regression for split 14 with alpha 30000 +Finished, now scoring +train_score: 0.25899803842928104, test_score: 0.060857772247081894 +Calculating split 15 of 16 +start_feature_index: 112, end_feature_index: 120 +Starting ridge regression for split 15 with alpha 30000 +Finished, now scoring +train_score: 0.2601793877610476, test_score: 0.06453505608921027 +Calculating split 16 of 16 +start_feature_index: 120, end_feature_index: 128 +Starting ridge regression for split 16 with alpha 30000 +Finished, now scoring +train_score: 0.25007554384253405, test_score: 0.04549699247597964 +Successfully processed features[5]. +All features have been processed. diff --git a/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/530967.err b/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/530967.err new file mode 100644 index 0000000000000000000000000000000000000000..e6a28ad995a78208fa27c9be81bf3bfb38d7d2fd --- /dev/null +++ b/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/530967.err @@ -0,0 +1,2796 @@ +[NbConvertApp] Converting notebook RR_sklearn.ipynb to python +[NbConvertApp] Writing 24321 bytes to RR_sklearn.py +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/16 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/8 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/4 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/4 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/2 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/2 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/2 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/8 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/4 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable diff --git a/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/531220.err b/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/531220.err new file mode 100644 index 0000000000000000000000000000000000000000..ea9fc71442171d580fe5e5c97bb49937eab88c16 --- /dev/null +++ b/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/531220.err @@ -0,0 +1,9264 @@ +[NbConvertApp] Converting notebook RR_sklearn.ipynb to python +[NbConvertApp] Writing 24321 bytes to RR_sklearn.py +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/32 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/32 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/2 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/2 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/2 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/1 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/1 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/1 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable diff --git a/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/531265.err b/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/531265.err new file mode 100644 index 0000000000000000000000000000000000000000..46a9490555822c4103a772afc3efdc35691dd4d0 --- /dev/null +++ b/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/531265.err @@ -0,0 +1,1827 @@ +[NbConvertApp] Converting notebook RR_sklearn.ipynb to python +[NbConvertApp] Writing 24321 bytes to RR_sklearn.py +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/16 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/8 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/8 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable diff --git a/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/531467.out b/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/531467.out new file mode 100644 index 0000000000000000000000000000000000000000..6f34e67ce6f2577c8f33f6f96fc57bfd576b10cf --- /dev/null +++ b/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/531467.out @@ -0,0 +1,207 @@ +NUM_GPUS=1 +MASTER_ADDR=ip-10-0-165-214 +MASTER_PORT=17718 +WORLD_SIZE=1 +Running RR_sklearn.py with argument: features[7] +Configured run_name = subj2_40 +Configured current_features = features[7] +Configured num_sessions = 40.0 +Configured subj = 2 +PID of this process = 2434749 +loading_betas +betas_ loaded +Number of zeros in valid_nsd_ids_full tensor(0) +Num train examples torch.Size([27000, 14278]) +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 14278]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 14278]) torch.Size([18, 3, 425, 425]) +Calculating split 1 of 16 +start_feature_index: 0, end_feature_index: 8 +Starting ridge regression for split 1 with alpha 30000 +Finished, now scoring +train_score: 0.22118424700880313, test_score: -0.00018639395688234124 +Calculating split 2 of 16 +start_feature_index: 8, end_feature_index: 16 +Starting ridge regression for split 2 with alpha 30000 +Finished, now scoring +train_score: 0.21781429005624586, test_score: -0.004410175664934713 +Calculating split 3 of 16 +start_feature_index: 16, end_feature_index: 24 +Starting ridge regression for split 3 with alpha 30000 +Finished, now scoring +train_score: 0.22237925643680734, test_score: 0.0022005577800370785 +Calculating split 4 of 16 +start_feature_index: 24, end_feature_index: 32 +Starting ridge regression for split 4 with alpha 30000 +Finished, now scoring +train_score: 0.2314759529374201, test_score: 0.015187422460725354 +Calculating split 5 of 16 +start_feature_index: 32, end_feature_index: 40 +Starting ridge regression for split 5 with alpha 30000 +Finished, now scoring +train_score: 0.23541187356912588, test_score: 0.02165310982675296 +Calculating split 6 of 16 +start_feature_index: 40, end_feature_index: 48 +Starting ridge regression for split 6 with alpha 30000 +Finished, now scoring +train_score: 0.22028420512299307, test_score: -0.0010169347937993365 +Calculating split 7 of 16 +start_feature_index: 48, end_feature_index: 56 +Starting ridge regression for split 7 with alpha 30000 +Finished, now scoring +train_score: 0.2181549642075443, test_score: -0.004423503646035273 +Calculating split 8 of 16 +start_feature_index: 56, end_feature_index: 64 +Starting ridge regression for split 8 with alpha 30000 +Finished, now scoring +train_score: 0.22642899663809363, test_score: 0.009834721241227135 +Calculating split 9 of 16 +start_feature_index: 64, end_feature_index: 72 +Starting ridge regression for split 9 with alpha 30000 +Finished, now scoring +train_score: 0.24482640747443535, test_score: 0.03583528177959912 +Calculating split 10 of 16 +start_feature_index: 72, end_feature_index: 80 +Starting ridge regression for split 10 with alpha 30000 +Finished, now scoring +train_score: 0.22984158107902286, test_score: 0.013166811729832532 +Calculating split 11 of 16 +start_feature_index: 80, end_feature_index: 88 +Starting ridge regression for split 11 with alpha 30000 +Finished, now scoring +train_score: 0.2277727936779321, test_score: 0.01072503751099847 +Calculating split 12 of 16 +start_feature_index: 88, end_feature_index: 96 +Starting ridge regression for split 12 with alpha 30000 +Finished, now scoring +train_score: 0.2229808354757165, test_score: 0.0031352973352508436 +Calculating split 13 of 16 +start_feature_index: 96, end_feature_index: 104 +Starting ridge regression for split 13 with alpha 30000 +Finished, now scoring +train_score: 0.23421752200784252, test_score: 0.020694269489721955 +Calculating split 14 of 16 +start_feature_index: 104, end_feature_index: 112 +Starting ridge regression for split 14 with alpha 30000 +Finished, now scoring +train_score: 0.23353604303604833, test_score: 0.019848757811768755 +Calculating split 15 of 16 +start_feature_index: 112, end_feature_index: 120 +Starting ridge regression for split 15 with alpha 30000 +Finished, now scoring +train_score: 0.22357032873391308, test_score: 0.003726018154744534 +Calculating split 16 of 16 +start_feature_index: 120, end_feature_index: 128 +Starting ridge regression for split 16 with alpha 30000 +Finished, now scoring +train_score: 0.23677028801455327, test_score: 0.023041712382392453 +Successfully processed features[7]. +Running RR_sklearn.py with argument: features[10] +Configured run_name = subj2_40 +Configured current_features = features[10] +Configured num_sessions = 40.0 +Configured subj = 2 +PID of this process = 2666861 +loading_betas +betas_ loaded +Number of zeros in valid_nsd_ids_full tensor(0) +Num train examples torch.Size([27000, 14278]) +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 14278]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 14278]) torch.Size([18, 3, 425, 425]) +Calculating split 1 of 8 +start_feature_index: 0, end_feature_index: 32 +Starting ridge regression for split 1 with alpha 30000 +Finished, now scoring +train_score: 0.2503948377959079, test_score: 0.04480029452500024 +Calculating split 2 of 8 +start_feature_index: 32, end_feature_index: 64 +Starting ridge regression for split 2 with alpha 30000 +Finished, now scoring +train_score: 0.24479905361678597, test_score: 0.035178924201495744 +Calculating split 3 of 8 +start_feature_index: 64, end_feature_index: 96 +Starting ridge regression for split 3 with alpha 30000 +Finished, now scoring +train_score: 0.2556086937364029, test_score: 0.051434880941542124 +Calculating split 4 of 8 +start_feature_index: 96, end_feature_index: 128 +Starting ridge regression for split 4 with alpha 30000 +Finished, now scoring +train_score: 0.25863434568931176, test_score: 0.0574479657791338 +Calculating split 5 of 8 +start_feature_index: 128, end_feature_index: 160 +Starting ridge regression for split 5 with alpha 30000 +Finished, now scoring +train_score: 0.25124702073593713, test_score: 0.04566823019700349 +Calculating split 6 of 8 +start_feature_index: 160, end_feature_index: 192 +Starting ridge regression for split 6 with alpha 30000 +Finished, now scoring +train_score: 0.25646403150259994, test_score: 0.05217278519238405 +Calculating split 7 of 8 +start_feature_index: 192, end_feature_index: 224 +Starting ridge regression for split 7 with alpha 30000 +Finished, now scoring +train_score: 0.255044140731536, test_score: 0.051054764464486806 +Calculating split 8 of 8 +start_feature_index: 224, end_feature_index: 256 +Starting ridge regression for split 8 with alpha 30000 +Finished, now scoring +train_score: 0.25772619398667357, test_score: 0.052637731365557536 +Successfully processed features[10]. +Running RR_sklearn.py with argument: features[12] +Configured run_name = subj2_40 +Configured current_features = features[12] +Configured num_sessions = 40.0 +Configured subj = 2 +PID of this process = 2696870 +loading_betas +betas_ loaded +Number of zeros in valid_nsd_ids_full tensor(0) +Num train examples torch.Size([27000, 14278]) +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 14278]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 14278]) torch.Size([18, 3, 425, 425]) +Calculating split 1 of 8 +start_feature_index: 0, end_feature_index: 32 +Starting ridge regression for split 1 with alpha 30000 +Finished, now scoring +train_score: 0.2618316130871008, test_score: 0.06201400415211354 +Calculating split 2 of 8 +start_feature_index: 32, end_feature_index: 64 +Starting ridge regression for split 2 with alpha 30000 +Finished, now scoring +train_score: 0.26768921647233024, test_score: 0.07104935422997355 +Calculating split 3 of 8 +start_feature_index: 64, end_feature_index: 96 +Starting ridge regression for split 3 with alpha 30000 +Finished, now scoring +train_score: 0.25767290983215024, test_score: 0.05764442265425824 +Calculating split 4 of 8 +start_feature_index: 96, end_feature_index: 128 +Starting ridge regression for split 4 with alpha 30000 +Finished, now scoring +train_score: 0.26017875637687177, test_score: 0.05846735717478009 +Calculating split 5 of 8 +start_feature_index: 128, end_feature_index: 160 +Starting ridge regression for split 5 with alpha 30000 +Finished, now scoring +train_score: 0.2591645170817769, test_score: 0.057693001865684115 +Calculating split 6 of 8 +start_feature_index: 160, end_feature_index: 192 +Starting ridge regression for split 6 with alpha 30000 +Finished, now scoring +train_score: 0.2633977519904978, test_score: 0.06634795177657278 +Calculating split 7 of 8 +start_feature_index: 192, end_feature_index: 224 +Starting ridge regression for split 7 with alpha 30000 +Finished, now scoring +train_score: 0.26143438922833306, test_score: 0.06085390134855612 +Calculating split 8 of 8 +start_feature_index: 224, end_feature_index: 256 +Starting ridge regression for split 8 with alpha 30000 +Finished, now scoring +train_score: 0.2575601731368852, test_score: 0.05578346959793063 +Successfully processed features[12]. +All features have been processed. diff --git a/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/531469.err b/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/531469.err new file mode 100644 index 0000000000000000000000000000000000000000..09b07876912bd746f1cd7d75773dc4f9da90bb2b --- /dev/null +++ b/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/531469.err @@ -0,0 +1,1254 @@ +[NbConvertApp] Converting notebook RR_sklearn.ipynb to python +[NbConvertApp] Writing 24321 bytes to RR_sklearn.py +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/2 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/2 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/2 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/1 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/1 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/1 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable diff --git a/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/531471.out b/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/531471.out new file mode 100644 index 0000000000000000000000000000000000000000..57b31a54a820408691a925688925ec76f9791613 --- /dev/null +++ b/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/531471.out @@ -0,0 +1,99 @@ +NUM_GPUS=1 +MASTER_ADDR=ip-10-0-154-216 +MASTER_PORT=12812 +WORLD_SIZE=1 +Running RR_sklearn.py with argument: features[5] +Configured run_name = subj5_40 +Configured current_features = features[5] +Configured num_sessions = 40.0 +Configured subj = 5 +PID of this process = 63919 +loading_betas +betas_ loaded +Number of zeros in valid_nsd_ids_full tensor(0) +Num train examples torch.Size([27000, 13039]) +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 13039]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 13039]) torch.Size([18, 3, 425, 425]) +Calculating split 1 of 16 +start_feature_index: 0, end_feature_index: 8 +Starting ridge regression for split 1 with alpha 30000 +Finished, now scoring +train_score: 0.21301442679581084, test_score: 0.03567930292949783 +Calculating split 2 of 16 +start_feature_index: 8, end_feature_index: 16 +Starting ridge regression for split 2 with alpha 30000 +Finished, now scoring +train_score: 0.19216436617230764, test_score: 0.006945049389090924 +Calculating split 3 of 16 +start_feature_index: 16, end_feature_index: 24 +Starting ridge regression for split 3 with alpha 30000 +Finished, now scoring +train_score: 0.19078113036075142, test_score: 0.004511738263617895 +Calculating split 4 of 16 +start_feature_index: 24, end_feature_index: 32 +Starting ridge regression for split 4 with alpha 30000 +Finished, now scoring +train_score: 0.20456105788514758, test_score: 0.024376356580517126 +Calculating split 5 of 16 +start_feature_index: 32, end_feature_index: 40 +Starting ridge regression for split 5 with alpha 30000 +Finished, now scoring +train_score: 0.20875176609346155, test_score: 0.0345173619227817 +Calculating split 6 of 16 +start_feature_index: 40, end_feature_index: 48 +Starting ridge regression for split 6 with alpha 30000 +Finished, now scoring +train_score: 0.21400400721529889, test_score: 0.04088023402490297 +Calculating split 7 of 16 +start_feature_index: 48, end_feature_index: 56 +Starting ridge regression for split 7 with alpha 30000 +Finished, now scoring +train_score: 0.23925744086237755, test_score: 0.07821881004947392 +Calculating split 8 of 16 +start_feature_index: 56, end_feature_index: 64 +Starting ridge regression for split 8 with alpha 30000 +Finished, now scoring +train_score: 0.21493262484256567, test_score: 0.0428536694199505 +Calculating split 9 of 16 +start_feature_index: 64, end_feature_index: 72 +Starting ridge regression for split 9 with alpha 30000 +Finished, now scoring +train_score: 0.21210502209348628, test_score: 0.038246022394579235 +Calculating split 10 of 16 +start_feature_index: 72, end_feature_index: 80 +Starting ridge regression for split 10 with alpha 30000 +Finished, now scoring +train_score: 0.21132869667851764, test_score: 0.0349302319440069 +Calculating split 11 of 16 +start_feature_index: 80, end_feature_index: 88 +Starting ridge regression for split 11 with alpha 30000 +Finished, now scoring +train_score: 0.20920412005885614, test_score: 0.03488746900704536 +Calculating split 12 of 16 +start_feature_index: 88, end_feature_index: 96 +Starting ridge regression for split 12 with alpha 30000 +Finished, now scoring +train_score: 0.21357681614509993, test_score: 0.041260373329745685 +Calculating split 13 of 16 +start_feature_index: 96, end_feature_index: 104 +Starting ridge regression for split 13 with alpha 30000 +Finished, now scoring +train_score: 0.1974692095144184, test_score: 0.014556423820063889 +Calculating split 14 of 16 +start_feature_index: 104, end_feature_index: 112 +Starting ridge regression for split 14 with alpha 30000 +Finished, now scoring +train_score: 0.2211635782710888, test_score: 0.05327835295862623 +Calculating split 15 of 16 +start_feature_index: 112, end_feature_index: 120 +Starting ridge regression for split 15 with alpha 30000 +Finished, now scoring +train_score: 0.2232306566142229, test_score: 0.05942082746572925 +Calculating split 16 of 16 +start_feature_index: 120, end_feature_index: 128 +Starting ridge regression for split 16 with alpha 30000 +Finished, now scoring +train_score: 0.2115116315001195, test_score: 0.03787845113267213 +Successfully processed features[5]. +All features have been processed. diff --git a/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/531653.err b/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/531653.err new file mode 100644 index 0000000000000000000000000000000000000000..83628982fe98f92257aeea33773d14c61eff76e6 --- /dev/null +++ b/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/531653.err @@ -0,0 +1,3818 @@ +[NbConvertApp] Converting notebook RR_sklearn.ipynb to python +[NbConvertApp] Writing 24321 bytes to RR_sklearn.py +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/32 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/15 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0it [00:00, ?it/s] 0it [00:00, ?it/s] +Exception ignored in: +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0it [00:00, ?it/s] 0it [00:00, ?it/s] +Exception ignored in: +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0it [00:00, ?it/s] 0it [00:00, ?it/s] +Exception ignored in: +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0it [00:00, ?it/s] 0it [00:00, ?it/s] +Exception ignored in: +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0it [00:00, ?it/s] 0it [00:00, ?it/s] +Exception ignored in: +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0it [00:00, ?it/s] 0it [00:00, ?it/s] +Exception ignored in: +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0it [00:00, ?it/s] 0it [00:00, ?it/s] +Exception ignored in: +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0it [00:00, ?it/s] 0it [00:00, ?it/s] +Exception ignored in: +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0it [00:00, ?it/s] 0it [00:00, ?it/s] +Exception ignored in: +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0it [00:00, ?it/s] 0it [00:00, ?it/s] +Exception ignored in: +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0it [00:00, ?it/s] 0it [00:00, ?it/s] +Exception ignored in: +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0it [00:00, ?it/s] 0it [00:00, ?it/s] +Exception ignored in: +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0it [00:00, ?it/s] 0it [00:00, ?it/s] +Exception ignored in: +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0it [00:00, ?it/s] 0it [00:00, ?it/s] +Exception ignored in: +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0it [00:00, ?it/s] 0it [00:00, ?it/s] +Exception ignored in: +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0it [00:00, ?it/s] 0it [00:00, ?it/s] +Exception ignored in: +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0it [00:00, ?it/s] 0it [00:00, ?it/s] +Exception ignored in: +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable diff --git a/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/532239.out b/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/532239.out new file mode 100644 index 0000000000000000000000000000000000000000..8b8a4b966bd3d2df26fde95943711765320dd524 --- /dev/null +++ b/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/532239.out @@ -0,0 +1,421 @@ +NUM_GPUS=1 +MASTER_ADDR=ip-10-0-142-24 +MASTER_PORT=14863 +WORLD_SIZE=1 +Running RR_sklearn.py with argument: features[0] +Configured run_name = subj1_5 +Configured current_features = features[0] +Configured num_sessions = 5.0 +Configured subj = 1 +PID of this process = 1474080 +loading_betas +betas_ loaded +Number of zeros in valid_nsd_ids_full tensor(0) +Num train examples torch.Size([3410, 15724]) +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Calculating split 18 of 32 +start_feature_index: 34, end_feature_index: 36 +Starting ridge regression for split 18 with alpha 30000 +Finished, now scoring +train_score: 0.31668804452239335, test_score: -0.016805799286874146 +Calculating split 19 of 32 +start_feature_index: 36, end_feature_index: 38 +Starting ridge regression for split 19 with alpha 30000 +Finished, now scoring +train_score: 0.35142218620670607, test_score: 0.0302761501166291 +Calculating split 20 of 32 +start_feature_index: 38, end_feature_index: 40 +Starting ridge regression for split 20 with alpha 30000 +Finished, now scoring +train_score: 0.3677188562279432, test_score: 0.05636319198733855 +Calculating split 21 of 32 +start_feature_index: 40, end_feature_index: 42 +Starting ridge regression for split 21 with alpha 30000 +Finished, now scoring +train_score: 0.32778748210425773, test_score: 0.0062318157214303034 +Calculating split 22 of 32 +start_feature_index: 42, end_feature_index: 44 +Starting ridge regression for split 22 with alpha 30000 +Finished, now scoring +train_score: 0.31721737311752096, test_score: -0.01599214902351841 +Calculating split 23 of 32 +start_feature_index: 44, end_feature_index: 46 +Starting ridge regression for split 23 with alpha 30000 +Finished, now scoring +train_score: 0.3182078265171829, test_score: -0.013819151581188844 +Calculating split 24 of 32 +start_feature_index: 46, end_feature_index: 48 +Starting ridge regression for split 24 with alpha 30000 +Finished, now scoring +train_score: 0.3329476429262677, test_score: 0.013254452022352313 +Calculating split 25 of 32 +start_feature_index: 48, end_feature_index: 50 +Starting ridge regression for split 25 with alpha 30000 +Finished, now scoring +train_score: 0.35242309639643304, test_score: 0.04845234671818164 +Calculating split 26 of 32 +start_feature_index: 50, end_feature_index: 52 +Starting ridge regression for split 26 with alpha 30000 +Finished, now scoring +train_score: 0.3481640432121725, test_score: 0.026805129905564003 +Calculating split 27 of 32 +start_feature_index: 52, end_feature_index: 54 +Starting ridge regression for split 27 with alpha 30000 +Finished, now scoring +train_score: 0.3969746788035622, test_score: 0.1221814250124897 +Calculating split 28 of 32 +start_feature_index: 54, end_feature_index: 56 +Starting ridge regression for split 28 with alpha 30000 +Finished, now scoring +train_score: 0.3381586772240124, test_score: 0.022509242056514302 +Calculating split 29 of 32 +start_feature_index: 56, end_feature_index: 58 +Starting ridge regression for split 29 with alpha 30000 +Finished, now scoring +train_score: 0.3231010876914665, test_score: -0.004693472144121787 +Calculating split 30 of 32 +start_feature_index: 58, end_feature_index: 60 +Starting ridge regression for split 30 with alpha 30000 +Finished, now scoring +train_score: 0.34854524577999507, test_score: 0.0262222816368368 +Calculating split 31 of 32 +start_feature_index: 60, end_feature_index: 62 +Starting ridge regression for split 31 with alpha 30000 +Finished, now scoring +train_score: 0.3768632398808942, test_score: 0.07774635829771985 +Calculating split 32 of 32 +start_feature_index: 62, end_feature_index: 64 +Starting ridge regression for split 32 with alpha 30000 +Finished, now scoring +train_score: 0.3228820634939034, test_score: -0.007888107822825688 +Successfully processed features[0]. +Running RR_sklearn.py with argument: features[2] +Configured run_name = subj1_5 +Configured current_features = features[2] +Configured num_sessions = 5.0 +Configured subj = 1 +PID of this process = 1538170 +loading_betas +betas_ loaded +Number of zeros in valid_nsd_ids_full tensor(0) +Num train examples torch.Size([3410, 15724]) +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Calculating split 18 of 32 +start_feature_index: 34, end_feature_index: 36 +Starting ridge regression for split 18 with alpha 30000 +Finished, now scoring +train_score: 0.3214328467997687, test_score: -0.008667025422590595 +Calculating split 19 of 32 +start_feature_index: 36, end_feature_index: 38 +Starting ridge regression for split 19 with alpha 30000 +Finished, now scoring +train_score: 0.3270064801752463, test_score: -0.0009888569337430549 +Calculating split 20 of 32 +start_feature_index: 38, end_feature_index: 40 +Starting ridge regression for split 20 with alpha 30000 +Finished, now scoring +train_score: 0.3912697900485432, test_score: 0.09827967209140352 +Calculating split 21 of 32 +start_feature_index: 40, end_feature_index: 42 +Starting ridge regression for split 21 with alpha 30000 +Finished, now scoring +train_score: 0.3202957290233708, test_score: -0.012069223846753517 +Calculating split 22 of 32 +start_feature_index: 42, end_feature_index: 44 +Starting ridge regression for split 22 with alpha 30000 +Finished, now scoring +train_score: 0.3526325048368849, test_score: 0.03308912595530055 +Calculating split 23 of 32 +start_feature_index: 44, end_feature_index: 46 +Starting ridge regression for split 23 with alpha 30000 +Finished, now scoring +train_score: 0.35625775722795744, test_score: 0.052850002519048436 +Calculating split 24 of 32 +start_feature_index: 46, end_feature_index: 48 +Starting ridge regression for split 24 with alpha 30000 +Finished, now scoring +train_score: 0.3205205438248351, test_score: -0.010896749126274988 +Calculating split 25 of 32 +start_feature_index: 48, end_feature_index: 50 +Starting ridge regression for split 25 with alpha 30000 +Finished, now scoring +train_score: 0.37529811560073756, test_score: 0.08703403954513153 +Calculating split 26 of 32 +start_feature_index: 50, end_feature_index: 52 +Starting ridge regression for split 26 with alpha 30000 +Finished, now scoring +train_score: 0.3300786715337478, test_score: 0.0026539837190144963 +Calculating split 27 of 32 +start_feature_index: 52, end_feature_index: 54 +Starting ridge regression for split 27 with alpha 30000 +Finished, now scoring +train_score: 0.33352849314086536, test_score: 0.01347594170732551 +Calculating split 28 of 32 +start_feature_index: 54, end_feature_index: 56 +Starting ridge regression for split 28 with alpha 30000 +Finished, now scoring +train_score: 0.3697251505600773, test_score: 0.06673917548628755 +Calculating split 29 of 32 +start_feature_index: 56, end_feature_index: 58 +Starting ridge regression for split 29 with alpha 30000 +Finished, now scoring +train_score: 0.3191978768162868, test_score: -0.012166360109303326 +Calculating split 30 of 32 +start_feature_index: 58, end_feature_index: 60 +Starting ridge regression for split 30 with alpha 30000 +Finished, now scoring +train_score: 0.3180257132478128, test_score: -0.01424510180254433 +Calculating split 31 of 32 +start_feature_index: 60, end_feature_index: 62 +Starting ridge regression for split 31 with alpha 30000 +Finished, now scoring +train_score: 0.3957877889365305, test_score: 0.12773836690204196 +Calculating split 32 of 32 +start_feature_index: 62, end_feature_index: 64 +Starting ridge regression for split 32 with alpha 30000 +Finished, now scoring +train_score: 0.33024794084584463, test_score: 0.004857370030794305 +Successfully processed features[2]. +Running RR_sklearn.py with argument: features[5] +Configured run_name = subj1_5 +Configured current_features = features[5] +Configured num_sessions = 5.0 +Configured subj = 1 +PID of this process = 1591744 +loading_betas +betas_ loaded +Number of zeros in valid_nsd_ids_full tensor(0) +Num train examples torch.Size([3410, 15724]) +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Successfully processed features[5]. +Running RR_sklearn.py with argument: features[7] +Configured run_name = subj1_5 +Configured current_features = features[7] +Configured num_sessions = 5.0 +Configured subj = 1 +PID of this process = 1592766 +loading_betas +betas_ loaded +Number of zeros in valid_nsd_ids_full tensor(0) +Num train examples torch.Size([3410, 15724]) +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Successfully processed features[7]. +Running RR_sklearn.py with argument: features[10] +Configured run_name = subj1_5 +Configured current_features = features[10] +Configured num_sessions = 5.0 +Configured subj = 1 +PID of this process = 1593418 +loading_betas +betas_ loaded +Number of zeros in valid_nsd_ids_full tensor(0) +Num train examples torch.Size([3410, 15724]) +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Successfully processed features[10]. +Running RR_sklearn.py with argument: features[12] +Configured run_name = subj1_5 +Configured current_features = features[12] +Configured num_sessions = 5.0 +Configured subj = 1 +PID of this process = 1594164 +loading_betas +betas_ loaded +Number of zeros in valid_nsd_ids_full tensor(0) +Num train examples torch.Size([3410, 15724]) +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Successfully processed features[12]. +Running RR_sklearn.py with argument: features[14] +Configured run_name = subj1_5 +Configured current_features = features[14] +Configured num_sessions = 5.0 +Configured subj = 1 +PID of this process = 1594713 +loading_betas +betas_ loaded +Number of zeros in valid_nsd_ids_full tensor(0) +Num train examples torch.Size([3410, 15724]) +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Successfully processed features[14]. +Running RR_sklearn.py with argument: features[16] +Configured run_name = subj1_5 +Configured current_features = features[16] +Configured num_sessions = 5.0 +Configured subj = 1 +PID of this process = 1597420 +loading_betas +betas_ loaded +Number of zeros in valid_nsd_ids_full tensor(0) +Num train examples torch.Size([3410, 15724]) +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Successfully processed features[16]. +Running RR_sklearn.py with argument: features[19] +Configured run_name = subj1_5 +Configured current_features = features[19] +Configured num_sessions = 5.0 +Configured subj = 1 +PID of this process = 1599087 +loading_betas +betas_ loaded +Number of zeros in valid_nsd_ids_full tensor(0) +Num train examples torch.Size([3410, 15724]) +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Successfully processed features[19]. +Running RR_sklearn.py with argument: features[21] +Configured run_name = subj1_5 +Configured current_features = features[21] +Configured num_sessions = 5.0 +Configured subj = 1 +PID of this process = 1601175 +loading_betas +betas_ loaded +Number of zeros in valid_nsd_ids_full tensor(0) +Num train examples torch.Size([3410, 15724]) +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Successfully processed features[21]. +Running RR_sklearn.py with argument: features[23] +Configured run_name = subj1_5 +Configured current_features = features[23] +Configured num_sessions = 5.0 +Configured subj = 1 +PID of this process = 1602133 +loading_betas +betas_ loaded +Number of zeros in valid_nsd_ids_full tensor(0) +Num train examples torch.Size([3410, 15724]) +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Successfully processed features[23]. +Running RR_sklearn.py with argument: features[25] +Configured run_name = subj1_5 +Configured current_features = features[25] +Configured num_sessions = 5.0 +Configured subj = 1 +PID of this process = 1602561 +loading_betas +betas_ loaded +Number of zeros in valid_nsd_ids_full tensor(0) +Num train examples torch.Size([3410, 15724]) +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Successfully processed features[25]. +Running RR_sklearn.py with argument: features[28] +Configured run_name = subj1_5 +Configured current_features = features[28] +Configured num_sessions = 5.0 +Configured subj = 1 +PID of this process = 1603018 +loading_betas +betas_ loaded +Number of zeros in valid_nsd_ids_full tensor(0) +Num train examples torch.Size([3410, 15724]) +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Successfully processed features[28]. +Running RR_sklearn.py with argument: features[30] +Configured run_name = subj1_5 +Configured current_features = features[30] +Configured num_sessions = 5.0 +Configured subj = 1 +PID of this process = 1603481 +loading_betas +betas_ loaded +Number of zeros in valid_nsd_ids_full tensor(0) +Num train examples torch.Size([3410, 15724]) +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Successfully processed features[30]. +Running RR_sklearn.py with argument: features[32] +Configured run_name = subj1_5 +Configured current_features = features[32] +Configured num_sessions = 5.0 +Configured subj = 1 +PID of this process = 1603917 +loading_betas +betas_ loaded +Number of zeros in valid_nsd_ids_full tensor(0) +Num train examples torch.Size([3410, 15724]) +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Successfully processed features[32]. +Running RR_sklearn.py with argument: features[34] +Configured run_name = subj1_5 +Configured current_features = features[34] +Configured num_sessions = 5.0 +Configured subj = 1 +PID of this process = 1604546 +loading_betas +betas_ loaded +Number of zeros in valid_nsd_ids_full tensor(0) +Num train examples torch.Size([3410, 15724]) +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Successfully processed features[34]. +Running RR_sklearn.py with argument: classifier[0] +Configured run_name = subj1_5 +Configured current_features = classifier[0] +Configured num_sessions = 5.0 +Configured subj = 1 +PID of this process = 1605472 +loading_betas +betas_ loaded +Number of zeros in valid_nsd_ids_full tensor(0) +Num train examples torch.Size([3410, 15724]) +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Successfully processed classifier[0]. +Running RR_sklearn.py with argument: classifier[3] +Configured run_name = subj1_5 +Configured current_features = classifier[3] +Configured num_sessions = 5.0 +Configured subj = 1 +PID of this process = 1606576 +loading_betas +betas_ loaded +Number of zeros in valid_nsd_ids_full tensor(0) +Num train examples torch.Size([3410, 15724]) +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Successfully processed classifier[3]. +Running RR_sklearn.py with argument: classifier[6] +Configured run_name = subj1_5 +Configured current_features = classifier[6] +Configured num_sessions = 5.0 +Configured subj = 1 +PID of this process = 1606999 +loading_betas +betas_ loaded +Number of zeros in valid_nsd_ids_full tensor(0) +Num train examples torch.Size([3410, 15724]) +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Successfully processed classifier[6]. +All features have been processed. diff --git a/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/532240.err b/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/532240.err new file mode 100644 index 0000000000000000000000000000000000000000..c36b2dae1176e607489102f2d7cc7f502ce9d056 --- /dev/null +++ b/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/532240.err @@ -0,0 +1,896 @@ +[NbConvertApp] Converting notebook RR_sklearn.ipynb to python +[NbConvertApp] Writing 24513 bytes to RR_sklearn.py +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/15 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/15 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0it [00:00, ?it/s] 0it [00:00, ?it/s] +Exception ignored in: +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0it [00:00, ?it/s] 0it [00:00, ?it/s] +Exception ignored in: +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0it [00:00, ?it/s] 0it [00:00, ?it/s] +Exception ignored in: +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0it [00:00, ?it/s] 0it [00:00, ?it/s] +Exception ignored in: +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0it [00:00, ?it/s] 0it [00:00, ?it/s] +Exception ignored in: +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0it [00:00, ?it/s] 0it [00:00, ?it/s] +Exception ignored in: +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0it [00:00, ?it/s] 0it [00:00, ?it/s] +Exception ignored in: +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0it [00:00, ?it/s] 0it [00:00, ?it/s] +Exception ignored in: +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0it [00:00, ?it/s] 0it [00:00, ?it/s] +Exception ignored in: +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0it [00:00, ?it/s] 0it [00:00, ?it/s] +Exception ignored in: +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0it [00:00, ?it/s] 0it [00:00, ?it/s] +Exception ignored in: +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0it [00:00, ?it/s] 0it [00:00, ?it/s] +Exception ignored in: +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0it [00:00, ?it/s] 0it [00:00, ?it/s] +Exception ignored in: +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0it [00:00, ?it/s] 0it [00:00, ?it/s] +Exception ignored in: +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0it [00:00, ?it/s] 0it [00:00, ?it/s] +Exception ignored in: +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0it [00:00, ?it/s] 0it [00:00, ?it/s] +Exception ignored in: +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0it [00:00, ?it/s] 0it [00:00, ?it/s] +Exception ignored in: +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable diff --git a/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/532241.err b/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/532241.err new file mode 100644 index 0000000000000000000000000000000000000000..2dbf0deb2743b3ff714e4e2907657677b80275df --- /dev/null +++ b/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/532241.err @@ -0,0 +1,608 @@ +[NbConvertApp] Converting notebook RR_sklearn.ipynb to python +[NbConvertApp] Writing 24513 bytes to RR_sklearn.py +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/15 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/15 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0it [00:00, ?it/s] 0it [00:00, ?it/s] +Exception ignored in: +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0it [00:00, ?it/s] 0it [00:00, ?it/s] +Exception ignored in: +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0it [00:00, ?it/s] 0it [00:00, ?it/s] +Exception ignored in: +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0it [00:00, ?it/s] 0it [00:00, ?it/s] +Exception ignored in: +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0it [00:00, ?it/s] 0it [00:00, ?it/s] +Exception ignored in: +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0it [00:00, ?it/s] 0it [00:00, ?it/s] +Exception ignored in: +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0it [00:00, ?it/s] 0it [00:00, ?it/s] +Exception ignored in: +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0it [00:00, ?it/s] 0it [00:00, ?it/s] +Exception ignored in: +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0it [00:00, ?it/s] 0it [00:00, ?it/s] +Exception ignored in: +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0it [00:00, ?it/s] 0it [00:00, ?it/s] +Exception ignored in: +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0it [00:00, ?it/s] 0it [00:00, ?it/s] +Exception ignored in: +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0it [00:00, ?it/s] 0it [00:00, ?it/s] +Exception ignored in: +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0it [00:00, ?it/s] 0it [00:00, ?it/s] +Exception ignored in: +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0it [00:00, ?it/s] 0it [00:00, ?it/s] +Exception ignored in: +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0it [00:00, ?it/s] 0it [00:00, ?it/s] +Exception ignored in: +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0it [00:00, ?it/s] 0it [00:00, ?it/s] +Exception ignored in: +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0it [00:00, ?it/s] 0it [00:00, ?it/s] +Exception ignored in: +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable diff --git a/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/532247.err b/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/532247.err new file mode 100644 index 0000000000000000000000000000000000000000..28ea1a6b7b397620350816f423a49ce22a97420b --- /dev/null +++ b/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/532247.err @@ -0,0 +1,2955 @@ +[NbConvertApp] Converting notebook RR_sklearn.ipynb to python +[NbConvertApp] Writing 24512 bytes to RR_sklearn.py +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/32 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/32 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/16 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/16 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/8 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/8 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/8 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/8 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/4 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/4 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/4 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/4 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/2 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/2 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/2 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/2 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/1 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/1 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/1 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable diff --git a/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/532250.err b/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/532250.err new file mode 100644 index 0000000000000000000000000000000000000000..c66a52ec8705bd7e01a4c6ed9d70942afd5ad132 --- /dev/null +++ b/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/532250.err @@ -0,0 +1,4726 @@ +[NbConvertApp] Converting notebook RR_sklearn.ipynb to python +[NbConvertApp] Writing 24512 bytes to RR_sklearn.py +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/32 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/32 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/16 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/16 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/8 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/8 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/8 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/8 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/4 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/4 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/4 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/4 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/2 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/2 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/2 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/2 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/1 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/1 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/1 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable diff --git a/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/532250.out b/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/532250.out new file mode 100644 index 0000000000000000000000000000000000000000..fc82bd30929a1df5b8c020161350d3f0e4481926 --- /dev/null +++ b/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/532250.out @@ -0,0 +1,1046 @@ +NUM_GPUS=1 +MASTER_ADDR=ip-10-0-130-166 +MASTER_PORT=17093 +WORLD_SIZE=1 +Running RR_sklearn.py with argument: features[0] +Configured run_name = subj1_5 +Configured current_features = features[0] +Configured num_sessions = 5.0 +Configured subj = 1 +PID of this process = 2835772 +loading_betas +betas_ loaded +Number of zeros in valid_nsd_ids_full tensor(0) +Num train examples torch.Size([3410, 15724]) +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Calculating split 1 of 32 +start_feature_index: 0, end_feature_index: 2 +Starting ridge regression for split 1 with alpha 30000 +Finished, now scoring +train_score: 0.3827510972187779, test_score: 0.09739441196498591 +Calculating split 2 of 32 +start_feature_index: 2, end_feature_index: 4 +Starting ridge regression for split 2 with alpha 30000 +Finished, now scoring +train_score: 0.3815379336776556, test_score: 0.09137083797356242 +Calculating split 3 of 32 +start_feature_index: 4, end_feature_index: 6 +Starting ridge regression for split 3 with alpha 30000 +Finished, now scoring +train_score: 0.35555939519607316, test_score: 0.04481415035701681 +Calculating split 4 of 32 +start_feature_index: 6, end_feature_index: 8 +Starting ridge regression for split 4 with alpha 30000 +Finished, now scoring +train_score: 0.34384917197645415, test_score: 0.0312333427579234 +Calculating split 5 of 32 +start_feature_index: 8, end_feature_index: 10 +Starting ridge regression for split 5 with alpha 30000 +Finished, now scoring +train_score: 0.36537936104658075, test_score: 0.06864400217970563 +Calculating split 6 of 32 +start_feature_index: 10, end_feature_index: 12 +Starting ridge regression for split 6 with alpha 30000 +Finished, now scoring +train_score: 0.31988767335380974, test_score: -0.010683514883775455 +Calculating split 7 of 32 +start_feature_index: 12, end_feature_index: 14 +Starting ridge regression for split 7 with alpha 30000 +Finished, now scoring +train_score: 0.3670156157995524, test_score: 0.07158170774210096 +Calculating split 8 of 32 +start_feature_index: 14, end_feature_index: 16 +Starting ridge regression for split 8 with alpha 30000 +Finished, now scoring +train_score: 0.35514625211404605, test_score: 0.046767356629719675 +Calculating split 9 of 32 +start_feature_index: 16, end_feature_index: 18 +Starting ridge regression for split 9 with alpha 30000 +Finished, now scoring +train_score: 0.36565236723892525, test_score: 0.0685946201890864 +Calculating split 10 of 32 +start_feature_index: 18, end_feature_index: 20 +Starting ridge regression for split 10 with alpha 30000 +Finished, now scoring +train_score: 0.3654146567023209, test_score: 0.05876784705105495 +Calculating split 11 of 32 +start_feature_index: 20, end_feature_index: 22 +Starting ridge regression for split 11 with alpha 30000 +Finished, now scoring +train_score: 0.3351699324187768, test_score: 0.01629395109312038 +Calculating split 12 of 32 +start_feature_index: 22, end_feature_index: 24 +Starting ridge regression for split 12 with alpha 30000 +Finished, now scoring +train_score: 0.368207142800397, test_score: 0.07166057119159433 +Calculating split 13 of 32 +start_feature_index: 24, end_feature_index: 26 +Starting ridge regression for split 13 with alpha 30000 +Finished, now scoring +train_score: 0.406614913448116, test_score: 0.14008819515582083 +Calculating split 14 of 32 +start_feature_index: 26, end_feature_index: 28 +Starting ridge regression for split 14 with alpha 30000 +Finished, now scoring +train_score: 0.3652322116988238, test_score: 0.06853497227189509 +Calculating split 15 of 32 +start_feature_index: 28, end_feature_index: 30 +Starting ridge regression for split 15 with alpha 30000 +Finished, now scoring +train_score: 0.39834544175777475, test_score: 0.12248201777136776 +Calculating split 16 of 32 +start_feature_index: 30, end_feature_index: 32 +Starting ridge regression for split 16 with alpha 30000 +Finished, now scoring +train_score: 0.3781342686655748, test_score: 0.07987613400418589 +Calculating split 17 of 32 +start_feature_index: 32, end_feature_index: 34 +Starting ridge regression for split 17 with alpha 30000 +Finished, now scoring +train_score: 0.3923628582479357, test_score: 0.10958239425803551 +Calculating split 18 of 32 +start_feature_index: 34, end_feature_index: 36 +Starting ridge regression for split 18 with alpha 30000 +Finished, now scoring +train_score: 0.31668804452239335, test_score: -0.016805799286874146 +Calculating split 19 of 32 +start_feature_index: 36, end_feature_index: 38 +Starting ridge regression for split 19 with alpha 30000 +Finished, now scoring +train_score: 0.35142218620670607, test_score: 0.0302761501166291 +Calculating split 20 of 32 +start_feature_index: 38, end_feature_index: 40 +Starting ridge regression for split 20 with alpha 30000 +Finished, now scoring +train_score: 0.3677188562279432, test_score: 0.05636319198733855 +Calculating split 21 of 32 +start_feature_index: 40, end_feature_index: 42 +Starting ridge regression for split 21 with alpha 30000 +Finished, now scoring +train_score: 0.32778748210425773, test_score: 0.0062318157214303034 +Calculating split 22 of 32 +start_feature_index: 42, end_feature_index: 44 +Starting ridge regression for split 22 with alpha 30000 +Finished, now scoring +train_score: 0.31721737311752096, test_score: -0.01599214902351841 +Calculating split 23 of 32 +start_feature_index: 44, end_feature_index: 46 +Starting ridge regression for split 23 with alpha 30000 +Finished, now scoring +train_score: 0.3182078265171829, test_score: -0.013819151581188844 +Calculating split 24 of 32 +start_feature_index: 46, end_feature_index: 48 +Starting ridge regression for split 24 with alpha 30000 +Finished, now scoring +train_score: 0.3329476429262677, test_score: 0.013254452022352313 +Calculating split 25 of 32 +start_feature_index: 48, end_feature_index: 50 +Starting ridge regression for split 25 with alpha 30000 +Finished, now scoring +train_score: 0.35242309639643304, test_score: 0.04845234671818164 +Calculating split 26 of 32 +start_feature_index: 50, end_feature_index: 52 +Starting ridge regression for split 26 with alpha 30000 +Finished, now scoring +train_score: 0.3481640432121725, test_score: 0.026805129905564003 +Calculating split 27 of 32 +start_feature_index: 52, end_feature_index: 54 +Starting ridge regression for split 27 with alpha 30000 +Finished, now scoring +train_score: 0.3969746788035622, test_score: 0.1221814250124897 +Calculating split 28 of 32 +start_feature_index: 54, end_feature_index: 56 +Starting ridge regression for split 28 with alpha 30000 +Finished, now scoring +train_score: 0.3381586772240124, test_score: 0.022509242056514302 +Calculating split 29 of 32 +start_feature_index: 56, end_feature_index: 58 +Starting ridge regression for split 29 with alpha 30000 +Finished, now scoring +train_score: 0.3231010876914665, test_score: -0.004693472144121787 +Calculating split 30 of 32 +start_feature_index: 58, end_feature_index: 60 +Starting ridge regression for split 30 with alpha 30000 +Finished, now scoring +train_score: 0.34854524577999507, test_score: 0.0262222816368368 +Calculating split 31 of 32 +start_feature_index: 60, end_feature_index: 62 +Starting ridge regression for split 31 with alpha 30000 +Finished, now scoring +train_score: 0.3768632398808942, test_score: 0.07774635829771985 +Calculating split 32 of 32 +start_feature_index: 62, end_feature_index: 64 +Starting ridge regression for split 32 with alpha 30000 +Finished, now scoring +train_score: 0.3228820634939034, test_score: -0.007888107822825688 +Successfully processed features[0]. +Running RR_sklearn.py with argument: features[2] +Configured run_name = subj1_5 +Configured current_features = features[2] +Configured num_sessions = 5.0 +Configured subj = 1 +PID of this process = 2891596 +loading_betas +betas_ loaded +Number of zeros in valid_nsd_ids_full tensor(0) +Num train examples torch.Size([3410, 15724]) +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Calculating split 1 of 32 +start_feature_index: 0, end_feature_index: 2 +Starting ridge regression for split 1 with alpha 30000 +Finished, now scoring +train_score: 0.3227135092105409, test_score: -0.00797438138883087 +Calculating split 2 of 32 +start_feature_index: 2, end_feature_index: 4 +Starting ridge regression for split 2 with alpha 30000 +Finished, now scoring +train_score: 0.37601489903812496, test_score: 0.08000619363132848 +Calculating split 3 of 32 +start_feature_index: 4, end_feature_index: 6 +Starting ridge regression for split 3 with alpha 30000 +Finished, now scoring +train_score: 0.37743940451871777, test_score: 0.08429436411886149 +Calculating split 4 of 32 +start_feature_index: 6, end_feature_index: 8 +Starting ridge regression for split 4 with alpha 30000 +Finished, now scoring +train_score: 0.3376308352396107, test_score: 0.0164531043958439 +Calculating split 5 of 32 +start_feature_index: 8, end_feature_index: 10 +Starting ridge regression for split 5 with alpha 30000 +Finished, now scoring +train_score: 0.3411871698937552, test_score: 0.020653915131822607 +Calculating split 6 of 32 +start_feature_index: 10, end_feature_index: 12 +Starting ridge regression for split 6 with alpha 30000 +Finished, now scoring +train_score: 0.3411899632024633, test_score: 0.02046087133046777 +Calculating split 7 of 32 +start_feature_index: 12, end_feature_index: 14 +Starting ridge regression for split 7 with alpha 30000 +Finished, now scoring +train_score: 0.31871774656989466, test_score: -0.014386029765691715 +Calculating split 8 of 32 +start_feature_index: 14, end_feature_index: 16 +Starting ridge regression for split 8 with alpha 30000 +Finished, now scoring +train_score: 0.3530255903108355, test_score: 0.05099204876059724 +Calculating split 9 of 32 +start_feature_index: 16, end_feature_index: 18 +Starting ridge regression for split 9 with alpha 30000 +Finished, now scoring +train_score: 0.3470488702438038, test_score: 0.031668623771498955 +Calculating split 10 of 32 +start_feature_index: 18, end_feature_index: 20 +Starting ridge regression for split 10 with alpha 30000 +Finished, now scoring +train_score: 0.3521992932662174, test_score: 0.0478170245440905 +Calculating split 11 of 32 +start_feature_index: 20, end_feature_index: 22 +Starting ridge regression for split 11 with alpha 30000 +Finished, now scoring +train_score: 0.3167824836214084, test_score: -0.01637491072515221 +Calculating split 12 of 32 +start_feature_index: 22, end_feature_index: 24 +Starting ridge regression for split 12 with alpha 30000 +Finished, now scoring +train_score: 0.3801177065869422, test_score: 0.08370038863111803 +Calculating split 13 of 32 +start_feature_index: 24, end_feature_index: 26 +Starting ridge regression for split 13 with alpha 30000 +Finished, now scoring +train_score: 0.40057183471056806, test_score: 0.11671312005249461 +Calculating split 14 of 32 +start_feature_index: 26, end_feature_index: 28 +Starting ridge regression for split 14 with alpha 30000 +Finished, now scoring +train_score: 0.35486252859222, test_score: 0.04760251913507343 +Calculating split 15 of 32 +start_feature_index: 28, end_feature_index: 30 +Starting ridge regression for split 15 with alpha 30000 +Finished, now scoring +train_score: 0.31756364722501257, test_score: -0.015722368973470596 +Calculating split 16 of 32 +start_feature_index: 30, end_feature_index: 32 +Starting ridge regression for split 16 with alpha 30000 +Finished, now scoring +train_score: 0.35615334371091123, test_score: 0.052152302785134906 +Calculating split 17 of 32 +start_feature_index: 32, end_feature_index: 34 +Starting ridge regression for split 17 with alpha 30000 +Finished, now scoring +train_score: 0.31855032723701965, test_score: -0.014804099113140186 +Calculating split 18 of 32 +start_feature_index: 34, end_feature_index: 36 +Starting ridge regression for split 18 with alpha 30000 +Finished, now scoring +train_score: 0.3214328467997687, test_score: -0.008667025422590595 +Calculating split 19 of 32 +start_feature_index: 36, end_feature_index: 38 +Starting ridge regression for split 19 with alpha 30000 +Finished, now scoring +train_score: 0.3270064801752463, test_score: -0.0009888569337430549 +Calculating split 20 of 32 +start_feature_index: 38, end_feature_index: 40 +Starting ridge regression for split 20 with alpha 30000 +Finished, now scoring +train_score: 0.3912697900485432, test_score: 0.09827967209140352 +Calculating split 21 of 32 +start_feature_index: 40, end_feature_index: 42 +Starting ridge regression for split 21 with alpha 30000 +Finished, now scoring +train_score: 0.3202957290233708, test_score: -0.012069223846753517 +Calculating split 22 of 32 +start_feature_index: 42, end_feature_index: 44 +Starting ridge regression for split 22 with alpha 30000 +Finished, now scoring +train_score: 0.3526325048368849, test_score: 0.03308912595530055 +Calculating split 23 of 32 +start_feature_index: 44, end_feature_index: 46 +Starting ridge regression for split 23 with alpha 30000 +Finished, now scoring +train_score: 0.35625775722795744, test_score: 0.052850002519048436 +Calculating split 24 of 32 +start_feature_index: 46, end_feature_index: 48 +Starting ridge regression for split 24 with alpha 30000 +Finished, now scoring +train_score: 0.3205205438248351, test_score: -0.010896749126274988 +Calculating split 25 of 32 +start_feature_index: 48, end_feature_index: 50 +Starting ridge regression for split 25 with alpha 30000 +Finished, now scoring +train_score: 0.37529811560073756, test_score: 0.08703403954513153 +Calculating split 26 of 32 +start_feature_index: 50, end_feature_index: 52 +Starting ridge regression for split 26 with alpha 30000 +Finished, now scoring +train_score: 0.3300786715337478, test_score: 0.0026539837190144963 +Calculating split 27 of 32 +start_feature_index: 52, end_feature_index: 54 +Starting ridge regression for split 27 with alpha 30000 +Finished, now scoring +train_score: 0.33352849314086536, test_score: 0.01347594170732551 +Calculating split 28 of 32 +start_feature_index: 54, end_feature_index: 56 +Starting ridge regression for split 28 with alpha 30000 +Finished, now scoring +train_score: 0.3697251505600773, test_score: 0.06673917548628755 +Calculating split 29 of 32 +start_feature_index: 56, end_feature_index: 58 +Starting ridge regression for split 29 with alpha 30000 +Finished, now scoring +train_score: 0.3191978768162868, test_score: -0.012166360109303326 +Calculating split 30 of 32 +start_feature_index: 58, end_feature_index: 60 +Starting ridge regression for split 30 with alpha 30000 +Finished, now scoring +train_score: 0.3180257132478128, test_score: -0.01424510180254433 +Calculating split 31 of 32 +start_feature_index: 60, end_feature_index: 62 +Starting ridge regression for split 31 with alpha 30000 +Finished, now scoring +train_score: 0.3957877889365305, test_score: 0.12773836690204196 +Calculating split 32 of 32 +start_feature_index: 62, end_feature_index: 64 +Starting ridge regression for split 32 with alpha 30000 +Finished, now scoring +train_score: 0.33024794084584463, test_score: 0.004857370030794305 +Successfully processed features[2]. +Running RR_sklearn.py with argument: features[5] +Configured run_name = subj1_5 +Configured current_features = features[5] +Configured num_sessions = 5.0 +Configured subj = 1 +PID of this process = 2945101 +loading_betas +betas_ loaded +Number of zeros in valid_nsd_ids_full tensor(0) +Num train examples torch.Size([3410, 15724]) +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Calculating split 1 of 16 +start_feature_index: 0, end_feature_index: 8 +Starting ridge regression for split 1 with alpha 30000 +Finished, now scoring +train_score: 0.3451402523301328, test_score: 0.02880489525018423 +Calculating split 2 of 16 +start_feature_index: 8, end_feature_index: 16 +Starting ridge regression for split 2 with alpha 30000 +Finished, now scoring +train_score: 0.3306782801336067, test_score: 0.004556705464298719 +Calculating split 3 of 16 +start_feature_index: 16, end_feature_index: 24 +Starting ridge regression for split 3 with alpha 30000 +Finished, now scoring +train_score: 0.3297335272828127, test_score: 0.003424018559720683 +Calculating split 4 of 16 +start_feature_index: 24, end_feature_index: 32 +Starting ridge regression for split 4 with alpha 30000 +Finished, now scoring +train_score: 0.3410279358755863, test_score: 0.022011981709343854 +Calculating split 5 of 16 +start_feature_index: 32, end_feature_index: 40 +Starting ridge regression for split 5 with alpha 30000 +Finished, now scoring +train_score: 0.34339592014824094, test_score: 0.02714165142920003 +Calculating split 6 of 16 +start_feature_index: 40, end_feature_index: 48 +Starting ridge regression for split 6 with alpha 30000 +Finished, now scoring +train_score: 0.3501184472877296, test_score: 0.03757611108480025 +Calculating split 7 of 16 +start_feature_index: 48, end_feature_index: 56 +Starting ridge regression for split 7 with alpha 30000 +Finished, now scoring +train_score: 0.3676705709505903, test_score: 0.06538827591686772 +Calculating split 8 of 16 +start_feature_index: 56, end_feature_index: 64 +Starting ridge regression for split 8 with alpha 30000 +Finished, now scoring +train_score: 0.3509785761089043, test_score: 0.03862326225483298 +Calculating split 9 of 16 +start_feature_index: 64, end_feature_index: 72 +Starting ridge regression for split 9 with alpha 30000 +Finished, now scoring +train_score: 0.34576462717742745, test_score: 0.030431823964654135 +Calculating split 10 of 16 +start_feature_index: 72, end_feature_index: 80 +Starting ridge regression for split 10 with alpha 30000 +Finished, now scoring +train_score: 0.34295058709330073, test_score: 0.025766867153754768 +Calculating split 11 of 16 +start_feature_index: 80, end_feature_index: 88 +Starting ridge regression for split 11 with alpha 30000 +Finished, now scoring +train_score: 0.34640802641267276, test_score: 0.03266699814392111 +Calculating split 12 of 16 +start_feature_index: 88, end_feature_index: 96 +Starting ridge regression for split 12 with alpha 30000 +Finished, now scoring +train_score: 0.34864871667103203, test_score: 0.03379981385021686 +Calculating split 13 of 16 +start_feature_index: 96, end_feature_index: 104 +Starting ridge regression for split 13 with alpha 30000 +Finished, now scoring +train_score: 0.3333335918759452, test_score: 0.009561350068138 +Calculating split 14 of 16 +start_feature_index: 104, end_feature_index: 112 +Starting ridge regression for split 14 with alpha 30000 +Finished, now scoring +train_score: 0.3525190061555026, test_score: 0.04258306505568017 +Calculating split 15 of 16 +start_feature_index: 112, end_feature_index: 120 +Starting ridge regression for split 15 with alpha 30000 +Finished, now scoring +train_score: 0.35453412531009104, test_score: 0.04565754182646879 +Calculating split 16 of 16 +start_feature_index: 120, end_feature_index: 128 +Starting ridge regression for split 16 with alpha 30000 +Finished, now scoring +train_score: 0.3443350246142607, test_score: 0.030538385993893438 +Successfully processed features[5]. +Running RR_sklearn.py with argument: features[7] +Configured run_name = subj1_5 +Configured current_features = features[7] +Configured num_sessions = 5.0 +Configured subj = 1 +PID of this process = 2982846 +loading_betas +betas_ loaded +Number of zeros in valid_nsd_ids_full tensor(0) +Num train examples torch.Size([3410, 15724]) +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Calculating split 1 of 16 +start_feature_index: 0, end_feature_index: 8 +Starting ridge regression for split 1 with alpha 30000 +Finished, now scoring +train_score: 0.32551476402878365, test_score: -0.0038944548827493006 +Calculating split 2 of 16 +start_feature_index: 8, end_feature_index: 16 +Starting ridge regression for split 2 with alpha 30000 +Finished, now scoring +train_score: 0.32313029170913427, test_score: -0.006907083772309053 +Calculating split 3 of 16 +start_feature_index: 16, end_feature_index: 24 +Starting ridge regression for split 3 with alpha 30000 +Finished, now scoring +train_score: 0.3264053301023056, test_score: -0.0018337210376384565 +Calculating split 4 of 16 +start_feature_index: 24, end_feature_index: 32 +Starting ridge regression for split 4 with alpha 30000 +Finished, now scoring +train_score: 0.33273489977373905, test_score: 0.008519336740572021 +Calculating split 5 of 16 +start_feature_index: 32, end_feature_index: 40 +Starting ridge regression for split 5 with alpha 30000 +Finished, now scoring +train_score: 0.33465357710318416, test_score: 0.011555142264335922 +Calculating split 6 of 16 +start_feature_index: 40, end_feature_index: 48 +Starting ridge regression for split 6 with alpha 30000 +Finished, now scoring +train_score: 0.32472201949337, test_score: -0.004704922730115407 +Calculating split 7 of 16 +start_feature_index: 48, end_feature_index: 56 +Starting ridge regression for split 7 with alpha 30000 +Finished, now scoring +train_score: 0.32287920382628493, test_score: -0.007483333341259923 +Calculating split 8 of 16 +start_feature_index: 56, end_feature_index: 64 +Starting ridge regression for split 8 with alpha 30000 +Finished, now scoring +train_score: 0.32861970498386617, test_score: 0.0027739786118330272 +Calculating split 9 of 16 +start_feature_index: 64, end_feature_index: 72 +Starting ridge regression for split 9 with alpha 30000 +Finished, now scoring +train_score: 0.34232775953339245, test_score: 0.023686333223435427 +Calculating split 10 of 16 +start_feature_index: 72, end_feature_index: 80 +Starting ridge regression for split 10 with alpha 30000 +Finished, now scoring +train_score: 0.33149442678978475, test_score: 0.006368813885196211 +Calculating split 11 of 16 +start_feature_index: 80, end_feature_index: 88 +Starting ridge regression for split 11 with alpha 30000 +Finished, now scoring +train_score: 0.3301637680691381, test_score: 0.005094758115376514 +Calculating split 12 of 16 +start_feature_index: 88, end_feature_index: 96 +Starting ridge regression for split 12 with alpha 30000 +Finished, now scoring +train_score: 0.326714897317377, test_score: -0.0016796687775037656 +Calculating split 13 of 16 +start_feature_index: 96, end_feature_index: 104 +Starting ridge regression for split 13 with alpha 30000 +Finished, now scoring +train_score: 0.334262675023321, test_score: 0.011078022861361655 +Calculating split 14 of 16 +start_feature_index: 104, end_feature_index: 112 +Starting ridge regression for split 14 with alpha 30000 +Finished, now scoring +train_score: 0.3340002390205186, test_score: 0.011658511880960933 +Calculating split 15 of 16 +start_feature_index: 112, end_feature_index: 120 +Starting ridge regression for split 15 with alpha 30000 +Finished, now scoring +train_score: 0.32692890940809255, test_score: -0.0008426261504206649 +Calculating split 16 of 16 +start_feature_index: 120, end_feature_index: 128 +Starting ridge regression for split 16 with alpha 30000 +Finished, now scoring +train_score: 0.3361926841810215, test_score: 0.014238343915877458 +Successfully processed features[7]. +Running RR_sklearn.py with argument: features[10] +Configured run_name = subj1_5 +Configured current_features = features[10] +Configured num_sessions = 5.0 +Configured subj = 1 +PID of this process = 3007283 +loading_betas +betas_ loaded +Number of zeros in valid_nsd_ids_full tensor(0) +Num train examples torch.Size([3410, 15724]) +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Calculating split 1 of 8 +start_feature_index: 0, end_feature_index: 32 +Starting ridge regression for split 1 with alpha 30000 +Finished, now scoring +train_score: 0.3442760489813225, test_score: 0.02825293330891165 +Calculating split 2 of 8 +start_feature_index: 32, end_feature_index: 64 +Starting ridge regression for split 2 with alpha 30000 +Finished, now scoring +train_score: 0.33959484241856275, test_score: 0.019713988985295996 +Calculating split 3 of 8 +start_feature_index: 64, end_feature_index: 96 +Starting ridge regression for split 3 with alpha 30000 +Finished, now scoring +train_score: 0.3476213666098597, test_score: 0.032233529574420196 +Calculating split 4 of 8 +start_feature_index: 96, end_feature_index: 128 +Starting ridge regression for split 4 with alpha 30000 +Finished, now scoring +train_score: 0.3494421978790678, test_score: 0.03697426642245741 +Calculating split 5 of 8 +start_feature_index: 128, end_feature_index: 160 +Starting ridge regression for split 5 with alpha 30000 +Finished, now scoring +train_score: 0.3448156309363934, test_score: 0.028526988907389934 +Calculating split 6 of 8 +start_feature_index: 160, end_feature_index: 192 +Starting ridge regression for split 6 with alpha 30000 +Finished, now scoring +train_score: 0.3478146339568191, test_score: 0.03252213662487006 +Calculating split 7 of 8 +start_feature_index: 192, end_feature_index: 224 +Starting ridge regression for split 7 with alpha 30000 +Finished, now scoring +train_score: 0.3466218243712277, test_score: 0.03134683359448675 +Calculating split 8 of 8 +start_feature_index: 224, end_feature_index: 256 +Starting ridge regression for split 8 with alpha 30000 +Finished, now scoring +train_score: 0.3480947185295837, test_score: 0.03228375456803971 +Successfully processed features[10]. +Running RR_sklearn.py with argument: features[12] +Configured run_name = subj1_5 +Configured current_features = features[12] +Configured num_sessions = 5.0 +Configured subj = 1 +PID of this process = 3018959 +loading_betas +betas_ loaded +Number of zeros in valid_nsd_ids_full tensor(0) +Num train examples torch.Size([3410, 15724]) +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Calculating split 1 of 8 +start_feature_index: 0, end_feature_index: 32 +Starting ridge regression for split 1 with alpha 30000 +Finished, now scoring +train_score: 0.350486420483696, test_score: 0.0388702531456758 +Calculating split 2 of 8 +start_feature_index: 32, end_feature_index: 64 +Starting ridge regression for split 2 with alpha 30000 +Finished, now scoring +train_score: 0.3553759309226923, test_score: 0.0464616726577605 +Calculating split 3 of 8 +start_feature_index: 64, end_feature_index: 96 +Starting ridge regression for split 3 with alpha 30000 +Finished, now scoring +train_score: 0.34862414518448537, test_score: 0.03628899182975376 +Calculating split 4 of 8 +start_feature_index: 96, end_feature_index: 128 +Starting ridge regression for split 4 with alpha 30000 +Finished, now scoring +train_score: 0.34992352429039325, test_score: 0.035913732879003936 +Calculating split 5 of 8 +start_feature_index: 128, end_feature_index: 160 +Starting ridge regression for split 5 with alpha 30000 +Finished, now scoring +train_score: 0.3485628747888662, test_score: 0.03505328242002878 +Calculating split 6 of 8 +start_feature_index: 160, end_feature_index: 192 +Starting ridge regression for split 6 with alpha 30000 +Finished, now scoring +train_score: 0.35251752229378064, test_score: 0.042703651439883965 +Calculating split 7 of 8 +start_feature_index: 192, end_feature_index: 224 +Starting ridge regression for split 7 with alpha 30000 +Finished, now scoring +train_score: 0.35109316660763434, test_score: 0.03904990898679841 +Calculating split 8 of 8 +start_feature_index: 224, end_feature_index: 256 +Starting ridge regression for split 8 with alpha 30000 +Finished, now scoring +train_score: 0.3482313382158634, test_score: 0.03503747114440777 +Successfully processed features[12]. +Running RR_sklearn.py with argument: features[14] +Configured run_name = subj1_5 +Configured current_features = features[14] +Configured num_sessions = 5.0 +Configured subj = 1 +PID of this process = 3037423 +loading_betas +betas_ loaded +Number of zeros in valid_nsd_ids_full tensor(0) +Num train examples torch.Size([3410, 15724]) +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Calculating split 1 of 8 +start_feature_index: 0, end_feature_index: 32 +Starting ridge regression for split 1 with alpha 30000 +Finished, now scoring +train_score: 0.3648314155350408, test_score: 0.06310204285845625 +Calculating split 2 of 8 +start_feature_index: 32, end_feature_index: 64 +Starting ridge regression for split 2 with alpha 30000 +Finished, now scoring +train_score: 0.3660685215354702, test_score: 0.06531508718868918 +Calculating split 3 of 8 +start_feature_index: 64, end_feature_index: 96 +Starting ridge regression for split 3 with alpha 30000 +Finished, now scoring +train_score: 0.3702771938348235, test_score: 0.0735236510041007 +Calculating split 4 of 8 +start_feature_index: 96, end_feature_index: 128 +Starting ridge regression for split 4 with alpha 30000 +Finished, now scoring +train_score: 0.36653803277943897, test_score: 0.06556154000130715 +Calculating split 5 of 8 +start_feature_index: 128, end_feature_index: 160 +Starting ridge regression for split 5 with alpha 30000 +Finished, now scoring +train_score: 0.3718337646098957, test_score: 0.07681329142591126 +Calculating split 6 of 8 +start_feature_index: 160, end_feature_index: 192 +Starting ridge regression for split 6 with alpha 30000 +Finished, now scoring +train_score: 0.3612669627785114, test_score: 0.057963538515428376 +Calculating split 7 of 8 +start_feature_index: 192, end_feature_index: 224 +Starting ridge regression for split 7 with alpha 30000 +Finished, now scoring +train_score: 0.3724648850105128, test_score: 0.07820231113698212 +Calculating split 8 of 8 +start_feature_index: 224, end_feature_index: 256 +Starting ridge regression for split 8 with alpha 30000 +Finished, now scoring +train_score: 0.36977358452771686, test_score: 0.06932464849940871 +Successfully processed features[14]. +Running RR_sklearn.py with argument: features[16] +Configured run_name = subj1_5 +Configured current_features = features[16] +Configured num_sessions = 5.0 +Configured subj = 1 +PID of this process = 3054826 +loading_betas +betas_ loaded +Number of zeros in valid_nsd_ids_full tensor(0) +Num train examples torch.Size([3410, 15724]) +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Calculating split 1 of 8 +start_feature_index: 0, end_feature_index: 32 +Starting ridge regression for split 1 with alpha 25000 +Finished, now scoring +train_score: 0.3957437452905621, test_score: 0.055637475936992545 +Calculating split 2 of 8 +start_feature_index: 32, end_feature_index: 64 +Starting ridge regression for split 2 with alpha 25000 +Finished, now scoring +train_score: 0.3993688480800223, test_score: 0.062899651782342 +Calculating split 3 of 8 +start_feature_index: 64, end_feature_index: 96 +Starting ridge regression for split 3 with alpha 25000 +Finished, now scoring +train_score: 0.3924322419023295, test_score: 0.049686484273794566 +Calculating split 4 of 8 +start_feature_index: 96, end_feature_index: 128 +Starting ridge regression for split 4 with alpha 25000 +Finished, now scoring +train_score: 0.4001586695108765, test_score: 0.06744860876426508 +Calculating split 5 of 8 +start_feature_index: 128, end_feature_index: 160 +Starting ridge regression for split 5 with alpha 25000 +Finished, now scoring +train_score: 0.39581063774501457, test_score: 0.0560430111220304 +Calculating split 6 of 8 +start_feature_index: 160, end_feature_index: 192 +Starting ridge regression for split 6 with alpha 25000 +Finished, now scoring +train_score: 0.39305215928746123, test_score: 0.05154857441945255 +Calculating split 7 of 8 +start_feature_index: 192, end_feature_index: 224 +Starting ridge regression for split 7 with alpha 25000 +Finished, now scoring +train_score: 0.39832534363781513, test_score: 0.062572433120195 +Calculating split 8 of 8 +start_feature_index: 224, end_feature_index: 256 +Starting ridge regression for split 8 with alpha 25000 +Finished, now scoring +train_score: 0.3904551678786788, test_score: 0.04723821028267118 +Successfully processed features[16]. +Running RR_sklearn.py with argument: features[19] +Configured run_name = subj1_5 +Configured current_features = features[19] +Configured num_sessions = 5.0 +Configured subj = 1 +PID of this process = 3066816 +loading_betas +betas_ loaded +Number of zeros in valid_nsd_ids_full tensor(0) +Num train examples torch.Size([3410, 15724]) +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Calculating split 1 of 4 +start_feature_index: 0, end_feature_index: 128 +Starting ridge regression for split 1 with alpha 25000 +Finished, now scoring +train_score: 0.4184037347874951, test_score: 0.09577985436738819 +Calculating split 2 of 4 +start_feature_index: 128, end_feature_index: 256 +Starting ridge regression for split 2 with alpha 25000 +Finished, now scoring +train_score: 0.41984616100316613, test_score: 0.09755009888052944 +Calculating split 3 of 4 +start_feature_index: 256, end_feature_index: 384 +Starting ridge regression for split 3 with alpha 25000 +Finished, now scoring +train_score: 0.4221987636054256, test_score: 0.10273255327434269 +Calculating split 4 of 4 +start_feature_index: 384, end_feature_index: 512 +Starting ridge regression for split 4 with alpha 25000 +Finished, now scoring +train_score: 0.41740063793024007, test_score: 0.09364083834772594 +Successfully processed features[19]. +Running RR_sklearn.py with argument: features[21] +Configured run_name = subj1_5 +Configured current_features = features[21] +Configured num_sessions = 5.0 +Configured subj = 1 +PID of this process = 3072737 +loading_betas +betas_ loaded +Number of zeros in valid_nsd_ids_full tensor(0) +Num train examples torch.Size([3410, 15724]) +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Calculating split 1 of 4 +start_feature_index: 0, end_feature_index: 128 +Starting ridge regression for split 1 with alpha 25000 +Finished, now scoring +train_score: 0.4189076283244439, test_score: 0.09665997675778377 +Calculating split 2 of 4 +start_feature_index: 128, end_feature_index: 256 +Starting ridge regression for split 2 with alpha 25000 +Finished, now scoring +train_score: 0.4125399464682488, test_score: 0.08462618878333174 +Calculating split 3 of 4 +start_feature_index: 256, end_feature_index: 384 +Starting ridge regression for split 3 with alpha 25000 +Finished, now scoring +train_score: 0.4160726260521991, test_score: 0.09097546086674758 +Calculating split 4 of 4 +start_feature_index: 384, end_feature_index: 512 +Starting ridge regression for split 4 with alpha 25000 +Finished, now scoring +train_score: 0.4098096678042493, test_score: 0.08110893028521862 +Successfully processed features[21]. +Running RR_sklearn.py with argument: features[23] +Configured run_name = subj1_5 +Configured current_features = features[23] +Configured num_sessions = 5.0 +Configured subj = 1 +PID of this process = 3084253 +loading_betas +betas_ loaded +Number of zeros in valid_nsd_ids_full tensor(0) +Num train examples torch.Size([3410, 15724]) +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Calculating split 1 of 4 +start_feature_index: 0, end_feature_index: 128 +Starting ridge regression for split 1 with alpha 25000 +Finished, now scoring +train_score: 0.3980854485526472, test_score: 0.06057024176796061 +Calculating split 2 of 4 +start_feature_index: 128, end_feature_index: 256 +Starting ridge regression for split 2 with alpha 25000 +Finished, now scoring +train_score: 0.4042434944741487, test_score: 0.07129516353047796 +Calculating split 3 of 4 +start_feature_index: 256, end_feature_index: 384 +Starting ridge regression for split 3 with alpha 25000 +Finished, now scoring +train_score: 0.39972702863862664, test_score: 0.06307442091302158 +Calculating split 4 of 4 +start_feature_index: 384, end_feature_index: 512 +Starting ridge regression for split 4 with alpha 25000 +Finished, now scoring +train_score: 0.4079671440835632, test_score: 0.07712050443555685 +Successfully processed features[23]. +Running RR_sklearn.py with argument: features[25] +Configured run_name = subj1_5 +Configured current_features = features[25] +Configured num_sessions = 5.0 +Configured subj = 1 +PID of this process = 3090273 +loading_betas +betas_ loaded +Number of zeros in valid_nsd_ids_full tensor(0) +Num train examples torch.Size([3410, 15724]) +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Calculating split 1 of 4 +start_feature_index: 0, end_feature_index: 128 +Starting ridge regression for split 1 with alpha 25000 +Finished, now scoring +train_score: 0.4060714806380359, test_score: 0.0750115612781851 +Calculating split 2 of 4 +start_feature_index: 128, end_feature_index: 256 +Starting ridge regression for split 2 with alpha 25000 +Finished, now scoring +train_score: 0.40341480276651964, test_score: 0.07112669636842107 +Calculating split 3 of 4 +start_feature_index: 256, end_feature_index: 384 +Starting ridge regression for split 3 with alpha 25000 +Finished, now scoring +train_score: 0.40350914640849, test_score: 0.07116208195679377 +Calculating split 4 of 4 +start_feature_index: 384, end_feature_index: 512 +Starting ridge regression for split 4 with alpha 25000 +Finished, now scoring +train_score: 0.4060274277964839, test_score: 0.07550488212614456 +Successfully processed features[25]. +Running RR_sklearn.py with argument: features[28] +Configured run_name = subj1_5 +Configured current_features = features[28] +Configured num_sessions = 5.0 +Configured subj = 1 +PID of this process = 3100164 +loading_betas +betas_ loaded +Number of zeros in valid_nsd_ids_full tensor(0) +Num train examples torch.Size([3410, 15724]) +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Calculating split 1 of 2 +start_feature_index: 0, end_feature_index: 256 +Starting ridge regression for split 1 with alpha 25000 +Finished, now scoring +train_score: 0.43136157412195225, test_score: 0.11964083884603748 +Calculating split 2 of 2 +start_feature_index: 256, end_feature_index: 512 +Starting ridge regression for split 2 with alpha 25000 +Finished, now scoring +train_score: 0.4281560364057678, test_score: 0.11391020478628065 +Successfully processed features[28]. +Running RR_sklearn.py with argument: features[30] +Configured run_name = subj1_5 +Configured current_features = features[30] +Configured num_sessions = 5.0 +Configured subj = 1 +PID of this process = 3104810 +loading_betas +betas_ loaded +Number of zeros in valid_nsd_ids_full tensor(0) +Num train examples torch.Size([3410, 15724]) +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Calculating split 1 of 2 +start_feature_index: 0, end_feature_index: 256 +Starting ridge regression for split 1 with alpha 25000 +Finished, now scoring +train_score: 0.431750401242045, test_score: 0.11899459365993816 +Calculating split 2 of 2 +start_feature_index: 256, end_feature_index: 512 +Starting ridge regression for split 2 with alpha 25000 +Finished, now scoring +train_score: 0.4310865760610821, test_score: 0.11766193797255708 +Successfully processed features[30]. +Running RR_sklearn.py with argument: features[32] +Configured run_name = subj1_5 +Configured current_features = features[32] +Configured num_sessions = 5.0 +Configured subj = 1 +PID of this process = 3107886 +loading_betas +betas_ loaded +Number of zeros in valid_nsd_ids_full tensor(0) +Num train examples torch.Size([3410, 15724]) +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Calculating split 1 of 2 +start_feature_index: 0, end_feature_index: 256 +Starting ridge regression for split 1 with alpha 25000 +Finished, now scoring +train_score: 0.430883914783543, test_score: 0.11637500240875152 +Calculating split 2 of 2 +start_feature_index: 256, end_feature_index: 512 +Starting ridge regression for split 2 with alpha 25000 +Finished, now scoring +train_score: 0.43392037420835944, test_score: 0.12127643117745526 +Successfully processed features[32]. +Running RR_sklearn.py with argument: features[34] +Configured run_name = subj1_5 +Configured current_features = features[34] +Configured num_sessions = 5.0 +Configured subj = 1 +PID of this process = 3114682 +loading_betas +betas_ loaded +Number of zeros in valid_nsd_ids_full tensor(0) +Num train examples torch.Size([3410, 15724]) +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Calculating split 1 of 2 +start_feature_index: 0, end_feature_index: 256 +Starting ridge regression for split 1 with alpha 25000 +Finished, now scoring +train_score: 0.44535715846043666, test_score: 0.14185568270411616 +Calculating split 2 of 2 +start_feature_index: 256, end_feature_index: 512 +Starting ridge regression for split 2 with alpha 25000 +Finished, now scoring +train_score: 0.4436121154148549, test_score: 0.13890409651143665 +Successfully processed features[34]. +Running RR_sklearn.py with argument: classifier[0] +Configured run_name = subj1_5 +Configured current_features = classifier[0] +Configured num_sessions = 5.0 +Configured subj = 1 +PID of this process = 3117611 +loading_betas +betas_ loaded +Number of zeros in valid_nsd_ids_full tensor(0) +Num train examples torch.Size([3410, 15724]) +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Calculating split 1 of 1 +start_feature_index: 0, end_feature_index: 4096 +Starting ridge regression for split 1 with alpha 20000 +Finished, now scoring +train_score: 0.5231438413348609, test_score: 0.19493575688668413 +Successfully processed classifier[0]. +Running RR_sklearn.py with argument: classifier[3] +Configured run_name = subj1_5 +Configured current_features = classifier[3] +Configured num_sessions = 5.0 +Configured subj = 1 +PID of this process = 3119139 +loading_betas +betas_ loaded +Number of zeros in valid_nsd_ids_full tensor(0) +Num train examples torch.Size([3410, 15724]) +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Calculating split 1 of 1 +start_feature_index: 0, end_feature_index: 4096 +Starting ridge regression for split 1 with alpha 20000 +Finished, now scoring +train_score: 0.4992993245463038, test_score: 0.15135143369955711 +Successfully processed classifier[3]. +Running RR_sklearn.py with argument: classifier[6] +Configured run_name = subj1_5 +Configured current_features = classifier[6] +Configured num_sessions = 5.0 +Configured subj = 1 +PID of this process = 3120726 +loading_betas +betas_ loaded +Number of zeros in valid_nsd_ids_full tensor(0) +Num train examples torch.Size([3410, 15724]) +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Calculating split 1 of 1 +start_feature_index: 0, end_feature_index: 1000 +Starting ridge regression for split 1 with alpha 20000 +Finished, now scoring +train_score: 0.5595520146784586, test_score: 0.2632966916309557 +Successfully processed classifier[6]. +All features have been processed. diff --git a/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/532251.out b/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/532251.out new file mode 100644 index 0000000000000000000000000000000000000000..03c209ba6e17a35ed5cd3e91c3d5145cb3009807 --- /dev/null +++ b/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/532251.out @@ -0,0 +1,1046 @@ +NUM_GPUS=1 +MASTER_ADDR=ip-10-0-142-24 +MASTER_PORT=17911 +WORLD_SIZE=1 +Running RR_sklearn.py with argument: features[0] +Configured run_name = subj1_10 +Configured current_features = features[0] +Configured num_sessions = 10.0 +Configured subj = 1 +PID of this process = 1732508 +loading_betas +betas_ loaded +Number of zeros in valid_nsd_ids_full tensor(0) +Num train examples torch.Size([6803, 15724]) +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Calculating split 1 of 32 +start_feature_index: 0, end_feature_index: 2 +Starting ridge regression for split 1 with alpha 30000 +Finished, now scoring +train_score: 0.38553534252752264, test_score: 0.1123602450843382 +Calculating split 2 of 32 +start_feature_index: 2, end_feature_index: 4 +Starting ridge regression for split 2 with alpha 30000 +Finished, now scoring +train_score: 0.38621248317184, test_score: 0.10826867619119128 +Calculating split 3 of 32 +start_feature_index: 4, end_feature_index: 6 +Starting ridge regression for split 3 with alpha 30000 +Finished, now scoring +train_score: 0.35373372811373976, test_score: 0.05906942257353002 +Calculating split 4 of 32 +start_feature_index: 6, end_feature_index: 8 +Starting ridge regression for split 4 with alpha 30000 +Finished, now scoring +train_score: 0.3395760036709149, test_score: 0.03833003249047931 +Calculating split 5 of 32 +start_feature_index: 8, end_feature_index: 10 +Starting ridge regression for split 5 with alpha 30000 +Finished, now scoring +train_score: 0.3642920510243032, test_score: 0.0861898461013401 +Calculating split 6 of 32 +start_feature_index: 10, end_feature_index: 12 +Starting ridge regression for split 6 with alpha 30000 +Finished, now scoring +train_score: 0.31170520363124565, test_score: -0.009190355344754639 +Calculating split 7 of 32 +start_feature_index: 12, end_feature_index: 14 +Starting ridge regression for split 7 with alpha 30000 +Finished, now scoring +train_score: 0.36553687564910786, test_score: 0.08802587124294908 +Calculating split 8 of 32 +start_feature_index: 14, end_feature_index: 16 +Starting ridge regression for split 8 with alpha 30000 +Finished, now scoring +train_score: 0.3547295758932227, test_score: 0.061339196062626854 +Calculating split 9 of 32 +start_feature_index: 16, end_feature_index: 18 +Starting ridge regression for split 9 with alpha 30000 +Finished, now scoring +train_score: 0.36336779051663515, test_score: 0.08240634194209283 +Calculating split 10 of 32 +start_feature_index: 18, end_feature_index: 20 +Starting ridge regression for split 10 with alpha 30000 +Finished, now scoring +train_score: 0.36802038022388384, test_score: 0.08139944192647842 +Calculating split 11 of 32 +start_feature_index: 20, end_feature_index: 22 +Starting ridge regression for split 11 with alpha 30000 +Finished, now scoring +train_score: 0.3288170650205939, test_score: 0.021531463670849738 +Calculating split 12 of 32 +start_feature_index: 22, end_feature_index: 24 +Starting ridge regression for split 12 with alpha 30000 +Finished, now scoring +train_score: 0.36629241250545164, test_score: 0.08514256686739975 +Calculating split 13 of 32 +start_feature_index: 24, end_feature_index: 26 +Starting ridge regression for split 13 with alpha 30000 +Finished, now scoring +train_score: 0.4126953908513807, test_score: 0.1610587384948311 +Calculating split 14 of 32 +start_feature_index: 26, end_feature_index: 28 +Starting ridge regression for split 14 with alpha 30000 +Finished, now scoring +train_score: 0.3645405801176361, test_score: 0.08154077242984728 +Calculating split 15 of 32 +start_feature_index: 28, end_feature_index: 30 +Starting ridge regression for split 15 with alpha 30000 +Finished, now scoring +train_score: 0.40474355517627475, test_score: 0.14232271690954307 +Calculating split 16 of 32 +start_feature_index: 30, end_feature_index: 32 +Starting ridge regression for split 16 with alpha 30000 +Finished, now scoring +train_score: 0.3841153226446022, test_score: 0.09896672616152107 +Calculating split 17 of 32 +start_feature_index: 32, end_feature_index: 34 +Starting ridge regression for split 17 with alpha 30000 +Finished, now scoring +train_score: 0.3997869221901475, test_score: 0.13123249282587973 +Calculating split 18 of 32 +start_feature_index: 34, end_feature_index: 36 +Starting ridge regression for split 18 with alpha 30000 +Finished, now scoring +train_score: 0.30803351791946487, test_score: -0.017072567503794198 +Calculating split 19 of 32 +start_feature_index: 36, end_feature_index: 38 +Starting ridge regression for split 19 with alpha 30000 +Finished, now scoring +train_score: 0.350628741557499, test_score: 0.044146803682999225 +Calculating split 20 of 32 +start_feature_index: 38, end_feature_index: 40 +Starting ridge regression for split 20 with alpha 30000 +Finished, now scoring +train_score: 0.3708545290215234, test_score: 0.07415206828700396 +Calculating split 21 of 32 +start_feature_index: 40, end_feature_index: 42 +Starting ridge regression for split 21 with alpha 30000 +Finished, now scoring +train_score: 0.3217455052416617, test_score: 0.012052946832462207 +Calculating split 22 of 32 +start_feature_index: 42, end_feature_index: 44 +Starting ridge regression for split 22 with alpha 30000 +Finished, now scoring +train_score: 0.3086277993280388, test_score: -0.01604966711386884 +Calculating split 23 of 32 +start_feature_index: 44, end_feature_index: 46 +Starting ridge regression for split 23 with alpha 30000 +Finished, now scoring +train_score: 0.3098077390249735, test_score: -0.01349167181559727 +Calculating split 24 of 32 +start_feature_index: 46, end_feature_index: 48 +Starting ridge regression for split 24 with alpha 30000 +Finished, now scoring +train_score: 0.3263335754723431, test_score: 0.016890126565333924 +Calculating split 25 of 32 +start_feature_index: 48, end_feature_index: 50 +Starting ridge regression for split 25 with alpha 30000 +Finished, now scoring +train_score: 0.34871102344429444, test_score: 0.057144597855504534 +Calculating split 26 of 32 +start_feature_index: 50, end_feature_index: 52 +Starting ridge regression for split 26 with alpha 30000 +Finished, now scoring +train_score: 0.346753282591186, test_score: 0.03954779513403772 +Calculating split 27 of 32 +start_feature_index: 52, end_feature_index: 54 +Starting ridge regression for split 27 with alpha 30000 +Finished, now scoring +train_score: 0.4028050689434146, test_score: 0.1412251308133371 +Calculating split 28 of 32 +start_feature_index: 54, end_feature_index: 56 +Starting ridge regression for split 28 with alpha 30000 +Finished, now scoring +train_score: 0.33174517581014223, test_score: 0.02866087351371819 +Calculating split 29 of 32 +start_feature_index: 56, end_feature_index: 58 +Starting ridge regression for split 29 with alpha 30000 +Finished, now scoring +train_score: 0.3156928131922943, test_score: -0.0016871627165130768 +Calculating split 30 of 32 +start_feature_index: 58, end_feature_index: 60 +Starting ridge regression for split 30 with alpha 30000 +Finished, now scoring +train_score: 0.3466904173621998, test_score: 0.03885354753758794 +Calculating split 31 of 32 +start_feature_index: 60, end_feature_index: 62 +Starting ridge regression for split 31 with alpha 30000 +Finished, now scoring +train_score: 0.3827769603807217, test_score: 0.09634722392989994 +Calculating split 32 of 32 +start_feature_index: 62, end_feature_index: 64 +Starting ridge regression for split 32 with alpha 30000 +Finished, now scoring +train_score: 0.31581608988416215, test_score: -0.005697398234672361 +Successfully processed features[0]. +Running RR_sklearn.py with argument: features[2] +Configured run_name = subj1_10 +Configured current_features = features[2] +Configured num_sessions = 10.0 +Configured subj = 1 +PID of this process = 2126272 +loading_betas +betas_ loaded +Number of zeros in valid_nsd_ids_full tensor(0) +Num train examples torch.Size([6803, 15724]) +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Calculating split 1 of 32 +start_feature_index: 0, end_feature_index: 2 +Starting ridge regression for split 1 with alpha 30000 +Finished, now scoring +train_score: 0.3154634467044899, test_score: -0.006210179256735814 +Calculating split 2 of 32 +start_feature_index: 2, end_feature_index: 4 +Starting ridge regression for split 2 with alpha 30000 +Finished, now scoring +train_score: 0.37613805475463646, test_score: 0.10306096818902104 +Calculating split 3 of 32 +start_feature_index: 4, end_feature_index: 6 +Starting ridge regression for split 3 with alpha 30000 +Finished, now scoring +train_score: 0.37855039021169024, test_score: 0.10015155947119804 +Calculating split 4 of 32 +start_feature_index: 6, end_feature_index: 8 +Starting ridge regression for split 4 with alpha 30000 +Finished, now scoring +train_score: 0.3314203513892404, test_score: 0.024848445498729804 +Calculating split 5 of 32 +start_feature_index: 8, end_feature_index: 10 +Starting ridge regression for split 5 with alpha 30000 +Finished, now scoring +train_score: 0.33727193675239514, test_score: 0.02880897463533005 +Calculating split 6 of 32 +start_feature_index: 10, end_feature_index: 12 +Starting ridge regression for split 6 with alpha 30000 +Finished, now scoring +train_score: 0.33622811499935384, test_score: 0.029109486893365278 +Calculating split 7 of 32 +start_feature_index: 12, end_feature_index: 14 +Starting ridge regression for split 7 with alpha 30000 +Finished, now scoring +train_score: 0.3104968212735479, test_score: -0.013969568338818666 +Calculating split 8 of 32 +start_feature_index: 14, end_feature_index: 16 +Starting ridge regression for split 8 with alpha 30000 +Finished, now scoring +train_score: 0.3495006722904462, test_score: 0.06414829262654256 +Calculating split 9 of 32 +start_feature_index: 16, end_feature_index: 18 +Starting ridge regression for split 9 with alpha 30000 +Finished, now scoring +train_score: 0.34269690470514247, test_score: 0.03898998094841839 +Calculating split 10 of 32 +start_feature_index: 18, end_feature_index: 20 +Starting ridge regression for split 10 with alpha 30000 +Finished, now scoring +train_score: 0.34884527054376807, test_score: 0.05719678742729923 +Calculating split 11 of 32 +start_feature_index: 20, end_feature_index: 22 +Starting ridge regression for split 11 with alpha 30000 +Finished, now scoring +train_score: 0.30811383244353013, test_score: -0.01685030210376883 +Calculating split 12 of 32 +start_feature_index: 22, end_feature_index: 24 +Starting ridge regression for split 12 with alpha 30000 +Finished, now scoring +train_score: 0.3832088391109188, test_score: 0.10327279679852246 +Calculating split 13 of 32 +start_feature_index: 24, end_feature_index: 26 +Starting ridge regression for split 13 with alpha 30000 +Finished, now scoring +train_score: 0.40467000463326913, test_score: 0.13956485761294649 +Calculating split 14 of 32 +start_feature_index: 26, end_feature_index: 28 +Starting ridge regression for split 14 with alpha 30000 +Finished, now scoring +train_score: 0.35028256484637393, test_score: 0.05693781741063514 +Calculating split 15 of 32 +start_feature_index: 28, end_feature_index: 30 +Starting ridge regression for split 15 with alpha 30000 +Finished, now scoring +train_score: 0.30917989829735354, test_score: -0.01593359336276376 +Calculating split 16 of 32 +start_feature_index: 30, end_feature_index: 32 +Starting ridge regression for split 16 with alpha 30000 +Finished, now scoring +train_score: 0.35303766698340905, test_score: 0.06150482865998224 +Calculating split 17 of 32 +start_feature_index: 32, end_feature_index: 34 +Starting ridge regression for split 17 with alpha 30000 +Finished, now scoring +train_score: 0.3103693995345406, test_score: -0.01435148857691344 +Calculating split 18 of 32 +start_feature_index: 34, end_feature_index: 36 +Starting ridge regression for split 18 with alpha 30000 +Finished, now scoring +train_score: 0.3137278982750047, test_score: -0.007616662335071763 +Calculating split 19 of 32 +start_feature_index: 36, end_feature_index: 38 +Starting ridge regression for split 19 with alpha 30000 +Finished, now scoring +train_score: 0.32060119823240185, test_score: 0.0019356001892446347 +Calculating split 20 of 32 +start_feature_index: 38, end_feature_index: 40 +Starting ridge regression for split 20 with alpha 30000 +Finished, now scoring +train_score: 0.40353540701488205, test_score: 0.12742089730117023 +Calculating split 21 of 32 +start_feature_index: 40, end_feature_index: 42 +Starting ridge regression for split 21 with alpha 30000 +Finished, now scoring +train_score: 0.31234836438103025, test_score: -0.011342643574621374 +Calculating split 22 of 32 +start_feature_index: 42, end_feature_index: 44 +Starting ridge regression for split 22 with alpha 30000 +Finished, now scoring +train_score: 0.3528923229338017, test_score: 0.04893395500146064 +Calculating split 23 of 32 +start_feature_index: 44, end_feature_index: 46 +Starting ridge regression for split 23 with alpha 30000 +Finished, now scoring +train_score: 0.35258747969595305, test_score: 0.061748200969686313 +Calculating split 24 of 32 +start_feature_index: 46, end_feature_index: 48 +Starting ridge regression for split 24 with alpha 30000 +Finished, now scoring +train_score: 0.31239096809533756, test_score: -0.010260013770390868 +Calculating split 25 of 32 +start_feature_index: 48, end_feature_index: 50 +Starting ridge regression for split 25 with alpha 30000 +Finished, now scoring +train_score: 0.3758941067805386, test_score: 0.1018337392393022 +Calculating split 26 of 32 +start_feature_index: 50, end_feature_index: 52 +Starting ridge regression for split 26 with alpha 30000 +Finished, now scoring +train_score: 0.3259494135632477, test_score: 0.008465281600023432 +Calculating split 27 of 32 +start_feature_index: 52, end_feature_index: 54 +Starting ridge regression for split 27 with alpha 30000 +Finished, now scoring +train_score: 0.3300762107879644, test_score: 0.02352550461047715 +Calculating split 28 of 32 +start_feature_index: 54, end_feature_index: 56 +Starting ridge regression for split 28 with alpha 30000 +Finished, now scoring +train_score: 0.370390900420877, test_score: 0.08091781754640978 +Calculating split 29 of 32 +start_feature_index: 56, end_feature_index: 58 +Starting ridge regression for split 29 with alpha 30000 +Finished, now scoring +train_score: 0.3109429350242693, test_score: -0.011682739745913948 +Calculating split 30 of 32 +start_feature_index: 58, end_feature_index: 60 +Starting ridge regression for split 30 with alpha 30000 +Finished, now scoring +train_score: 0.30987808335911776, test_score: -0.013709155510115388 +Calculating split 31 of 32 +start_feature_index: 60, end_feature_index: 62 +Starting ridge regression for split 31 with alpha 30000 +Finished, now scoring +train_score: 0.3991451869069987, test_score: 0.14841410775297575 +Calculating split 32 of 32 +start_feature_index: 62, end_feature_index: 64 +Starting ridge regression for split 32 with alpha 30000 +Finished, now scoring +train_score: 0.3236839497222669, test_score: 0.007817111747655084 +Successfully processed features[2]. +Running RR_sklearn.py with argument: features[5] +Configured run_name = subj1_10 +Configured current_features = features[5] +Configured num_sessions = 10.0 +Configured subj = 1 +PID of this process = 2351460 +loading_betas +betas_ loaded +Number of zeros in valid_nsd_ids_full tensor(0) +Num train examples torch.Size([6803, 15724]) +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Calculating split 1 of 16 +start_feature_index: 0, end_feature_index: 8 +Starting ridge regression for split 1 with alpha 30000 +Finished, now scoring +train_score: 0.34191237421145626, test_score: 0.03713685227512429 +Calculating split 2 of 16 +start_feature_index: 8, end_feature_index: 16 +Starting ridge regression for split 2 with alpha 30000 +Finished, now scoring +train_score: 0.3248363905708093, test_score: 0.009001154556007286 +Calculating split 3 of 16 +start_feature_index: 16, end_feature_index: 24 +Starting ridge regression for split 3 with alpha 30000 +Finished, now scoring +train_score: 0.32328964036808294, test_score: 0.007346000443818047 +Calculating split 4 of 16 +start_feature_index: 24, end_feature_index: 32 +Starting ridge regression for split 4 with alpha 30000 +Finished, now scoring +train_score: 0.337091619683217, test_score: 0.029075028513052784 +Calculating split 5 of 16 +start_feature_index: 32, end_feature_index: 40 +Starting ridge regression for split 5 with alpha 30000 +Finished, now scoring +train_score: 0.33866440803649667, test_score: 0.03454750139346287 +Calculating split 6 of 16 +start_feature_index: 40, end_feature_index: 48 +Starting ridge regression for split 6 with alpha 30000 +Finished, now scoring +train_score: 0.3472228588072675, test_score: 0.04615624887885766 +Calculating split 7 of 16 +start_feature_index: 48, end_feature_index: 56 +Starting ridge regression for split 7 with alpha 30000 +Finished, now scoring +train_score: 0.36722483634831843, test_score: 0.0784608573075688 +Calculating split 8 of 16 +start_feature_index: 56, end_feature_index: 64 +Starting ridge regression for split 8 with alpha 30000 +Finished, now scoring +train_score: 0.34863975176255907, test_score: 0.0481080426403072 +Calculating split 9 of 16 +start_feature_index: 64, end_feature_index: 72 +Starting ridge regression for split 9 with alpha 30000 +Finished, now scoring +train_score: 0.3414393734621911, test_score: 0.038497302632404924 +Calculating split 10 of 16 +start_feature_index: 72, end_feature_index: 80 +Starting ridge regression for split 10 with alpha 30000 +Finished, now scoring +train_score: 0.3393587265089918, test_score: 0.033244641244223924 +Calculating split 11 of 16 +start_feature_index: 80, end_feature_index: 88 +Starting ridge regression for split 11 with alpha 30000 +Finished, now scoring +train_score: 0.3425584195439046, test_score: 0.04027007376542187 +Calculating split 12 of 16 +start_feature_index: 88, end_feature_index: 96 +Starting ridge regression for split 12 with alpha 30000 +Finished, now scoring +train_score: 0.34606298414134234, test_score: 0.044854792690376996 +Calculating split 13 of 16 +start_feature_index: 96, end_feature_index: 104 +Starting ridge regression for split 13 with alpha 30000 +Finished, now scoring +train_score: 0.3279448577161442, test_score: 0.01448704191000981 +Calculating split 14 of 16 +start_feature_index: 104, end_feature_index: 112 +Starting ridge regression for split 14 with alpha 30000 +Finished, now scoring +train_score: 0.34948950113321425, test_score: 0.05252185793494438 +Calculating split 15 of 16 +start_feature_index: 112, end_feature_index: 120 +Starting ridge regression for split 15 with alpha 30000 +Finished, now scoring +train_score: 0.3522809439094343, test_score: 0.05756896762402758 +Calculating split 16 of 16 +start_feature_index: 120, end_feature_index: 128 +Starting ridge regression for split 16 with alpha 30000 +Finished, now scoring +train_score: 0.3408715659294436, test_score: 0.03780546881520282 +Successfully processed features[5]. +Running RR_sklearn.py with argument: features[7] +Configured run_name = subj1_10 +Configured current_features = features[7] +Configured num_sessions = 10.0 +Configured subj = 1 +PID of this process = 2392148 +loading_betas +betas_ loaded +Number of zeros in valid_nsd_ids_full tensor(0) +Num train examples torch.Size([6803, 15724]) +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Calculating split 1 of 16 +start_feature_index: 0, end_feature_index: 8 +Starting ridge regression for split 1 with alpha 30000 +Finished, now scoring +train_score: 0.31794365906492894, test_score: -0.0015421172886867583 +Calculating split 2 of 16 +start_feature_index: 8, end_feature_index: 16 +Starting ridge regression for split 2 with alpha 30000 +Finished, now scoring +train_score: 0.31480364544772277, test_score: -0.0054636447030314336 +Calculating split 3 of 16 +start_feature_index: 16, end_feature_index: 24 +Starting ridge regression for split 3 with alpha 30000 +Finished, now scoring +train_score: 0.31871613564163526, test_score: 0.0005992446212159551 +Calculating split 4 of 16 +start_feature_index: 24, end_feature_index: 32 +Starting ridge regression for split 4 with alpha 30000 +Finished, now scoring +train_score: 0.3265776107121048, test_score: 0.012466025787485445 +Calculating split 5 of 16 +start_feature_index: 32, end_feature_index: 40 +Starting ridge regression for split 5 with alpha 30000 +Finished, now scoring +train_score: 0.3293540245472018, test_score: 0.017318800018856762 +Calculating split 6 of 16 +start_feature_index: 40, end_feature_index: 48 +Starting ridge regression for split 6 with alpha 30000 +Finished, now scoring +train_score: 0.31721189426088975, test_score: -0.002257202836952099 +Calculating split 7 of 16 +start_feature_index: 48, end_feature_index: 56 +Starting ridge regression for split 7 with alpha 30000 +Finished, now scoring +train_score: 0.3149764993213417, test_score: -0.005515937537068098 +Calculating split 8 of 16 +start_feature_index: 56, end_feature_index: 64 +Starting ridge regression for split 8 with alpha 30000 +Finished, now scoring +train_score: 0.3217393301958924, test_score: 0.0066345748851719035 +Calculating split 9 of 16 +start_feature_index: 64, end_feature_index: 72 +Starting ridge regression for split 9 with alpha 30000 +Finished, now scoring +train_score: 0.33899611121544093, test_score: 0.03129133971760807 +Calculating split 10 of 16 +start_feature_index: 72, end_feature_index: 80 +Starting ridge regression for split 10 with alpha 30000 +Finished, now scoring +train_score: 0.325724509997356, test_score: 0.01127594307840336 +Calculating split 11 of 16 +start_feature_index: 80, end_feature_index: 88 +Starting ridge regression for split 11 with alpha 30000 +Finished, now scoring +train_score: 0.32320618172561255, test_score: 0.00824888498282945 +Calculating split 12 of 16 +start_feature_index: 88, end_feature_index: 96 +Starting ridge regression for split 12 with alpha 30000 +Finished, now scoring +train_score: 0.31947421945913096, test_score: 0.0013143083557439587 +Calculating split 13 of 16 +start_feature_index: 96, end_feature_index: 104 +Starting ridge regression for split 13 with alpha 30000 +Finished, now scoring +train_score: 0.32799229003490005, test_score: 0.01614295747223123 +Calculating split 14 of 16 +start_feature_index: 104, end_feature_index: 112 +Starting ridge regression for split 14 with alpha 30000 +Finished, now scoring +train_score: 0.3282774303842279, test_score: 0.016434768835631094 +Calculating split 15 of 16 +start_feature_index: 112, end_feature_index: 120 +Starting ridge regression for split 15 with alpha 30000 +Finished, now scoring +train_score: 0.3193435634039763, test_score: 0.0018797360700877667 +Calculating split 16 of 16 +start_feature_index: 120, end_feature_index: 128 +Starting ridge regression for split 16 with alpha 30000 +Finished, now scoring +train_score: 0.33065585257350344, test_score: 0.019268962903294787 +Successfully processed features[7]. +Running RR_sklearn.py with argument: features[10] +Configured run_name = subj1_10 +Configured current_features = features[10] +Configured num_sessions = 10.0 +Configured subj = 1 +PID of this process = 2444378 +loading_betas +betas_ loaded +Number of zeros in valid_nsd_ids_full tensor(0) +Num train examples torch.Size([6803, 15724]) +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Calculating split 1 of 8 +start_feature_index: 0, end_feature_index: 32 +Starting ridge regression for split 1 with alpha 30000 +Finished, now scoring +train_score: 0.3405456337815197, test_score: 0.036635259625817596 +Calculating split 2 of 8 +start_feature_index: 32, end_feature_index: 64 +Starting ridge regression for split 2 with alpha 30000 +Finished, now scoring +train_score: 0.33492951199797405, test_score: 0.027024428944867368 +Calculating split 3 of 8 +start_feature_index: 64, end_feature_index: 96 +Starting ridge regression for split 3 with alpha 30000 +Finished, now scoring +train_score: 0.3443340817574262, test_score: 0.04141515458152369 +Calculating split 4 of 8 +start_feature_index: 96, end_feature_index: 128 +Starting ridge regression for split 4 with alpha 30000 +Finished, now scoring +train_score: 0.346912435401218, test_score: 0.04700942424621859 +Calculating split 5 of 8 +start_feature_index: 128, end_feature_index: 160 +Starting ridge regression for split 5 with alpha 30000 +Finished, now scoring +train_score: 0.3409356397581621, test_score: 0.036964053143220876 +Calculating split 6 of 8 +start_feature_index: 160, end_feature_index: 192 +Starting ridge regression for split 6 with alpha 30000 +Finished, now scoring +train_score: 0.3448027576543074, test_score: 0.04192154818966956 +Calculating split 7 of 8 +start_feature_index: 192, end_feature_index: 224 +Starting ridge regression for split 7 with alpha 30000 +Finished, now scoring +train_score: 0.3434005784899519, test_score: 0.04089813267617008 +Calculating split 8 of 8 +start_feature_index: 224, end_feature_index: 256 +Starting ridge regression for split 8 with alpha 30000 +Finished, now scoring +train_score: 0.3454428586938752, test_score: 0.04207245611689743 +Successfully processed features[10]. +Running RR_sklearn.py with argument: features[12] +Configured run_name = subj1_10 +Configured current_features = features[12] +Configured num_sessions = 10.0 +Configured subj = 1 +PID of this process = 2469273 +loading_betas +betas_ loaded +Number of zeros in valid_nsd_ids_full tensor(0) +Num train examples torch.Size([6803, 15724]) +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Calculating split 1 of 8 +start_feature_index: 0, end_feature_index: 32 +Starting ridge regression for split 1 with alpha 30000 +Finished, now scoring +train_score: 0.3482071207358968, test_score: 0.04986584215603282 +Calculating split 2 of 8 +start_feature_index: 32, end_feature_index: 64 +Starting ridge regression for split 2 with alpha 30000 +Finished, now scoring +train_score: 0.35377937879372523, test_score: 0.05810863071369893 +Calculating split 3 of 8 +start_feature_index: 64, end_feature_index: 96 +Starting ridge regression for split 3 with alpha 30000 +Finished, now scoring +train_score: 0.34637621277327385, test_score: 0.047305928552375524 +Calculating split 4 of 8 +start_feature_index: 96, end_feature_index: 128 +Starting ridge regression for split 4 with alpha 30000 +Finished, now scoring +train_score: 0.3472396317185809, test_score: 0.04634166259446765 +Calculating split 5 of 8 +start_feature_index: 128, end_feature_index: 160 +Starting ridge regression for split 5 with alpha 30000 +Finished, now scoring +train_score: 0.34601265954320465, test_score: 0.04545946674937316 +Calculating split 6 of 8 +start_feature_index: 160, end_feature_index: 192 +Starting ridge regression for split 6 with alpha 30000 +Finished, now scoring +train_score: 0.3504603922605951, test_score: 0.05403538262367265 +Calculating split 7 of 8 +start_feature_index: 192, end_feature_index: 224 +Starting ridge regression for split 7 with alpha 30000 +Finished, now scoring +train_score: 0.34839156827771306, test_score: 0.04930296166937083 +Calculating split 8 of 8 +start_feature_index: 224, end_feature_index: 256 +Starting ridge regression for split 8 with alpha 30000 +Finished, now scoring +train_score: 0.3453695285382311, test_score: 0.04497449377016215 +Successfully processed features[12]. +Running RR_sklearn.py with argument: features[14] +Configured run_name = subj1_10 +Configured current_features = features[14] +Configured num_sessions = 10.0 +Configured subj = 1 +PID of this process = 2494202 +loading_betas +betas_ loaded +Number of zeros in valid_nsd_ids_full tensor(0) +Num train examples torch.Size([6803, 15724]) +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Calculating split 1 of 8 +start_feature_index: 0, end_feature_index: 32 +Starting ridge regression for split 1 with alpha 30000 +Finished, now scoring +train_score: 0.36441901569660334, test_score: 0.07646125879702399 +Calculating split 2 of 8 +start_feature_index: 32, end_feature_index: 64 +Starting ridge regression for split 2 with alpha 30000 +Finished, now scoring +train_score: 0.3666663708603363, test_score: 0.08001447800722035 +Calculating split 3 of 8 +start_feature_index: 64, end_feature_index: 96 +Starting ridge regression for split 3 with alpha 30000 +Finished, now scoring +train_score: 0.37067779593731387, test_score: 0.08774455374580903 +Calculating split 4 of 8 +start_feature_index: 96, end_feature_index: 128 +Starting ridge regression for split 4 with alpha 30000 +Finished, now scoring +train_score: 0.3662356561965552, test_score: 0.07925030249755832 +Calculating split 5 of 8 +start_feature_index: 128, end_feature_index: 160 +Starting ridge regression for split 5 with alpha 30000 +Finished, now scoring +train_score: 0.37278380304164616, test_score: 0.09203413347722277 +Calculating split 6 of 8 +start_feature_index: 160, end_feature_index: 192 +Starting ridge regression for split 6 with alpha 30000 +Finished, now scoring +train_score: 0.3604173035773594, test_score: 0.07070096791092302 +Calculating split 7 of 8 +start_feature_index: 192, end_feature_index: 224 +Starting ridge regression for split 7 with alpha 30000 +Finished, now scoring +train_score: 0.37387719780792666, test_score: 0.09403033243597889 +Calculating split 8 of 8 +start_feature_index: 224, end_feature_index: 256 +Starting ridge regression for split 8 with alpha 30000 +Finished, now scoring +train_score: 0.3700458106337353, test_score: 0.08350783650550403 +Successfully processed features[14]. +Running RR_sklearn.py with argument: features[16] +Configured run_name = subj1_10 +Configured current_features = features[16] +Configured num_sessions = 10.0 +Configured subj = 1 +PID of this process = 2521983 +loading_betas +betas_ loaded +Number of zeros in valid_nsd_ids_full tensor(0) +Num train examples torch.Size([6803, 15724]) +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Calculating split 1 of 8 +start_feature_index: 0, end_feature_index: 32 +Starting ridge regression for split 1 with alpha 25000 +Finished, now scoring +train_score: 0.3926778488925601, test_score: 0.0689009320591708 +Calculating split 2 of 8 +start_feature_index: 32, end_feature_index: 64 +Starting ridge regression for split 2 with alpha 25000 +Finished, now scoring +train_score: 0.39694405235084396, test_score: 0.07660762674856522 +Calculating split 3 of 8 +start_feature_index: 64, end_feature_index: 96 +Starting ridge regression for split 3 with alpha 25000 +Finished, now scoring +train_score: 0.3882089180408372, test_score: 0.06082564600190696 +Calculating split 4 of 8 +start_feature_index: 96, end_feature_index: 128 +Starting ridge regression for split 4 with alpha 25000 +Finished, now scoring +train_score: 0.39719631220769314, test_score: 0.08112030456333667 +Calculating split 5 of 8 +start_feature_index: 128, end_feature_index: 160 +Starting ridge regression for split 5 with alpha 25000 +Finished, now scoring +train_score: 0.3925857175696674, test_score: 0.06854382443690066 +Calculating split 6 of 8 +start_feature_index: 160, end_feature_index: 192 +Starting ridge regression for split 6 with alpha 25000 +Finished, now scoring +train_score: 0.38892256386695834, test_score: 0.06381571819085996 +Calculating split 7 of 8 +start_feature_index: 192, end_feature_index: 224 +Starting ridge regression for split 7 with alpha 25000 +Finished, now scoring +train_score: 0.3959366271000754, test_score: 0.07704936390440087 +Calculating split 8 of 8 +start_feature_index: 224, end_feature_index: 256 +Starting ridge regression for split 8 with alpha 25000 +Finished, now scoring +train_score: 0.38639345021911753, test_score: 0.059059740234861414 +Successfully processed features[16]. +Running RR_sklearn.py with argument: features[19] +Configured run_name = subj1_10 +Configured current_features = features[19] +Configured num_sessions = 10.0 +Configured subj = 1 +PID of this process = 2547115 +loading_betas +betas_ loaded +Number of zeros in valid_nsd_ids_full tensor(0) +Num train examples torch.Size([6803, 15724]) +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Calculating split 1 of 4 +start_feature_index: 0, end_feature_index: 128 +Starting ridge regression for split 1 with alpha 25000 +Finished, now scoring +train_score: 0.42000233581502544, test_score: 0.11536665977312624 +Calculating split 2 of 4 +start_feature_index: 128, end_feature_index: 256 +Starting ridge regression for split 2 with alpha 25000 +Finished, now scoring +train_score: 0.42145479706596334, test_score: 0.1176084142353973 +Calculating split 3 of 4 +start_feature_index: 256, end_feature_index: 384 +Starting ridge regression for split 3 with alpha 25000 +Finished, now scoring +train_score: 0.4243677583688062, test_score: 0.12339783752191852 +Calculating split 4 of 4 +start_feature_index: 384, end_feature_index: 512 +Starting ridge regression for split 4 with alpha 25000 +Finished, now scoring +train_score: 0.4182525992539979, test_score: 0.11299770274773314 +Successfully processed features[19]. +Running RR_sklearn.py with argument: features[21] +Configured run_name = subj1_10 +Configured current_features = features[21] +Configured num_sessions = 10.0 +Configured subj = 1 +PID of this process = 2557738 +loading_betas +betas_ loaded +Number of zeros in valid_nsd_ids_full tensor(0) +Num train examples torch.Size([6803, 15724]) +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Calculating split 1 of 4 +start_feature_index: 0, end_feature_index: 128 +Starting ridge regression for split 1 with alpha 25000 +Finished, now scoring +train_score: 0.4202979271214102, test_score: 0.11627876996831846 +Calculating split 2 of 4 +start_feature_index: 128, end_feature_index: 256 +Starting ridge regression for split 2 with alpha 25000 +Finished, now scoring +train_score: 0.41280405554636773, test_score: 0.10282240291292122 +Calculating split 3 of 4 +start_feature_index: 256, end_feature_index: 384 +Starting ridge regression for split 3 with alpha 25000 +Finished, now scoring +train_score: 0.41696496567248054, test_score: 0.1100559194502494 +Calculating split 4 of 4 +start_feature_index: 384, end_feature_index: 512 +Starting ridge regression for split 4 with alpha 25000 +Finished, now scoring +train_score: 0.40973266428585076, test_score: 0.09879425398674405 +Successfully processed features[21]. +Running RR_sklearn.py with argument: features[23] +Configured run_name = subj1_10 +Configured current_features = features[23] +Configured num_sessions = 10.0 +Configured subj = 1 +PID of this process = 2568877 +loading_betas +betas_ loaded +Number of zeros in valid_nsd_ids_full tensor(0) +Num train examples torch.Size([6803, 15724]) +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Calculating split 1 of 4 +start_feature_index: 0, end_feature_index: 128 +Starting ridge regression for split 1 with alpha 25000 +Finished, now scoring +train_score: 0.3953040405494548, test_score: 0.074849841177002 +Calculating split 2 of 4 +start_feature_index: 128, end_feature_index: 256 +Starting ridge regression for split 2 with alpha 25000 +Finished, now scoring +train_score: 0.40266179039641325, test_score: 0.0872759034120092 +Calculating split 3 of 4 +start_feature_index: 256, end_feature_index: 384 +Starting ridge regression for split 3 with alpha 25000 +Finished, now scoring +train_score: 0.397447660636291, test_score: 0.07773101296726624 +Calculating split 4 of 4 +start_feature_index: 384, end_feature_index: 512 +Starting ridge regression for split 4 with alpha 25000 +Finished, now scoring +train_score: 0.4067538372688126, test_score: 0.09341953572434775 +Successfully processed features[23]. +Running RR_sklearn.py with argument: features[25] +Configured run_name = subj1_10 +Configured current_features = features[25] +Configured num_sessions = 10.0 +Configured subj = 1 +PID of this process = 2579737 +loading_betas +betas_ loaded +Number of zeros in valid_nsd_ids_full tensor(0) +Num train examples torch.Size([6803, 15724]) +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Calculating split 1 of 4 +start_feature_index: 0, end_feature_index: 128 +Starting ridge regression for split 1 with alpha 25000 +Finished, now scoring +train_score: 0.40284742454538763, test_score: 0.08830853132264742 +Calculating split 2 of 4 +start_feature_index: 128, end_feature_index: 256 +Starting ridge regression for split 2 with alpha 25000 +Finished, now scoring +train_score: 0.39988550190882227, test_score: 0.08420163537075707 +Calculating split 3 of 4 +start_feature_index: 256, end_feature_index: 384 +Starting ridge regression for split 3 with alpha 25000 +Finished, now scoring +train_score: 0.40001739006634124, test_score: 0.08402840123944645 +Calculating split 4 of 4 +start_feature_index: 384, end_feature_index: 512 +Starting ridge regression for split 4 with alpha 25000 +Finished, now scoring +train_score: 0.4028720499203454, test_score: 0.08883715386992519 +Successfully processed features[25]. +Running RR_sklearn.py with argument: features[28] +Configured run_name = subj1_10 +Configured current_features = features[28] +Configured num_sessions = 10.0 +Configured subj = 1 +PID of this process = 2590196 +loading_betas +betas_ loaded +Number of zeros in valid_nsd_ids_full tensor(0) +Num train examples torch.Size([6803, 15724]) +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Calculating split 1 of 2 +start_feature_index: 0, end_feature_index: 256 +Starting ridge regression for split 1 with alpha 25000 +Finished, now scoring +train_score: 0.43252109486718376, test_score: 0.13901131123733773 +Calculating split 2 of 2 +start_feature_index: 256, end_feature_index: 512 +Starting ridge regression for split 2 with alpha 25000 +Finished, now scoring +train_score: 0.4288516184466903, test_score: 0.13260886898531785 +Successfully processed features[28]. +Running RR_sklearn.py with argument: features[30] +Configured run_name = subj1_10 +Configured current_features = features[30] +Configured num_sessions = 10.0 +Configured subj = 1 +PID of this process = 2595018 +loading_betas +betas_ loaded +Number of zeros in valid_nsd_ids_full tensor(0) +Num train examples torch.Size([6803, 15724]) +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Calculating split 1 of 2 +start_feature_index: 0, end_feature_index: 256 +Starting ridge regression for split 1 with alpha 25000 +Finished, now scoring +train_score: 0.4323193850201987, test_score: 0.13792697842778706 +Calculating split 2 of 2 +start_feature_index: 256, end_feature_index: 512 +Starting ridge regression for split 2 with alpha 25000 +Finished, now scoring +train_score: 0.43174109583375275, test_score: 0.13748324132009299 +Successfully processed features[30]. +Running RR_sklearn.py with argument: features[32] +Configured run_name = subj1_10 +Configured current_features = features[32] +Configured num_sessions = 10.0 +Configured subj = 1 +PID of this process = 2599766 +loading_betas +betas_ loaded +Number of zeros in valid_nsd_ids_full tensor(0) +Num train examples torch.Size([6803, 15724]) +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Calculating split 1 of 2 +start_feature_index: 0, end_feature_index: 256 +Starting ridge regression for split 1 with alpha 25000 +Finished, now scoring +train_score: 0.43082053416360827, test_score: 0.13517594082104556 +Calculating split 2 of 2 +start_feature_index: 256, end_feature_index: 512 +Starting ridge regression for split 2 with alpha 25000 +Finished, now scoring +train_score: 0.43436519684581065, test_score: 0.14076296283624276 +Successfully processed features[32]. +Running RR_sklearn.py with argument: features[34] +Configured run_name = subj1_10 +Configured current_features = features[34] +Configured num_sessions = 10.0 +Configured subj = 1 +PID of this process = 2603989 +loading_betas +betas_ loaded +Number of zeros in valid_nsd_ids_full tensor(0) +Num train examples torch.Size([6803, 15724]) +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Calculating split 1 of 2 +start_feature_index: 0, end_feature_index: 256 +Starting ridge regression for split 1 with alpha 25000 +Finished, now scoring +train_score: 0.44627043158985374, test_score: 0.1600600849691143 +Calculating split 2 of 2 +start_feature_index: 256, end_feature_index: 512 +Starting ridge regression for split 2 with alpha 25000 +Finished, now scoring +train_score: 0.44471729777374835, test_score: 0.15761671574899058 +Successfully processed features[34]. +Running RR_sklearn.py with argument: classifier[0] +Configured run_name = subj1_10 +Configured current_features = classifier[0] +Configured num_sessions = 10.0 +Configured subj = 1 +PID of this process = 2614142 +loading_betas +betas_ loaded +Number of zeros in valid_nsd_ids_full tensor(0) +Num train examples torch.Size([6803, 15724]) +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Calculating split 1 of 1 +start_feature_index: 0, end_feature_index: 4096 +Starting ridge regression for split 1 with alpha 20000 +Finished, now scoring +train_score: 0.5248251177002107, test_score: 0.2229314520890191 +Successfully processed classifier[0]. +Running RR_sklearn.py with argument: classifier[3] +Configured run_name = subj1_10 +Configured current_features = classifier[3] +Configured num_sessions = 10.0 +Configured subj = 1 +PID of this process = 2616941 +loading_betas +betas_ loaded +Number of zeros in valid_nsd_ids_full tensor(0) +Num train examples torch.Size([6803, 15724]) +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Calculating split 1 of 1 +start_feature_index: 0, end_feature_index: 4096 +Starting ridge regression for split 1 with alpha 20000 +Finished, now scoring +train_score: 0.49794425339650134, test_score: 0.17780215635137198 +Successfully processed classifier[3]. +Running RR_sklearn.py with argument: classifier[6] +Configured run_name = subj1_10 +Configured current_features = classifier[6] +Configured num_sessions = 10.0 +Configured subj = 1 +PID of this process = 2618883 +loading_betas +betas_ loaded +Number of zeros in valid_nsd_ids_full tensor(0) +Num train examples torch.Size([6803, 15724]) +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Calculating split 1 of 1 +start_feature_index: 0, end_feature_index: 1000 +Starting ridge regression for split 1 with alpha 20000 +Finished, now scoring +train_score: 0.5621941683281524, test_score: 0.29625753255527093 +Successfully processed classifier[6]. +All features have been processed. diff --git a/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/532252.err b/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/532252.err new file mode 100644 index 0000000000000000000000000000000000000000..cea7db65e2f0dd157c31e75c872d68313fb573a2 --- /dev/null +++ b/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/532252.err @@ -0,0 +1,14706 @@ +[NbConvertApp] Converting notebook RR_sklearn.ipynb to python +[NbConvertApp] Writing 24512 bytes to RR_sklearn.py +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/32 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/32 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/16 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/16 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/8 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/8 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/8 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/8 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/4 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/4 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/4 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/4 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/2 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/2 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/2 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/2 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/1 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/1 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable +/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/domain/core.py:90: RuntimeWarning: FixedResolutionDomain is an irreversible domain. It does not guarantee the reversibility of `send` and `receive` methods. Please use the combination of `send` and `receive` methods with caution. + warnings.warn( + 0%| | 0/1 [00:00 +Traceback (most recent call last): + File "/admin/home-ckadirt/mindeye/lib/python3.11/site-packages/bdpy/dl/torch/torch.py", line 108, in __del__ +TypeError: 'NoneType' object is not callable diff --git a/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/532392.out b/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/532392.out new file mode 100644 index 0000000000000000000000000000000000000000..95ec6af2894118bf82671bddddcee645343a151d --- /dev/null +++ b/spurious_reconstruction/analysis/1_case_study/feature-decoding/slurms/532392.out @@ -0,0 +1,1046 @@ +NUM_GPUS=1 +MASTER_ADDR=ip-10-0-142-24 +MASTER_PORT=11552 +WORLD_SIZE=1 +Running RR_sklearn.py with argument: features[0] +Configured run_name = subj1_3 +Configured current_features = features[0] +Configured num_sessions = 3.0 +Configured subj = 1 +PID of this process = 3486358 +loading_betas +betas_ loaded +Number of zeros in valid_nsd_ids_full tensor(0) +Num train examples torch.Size([2049, 15724]) +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Calculating split 1 of 32 +start_feature_index: 0, end_feature_index: 2 +Starting ridge regression for split 1 with alpha 30000 +Finished, now scoring +train_score: 0.39667401562420623, test_score: 0.08397637923465731 +Calculating split 2 of 32 +start_feature_index: 2, end_feature_index: 4 +Starting ridge regression for split 2 with alpha 30000 +Finished, now scoring +train_score: 0.3938251793252555, test_score: 0.07616090279534943 +Calculating split 3 of 32 +start_feature_index: 4, end_feature_index: 6 +Starting ridge regression for split 3 with alpha 30000 +Finished, now scoring +train_score: 0.3736857446154118, test_score: 0.03774753437198343 +Calculating split 4 of 32 +start_feature_index: 6, end_feature_index: 8 +Starting ridge regression for split 4 with alpha 30000 +Finished, now scoring +train_score: 0.3616683139623189, test_score: 0.025294295952967172 +Calculating split 5 of 32 +start_feature_index: 8, end_feature_index: 10 +Starting ridge regression for split 5 with alpha 30000 +Finished, now scoring +train_score: 0.38219982944742253, test_score: 0.059006731093535214 +Calculating split 6 of 32 +start_feature_index: 10, end_feature_index: 12 +Starting ridge regression for split 6 with alpha 30000 +Finished, now scoring +train_score: 0.34038476040546845, test_score: -0.011753514730380344 +Calculating split 7 of 32 +start_feature_index: 12, end_feature_index: 14 +Starting ridge regression for split 7 with alpha 30000 +Finished, now scoring +train_score: 0.38416662167500654, test_score: 0.062254034208436435 +Calculating split 8 of 32 +start_feature_index: 14, end_feature_index: 16 +Starting ridge regression for split 8 with alpha 30000 +Finished, now scoring +train_score: 0.3707806570889899, test_score: 0.03732128625791838 +Calculating split 9 of 32 +start_feature_index: 16, end_feature_index: 18 +Starting ridge regression for split 9 with alpha 30000 +Finished, now scoring +train_score: 0.38423335049282775, test_score: 0.06130603020721521 +Calculating split 10 of 32 +start_feature_index: 18, end_feature_index: 20 +Starting ridge regression for split 10 with alpha 30000 +Finished, now scoring +train_score: 0.38151891836468155, test_score: 0.04909398133458754 +Calculating split 11 of 32 +start_feature_index: 20, end_feature_index: 22 +Starting ridge regression for split 11 with alpha 30000 +Finished, now scoring +train_score: 0.35485129564547463, test_score: 0.012360373487861233 +Calculating split 12 of 32 +start_feature_index: 22, end_feature_index: 24 +Starting ridge regression for split 12 with alpha 30000 +Finished, now scoring +train_score: 0.38641347341188914, test_score: 0.06342019753814217 +Calculating split 13 of 32 +start_feature_index: 24, end_feature_index: 26 +Starting ridge regression for split 13 with alpha 30000 +Finished, now scoring +train_score: 0.4187972290969978, test_score: 0.12269069883267872 +Calculating split 14 of 32 +start_feature_index: 26, end_feature_index: 28 +Starting ridge regression for split 14 with alpha 30000 +Finished, now scoring +train_score: 0.3813024313700791, test_score: 0.058915953684110324 +Calculating split 15 of 32 +start_feature_index: 28, end_feature_index: 30 +Starting ridge regression for split 15 with alpha 30000 +Finished, now scoring +train_score: 0.4099399057885426, test_score: 0.10562600191564916 +Calculating split 16 of 32 +start_feature_index: 30, end_feature_index: 32 +Starting ridge regression for split 16 with alpha 30000 +Finished, now scoring +train_score: 0.3909195420036664, test_score: 0.0654157424123637 +Calculating split 17 of 32 +start_feature_index: 32, end_feature_index: 34 +Starting ridge regression for split 17 with alpha 30000 +Finished, now scoring +train_score: 0.4039704471667512, test_score: 0.09282588610085771 +Calculating split 18 of 32 +start_feature_index: 34, end_feature_index: 36 +Starting ridge regression for split 18 with alpha 30000 +Finished, now scoring +train_score: 0.3374575409698548, test_score: -0.017416929149140673 +Calculating split 19 of 32 +start_feature_index: 36, end_feature_index: 38 +Starting ridge regression for split 19 with alpha 30000 +Finished, now scoring +train_score: 0.36951565961265875, test_score: 0.024675319626898267 +Calculating split 20 of 32 +start_feature_index: 38, end_feature_index: 40 +Starting ridge regression for split 20 with alpha 30000 +Finished, now scoring +train_score: 0.38304132295220555, test_score: 0.04568657824361852 +Calculating split 21 of 32 +start_feature_index: 40, end_feature_index: 42 +Starting ridge regression for split 21 with alpha 30000 +Finished, now scoring +train_score: 0.3470286988409469, test_score: 0.002634221222452654 +Calculating split 22 of 32 +start_feature_index: 42, end_feature_index: 44 +Starting ridge regression for split 22 with alpha 30000 +Finished, now scoring +train_score: 0.33784988495481494, test_score: -0.016745329563012407 +Calculating split 23 of 32 +start_feature_index: 44, end_feature_index: 46 +Starting ridge regression for split 23 with alpha 30000 +Finished, now scoring +train_score: 0.338868499789565, test_score: -0.014605425851987637 +Calculating split 24 of 32 +start_feature_index: 46, end_feature_index: 48 +Starting ridge regression for split 24 with alpha 30000 +Finished, now scoring +train_score: 0.3525163175073622, test_score: 0.009695736672919996 +Calculating split 25 of 32 +start_feature_index: 48, end_feature_index: 50 +Starting ridge regression for split 25 with alpha 30000 +Finished, now scoring +train_score: 0.37057927013514314, test_score: 0.041444042020687404 +Calculating split 26 of 32 +start_feature_index: 50, end_feature_index: 52 +Starting ridge regression for split 26 with alpha 30000 +Finished, now scoring +train_score: 0.36654475575875767, test_score: 0.02207310883653536 +Calculating split 27 of 32 +start_feature_index: 52, end_feature_index: 54 +Starting ridge regression for split 27 with alpha 30000 +Finished, now scoring +train_score: 0.4082587079130417, test_score: 0.10453391418455046 +Calculating split 28 of 32 +start_feature_index: 54, end_feature_index: 56 +Starting ridge regression for split 28 with alpha 30000 +Finished, now scoring +train_score: 0.35807194315476004, test_score: 0.018819654384696245 +Calculating split 29 of 32 +start_feature_index: 56, end_feature_index: 58 +Starting ridge regression for split 29 with alpha 30000 +Finished, now scoring +train_score: 0.34336434718916115, test_score: -0.006959115956445012 +Calculating split 30 of 32 +start_feature_index: 58, end_feature_index: 60 +Starting ridge regression for split 30 with alpha 30000 +Finished, now scoring +train_score: 0.3674043433629027, test_score: 0.020761829371684637 +Calculating split 31 of 32 +start_feature_index: 60, end_feature_index: 62 +Starting ridge regression for split 31 with alpha 30000 +Finished, now scoring +train_score: 0.38973559707530414, test_score: 0.06358694408767135 +Calculating split 32 of 32 +start_feature_index: 62, end_feature_index: 64 +Starting ridge regression for split 32 with alpha 30000 +Finished, now scoring +train_score: 0.34280146352993635, test_score: -0.009572364164586346 +Successfully processed features[0]. +Running RR_sklearn.py with argument: features[2] +Configured run_name = subj1_3 +Configured current_features = features[2] +Configured num_sessions = 3.0 +Configured subj = 1 +PID of this process = 3528806 +loading_betas +betas_ loaded +Number of zeros in valid_nsd_ids_full tensor(0) +Num train examples torch.Size([2049, 15724]) +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Calculating split 1 of 32 +start_feature_index: 0, end_feature_index: 2 +Starting ridge regression for split 1 with alpha 30000 +Finished, now scoring +train_score: 0.34268771949111276, test_score: -0.010188951118771982 +Calculating split 2 of 32 +start_feature_index: 2, end_feature_index: 4 +Starting ridge regression for split 2 with alpha 30000 +Finished, now scoring +train_score: 0.39212128191197165, test_score: 0.0689566282043216 +Calculating split 3 of 32 +start_feature_index: 4, end_feature_index: 6 +Starting ridge regression for split 3 with alpha 30000 +Finished, now scoring +train_score: 0.392197019481039, test_score: 0.07281313145726429 +Calculating split 4 of 32 +start_feature_index: 6, end_feature_index: 8 +Starting ridge regression for split 4 with alpha 30000 +Finished, now scoring +train_score: 0.35667937977949654, test_score: 0.01142769438828995 +Calculating split 5 of 32 +start_feature_index: 8, end_feature_index: 10 +Starting ridge regression for split 5 with alpha 30000 +Finished, now scoring +train_score: 0.3582389577558132, test_score: 0.014458701340479064 +Calculating split 6 of 32 +start_feature_index: 10, end_feature_index: 12 +Starting ridge regression for split 6 with alpha 30000 +Finished, now scoring +train_score: 0.36060273620686667, test_score: 0.01738773475019756 +Calculating split 7 of 32 +start_feature_index: 12, end_feature_index: 14 +Starting ridge regression for split 7 with alpha 30000 +Finished, now scoring +train_score: 0.33925209618086094, test_score: -0.015243900471369986 +Calculating split 8 of 32 +start_feature_index: 14, end_feature_index: 16 +Starting ridge regression for split 8 with alpha 30000 +Finished, now scoring +train_score: 0.3710793135905819, test_score: 0.04284389717304712 +Calculating split 9 of 32 +start_feature_index: 16, end_feature_index: 18 +Starting ridge regression for split 9 with alpha 30000 +Finished, now scoring +train_score: 0.3639439683541913, test_score: 0.02524585876976103 +Calculating split 10 of 32 +start_feature_index: 18, end_feature_index: 20 +Starting ridge regression for split 10 with alpha 30000 +Finished, now scoring +train_score: 0.369735832499446, test_score: 0.04170633500854152 +Calculating split 11 of 32 +start_feature_index: 20, end_feature_index: 22 +Starting ridge regression for split 11 with alpha 30000 +Finished, now scoring +train_score: 0.3375531463325104, test_score: -0.016957532817681753 +Calculating split 12 of 32 +start_feature_index: 22, end_feature_index: 24 +Starting ridge regression for split 12 with alpha 30000 +Finished, now scoring +train_score: 0.39226301960070764, test_score: 0.06956222396750368 +Calculating split 13 of 32 +start_feature_index: 24, end_feature_index: 26 +Starting ridge regression for split 13 with alpha 30000 +Finished, now scoring +train_score: 0.4153156209981494, test_score: 0.10330437424447993 +Calculating split 14 of 32 +start_feature_index: 26, end_feature_index: 28 +Starting ridge regression for split 14 with alpha 30000 +Finished, now scoring +train_score: 0.3745165417777699, test_score: 0.042291565583246274 +Calculating split 15 of 32 +start_feature_index: 28, end_feature_index: 30 +Starting ridge regression for split 15 with alpha 30000 +Finished, now scoring +train_score: 0.33828076551509156, test_score: -0.016242343982445614 +Calculating split 16 of 32 +start_feature_index: 30, end_feature_index: 32 +Starting ridge regression for split 16 with alpha 30000 +Finished, now scoring +train_score: 0.3748375259187342, test_score: 0.045563969004028294 +Calculating split 17 of 32 +start_feature_index: 32, end_feature_index: 34 +Starting ridge regression for split 17 with alpha 30000 +Finished, now scoring +train_score: 0.3390032774978152, test_score: -0.015683911638212148 +Calculating split 18 of 32 +start_feature_index: 34, end_feature_index: 36 +Starting ridge regression for split 18 with alpha 30000 +Finished, now scoring +train_score: 0.3414047460363942, test_score: -0.010305086408810369 +Calculating split 19 of 32 +start_feature_index: 36, end_feature_index: 38 +Starting ridge regression for split 19 with alpha 30000 +Finished, now scoring +train_score: 0.34594594728626193, test_score: -0.0037658189268860087 +Calculating split 20 of 32 +start_feature_index: 38, end_feature_index: 40 +Starting ridge regression for split 20 with alpha 30000 +Finished, now scoring +train_score: 0.4000237237979711, test_score: 0.07846326251117722 +Calculating split 21 of 32 +start_feature_index: 40, end_feature_index: 42 +Starting ridge regression for split 21 with alpha 30000 +Finished, now scoring +train_score: 0.34062543124753175, test_score: -0.013287114114558695 +Calculating split 22 of 32 +start_feature_index: 42, end_feature_index: 44 +Starting ridge regression for split 22 with alpha 30000 +Finished, now scoring +train_score: 0.36874261361217336, test_score: 0.024900680592975316 +Calculating split 23 of 32 +start_feature_index: 44, end_feature_index: 46 +Starting ridge regression for split 23 with alpha 30000 +Finished, now scoring +train_score: 0.3762189074989283, test_score: 0.04783585948826636 +Calculating split 24 of 32 +start_feature_index: 46, end_feature_index: 48 +Starting ridge regression for split 24 with alpha 30000 +Finished, now scoring +train_score: 0.3408778410547861, test_score: -0.012153286022696025 +Calculating split 25 of 32 +start_feature_index: 48, end_feature_index: 50 +Starting ridge regression for split 25 with alpha 30000 +Finished, now scoring +train_score: 0.3902994884084831, test_score: 0.07572792327595608 +Calculating split 26 of 32 +start_feature_index: 50, end_feature_index: 52 +Starting ridge regression for split 26 with alpha 30000 +Finished, now scoring +train_score: 0.348184743378173, test_score: -0.002264339444079835 +Calculating split 27 of 32 +start_feature_index: 52, end_feature_index: 54 +Starting ridge regression for split 27 with alpha 30000 +Finished, now scoring +train_score: 0.3523826476379873, test_score: 0.00883844637584481 +Calculating split 28 of 32 +start_feature_index: 54, end_feature_index: 56 +Starting ridge regression for split 28 with alpha 30000 +Finished, now scoring +train_score: 0.3845283304604168, test_score: 0.05598815921019684 +Calculating split 29 of 32 +start_feature_index: 56, end_feature_index: 58 +Starting ridge regression for split 29 with alpha 30000 +Finished, now scoring +train_score: 0.3393067152252041, test_score: -0.013458024134681014 +Calculating split 30 of 32 +start_feature_index: 58, end_feature_index: 60 +Starting ridge regression for split 30 with alpha 30000 +Finished, now scoring +train_score: 0.3383129214398911, test_score: -0.015194714188968282 +Calculating split 31 of 32 +start_feature_index: 60, end_feature_index: 62 +Starting ridge regression for split 31 with alpha 30000 +Finished, now scoring +train_score: 0.4094390106998124, test_score: 0.1131519181588756 +Calculating split 32 of 32 +start_feature_index: 62, end_feature_index: 64 +Starting ridge regression for split 32 with alpha 30000 +Finished, now scoring +train_score: 0.34893068940183175, test_score: 0.0017187205112026037 +Successfully processed features[2]. +Running RR_sklearn.py with argument: features[5] +Configured run_name = subj1_3 +Configured current_features = features[5] +Configured num_sessions = 3.0 +Configured subj = 1 +PID of this process = 3574920 +loading_betas +betas_ loaded +Number of zeros in valid_nsd_ids_full tensor(0) +Num train examples torch.Size([2049, 15724]) +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Calculating split 1 of 16 +start_feature_index: 0, end_feature_index: 8 +Starting ridge regression for split 1 with alpha 30000 +Finished, now scoring +train_score: 0.36182375797654204, test_score: 0.02208501783102344 +Calculating split 2 of 16 +start_feature_index: 8, end_feature_index: 16 +Starting ridge regression for split 2 with alpha 30000 +Finished, now scoring +train_score: 0.3495342051308217, test_score: 0.0007318260835312163 +Calculating split 3 of 16 +start_feature_index: 16, end_feature_index: 24 +Starting ridge regression for split 3 with alpha 30000 +Finished, now scoring +train_score: 0.3484901406865831, test_score: 0.0002075572781877218 +Calculating split 4 of 16 +start_feature_index: 24, end_feature_index: 32 +Starting ridge regression for split 4 with alpha 30000 +Finished, now scoring +train_score: 0.358560386523182, test_score: 0.016561028197030904 +Calculating split 5 of 16 +start_feature_index: 32, end_feature_index: 40 +Starting ridge regression for split 5 with alpha 30000 +Finished, now scoring +train_score: 0.36147055415898155, test_score: 0.021950928505481675 +Calculating split 6 of 16 +start_feature_index: 40, end_feature_index: 48 +Starting ridge regression for split 6 with alpha 30000 +Finished, now scoring +train_score: 0.36673023877546246, test_score: 0.030515911944624646 +Calculating split 7 of 16 +start_feature_index: 48, end_feature_index: 56 +Starting ridge regression for split 7 with alpha 30000 +Finished, now scoring +train_score: 0.382788811613218, test_score: 0.055592317974388315 +Calculating split 8 of 16 +start_feature_index: 56, end_feature_index: 64 +Starting ridge regression for split 8 with alpha 30000 +Finished, now scoring +train_score: 0.36732888401298736, test_score: 0.030676004777865223 +Calculating split 9 of 16 +start_feature_index: 64, end_feature_index: 72 +Starting ridge regression for split 9 with alpha 30000 +Finished, now scoring +train_score: 0.36320986684663575, test_score: 0.024560004560622517 +Calculating split 10 of 16 +start_feature_index: 72, end_feature_index: 80 +Starting ridge regression for split 10 with alpha 30000 +Finished, now scoring +train_score: 0.35998434844085503, test_score: 0.019772183842518207 +Calculating split 11 of 16 +start_feature_index: 80, end_feature_index: 88 +Starting ridge regression for split 11 with alpha 30000 +Finished, now scoring +train_score: 0.36324431446143063, test_score: 0.025941373341644335 +Calculating split 12 of 16 +start_feature_index: 88, end_feature_index: 96 +Starting ridge regression for split 12 with alpha 30000 +Finished, now scoring +train_score: 0.3660065759913259, test_score: 0.02765719926560616 +Calculating split 13 of 16 +start_feature_index: 96, end_feature_index: 104 +Starting ridge regression for split 13 with alpha 30000 +Finished, now scoring +train_score: 0.3513749354920007, test_score: 0.005428019471591769 +Calculating split 14 of 16 +start_feature_index: 104, end_feature_index: 112 +Starting ridge regression for split 14 with alpha 30000 +Finished, now scoring +train_score: 0.3690806767806222, test_score: 0.03509971665702172 +Calculating split 15 of 16 +start_feature_index: 112, end_feature_index: 120 +Starting ridge regression for split 15 with alpha 30000 +Finished, now scoring +train_score: 0.3705762573871001, test_score: 0.03742643223224025 +Calculating split 16 of 16 +start_feature_index: 120, end_feature_index: 128 +Starting ridge regression for split 16 with alpha 30000 +Finished, now scoring +train_score: 0.3612387916340266, test_score: 0.024946816381592594 +Successfully processed features[5]. +Running RR_sklearn.py with argument: features[7] +Configured run_name = subj1_3 +Configured current_features = features[7] +Configured num_sessions = 3.0 +Configured subj = 1 +PID of this process = 3596442 +loading_betas +betas_ loaded +Number of zeros in valid_nsd_ids_full tensor(0) +Num train examples torch.Size([2049, 15724]) +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Calculating split 1 of 16 +start_feature_index: 0, end_feature_index: 8 +Starting ridge regression for split 1 with alpha 30000 +Finished, now scoring +train_score: 0.345424036910182, test_score: -0.00641576396318293 +Calculating split 2 of 16 +start_feature_index: 8, end_feature_index: 16 +Starting ridge regression for split 2 with alpha 30000 +Finished, now scoring +train_score: 0.3434592744678819, test_score: -0.008986821900833575 +Calculating split 3 of 16 +start_feature_index: 16, end_feature_index: 24 +Starting ridge regression for split 3 with alpha 30000 +Finished, now scoring +train_score: 0.34624947188187327, test_score: -0.0046911953029316064 +Calculating split 4 of 16 +start_feature_index: 24, end_feature_index: 32 +Starting ridge regression for split 4 with alpha 30000 +Finished, now scoring +train_score: 0.35163111655423596, test_score: 0.004528092811194542 +Calculating split 5 of 16 +start_feature_index: 32, end_feature_index: 40 +Starting ridge regression for split 5 with alpha 30000 +Finished, now scoring +train_score: 0.35309394021705365, test_score: 0.006871746498463344 +Calculating split 6 of 16 +start_feature_index: 40, end_feature_index: 48 +Starting ridge regression for split 6 with alpha 30000 +Finished, now scoring +train_score: 0.3447970754702918, test_score: -0.00710751438034034 +Calculating split 7 of 16 +start_feature_index: 48, end_feature_index: 56 +Starting ridge regression for split 7 with alpha 30000 +Finished, now scoring +train_score: 0.34307146663117266, test_score: -0.009579363018717911 +Calculating split 8 of 16 +start_feature_index: 56, end_feature_index: 64 +Starting ridge regression for split 8 with alpha 30000 +Finished, now scoring +train_score: 0.3475754835450646, test_score: -0.0006127314674612505 +Calculating split 9 of 16 +start_feature_index: 64, end_feature_index: 72 +Starting ridge regression for split 9 with alpha 30000 +Finished, now scoring +train_score: 0.35941519699632096, test_score: 0.016894625224438145 +Calculating split 10 of 16 +start_feature_index: 72, end_feature_index: 80 +Starting ridge regression for split 10 with alpha 30000 +Finished, now scoring +train_score: 0.3503870494327333, test_score: 0.002366947846647611 +Calculating split 11 of 16 +start_feature_index: 80, end_feature_index: 88 +Starting ridge regression for split 11 with alpha 30000 +Finished, now scoring +train_score: 0.3495114178724381, test_score: 0.0019600099251231924 +Calculating split 12 of 16 +start_feature_index: 88, end_feature_index: 96 +Starting ridge regression for split 12 with alpha 30000 +Finished, now scoring +train_score: 0.3462053960219303, test_score: -0.004484739965741246 +Calculating split 13 of 16 +start_feature_index: 96, end_feature_index: 104 +Starting ridge regression for split 13 with alpha 30000 +Finished, now scoring +train_score: 0.35326209172237477, test_score: 0.007249548728724909 +Calculating split 14 of 16 +start_feature_index: 104, end_feature_index: 112 +Starting ridge regression for split 14 with alpha 30000 +Finished, now scoring +train_score: 0.35244277187632983, test_score: 0.00707556436365308 +Calculating split 15 of 16 +start_feature_index: 112, end_feature_index: 120 +Starting ridge regression for split 15 with alpha 30000 +Finished, now scoring +train_score: 0.3472110502670257, test_score: -0.0030459424339841514 +Calculating split 16 of 16 +start_feature_index: 120, end_feature_index: 128 +Starting ridge regression for split 16 with alpha 30000 +Finished, now scoring +train_score: 0.3547305293354102, test_score: 0.009953405445851679 +Successfully processed features[7]. +Running RR_sklearn.py with argument: features[10] +Configured run_name = subj1_3 +Configured current_features = features[10] +Configured num_sessions = 3.0 +Configured subj = 1 +PID of this process = 3617838 +loading_betas +betas_ loaded +Number of zeros in valid_nsd_ids_full tensor(0) +Num train examples torch.Size([2049, 15724]) +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Calculating split 1 of 8 +start_feature_index: 0, end_feature_index: 32 +Starting ridge regression for split 1 with alpha 30000 +Finished, now scoring +train_score: 0.36117376665499723, test_score: 0.021799469981004075 +Calculating split 2 of 8 +start_feature_index: 32, end_feature_index: 64 +Starting ridge regression for split 2 with alpha 30000 +Finished, now scoring +train_score: 0.3576542869407037, test_score: 0.014371952052567132 +Calculating split 3 of 8 +start_feature_index: 64, end_feature_index: 96 +Starting ridge regression for split 3 with alpha 30000 +Finished, now scoring +train_score: 0.364577166565143, test_score: 0.025097138721551948 +Calculating split 4 of 8 +start_feature_index: 96, end_feature_index: 128 +Starting ridge regression for split 4 with alpha 30000 +Finished, now scoring +train_score: 0.36568476104855324, test_score: 0.029386538412951718 +Calculating split 5 of 8 +start_feature_index: 128, end_feature_index: 160 +Starting ridge regression for split 5 with alpha 30000 +Finished, now scoring +train_score: 0.3621040727021419, test_score: 0.02225220504178156 +Calculating split 6 of 8 +start_feature_index: 160, end_feature_index: 192 +Starting ridge regression for split 6 with alpha 30000 +Finished, now scoring +train_score: 0.364651059123669, test_score: 0.025303879557988136 +Calculating split 7 of 8 +start_feature_index: 192, end_feature_index: 224 +Starting ridge regression for split 7 with alpha 30000 +Finished, now scoring +train_score: 0.36366676704488554, test_score: 0.02470302505389435 +Calculating split 8 of 8 +start_feature_index: 224, end_feature_index: 256 +Starting ridge regression for split 8 with alpha 30000 +Finished, now scoring +train_score: 0.36466311055691614, test_score: 0.025284189399604806 +Successfully processed features[10]. +Running RR_sklearn.py with argument: features[12] +Configured run_name = subj1_3 +Configured current_features = features[12] +Configured num_sessions = 3.0 +Configured subj = 1 +PID of this process = 3628743 +loading_betas +betas_ loaded +Number of zeros in valid_nsd_ids_full tensor(0) +Num train examples torch.Size([2049, 15724]) +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Calculating split 1 of 8 +start_feature_index: 0, end_feature_index: 32 +Starting ridge regression for split 1 with alpha 30000 +Finished, now scoring +train_score: 0.3667497021058547, test_score: 0.0313192946096702 +Calculating split 2 of 8 +start_feature_index: 32, end_feature_index: 64 +Starting ridge regression for split 2 with alpha 30000 +Finished, now scoring +train_score: 0.37094850221403325, test_score: 0.03804417627389242 +Calculating split 3 of 8 +start_feature_index: 64, end_feature_index: 96 +Starting ridge regression for split 3 with alpha 30000 +Finished, now scoring +train_score: 0.3649579584513653, test_score: 0.028766393045968255 +Calculating split 4 of 8 +start_feature_index: 96, end_feature_index: 128 +Starting ridge regression for split 4 with alpha 30000 +Finished, now scoring +train_score: 0.3664425787817599, test_score: 0.028574052752989056 +Calculating split 5 of 8 +start_feature_index: 128, end_feature_index: 160 +Starting ridge regression for split 5 with alpha 30000 +Finished, now scoring +train_score: 0.3651754421554986, test_score: 0.027787902234593962 +Calculating split 6 of 8 +start_feature_index: 160, end_feature_index: 192 +Starting ridge regression for split 6 with alpha 30000 +Finished, now scoring +train_score: 0.3686660053021482, test_score: 0.0345551924990581 +Calculating split 7 of 8 +start_feature_index: 192, end_feature_index: 224 +Starting ridge regression for split 7 with alpha 30000 +Finished, now scoring +train_score: 0.3674423111544781, test_score: 0.03183299624777422 +Calculating split 8 of 8 +start_feature_index: 224, end_feature_index: 256 +Starting ridge regression for split 8 with alpha 30000 +Finished, now scoring +train_score: 0.3650215774858828, test_score: 0.027888517278707885 +Successfully processed features[12]. +Running RR_sklearn.py with argument: features[14] +Configured run_name = subj1_3 +Configured current_features = features[14] +Configured num_sessions = 3.0 +Configured subj = 1 +PID of this process = 3639554 +loading_betas +betas_ loaded +Number of zeros in valid_nsd_ids_full tensor(0) +Num train examples torch.Size([2049, 15724]) +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Calculating split 1 of 8 +start_feature_index: 0, end_feature_index: 32 +Starting ridge regression for split 1 with alpha 30000 +Finished, now scoring +train_score: 0.37911839044886353, test_score: 0.05258060627373771 +Calculating split 2 of 8 +start_feature_index: 32, end_feature_index: 64 +Starting ridge regression for split 2 with alpha 30000 +Finished, now scoring +train_score: 0.38053172293284376, test_score: 0.05483424555064602 +Calculating split 3 of 8 +start_feature_index: 64, end_feature_index: 96 +Starting ridge regression for split 3 with alpha 30000 +Finished, now scoring +train_score: 0.38407282923338, test_score: 0.06309426737574837 +Calculating split 4 of 8 +start_feature_index: 96, end_feature_index: 128 +Starting ridge regression for split 4 with alpha 30000 +Finished, now scoring +train_score: 0.38099174734451824, test_score: 0.055251921804398904 +Calculating split 5 of 8 +start_feature_index: 128, end_feature_index: 160 +Starting ridge regression for split 5 with alpha 30000 +Finished, now scoring +train_score: 0.38514231343941374, test_score: 0.06556441604498216 +Calculating split 6 of 8 +start_feature_index: 160, end_feature_index: 192 +Starting ridge regression for split 6 with alpha 30000 +Finished, now scoring +train_score: 0.37624625008665585, test_score: 0.048395698736537165 +Calculating split 7 of 8 +start_feature_index: 192, end_feature_index: 224 +Starting ridge regression for split 7 with alpha 30000 +Finished, now scoring +train_score: 0.3860842186739108, test_score: 0.06633826306468438 +Calculating split 8 of 8 +start_feature_index: 224, end_feature_index: 256 +Starting ridge regression for split 8 with alpha 30000 +Finished, now scoring +train_score: 0.38360423816874345, test_score: 0.058734107181469285 +Successfully processed features[14]. +Running RR_sklearn.py with argument: features[16] +Configured run_name = subj1_3 +Configured current_features = features[16] +Configured num_sessions = 3.0 +Configured subj = 1 +PID of this process = 3650338 +loading_betas +betas_ loaded +Number of zeros in valid_nsd_ids_full tensor(0) +Num train examples torch.Size([2049, 15724]) +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Calculating split 1 of 8 +start_feature_index: 0, end_feature_index: 32 +Starting ridge regression for split 1 with alpha 25000 +Finished, now scoring +train_score: 0.4128594488090807, test_score: 0.0464514700305962 +Calculating split 2 of 8 +start_feature_index: 32, end_feature_index: 64 +Starting ridge regression for split 2 with alpha 25000 +Finished, now scoring +train_score: 0.4158753086894985, test_score: 0.052717669630297136 +Calculating split 3 of 8 +start_feature_index: 64, end_feature_index: 96 +Starting ridge regression for split 3 with alpha 25000 +Finished, now scoring +train_score: 0.41029129679170717, test_score: 0.041323100377533735 +Calculating split 4 of 8 +start_feature_index: 96, end_feature_index: 128 +Starting ridge regression for split 4 with alpha 25000 +Finished, now scoring +train_score: 0.41727634984429596, test_score: 0.05746063754608882 +Calculating split 5 of 8 +start_feature_index: 128, end_feature_index: 160 +Starting ridge regression for split 5 with alpha 25000 +Finished, now scoring +train_score: 0.412612002359247, test_score: 0.046570528796688035 +Calculating split 6 of 8 +start_feature_index: 160, end_feature_index: 192 +Starting ridge regression for split 6 with alpha 25000 +Finished, now scoring +train_score: 0.41075976996188934, test_score: 0.04261426021041348 +Calculating split 7 of 8 +start_feature_index: 192, end_feature_index: 224 +Starting ridge regression for split 7 with alpha 25000 +Finished, now scoring +train_score: 0.4152750700371546, test_score: 0.05198810635959694 +Calculating split 8 of 8 +start_feature_index: 224, end_feature_index: 256 +Starting ridge regression for split 8 with alpha 25000 +Finished, now scoring +train_score: 0.4080032632229205, test_score: 0.03855298002379416 +Successfully processed features[16]. +Running RR_sklearn.py with argument: features[19] +Configured run_name = subj1_3 +Configured current_features = features[19] +Configured num_sessions = 3.0 +Configured subj = 1 +PID of this process = 3663694 +loading_betas +betas_ loaded +Number of zeros in valid_nsd_ids_full tensor(0) +Num train examples torch.Size([2049, 15724]) +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Calculating split 1 of 4 +start_feature_index: 0, end_feature_index: 128 +Starting ridge regression for split 1 with alpha 25000 +Finished, now scoring +train_score: 0.4325988736040936, test_score: 0.08160581806869406 +Calculating split 2 of 4 +start_feature_index: 128, end_feature_index: 256 +Starting ridge regression for split 2 with alpha 25000 +Finished, now scoring +train_score: 0.4337711924505709, test_score: 0.0832165276660185 +Calculating split 3 of 4 +start_feature_index: 256, end_feature_index: 384 +Starting ridge regression for split 3 with alpha 25000 +Finished, now scoring +train_score: 0.4358786473839542, test_score: 0.08809112944904415 +Calculating split 4 of 4 +start_feature_index: 384, end_feature_index: 512 +Starting ridge regression for split 4 with alpha 25000 +Finished, now scoring +train_score: 0.43174540260422556, test_score: 0.07991617870959866 +Successfully processed features[19]. +Running RR_sklearn.py with argument: features[21] +Configured run_name = subj1_3 +Configured current_features = features[21] +Configured num_sessions = 3.0 +Configured subj = 1 +PID of this process = 3669218 +loading_betas +betas_ loaded +Number of zeros in valid_nsd_ids_full tensor(0) +Num train examples torch.Size([2049, 15724]) +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Calculating split 1 of 4 +start_feature_index: 0, end_feature_index: 128 +Starting ridge regression for split 1 with alpha 25000 +Finished, now scoring +train_score: 0.4328020948381995, test_score: 0.08227701532699333 +Calculating split 2 of 4 +start_feature_index: 128, end_feature_index: 256 +Starting ridge regression for split 2 with alpha 25000 +Finished, now scoring +train_score: 0.42728582539424953, test_score: 0.07136342436094784 +Calculating split 3 of 4 +start_feature_index: 256, end_feature_index: 384 +Starting ridge regression for split 3 with alpha 25000 +Finished, now scoring +train_score: 0.4303658740333268, test_score: 0.07705747245771397 +Calculating split 4 of 4 +start_feature_index: 384, end_feature_index: 512 +Starting ridge regression for split 4 with alpha 25000 +Finished, now scoring +train_score: 0.4248797352526938, test_score: 0.06834239846983288 +Successfully processed features[21]. +Running RR_sklearn.py with argument: features[23] +Configured run_name = subj1_3 +Configured current_features = features[23] +Configured num_sessions = 3.0 +Configured subj = 1 +PID of this process = 3674798 +loading_betas +betas_ loaded +Number of zeros in valid_nsd_ids_full tensor(0) +Num train examples torch.Size([2049, 15724]) +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Calculating split 1 of 4 +start_feature_index: 0, end_feature_index: 128 +Starting ridge regression for split 1 with alpha 25000 +Finished, now scoring +train_score: 0.414758080086793, test_score: 0.05015213662093826 +Calculating split 2 of 4 +start_feature_index: 128, end_feature_index: 256 +Starting ridge regression for split 2 with alpha 25000 +Finished, now scoring +train_score: 0.41980853034489785, test_score: 0.05964769654056251 +Calculating split 3 of 4 +start_feature_index: 256, end_feature_index: 384 +Starting ridge regression for split 3 with alpha 25000 +Finished, now scoring +train_score: 0.4158992295435698, test_score: 0.052325560458017985 +Calculating split 4 of 4 +start_feature_index: 384, end_feature_index: 512 +Starting ridge regression for split 4 with alpha 25000 +Finished, now scoring +train_score: 0.4232415122668608, test_score: 0.06511362287652941 +Successfully processed features[23]. +Running RR_sklearn.py with argument: features[25] +Configured run_name = subj1_3 +Configured current_features = features[25] +Configured num_sessions = 3.0 +Configured subj = 1 +PID of this process = 3680308 +loading_betas +betas_ loaded +Number of zeros in valid_nsd_ids_full tensor(0) +Num train examples torch.Size([2049, 15724]) +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Calculating split 1 of 4 +start_feature_index: 0, end_feature_index: 128 +Starting ridge regression for split 1 with alpha 25000 +Finished, now scoring +train_score: 0.42166523046913273, test_score: 0.06406512764412468 +Calculating split 2 of 4 +start_feature_index: 128, end_feature_index: 256 +Starting ridge regression for split 2 with alpha 25000 +Finished, now scoring +train_score: 0.4193444883477417, test_score: 0.06038895188489373 +Calculating split 3 of 4 +start_feature_index: 256, end_feature_index: 384 +Starting ridge regression for split 3 with alpha 25000 +Finished, now scoring +train_score: 0.4193983696356466, test_score: 0.06048027532388556 +Calculating split 4 of 4 +start_feature_index: 384, end_feature_index: 512 +Starting ridge regression for split 4 with alpha 25000 +Finished, now scoring +train_score: 0.42147070573049517, test_score: 0.0644467772736165 +Successfully processed features[25]. +Running RR_sklearn.py with argument: features[28] +Configured run_name = subj1_3 +Configured current_features = features[28] +Configured num_sessions = 3.0 +Configured subj = 1 +PID of this process = 3685858 +loading_betas +betas_ loaded +Number of zeros in valid_nsd_ids_full tensor(0) +Num train examples torch.Size([2049, 15724]) +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Calculating split 1 of 2 +start_feature_index: 0, end_feature_index: 256 +Starting ridge regression for split 1 with alpha 25000 +Finished, now scoring +train_score: 0.44424036508784626, test_score: 0.10466621943554857 +Calculating split 2 of 2 +start_feature_index: 256, end_feature_index: 512 +Starting ridge regression for split 2 with alpha 25000 +Finished, now scoring +train_score: 0.44153576891301866, test_score: 0.09951250187830289 +Successfully processed features[28]. +Running RR_sklearn.py with argument: features[30] +Configured run_name = subj1_3 +Configured current_features = features[30] +Configured num_sessions = 3.0 +Configured subj = 1 +PID of this process = 3688763 +loading_betas +betas_ loaded +Number of zeros in valid_nsd_ids_full tensor(0) +Num train examples torch.Size([2049, 15724]) +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Calculating split 1 of 2 +start_feature_index: 0, end_feature_index: 256 +Starting ridge regression for split 1 with alpha 25000 +Finished, now scoring +train_score: 0.4453320501429956, test_score: 0.10387724368247059 +Calculating split 2 of 2 +start_feature_index: 256, end_feature_index: 512 +Starting ridge regression for split 2 with alpha 25000 +Finished, now scoring +train_score: 0.44453164502852255, test_score: 0.1022639728473796 +Successfully processed features[30]. +Running RR_sklearn.py with argument: features[32] +Configured run_name = subj1_3 +Configured current_features = features[32] +Configured num_sessions = 3.0 +Configured subj = 1 +PID of this process = 3691588 +loading_betas +betas_ loaded +Number of zeros in valid_nsd_ids_full tensor(0) +Num train examples torch.Size([2049, 15724]) +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Calculating split 1 of 2 +start_feature_index: 0, end_feature_index: 256 +Starting ridge regression for split 1 with alpha 25000 +Finished, now scoring +train_score: 0.44500982804694217, test_score: 0.10123665279441026 +Calculating split 2 of 2 +start_feature_index: 256, end_feature_index: 512 +Starting ridge regression for split 2 with alpha 25000 +Finished, now scoring +train_score: 0.4478446080908823, test_score: 0.10559471943461395 +Successfully processed features[32]. +Running RR_sklearn.py with argument: features[34] +Configured run_name = subj1_3 +Configured current_features = features[34] +Configured num_sessions = 3.0 +Configured subj = 1 +PID of this process = 3694471 +loading_betas +betas_ loaded +Number of zeros in valid_nsd_ids_full tensor(0) +Num train examples torch.Size([2049, 15724]) +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Calculating split 1 of 2 +start_feature_index: 0, end_feature_index: 256 +Starting ridge regression for split 1 with alpha 25000 +Finished, now scoring +train_score: 0.4571570523185727, test_score: 0.12503171707310937 +Calculating split 2 of 2 +start_feature_index: 256, end_feature_index: 512 +Starting ridge regression for split 2 with alpha 25000 +Finished, now scoring +train_score: 0.4555303237208904, test_score: 0.12183441316895469 +Successfully processed features[34]. +Running RR_sklearn.py with argument: classifier[0] +Configured run_name = subj1_3 +Configured current_features = classifier[0] +Configured num_sessions = 3.0 +Configured subj = 1 +PID of this process = 3697298 +loading_betas +betas_ loaded +Number of zeros in valid_nsd_ids_full tensor(0) +Num train examples torch.Size([2049, 15724]) +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Calculating split 1 of 1 +start_feature_index: 0, end_feature_index: 4096 +Starting ridge regression for split 1 with alpha 20000 +Finished, now scoring +train_score: 0.5336238680516561, test_score: 0.17212870116914633 +Successfully processed classifier[0]. +Running RR_sklearn.py with argument: classifier[3] +Configured run_name = subj1_3 +Configured current_features = classifier[3] +Configured num_sessions = 3.0 +Configured subj = 1 +PID of this process = 3698834 +loading_betas +betas_ loaded +Number of zeros in valid_nsd_ids_full tensor(0) +Num train examples torch.Size([2049, 15724]) +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Calculating split 1 of 1 +start_feature_index: 0, end_feature_index: 4096 +Starting ridge regression for split 1 with alpha 20000 +Finished, now scoring +train_score: 0.5125653007777902, test_score: 0.129444859296009 +Successfully processed classifier[3]. +Running RR_sklearn.py with argument: classifier[6] +Configured run_name = subj1_3 +Configured current_features = classifier[6] +Configured num_sessions = 3.0 +Configured subj = 1 +PID of this process = 3700361 +loading_betas +betas_ loaded +Number of zeros in valid_nsd_ids_full tensor(0) +Num train examples torch.Size([2049, 15724]) +Loaded all 73k possible NSD images to cpu! torch.Size([73000, 3, 224, 224]) +torch.Size([18, 8, 15724]) torch.Size([18, 3, 425, 425]) +torch.Size([18, 16, 15724]) torch.Size([18, 3, 425, 425]) +Calculating split 1 of 1 +start_feature_index: 0, end_feature_index: 1000 +Starting ridge regression for split 1 with alpha 20000 +Finished, now scoring +train_score: 0.5673236904296506, test_score: 0.22877881947002687 +Successfully processed classifier[6]. +All features have been processed.