{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"name":"python","version":"3.10.12","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"},"kaggle":{"accelerator":"gpu","dataSources":[{"sourceId":84969,"databundleVersionId":10033515,"sourceType":"competition"},{"sourceId":9862305,"sourceType":"datasetVersion","datasetId":6052780},{"sourceId":10611681,"sourceType":"datasetVersion","datasetId":6370848},{"sourceId":10643405,"sourceType":"datasetVersion","datasetId":6370847}],"dockerImageVersionId":30823,"isInternetEnabled":false,"language":"python","sourceType":"notebook","isGpuEnabled":true}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"# Do installs\ndeps_path = '/kaggle/input/czii-cryoet-dependencies'\n! cp -r /kaggle/input/czii-cryoet-dependencies/asciitree-0.3.3/ asciitree-0.3.3/\n! pip wheel asciitree-0.3.3/asciitree-0.3.3/\n! pip install asciitree-0.3.3-py3-none-any.whl\n! pip install -q --no-index --find-links {deps_path} --requirement {deps_path}/requirements.txt\n! rm -r asciitree*\n","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","trusted":true,"execution":{"iopub.status.busy":"2024-12-25T08:47:06.467919Z","iopub.execute_input":"2024-12-25T08:47:06.468417Z","iopub.status.idle":"2024-12-25T08:47:28.115269Z","shell.execute_reply.started":"2024-12-25T08:47:06.468373Z","shell.execute_reply":"2024-12-25T08:47:28.113908Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"from typing import List, Tuple, Union\nimport numpy as np\nimport pandas as pd\nimport torch\nfrom monai.data import DataLoader, Dataset, CacheDataset, decollate_batch\nfrom monai.transforms import (\n    Compose, \n    EnsureChannelFirstd, \n    Orientationd,  \n    AsDiscrete,  \n    RandFlipd, \n    RandRotate90d, \n    NormalizeIntensityd,\n    RandCropByLabelClassesd,\n)\nimport lightning.pytorch as pl\nfrom monai.networks.nets import UNet\nfrom monai.losses import TverskyLoss\nfrom monai.metrics import DiceMetric\nimport sys\nsys.path.append('/kaggle/input/k202411-czii-src')\nfrom my_submit_fusionI_kl_clustering import ExperimentRunner, seed_everything_but","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-25T08:47:28.117011Z","iopub.execute_input":"2024-12-25T08:47:28.117477Z","iopub.status.idle":"2024-12-25T08:47:53.67285Z","shell.execute_reply.started":"2024-12-25T08:47:28.117432Z","shell.execute_reply":"2024-12-25T08:47:53.671678Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"seed_everything_but(24601)\nexperiment_runner = ExperimentRunner()\nexperiment_runner.objective(\n    model_paths=[\n        '/kaggle/input/k202411-czii-models/2025-01-16-unet-4res-4layer-0200ep-frompretrain-10441-sphwithmatrix-0.8-0/train00200_fromsnapshot_traindata_standard_val_TS_5_4_2025-01-16--05-57-23--794_x/best_models_0.7852436784047132_0.9.pth',\n        '/kaggle/input/k202411-czii-models/2025-01-25-unet-4res-4layer-0200ep-frompretrain-10441-rotmatrixsgn-0.8-0/train00200_fromsnapshot_traindata_standard_val_TS_5_4_2025-01-25--18-53-04--360_x/best_models_0.7892614599394362_0.8.pth',\n        '/kaggle/input/k202411-czii-models/2025-01-14-unet-4res-4layer-0200ep-frompretrain-10441-sph-0.8-0/train00200_fromsnapshot_traindata_standard_val_TS_69_2_2025-01-14--08-27-01--394_x/best_models_0.8824749236356861_0.6.pth',\n        '/kaggle/input/k202411-czii-models/2025-01-04-unet-4res-4layer-0800ep-dropout/replicate00800_val_on_TS_6_4_bignn1_dropout_2025-01-03--17-04-35--313_x/best_models_0.7798912671918604_0.6.pth',\n        '/kaggle/input/k202411-czii-models/2025-01-16-unet-4res-4layer-0200ep-frompretrain-10441-sphwithmatrix-0.8-0/train00200_fromsnapshot_traindata_standard_val_TS_6_6_2025-01-16--10-07-17--136_x/best_models_0.7928252238755301_0.8.pth',\n        '/kaggle/input/k202411-czii-models/2025-01-29-unet-4res-4layer-0200ep-frompretrain-10441-rotmatrixsgn-0.8-0/train00200_fromsnapshot_traindata_standard_val_TS_6_6_2025-01-29--00-17-39--251_x/best_models_0.7877067049386183_0.6.pth',\n        '/kaggle/input/k202411-czii-models/2025-01-14-unet-4res-4layer-0200ep-frompretrain-10441-sph-0.8-0/train00200_fromsnapshot_traindata_standard_val_TS_73_6_2025-01-14--12-44-45--054_x/best_models_0.8334832574949145_0.8.pth',\n        '/kaggle/input/k202411-czii-models/2025-01-16-unet-4res-4layer-0200ep-frompretrain-10441-sphwithmatrix-0.8-0/train00200_fromsnapshot_traindata_standard_val_TS_86_3_2025-01-16--14-27-32--893_x/best_models_0.8337307828312702_0.1.pth',\n        '/kaggle/input/k202411-czii-models/2025-01-16-unet-4res-4layer-0200ep-frompretrain-10441-sphwithmatrix-0.8-0/train00200_fromsnapshot_traindata_standard_val_TS_99_9_2025-01-16--17-38-38--410_x/best_models_0.8005588533325161_0.7.pth',\n    ],\n    competition_data_root='/kaggle/input/czii-cryo-et-object-identification',\n    certainty_thresholds=[0.5, 0.7, 0.5, 0.5, 0.5, 0.5, 0.5],\n    device='cuda:0',\n    stdev_q=0.25,\n    gauss_power=3.0,\n    gauss_aggregation='sum',\n    circumcenter_single=False,\n    circumcenter_multi=True,\n    min_cluster_distance=1.2,\n    conv_mode='cross',\n    tile_size_z=184,\n    tile_size_xy=256\n)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-25T08:50:02.083172Z","iopub.execute_input":"2024-12-25T08:50:02.083628Z","iopub.status.idle":"2024-12-25T08:58:05.771268Z","shell.execute_reply.started":"2024-12-25T08:50:02.083597Z","shell.execute_reply":"2024-12-25T08:58:05.769577Z"}},"outputs":[],"execution_count":null}]}