{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"name":"python","version":"3.10.14","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"},"kaggle":{"accelerator":"none","dataSources":[{"sourceId":71549,"databundleVersionId":8561470,"sourceType":"competition"},{"sourceId":9273585,"sourceType":"datasetVersion","datasetId":5612382},{"sourceId":9274676,"sourceType":"datasetVersion","datasetId":5613162},{"sourceId":183439689,"sourceType":"kernelVersion"},{"sourceId":194548139,"sourceType":"kernelVersion"}],"isInternetEnabled":true,"language":"python","sourceType":"notebook","isGpuEnabled":false}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"markdown","source":"**[References]**\n* https://github.com/tubo213/kaggle-child-mind-institute-detect-sleep-states/tree/main?tab=MIT-1-ov-file\n* https://www.kaggle.com/code/itsuki9180/rsna2024-lsdc-training-baseline/notebook","metadata":{}},{"cell_type":"code","source":"!pip install hydra-core --no-index --find-links=/kaggle/input/hydra-core","metadata":{"execution":{"iopub.status.busy":"2024-08-29T11:47:59.239143Z","iopub.execute_input":"2024-08-29T11:47:59.239763Z","iopub.status.idle":"2024-08-29T11:48:16.599854Z","shell.execute_reply.started":"2024-08-29T11:47:59.239686Z","shell.execute_reply":"2024-08-29T11:48:16.598627Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"!unzip -q /kaggle/input/rsna2024-lsdc-making-dataset/_output_.zip","metadata":{"execution":{"iopub.status.busy":"2024-08-29T11:48:16.601895Z","iopub.execute_input":"2024-08-29T11:48:16.602209Z","iopub.status.idle":"2024-08-29T11:52:32.786146Z","shell.execute_reply.started":"2024-08-29T11:48:16.602176Z","shell.execute_reply":"2024-08-29T11:52:32.784950Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import os\nos.environ[\"CUDA_VISIBLE_DEVICES\"]=\"0\"\n\n# Please set the 'wandb_api_key'\nos.environ['WANDB_API_KEY'] = 'your_api_key'","metadata":{"execution":{"iopub.status.busy":"2024-08-29T11:52:32.787805Z","iopub.execute_input":"2024-08-29T11:52:32.788222Z","iopub.status.idle":"2024-08-29T11:52:32.793835Z","shell.execute_reply.started":"2024-08-29T11:52:32.788174Z","shell.execute_reply":"2024-08-29T11:52:32.792784Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"project_id = 'a'\n\n# Please set the 'wandb_entity'\nwandb_entity = 'your_entity'\n\n# Please override as needed.\nbatch_size = 24\nnum_workers = os.cpu_count()\nmodel_name = 'maxvit_tiny_rw_224.sw_in1k'\nimg_resize = 224\nlr = 0.0001","metadata":{"execution":{"iopub.status.busy":"2024-08-29T11:52:32.796329Z","iopub.execute_input":"2024-08-29T11:52:32.797077Z","iopub.status.idle":"2024-08-29T11:52:32.804986Z","shell.execute_reply.started":"2024-08-29T11:52:32.797028Z","shell.execute_reply":"2024-08-29T11:52:32.804133Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"%cd /kaggle/input/rsna2024-$project_id","metadata":{"execution":{"iopub.status.busy":"2024-08-29T11:52:32.806192Z","iopub.execute_input":"2024-08-29T11:52:32.806586Z","iopub.status.idle":"2024-08-29T11:52:32.817357Z","shell.execute_reply.started":"2024-08-29T11:52:32.806543Z","shell.execute_reply":"2024-08-29T11:52:32.816476Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"project = f'RSNA2024-{project_id}'\nexp_no = '007'\noutput_dir = f'/kaggle/working/{project_id}/output'\n\nselect_folds = [0, 1, 2, 3, 4]\nfor valid_fold in select_folds:\n    exp_name = f'{exp_no}-{valid_fold}'\n    split = f'fold_{valid_fold}_mskf'\n    !python -m run.train\\\n        project=$project\\\n        wandb_entity=$wandb_entity\\\n        exp_no=$exp_no\\\n        exp_name=$exp_name\\\n        num_workers=$num_workers\\\n        batch_size=$batch_size\\\n        model.model_name=$model_name\\\n        img_resize=$img_resize\\\n        optimizer.lr=$lr\\\n        dir=kaggle\\\n        dir.output_dir=$output_dir\\\n        split=$split","metadata":{"execution":{"iopub.status.busy":"2024-08-29T11:52:32.818849Z","iopub.execute_input":"2024-08-29T11:52:32.819179Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}