{"metadata":{"kernelspec":{"display_name":"Python 3","language":"python","name":"python3"},"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.12.12"},"kaggle":{"accelerator":"nvidiaTeslaT4","dataSources":[{"sourceType":"competition","sourceId":25954,"databundleVersionId":2091745},{"sourceType":"competition","sourceId":44224,"databundleVersionId":5188730},{"sourceType":"competition","sourceId":70203,"databundleVersionId":8068726},{"sourceType":"competition","sourceId":91844,"databundleVersionId":11361821},{"sourceType":"competition","sourceId":129329,"databundleVersionId":15996945},{"sourceType":"datasetVersion","sourceId":2315253,"datasetId":1389941,"databundleVersionId":2356678}],"dockerImageVersionId":31329,"isInternetEnabled":true,"language":"python","sourceType":"notebook","isGpuEnabled":true},"papermill":{"default_parameters":{},"duration":9882.216619,"end_time":"2026-05-25T03:44:27.885509+00:00","environment_variables":{},"exception":null,"input_path":"__notebook__.ipynb","output_path":"__notebook__.ipynb","parameters":{},"start_time":"2026-05-25T00:59:45.668890+00:00","version":"2.7.0"},"widgets":{"application/vnd.jupyter.widget-state+json":{"state":{"006234ae786a48d8b7565c7170850e5b":{"model_module":"@jupyter-widgets/controls","model_module_version":"2.0.0","model_name":"FloatProgressModel","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"2.0.0","_model_name":"FloatProgressModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"2.0.0","_view_name":"ProgressView","bar_style":"success","description":"","description_allow_html":false,"layout":"IPY_MODEL_a2369817fd7e455f97079c054d242eb3","max":757,"min":0,"orientation":"horizontal","style":"IPY_MODEL_54b1c1a5fd76457c8691a2e4f59e76ef","tabbable":null,"tooltip":null,"value":757}},"009a727d89f24e84a3e718643f3fb3e0":{"model_module":"@jupyter-widgets/controls","model_module_version":"2.0.0","model_name":"HTMLModel","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"2.0.0","_model_name":"HTMLModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"2.0.0","_view_name":"HTMLView","description":"","description_allow_html":false,"layout":"IPY_MODEL_777bc90758ec4d4aa4cb621f2c45904c","placeholder":" ","style":"IPY_MODEL_e55f1982157947e7967c5f5a89b217e2","tabbable":null,"tooltip":null,"value":"100%"}},"018b37bb762243dc915c6c3aa96164dd":{"model_module":"@jupyter-widgets/base","model_module_version":"2.0.0","model_name":"LayoutModel","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"2.0.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"2.0.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border_bottom":null,"border_left":null,"border_right":null,"border_top":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"064f6d06513a4a2d893b766c960dcb07":{"model_module":"@jupyter-widgets/base","model_module_version":"2.0.0","model_name":"LayoutModel","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"2.0.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"2.0.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border_bottom":null,"border_left":null,"border_right":null,"border_top":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"06ba88691086418f99d1041cd5aaab38":{"model_module":"@jupyter-widgets/controls","model_module_version":"2.0.0","model_name":"FloatProgressModel","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"2.0.0","_model_name":"FloatProgressModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"2.0.0","_view_name":"ProgressView","bar_style":"success","description":"","description_allow_html":false,"layout":"IPY_MODEL_a933fd08be5845e6b0f840fffeb46ad6","max":20,"min":0,"orientation":"horizontal","style":"IPY_MODEL_63767a54d9ea4fe0b2fe86ee735437f4","tabbable":null,"tooltip":null,"value":20}},"082b8876726b4d5a877899f5e9786cb4":{"model_module":"@jupyter-widgets/base","model_module_version":"2.0.0","model_name":"LayoutModel","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"2.0.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"2.0.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border_bottom":null,"border_left":null,"border_right":null,"border_top":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"083bcfe3793349bba9a695d836fd2434":{"model_module":"@jupyter-widgets/controls","model_module_version":"2.0.0","model_name":"HBoxModel","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"2.0.0","_model_name":"HBoxModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"2.0.0","_view_name":"HBoxView","box_style":"","children":["IPY_MODEL_ddbd2b6d8bbe48d0b53e750b5748ab2a","IPY_MODEL_06ba88691086418f99d1041cd5aaab38","IPY_MODEL_10faa27f979348f19e18948db9cd1a9b"],"layout":"IPY_MODEL_0b786a710d5e46efab08ff84dfea7773","tabbable":null,"tooltip":null}},"0b786a710d5e46efab08ff84dfea7773":{"model_module":"@jupyter-widgets/base","model_module_version":"2.0.0","model_name":"LayoutModel","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"2.0.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"2.0.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border_bottom":null,"border_left":null,"border_right":null,"border_top":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"0bea6a426ef64624a4ceac8f59db5fb3":{"model_module":"@jupyter-widgets/base","model_module_version":"2.0.0","model_name":"LayoutModel","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"2.0.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"2.0.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border_bottom":null,"border_left":null,"border_right":null,"border_top":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"0e8d2afd5659443994cadcd467d531a7":{"model_module":"@jupyter-widgets/controls","model_module_version":"2.0.0","model_name":"HTMLStyleModel","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"2.0.0","_model_name":"HTMLStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"2.0.0","_view_name":"StyleView","background":null,"description_width":"","font_size":null,"text_color":null}},"10e0d111a2ab4e76b95a130a0dcdb8f5":{"model_module":"@jupyter-widgets/controls","model_module_version":"2.0.0","model_name":"HTMLModel","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"2.0.0","_model_name":"HTMLModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"2.0.0","_view_name":"HTMLView","description":"","description_allow_html":false,"layout":"IPY_MODEL_fbadf742d4d841f083a2199ab13e1a11","placeholder":" ","style":"IPY_MODEL_7933e90cbc7b4d899cbb12d0ad61a352","tabbable":null,"tooltip":null,"value":" 738/738 [00:08&lt;00:00, 94.84it/s]"}},"10faa27f979348f19e18948db9cd1a9b":{"model_module":"@jupyter-widgets/controls","model_module_version":"2.0.0","model_name":"HTMLModel","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"2.0.0","_model_name":"HTMLModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"2.0.0","_view_name":"HTMLView","description":"","description_allow_html":false,"layout":"IPY_MODEL_85649aed3f0144fe8d734397106240df","placeholder":" ","style":"IPY_MODEL_ab9cb3d0b0d64c4695efb7cfbf9954c9","tabbable":null,"tooltip":null,"value":" 20/20 [39:38&lt;00:00, 119.65s/it]"}},"13241743b1a04315b6c5e2b7c8582940":{"model_module":"@jupyter-widgets/base","model_module_version":"2.0.0","model_name":"LayoutModel","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"2.0.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"2.0.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border_bottom":null,"border_left":null,"border_right":null,"border_top":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"1357a7094e4d4b009ac956d9936b20b5":{"model_module":"@jupyter-widgets/controls","model_module_version":"2.0.0","model_name":"HTMLModel","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"2.0.0","_model_name":"HTMLModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"2.0.0","_view_name":"HTMLView","description":"","description_allow_html":false,"layout":"IPY_MODEL_082b8876726b4d5a877899f5e9786cb4","placeholder":" ","style":"IPY_MODEL_6f9f8c99e02343279bffebe3b5ead655","tabbable":null,"tooltip":null,"value":"100%"}},"13c672eea68843ceadef943244af33bb":{"model_module":"@jupyter-widgets/base","model_module_version":"2.0.0","model_name":"LayoutModel","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"2.0.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"2.0.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border_bottom":null,"border_left":null,"border_right":null,"border_top":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"17a25f5f3f5949fdb11900195ad72cff":{"model_module":"@jupyter-widgets/base","model_module_version":"2.0.0","model_name":"LayoutModel","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"2.0.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"2.0.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border_bottom":null,"border_left":null,"border_right":null,"border_top":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"19b7b9d06bf64a0f990535ae61a297e1":{"model_module":"@jupyter-widgets/base","model_module_version":"2.0.0","model_name":"LayoutModel","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"2.0.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"2.0.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border_bottom":null,"border_left":null,"border_right":null,"border_top":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"1c6bc604690d43489265458f65eb906a":{"model_module":"@jupyter-widgets/controls","model_module_version":"2.0.0","model_name":"HBoxModel","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"2.0.0","_model_name":"HBoxModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"2.0.0","_view_name":"HBoxView","box_style":"","children":["IPY_MODEL_009a727d89f24e84a3e718643f3fb3e0","IPY_MODEL_006234ae786a48d8b7565c7170850e5b","IPY_MODEL_909615289e494104841e176840e79158"],"layout":"IPY_MODEL_f574ef43798b49ad97b9e1a5d5453c85","tabbable":null,"tooltip":null}},"2524432798aa464ca383fcd63e2609d3":{"model_module":"@jupyter-widgets/controls","model_module_version":"2.0.0","model_name":"HTMLModel","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"2.0.0","_model_name":"HTMLModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"2.0.0","_view_name":"HTMLView","description":"","description_allow_html":false,"layout":"IPY_MODEL_f00d21a626f9492aa769cafeddd320fd","placeholder":" ","style":"IPY_MODEL_3626c453c62e48e483fa8be13f7af4f5","tabbable":null,"tooltip":null,"value":" 747/747 [00:16&lt;00:00, 85.39it/s]"}},"2693e2695ae54855a1ee205d7b98ad53":{"model_module":"@jupyter-widgets/base","model_module_version":"2.0.0","model_name":"LayoutModel","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"2.0.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"2.0.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border_bottom":null,"border_left":null,"border_right":null,"border_top":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"29beb4dcd4694f47bfedbbd3e4df3d74":{"model_module":"@jupyter-widgets/base","model_module_version":"2.0.0","model_name":"LayoutModel","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"2.0.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"2.0.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border_bottom":null,"border_left":null,"border_right":null,"border_top":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"2aea26be863e4e08ba7642998a64c49b":{"model_module":"@jupyter-widgets/base","model_module_version":"2.0.0","model_name":"LayoutModel","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"2.0.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"2.0.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border_bottom":null,"border_left":null,"border_right":null,"border_top":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"2ca26e4936e84a0ab9161c83c760f79c":{"model_module":"@jupyter-widgets/controls","model_module_version":"2.0.0","model_name":"HTMLModel","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"2.0.0","_model_name":"HTMLModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"2.0.0","_view_name":"HTMLView","description":"","description_allow_html":false,"layout":"IPY_MODEL_2693e2695ae54855a1ee205d7b98ad53","placeholder":" ","style":"IPY_MODEL_b986f739677747efba39e21adc54d622","tabbable":null,"tooltip":null,"value":"100%"}},"30b23d14f1da4383bb88bb30ebd4b4b9":{"model_module":"@jupyter-widgets/base","model_module_version":"2.0.0","model_name":"LayoutModel","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"2.0.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"2.0.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border_bottom":null,"border_left":null,"border_right":null,"border_top":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"331994e7e29b4dc8b7298f17cd546e3d":{"model_module":"@jupyter-widgets/controls","model_module_version":"2.0.0","model_name":"HBoxModel","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"2.0.0","_model_name":"HBoxModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"2.0.0","_view_name":"HBoxView","box_style":"","children":["IPY_MODEL_2ca26e4936e84a0ab9161c83c760f79c","IPY_MODEL_405cae22666b4008abae61d669705331","IPY_MODEL_10e0d111a2ab4e76b95a130a0dcdb8f5"],"layout":"IPY_MODEL_558cbd3529c447c0a6fdf14359dc16d3","tabbable":null,"tooltip":null}},"3626c453c62e48e483fa8be13f7af4f5":{"model_module":"@jupyter-widgets/controls","model_module_version":"2.0.0","model_name":"HTMLStyleModel","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"2.0.0","_model_name":"HTMLStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"2.0.0","_view_name":"StyleView","background":null,"description_width":"","font_size":null,"text_color":null}},"405cae22666b4008abae61d669705331":{"model_module":"@jupyter-widgets/controls","model_module_version":"2.0.0","model_name":"FloatProgressModel","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"2.0.0","_model_name":"FloatProgressModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"2.0.0","_view_name":"ProgressView","bar_style":"success","description":"","description_allow_html":false,"layout":"IPY_MODEL_e8845d646c184594bb72f8630d64e48b","max":738,"min":0,"orientation":"horizontal","style":"IPY_MODEL_ee3efe1c92b34f64a4962bccbd28562b","tabbable":null,"tooltip":null,"value":738}},"41eaf95a53b348489a633c5cc89a65e1":{"model_module":"@jupyter-widgets/controls","model_module_version":"2.0.0","model_name":"HTMLModel","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"2.0.0","_model_name":"HTMLModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"2.0.0","_view_name":"HTMLView","description":"","description_allow_html":false,"layout":"IPY_MODEL_95e9c1cbcf3742d9a051dc7f8d44574b","placeholder":" ","style":"IPY_MODEL_f60c01df9d1f4827923c8f3452bd40c2","tabbable":null,"tooltip":null,"value":" 20/20 [39:37&lt;00:00, 118.30s/it]"}},"43937ac2e2ab4906948b973c1261d190":{"model_module":"@jupyter-widgets/controls","model_module_version":"2.0.0","model_name":"HBoxModel","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"2.0.0","_model_name":"HBoxModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"2.0.0","_view_name":"HBoxView","box_style":"","children":["IPY_MODEL_45ab82ce7217463388861eee27e57a2f","IPY_MODEL_c10042df764542cc884e9ef758522f8f","IPY_MODEL_dd17a2e6b0c14207b337e6cd39918e90"],"layout":"IPY_MODEL_2aea26be863e4e08ba7642998a64c49b","tabbable":null,"tooltip":null}},"45956da685414a7aada4f75e6e8e1412":{"model_module":"@jupyter-widgets/controls","model_module_version":"2.0.0","model_name":"HTMLModel","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"2.0.0","_model_name":"HTMLModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"2.0.0","_view_name":"HTMLView","description":"","description_allow_html":false,"layout":"IPY_MODEL_a41c722d10414cfab9a2a7759d4f2db6","placeholder":" ","style":"IPY_MODEL_ab7ac686c1194383bf57a671b8c1d4a0","tabbable":null,"tooltip":null,"value":"100%"}},"45ab82ce7217463388861eee27e57a2f":{"model_module":"@jupyter-widgets/controls","model_module_version":"2.0.0","model_name":"HTMLModel","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"2.0.0","_model_name":"HTMLModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"2.0.0","_view_name":"HTMLView","description":"","description_allow_html":false,"layout":"IPY_MODEL_614e7e88abf24bfaa7589ee2f9b15e61","placeholder":" ","style":"IPY_MODEL_53c3802203dc404787d329e146795f68","tabbable":null,"tooltip":null,"value":"model.safetensors: 100%"}},"48baf9ff091d479483b66bfd0772002e":{"model_module":"@jupyter-widgets/base","model_module_version":"2.0.0","model_name":"LayoutModel","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"2.0.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"2.0.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border_bottom":null,"border_left":null,"border_right":null,"border_top":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"491b7dfe7cd64ef9a01e7bfa8d647696":{"model_module":"@jupyter-widgets/base","model_module_version":"2.0.0","model_name":"LayoutModel","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"2.0.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"2.0.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border_bottom":null,"border_left":null,"border_right":null,"border_top":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"4dc0e2a5e0a34c10b610d199288e0010":{"model_module":"@jupyter-widgets/controls","model_module_version":"2.0.0","model_name":"ProgressStyleModel","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"2.0.0","_model_name":"ProgressStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"2.0.0","_view_name":"StyleView","bar_color":null,"description_width":""}},"503330c88fdb495388f22953c15c5e2c":{"model_module":"@jupyter-widgets/controls","model_module_version":"2.0.0","model_name":"HBoxModel","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"2.0.0","_model_name":"HBoxModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"2.0.0","_view_name":"HBoxView","box_style":"","children":["IPY_MODEL_45956da685414a7aada4f75e6e8e1412","IPY_MODEL_d4efd1b151b54bc7b050cff435ca20bb","IPY_MODEL_ccda5297be0d4e48808b13dd4d9adac2"],"layout":"IPY_MODEL_13c672eea68843ceadef943244af33bb","tabbable":null,"tooltip":null}},"50603568095d44ce8cf3f0b2a28d6162":{"model_module":"@jupyter-widgets/controls","model_module_version":"2.0.0","model_name":"HTMLStyleModel","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"2.0.0","_model_name":"HTMLStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"2.0.0","_view_name":"StyleView","background":null,"description_width":"","font_size":null,"text_color":null}},"5326e1ea69904561b4713ac607c880a2":{"model_module":"@jupyter-widgets/controls","model_module_version":"2.0.0","model_name":"HTMLModel","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"2.0.0","_model_name":"HTMLModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"2.0.0","_view_name":"HTMLView","description":"","description_allow_html":false,"layout":"IPY_MODEL_064f6d06513a4a2d893b766c960dcb07","placeholder":" ","style":"IPY_MODEL_9f5a5b59ea0843bda189593f7bff8f6c","tabbable":null,"tooltip":null,"value":" 20/20 [39:50&lt;00:00, 119.66s/it]"}},"53542a5f4eb445bd86a1fa7c791c5e0a":{"model_module":"@jupyter-widgets/base","model_module_version":"2.0.0","model_name":"LayoutModel","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"2.0.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"2.0.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border_bottom":null,"border_left":null,"border_right":null,"border_top":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"53c3802203dc404787d329e146795f68":{"model_module":"@jupyter-widgets/controls","model_module_version":"2.0.0","model_name":"HTMLStyleModel","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"2.0.0","_model_name":"HTMLStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"2.0.0","_view_name":"StyleView","background":null,"description_width":"","font_size":null,"text_color":null}},"54b1c1a5fd76457c8691a2e4f59e76ef":{"model_module":"@jupyter-widgets/controls","model_module_version":"2.0.0","model_name":"ProgressStyleModel","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"2.0.0","_model_name":"ProgressStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"2.0.0","_view_name":"StyleView","bar_color":null,"description_width":""}},"558cbd3529c447c0a6fdf14359dc16d3":{"model_module":"@jupyter-widgets/base","model_module_version":"2.0.0","model_name":"LayoutModel","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"2.0.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"2.0.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border_bottom":null,"border_left":null,"border_right":null,"border_top":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"565701564c97448fa3acf7c3faf82d20":{"model_module":"@jupyter-widgets/controls","model_module_version":"2.0.0","model_name":"ProgressStyleModel","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"2.0.0","_model_name":"ProgressStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"2.0.0","_view_name":"StyleView","bar_color":null,"description_width":""}},"56913c0a20694fcd98cb36518898c796":{"model_module":"@jupyter-widgets/controls","model_module_version":"2.0.0","model_name":"HTMLModel","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"2.0.0","_model_name":"HTMLModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"2.0.0","_view_name":"HTMLView","description":"","description_allow_html":false,"layout":"IPY_MODEL_48baf9ff091d479483b66bfd0772002e","placeholder":" ","style":"IPY_MODEL_9dd69c85da5c46fab11ce0e21aa11cc7","tabbable":null,"tooltip":null,"value":"100%"}},"56c11c7fd03144f88617883562ae5fb2":{"model_module":"@jupyter-widgets/controls","model_module_version":"2.0.0","model_name":"ProgressStyleModel","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"2.0.0","_model_name":"ProgressStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"2.0.0","_view_name":"StyleView","bar_color":null,"description_width":""}},"59910a6209e5491c8f0753f3a4e2901e":{"model_module":"@jupyter-widgets/controls","model_module_version":"2.0.0","model_name":"FloatProgressModel","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"2.0.0","_model_name":"FloatProgressModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"2.0.0","_view_name":"ProgressView","bar_style":"success","description":"","description_allow_html":false,"layout":"IPY_MODEL_ae02282e9a34490f996274c9f80095c0","max":20,"min":0,"orientation":"horizontal","style":"IPY_MODEL_c02c83fc3fd84dca988dd5a2278f168a","tabbable":null,"tooltip":null,"value":20}},"6146c0b50c6248679d2ba938a54e9fbf":{"model_module":"@jupyter-widgets/base","model_module_version":"2.0.0","model_name":"LayoutModel","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"2.0.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"2.0.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border_bottom":null,"border_left":null,"border_right":null,"border_top":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"614e7e88abf24bfaa7589ee2f9b15e61":{"model_module":"@jupyter-widgets/base","model_module_version":"2.0.0","model_name":"LayoutModel","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"2.0.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"2.0.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border_bottom":null,"border_left":null,"border_right":null,"border_top":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"61b7eb06516b4102a257f36e9fca134c":{"model_module":"@jupyter-widgets/controls","model_module_version":"2.0.0","model_name":"HTMLModel","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"2.0.0","_model_name":"HTMLModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"2.0.0","_view_name":"HTMLView","description":"","description_allow_html":false,"layout":"IPY_MODEL_a62cbb05de514749800302fab55a2c94","placeholder":" ","style":"IPY_MODEL_f1db74a5d91c423194d58d2c158da55a","tabbable":null,"tooltip":null,"value":" 744/744 [00:16&lt;00:00, 78.18it/s]"}},"61fc6559e0c34497af5e5b93f160ec0b":{"model_module":"@jupyter-widgets/base","model_module_version":"2.0.0","model_name":"LayoutModel","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"2.0.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"2.0.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border_bottom":null,"border_left":null,"border_right":null,"border_top":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"63767a54d9ea4fe0b2fe86ee735437f4":{"model_module":"@jupyter-widgets/controls","model_module_version":"2.0.0","model_name":"ProgressStyleModel","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"2.0.0","_model_name":"ProgressStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"2.0.0","_view_name":"StyleView","bar_color":null,"description_width":""}},"665dd35169be4711953025ca3d377099":{"model_module":"@jupyter-widgets/controls","model_module_version":"2.0.0","model_name":"HTMLStyleModel","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"2.0.0","_model_name":"HTMLStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"2.0.0","_view_name":"StyleView","background":null,"description_width":"","font_size":null,"text_color":null}},"68f40fe28d6a45a7b41cf52e946c200b":{"model_module":"@jupyter-widgets/base","model_module_version":"2.0.0","model_name":"LayoutModel","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"2.0.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"2.0.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border_bottom":null,"border_left":null,"border_right":null,"border_top":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"6b8241ce90a649778ba55672d171d93b":{"model_module":"@jupyter-widgets/base","model_module_version":"2.0.0","model_name":"LayoutModel","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"2.0.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"2.0.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border_bottom":null,"border_left":null,"border_right":null,"border_top":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"6f9f8c99e02343279bffebe3b5ead655":{"model_module":"@jupyter-widgets/controls","model_module_version":"2.0.0","model_name":"HTMLStyleModel","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"2.0.0","_model_name":"HTMLStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"2.0.0","_view_name":"StyleView","background":null,"description_width":"","font_size":null,"text_color":null}},"734fd5c1211c4520a33c7dc4a8f31137":{"model_module":"@jupyter-widgets/controls","model_module_version":"2.0.0","model_name":"HBoxModel","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"2.0.0","_model_name":"HBoxModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"2.0.0","_view_name":"HBoxView","box_style":"","children":["IPY_MODEL_a06e6feb36a6477b846c046575bb1871","IPY_MODEL_59910a6209e5491c8f0753f3a4e2901e","IPY_MODEL_5326e1ea69904561b4713ac607c880a2"],"layout":"IPY_MODEL_17a25f5f3f5949fdb11900195ad72cff","tabbable":null,"tooltip":null}},"7636029fcb8742f6877102a62f6c7133":{"model_module":"@jupyter-widgets/controls","model_module_version":"2.0.0","model_name":"ProgressStyleModel","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"2.0.0","_model_name":"ProgressStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"2.0.0","_view_name":"StyleView","bar_color":null,"description_width":""}},"777bc90758ec4d4aa4cb621f2c45904c":{"model_module":"@jupyter-widgets/base","model_module_version":"2.0.0","model_name":"LayoutModel","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"2.0.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"2.0.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border_bottom":null,"border_left":null,"border_right":null,"border_top":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"7933e90cbc7b4d899cbb12d0ad61a352":{"model_module":"@jupyter-widgets/controls","model_module_version":"2.0.0","model_name":"HTMLStyleModel","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"2.0.0","_model_name":"HTMLStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"2.0.0","_view_name":"StyleView","background":null,"description_width":"","font_size":null,"text_color":null}},"812000774351481a85d9176ef74cead2":{"model_module":"@jupyter-widgets/base","model_module_version":"2.0.0","model_name":"LayoutModel","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"2.0.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"2.0.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border_bottom":null,"border_left":null,"border_right":null,"border_top":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"85649aed3f0144fe8d734397106240df":{"model_module":"@jupyter-widgets/base","model_module_version":"2.0.0","model_name":"LayoutModel","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"2.0.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"2.0.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border_bottom":null,"border_left":null,"border_right":null,"border_top":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"8645739a3d0540959a6d6f210e63daaf":{"model_module":"@jupyter-widgets/controls","model_module_version":"2.0.0","model_name":"HTMLModel","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"2.0.0","_model_name":"HTMLModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"2.0.0","_view_name":"HTMLView","description":"","description_allow_html":false,"layout":"IPY_MODEL_6146c0b50c6248679d2ba938a54e9fbf","placeholder":" ","style":"IPY_MODEL_be7aa2b7d6b0469994adb73e17198140","tabbable":null,"tooltip":null,"value":" 751/751 [00:13&lt;00:00, 83.26it/s]"}},"8a5661b59eaa4626ac50bb723e764342":{"model_module":"@jupyter-widgets/controls","model_module_version":"2.0.0","model_name":"HBoxModel","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"2.0.0","_model_name":"HBoxModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"2.0.0","_view_name":"HBoxView","box_style":"","children":["IPY_MODEL_1357a7094e4d4b009ac956d9936b20b5","IPY_MODEL_8f70fde59fe942b388183779eddf8617","IPY_MODEL_61b7eb06516b4102a257f36e9fca134c"],"layout":"IPY_MODEL_a9fb16feb10b4ae68fbc6040f550e645","tabbable":null,"tooltip":null}},"8d40bbbcd32449d4839df86eeacc1773":{"model_module":"@jupyter-widgets/base","model_module_version":"2.0.0","model_name":"LayoutModel","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"2.0.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"2.0.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border_bottom":null,"border_left":null,"border_right":null,"border_top":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"8f70fde59fe942b388183779eddf8617":{"model_module":"@jupyter-widgets/controls","model_module_version":"2.0.0","model_name":"FloatProgressModel","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"2.0.0","_model_name":"FloatProgressModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"2.0.0","_view_name":"ProgressView","bar_style":"success","description":"","description_allow_html":false,"layout":"IPY_MODEL_61fc6559e0c34497af5e5b93f160ec0b","max":744,"min":0,"orientation":"horizontal","style":"IPY_MODEL_ee293451116242b2b91685f589c436d0","tabbable":null,"tooltip":null,"value":744}},"909615289e494104841e176840e79158":{"model_module":"@jupyter-widgets/controls","model_module_version":"2.0.0","model_name":"HTMLModel","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"2.0.0","_model_name":"HTMLModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"2.0.0","_view_name":"HTMLView","description":"","description_allow_html":false,"layout":"IPY_MODEL_19b7b9d06bf64a0f990535ae61a297e1","placeholder":" ","style":"IPY_MODEL_c34c805e087c47aa8ddb352f7f93aa3b","tabbable":null,"tooltip":null,"value":" 757/757 [00:12&lt;00:00, 87.02it/s]"}},"95e9c1cbcf3742d9a051dc7f8d44574b":{"model_module":"@jupyter-widgets/base","model_module_version":"2.0.0","model_name":"LayoutModel","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"2.0.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"2.0.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border_bottom":null,"border_left":null,"border_right":null,"border_top":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"9dd69c85da5c46fab11ce0e21aa11cc7":{"model_module":"@jupyter-widgets/controls","model_module_version":"2.0.0","model_name":"HTMLStyleModel","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"2.0.0","_model_name":"HTMLStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"2.0.0","_view_name":"StyleView","background":null,"description_width":"","font_size":null,"text_color":null}},"9e92aa780a12413293b5ab16f4a07190":{"model_module":"@jupyter-widgets/controls","model_module_version":"2.0.0","model_name":"FloatProgressModel","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"2.0.0","_model_name":"FloatProgressModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"2.0.0","_view_name":"ProgressView","bar_style":"success","description":"","description_allow_html":false,"layout":"IPY_MODEL_018b37bb762243dc915c6c3aa96164dd","max":747,"min":0,"orientation":"horizontal","style":"IPY_MODEL_565701564c97448fa3acf7c3faf82d20","tabbable":null,"tooltip":null,"value":747}},"9f5a5b59ea0843bda189593f7bff8f6c":{"model_module":"@jupyter-widgets/controls","model_module_version":"2.0.0","model_name":"HTMLStyleModel","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"2.0.0","_model_name":"HTMLStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"2.0.0","_view_name":"StyleView","background":null,"description_width":"","font_size":null,"text_color":null}},"a06e6feb36a6477b846c046575bb1871":{"model_module":"@jupyter-widgets/controls","model_module_version":"2.0.0","model_name":"HTMLModel","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"2.0.0","_model_name":"HTMLModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"2.0.0","_view_name":"HTMLView","description":"","description_allow_html":false,"layout":"IPY_MODEL_491b7dfe7cd64ef9a01e7bfa8d647696","placeholder":" ","style":"IPY_MODEL_0e8d2afd5659443994cadcd467d531a7","tabbable":null,"tooltip":null,"value":"100%"}},"a2369817fd7e455f97079c054d242eb3":{"model_module":"@jupyter-widgets/base","model_module_version":"2.0.0","model_name":"LayoutModel","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"2.0.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"2.0.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border_bottom":null,"border_left":null,"border_right":null,"border_top":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"a41c722d10414cfab9a2a7759d4f2db6":{"model_module":"@jupyter-widgets/base","model_module_version":"2.0.0","model_name":"LayoutModel","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"2.0.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"2.0.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border_bottom":null,"border_left":null,"border_right":null,"border_top":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"a62cbb05de514749800302fab55a2c94":{"model_module":"@jupyter-widgets/base","model_module_version":"2.0.0","model_name":"LayoutModel","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"2.0.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"2.0.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border_bottom":null,"border_left":null,"border_right":null,"border_top":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"a933fd08be5845e6b0f840fffeb46ad6":{"model_module":"@jupyter-widgets/base","model_module_version":"2.0.0","model_name":"LayoutModel","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"2.0.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"2.0.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border_bottom":null,"border_left":null,"border_right":null,"border_top":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"a9fb16feb10b4ae68fbc6040f550e645":{"model_module":"@jupyter-widgets/base","model_module_version":"2.0.0","model_name":"LayoutModel","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"2.0.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"2.0.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border_bottom":null,"border_left":null,"border_right":null,"border_top":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"aabffcf710c74e9b892796b824fc6438":{"model_module":"@jupyter-widgets/controls","model_module_version":"2.0.0","model_name":"HTMLStyleModel","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"2.0.0","_model_name":"HTMLStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"2.0.0","_view_name":"StyleView","background":null,"description_width":"","font_size":null,"text_color":null}},"ab7ac686c1194383bf57a671b8c1d4a0":{"model_module":"@jupyter-widgets/controls","model_module_version":"2.0.0","model_name":"HTMLStyleModel","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"2.0.0","_model_name":"HTMLStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"2.0.0","_view_name":"StyleView","background":null,"description_width":"","font_size":null,"text_color":null}},"ab9cb3d0b0d64c4695efb7cfbf9954c9":{"model_module":"@jupyter-widgets/controls","model_module_version":"2.0.0","model_name":"HTMLStyleModel","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"2.0.0","_model_name":"HTMLStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"2.0.0","_view_name":"StyleView","background":null,"description_width":"","font_size":null,"text_color":null}},"ae02282e9a34490f996274c9f80095c0":{"model_module":"@jupyter-widgets/base","model_module_version":"2.0.0","model_name":"LayoutModel","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"2.0.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"2.0.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border_bottom":null,"border_left":null,"border_right":null,"border_top":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"ae665f66025345908369ec2022e7da7f":{"model_module":"@jupyter-widgets/controls","model_module_version":"2.0.0","model_name":"HTMLStyleModel","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"2.0.0","_model_name":"HTMLStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"2.0.0","_view_name":"StyleView","background":null,"description_width":"","font_size":null,"text_color":null}},"b2ff4c260d2a45dc92e402ecbed0a404":{"model_module":"@jupyter-widgets/controls","model_module_version":"2.0.0","model_name":"HBoxModel","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"2.0.0","_model_name":"HBoxModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"2.0.0","_view_name":"HBoxView","box_style":"","children":["IPY_MODEL_ca8c529230d948e482f9425805a78164","IPY_MODEL_cb7d86cfba294a02af1746fa874731ab","IPY_MODEL_8645739a3d0540959a6d6f210e63daaf"],"layout":"IPY_MODEL_0bea6a426ef64624a4ceac8f59db5fb3","tabbable":null,"tooltip":null}},"b74a1c71428542c6bc7c106a766be829":{"model_module":"@jupyter-widgets/controls","model_module_version":"2.0.0","model_name":"HTMLStyleModel","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"2.0.0","_model_name":"HTMLStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"2.0.0","_view_name":"StyleView","background":null,"description_width":"","font_size":null,"text_color":null}},"b986f739677747efba39e21adc54d622":{"model_module":"@jupyter-widgets/controls","model_module_version":"2.0.0","model_name":"HTMLStyleModel","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"2.0.0","_model_name":"HTMLStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"2.0.0","_view_name":"StyleView","background":null,"description_width":"","font_size":null,"text_color":null}},"be7aa2b7d6b0469994adb73e17198140":{"model_module":"@jupyter-widgets/controls","model_module_version":"2.0.0","model_name":"HTMLStyleModel","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"2.0.0","_model_name":"HTMLStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"2.0.0","_view_name":"StyleView","background":null,"description_width":"","font_size":null,"text_color":null}},"bf8b84bd30614ca7bb14ddd540be7ca6":{"model_module":"@jupyter-widgets/controls","model_module_version":"2.0.0","model_name":"HBoxModel","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"2.0.0","_model_name":"HBoxModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"2.0.0","_view_name":"HBoxView","box_style":"","children":["IPY_MODEL_fdedf6fe511b4ac9893068ce0f648938","IPY_MODEL_d9c8aa5408834260b1b8968d29e79b68","IPY_MODEL_41eaf95a53b348489a633c5cc89a65e1"],"layout":"IPY_MODEL_fc3f7b9559ee4a0793a31ac458bc468c","tabbable":null,"tooltip":null}},"c02c83fc3fd84dca988dd5a2278f168a":{"model_module":"@jupyter-widgets/controls","model_module_version":"2.0.0","model_name":"ProgressStyleModel","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"2.0.0","_model_name":"ProgressStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"2.0.0","_view_name":"StyleView","bar_color":null,"description_width":""}},"c10042df764542cc884e9ef758522f8f":{"model_module":"@jupyter-widgets/controls","model_module_version":"2.0.0","model_name":"FloatProgressModel","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"2.0.0","_model_name":"FloatProgressModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"2.0.0","_view_name":"ProgressView","bar_style":"success","description":"","description_allow_html":false,"layout":"IPY_MODEL_29beb4dcd4694f47bfedbbd3e4df3d74","max":24069368,"min":0,"orientation":"horizontal","style":"IPY_MODEL_f94cad74427f4ea189871d76d6060d39","tabbable":null,"tooltip":null,"value":24069368}},"c34c805e087c47aa8ddb352f7f93aa3b":{"model_module":"@jupyter-widgets/controls","model_module_version":"2.0.0","model_name":"HTMLStyleModel","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"2.0.0","_model_name":"HTMLStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"2.0.0","_view_name":"StyleView","background":null,"description_width":"","font_size":null,"text_color":null}},"c52046b05fcc49dfa05083eb679f99a2":{"model_module":"@jupyter-widgets/base","model_module_version":"2.0.0","model_name":"LayoutModel","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"2.0.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"2.0.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border_bottom":null,"border_left":null,"border_right":null,"border_top":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"ca8c529230d948e482f9425805a78164":{"model_module":"@jupyter-widgets/controls","model_module_version":"2.0.0","model_name":"HTMLModel","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"2.0.0","_model_name":"HTMLModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"2.0.0","_view_name":"HTMLView","description":"","description_allow_html":false,"layout":"IPY_MODEL_6b8241ce90a649778ba55672d171d93b","placeholder":" ","style":"IPY_MODEL_665dd35169be4711953025ca3d377099","tabbable":null,"tooltip":null,"value":"100%"}},"cb7d86cfba294a02af1746fa874731ab":{"model_module":"@jupyter-widgets/controls","model_module_version":"2.0.0","model_name":"FloatProgressModel","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"2.0.0","_model_name":"FloatProgressModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"2.0.0","_view_name":"ProgressView","bar_style":"success","description":"","description_allow_html":false,"layout":"IPY_MODEL_68f40fe28d6a45a7b41cf52e946c200b","max":751,"min":0,"orientation":"horizontal","style":"IPY_MODEL_7636029fcb8742f6877102a62f6c7133","tabbable":null,"tooltip":null,"value":751}},"ccda5297be0d4e48808b13dd4d9adac2":{"model_module":"@jupyter-widgets/controls","model_module_version":"2.0.0","model_name":"HTMLModel","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"2.0.0","_model_name":"HTMLModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"2.0.0","_view_name":"HTMLView","description":"","description_allow_html":false,"layout":"IPY_MODEL_13241743b1a04315b6c5e2b7c8582940","placeholder":" ","style":"IPY_MODEL_b74a1c71428542c6bc7c106a766be829","tabbable":null,"tooltip":null,"value":" 20/20 [39:06&lt;00:00, 117.22s/it]"}},"d0144da51160499a8eaf14beff618ada":{"model_module":"@jupyter-widgets/base","model_module_version":"2.0.0","model_name":"LayoutModel","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"2.0.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"2.0.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border_bottom":null,"border_left":null,"border_right":null,"border_top":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"d4efd1b151b54bc7b050cff435ca20bb":{"model_module":"@jupyter-widgets/controls","model_module_version":"2.0.0","model_name":"FloatProgressModel","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"2.0.0","_model_name":"FloatProgressModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"2.0.0","_view_name":"ProgressView","bar_style":"success","description":"","description_allow_html":false,"layout":"IPY_MODEL_30b23d14f1da4383bb88bb30ebd4b4b9","max":20,"min":0,"orientation":"horizontal","style":"IPY_MODEL_4dc0e2a5e0a34c10b610d199288e0010","tabbable":null,"tooltip":null,"value":20}},"d9c8aa5408834260b1b8968d29e79b68":{"model_module":"@jupyter-widgets/controls","model_module_version":"2.0.0","model_name":"FloatProgressModel","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"2.0.0","_model_name":"FloatProgressModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"2.0.0","_view_name":"ProgressView","bar_style":"success","description":"","description_allow_html":false,"layout":"IPY_MODEL_812000774351481a85d9176ef74cead2","max":20,"min":0,"orientation":"horizontal","style":"IPY_MODEL_56c11c7fd03144f88617883562ae5fb2","tabbable":null,"tooltip":null,"value":20}},"dd17a2e6b0c14207b337e6cd39918e90":{"model_module":"@jupyter-widgets/controls","model_module_version":"2.0.0","model_name":"HTMLModel","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"2.0.0","_model_name":"HTMLModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"2.0.0","_view_name":"HTMLView","description":"","description_allow_html":false,"layout":"IPY_MODEL_d0144da51160499a8eaf14beff618ada","placeholder":" ","style":"IPY_MODEL_50603568095d44ce8cf3f0b2a28d6162","tabbable":null,"tooltip":null,"value":" 24.1M/24.1M [00:00&lt;00:00, 24.1MB/s]"}},"ddbd2b6d8bbe48d0b53e750b5748ab2a":{"model_module":"@jupyter-widgets/controls","model_module_version":"2.0.0","model_name":"HTMLModel","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"2.0.0","_model_name":"HTMLModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"2.0.0","_view_name":"HTMLView","description":"","description_allow_html":false,"layout":"IPY_MODEL_c52046b05fcc49dfa05083eb679f99a2","placeholder":" ","style":"IPY_MODEL_ae665f66025345908369ec2022e7da7f","tabbable":null,"tooltip":null,"value":"100%"}},"e55f1982157947e7967c5f5a89b217e2":{"model_module":"@jupyter-widgets/controls","model_module_version":"2.0.0","model_name":"HTMLStyleModel","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"2.0.0","_model_name":"HTMLStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"2.0.0","_view_name":"StyleView","background":null,"description_width":"","font_size":null,"text_color":null}},"e8845d646c184594bb72f8630d64e48b":{"model_module":"@jupyter-widgets/base","model_module_version":"2.0.0","model_name":"LayoutModel","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"2.0.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"2.0.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border_bottom":null,"border_left":null,"border_right":null,"border_top":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"ee293451116242b2b91685f589c436d0":{"model_module":"@jupyter-widgets/controls","model_module_version":"2.0.0","model_name":"ProgressStyleModel","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"2.0.0","_model_name":"ProgressStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"2.0.0","_view_name":"StyleView","bar_color":null,"description_width":""}},"ee3efe1c92b34f64a4962bccbd28562b":{"model_module":"@jupyter-widgets/controls","model_module_version":"2.0.0","model_name":"ProgressStyleModel","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"2.0.0","_model_name":"ProgressStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"2.0.0","_view_name":"StyleView","bar_color":null,"description_width":""}},"eef04e18511840349e1fbda270318ac7":{"model_module":"@jupyter-widgets/controls","model_module_version":"2.0.0","model_name":"HBoxModel","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"2.0.0","_model_name":"HBoxModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"2.0.0","_view_name":"HBoxView","box_style":"","children":["IPY_MODEL_56913c0a20694fcd98cb36518898c796","IPY_MODEL_9e92aa780a12413293b5ab16f4a07190","IPY_MODEL_2524432798aa464ca383fcd63e2609d3"],"layout":"IPY_MODEL_8d40bbbcd32449d4839df86eeacc1773","tabbable":null,"tooltip":null}},"f00d21a626f9492aa769cafeddd320fd":{"model_module":"@jupyter-widgets/base","model_module_version":"2.0.0","model_name":"LayoutModel","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"2.0.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"2.0.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border_bottom":null,"border_left":null,"border_right":null,"border_top":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"f1db74a5d91c423194d58d2c158da55a":{"model_module":"@jupyter-widgets/controls","model_module_version":"2.0.0","model_name":"HTMLStyleModel","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"2.0.0","_model_name":"HTMLStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"2.0.0","_view_name":"StyleView","background":null,"description_width":"","font_size":null,"text_color":null}},"f574ef43798b49ad97b9e1a5d5453c85":{"model_module":"@jupyter-widgets/base","model_module_version":"2.0.0","model_name":"LayoutModel","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"2.0.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"2.0.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border_bottom":null,"border_left":null,"border_right":null,"border_top":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"f60c01df9d1f4827923c8f3452bd40c2":{"model_module":"@jupyter-widgets/controls","model_module_version":"2.0.0","model_name":"HTMLStyleModel","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"2.0.0","_model_name":"HTMLStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"2.0.0","_view_name":"StyleView","background":null,"description_width":"","font_size":null,"text_color":null}},"f94cad74427f4ea189871d76d6060d39":{"model_module":"@jupyter-widgets/controls","model_module_version":"2.0.0","model_name":"ProgressStyleModel","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"2.0.0","_model_name":"ProgressStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"2.0.0","_view_name":"StyleView","bar_color":null,"description_width":""}},"fbadf742d4d841f083a2199ab13e1a11":{"model_module":"@jupyter-widgets/base","model_module_version":"2.0.0","model_name":"LayoutModel","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"2.0.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"2.0.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border_bottom":null,"border_left":null,"border_right":null,"border_top":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"fc3f7b9559ee4a0793a31ac458bc468c":{"model_module":"@jupyter-widgets/base","model_module_version":"2.0.0","model_name":"LayoutModel","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"2.0.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"2.0.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border_bottom":null,"border_left":null,"border_right":null,"border_top":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"fdedf6fe511b4ac9893068ce0f648938":{"model_module":"@jupyter-widgets/controls","model_module_version":"2.0.0","model_name":"HTMLModel","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"2.0.0","_model_name":"HTMLModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"2.0.0","_view_name":"HTMLView","description":"","description_allow_html":false,"layout":"IPY_MODEL_53542a5f4eb445bd86a1fa7c791c5e0a","placeholder":" ","style":"IPY_MODEL_aabffcf710c74e9b892796b824fc6438","tabbable":null,"tooltip":null,"value":"100%"}}},"version_major":2,"version_minor":0}}},"nbformat_minor":4,"nbformat":4,"cells":[{"id":"92bea12f-0045-489a-b3e4-18b736daecda","cell_type":"markdown","source":"## BirdCLEF+2026: HGNetV2-B0 Pretrain on Past BirdCLEFs\n\nPretrain HGNetV2-B0 + LSE Head on audio from past BirdCLEF competitions\n(2021/2023/2024/2025), filtered to the 234 species defined in the 2026 taxonomy.\nThe saved checkpoint is consumed by the fine-tuning notebook for warm-start.\n","metadata":{}},{"id":"c9ef142e","cell_type":"markdown","source":"### libraries","metadata":{"papermill":{"duration":0.015309,"end_time":"2026-05-25T00:59:48.059707+00:00","exception":false,"start_time":"2026-05-25T00:59:48.044398+00:00","status":"completed"},"tags":[]}},{"id":"0605e1d5","cell_type":"code","source":"!pip install -q openvino onnxsim onnxscript onnxruntime","metadata":{"_kg_hide-output":true,"execution":{"iopub.execute_input":"2026-05-25T00:59:48.092039Z","iopub.status.busy":"2026-05-25T00:59:48.091736Z","iopub.status.idle":"2026-05-25T00:59:57.947663Z","shell.execute_reply":"2026-05-25T00:59:57.946944Z"},"papermill":{"duration":9.874285,"end_time":"2026-05-25T00:59:57.949480+00:00","exception":false,"start_time":"2026-05-25T00:59:48.075195+00:00","status":"completed"},"tags":[]},"outputs":[],"execution_count":null},{"id":"cacca2ba","cell_type":"code","source":"RANDOM_SEED = 1086\n\nimport os\nos.environ['PYTHONHASHSEED'] = str(RANDOM_SEED)","metadata":{"execution":{"iopub.execute_input":"2026-05-25T00:59:57.986049Z","iopub.status.busy":"2026-05-25T00:59:57.985786Z","iopub.status.idle":"2026-05-25T00:59:57.990006Z","shell.execute_reply":"2026-05-25T00:59:57.989228Z"},"papermill":{"duration":0.023548,"end_time":"2026-05-25T00:59:57.991330+00:00","exception":false,"start_time":"2026-05-25T00:59:57.967782+00:00","status":"completed"},"tags":[]},"outputs":[],"execution_count":null},{"id":"7b9f7b20","cell_type":"code","source":"import ast\nimport gc\nimport copy\nimport math\nimport random\nimport warnings\nimport typing as tp\nfrom pathlib import Path\n\nfrom time import time\nfrom functools import wraps\nimport numpy as np\nimport pandas as pd\nfrom scipy.sparse import coo_matrix\n\nfrom tqdm.notebook import tqdm, trange\nfrom sklearn.metrics import roc_auc_score, log_loss\n\nimport wave\nimport soundfile\n\nimport timm\nimport torch\nimport torchaudio\nfrom torchvision.transforms import v2 as tvt_v2\n\nfrom torch import nn\nfrom torch.nn import functional as F\nfrom torch.utils.data import Dataset, DataLoader\nfrom torch.optim.lr_scheduler import OneCycleLR\nfrom torch.optim import AdamW\n\nimport joblib\nimport onnx, onnxsim\nimport openvino as ov","metadata":{"_kg_hide-output":true,"execution":{"iopub.execute_input":"2026-05-25T00:59:58.026350Z","iopub.status.busy":"2026-05-25T00:59:58.025607Z","iopub.status.idle":"2026-05-25T01:00:14.320455Z","shell.execute_reply":"2026-05-25T01:00:14.318741Z"},"papermill":{"duration":16.31521,"end_time":"2026-05-25T01:00:14.323259+00:00","exception":false,"start_time":"2026-05-25T00:59:58.008049+00:00","status":"completed"},"tags":[]},"outputs":[],"execution_count":null},{"id":"aaab6dd5","cell_type":"code","source":"device = torch.device(\"cuda:0\" if torch.cuda.is_available() else \"cpu\")","metadata":{"_kg_hide-output":true,"execution":{"iopub.execute_input":"2026-05-25T01:00:14.384616Z","iopub.status.busy":"2026-05-25T01:00:14.383231Z","iopub.status.idle":"2026-05-25T01:00:14.648893Z","shell.execute_reply":"2026-05-25T01:00:14.648011Z"},"papermill":{"duration":0.298281,"end_time":"2026-05-25T01:00:14.650432+00:00","exception":false,"start_time":"2026-05-25T01:00:14.352151+00:00","status":"completed"},"tags":[]},"outputs":[],"execution_count":null},{"id":"3cafb0f0-a154-4350-aca6-812f96f471c5","cell_type":"code","source":"ROOT = Path.cwd().parent\n\nINPUT = ROOT / \"input\"\nDATA = INPUT / \"competitions\" / \"birdclef-2026\"\nTRAIN_AUDIO = DATA / \"train_audio\"\nTRAIN_SS = DATA / \"train_soundscapes\"\nTEST_SS = DATA / \"test_soundscapes\"\n\nTRAIN_AUDIO_WAVS = [\n    INPUT / \"datasets\" / f\"ttahara/birdclef2026-train-audio-wav-{i:02}\"\n    for i in range(4)]\nPROC = ROOT / \"processed_data\"\nTRAIN_SS_SPLIT = PROC / \"train_soundscapes_split\"\nTRAIN_SS_SPLIT.mkdir(exist_ok=True, parents=True)\n\nN_FOLDS = 4\nN_SPECIES = 234\nN_CLASSES = 5\n\n# Past BirdCLEF competition roots (attach all four competitions on Kaggle UI).\n# IMPORTANT (filename schema per year):\n#   bc2021: filename column = \"<file>.ogg\" (no species prefix)\n#           -> need use_species_subdir=True (prepend primary_label)\n#   bc2023/2024/2025: filename column = \"<species>/<file>.ogg\" (already prefixed)\n#           -> use_species_subdir=False (do NOT prepend, otherwise double-prefix breaks Path.exists())\nPAST_COMPETITIONS = {\n    \"bc2021\": {\n        \"audio_dir\":          INPUT / \"competitions\" / \"birdclef-2021\" / \"train_short_audio\",\n        \"metadata_csv\":       INPUT / \"competitions\" / \"birdclef-2021\" / \"train_metadata.csv\",\n        \"label_col\":          \"primary_label\",\n        \"secondary_col\":      \"secondary_labels\",\n        \"filename_col\":       \"filename\",\n        \"use_species_subdir\": True,\n    },\n    \"bc2023\": {\n        \"audio_dir\":          INPUT / \"competitions\" / \"birdclef-2023\" / \"train_audio\",\n        \"metadata_csv\":       INPUT / \"competitions\" / \"birdclef-2023\" / \"train_metadata.csv\",\n        \"label_col\":          \"primary_label\",\n        \"secondary_col\":      \"secondary_labels\",\n        \"filename_col\":       \"filename\",\n        \"use_species_subdir\": False,\n    },\n    \"bc2024\": {\n        \"audio_dir\":          INPUT / \"competitions\" / \"birdclef-2024\" / \"train_audio\",\n        \"metadata_csv\":       INPUT / \"competitions\" / \"birdclef-2024\" / \"train_metadata.csv\",\n        \"label_col\":          \"primary_label\",\n        \"secondary_col\":      \"secondary_labels\",\n        \"filename_col\":       \"filename\",\n        \"use_species_subdir\": False,\n    },\n    \"bc2025\": {\n        \"audio_dir\":          INPUT / \"competitions\" / \"birdclef-2025\" / \"train_audio\",\n        \"metadata_csv\":       INPUT / \"competitions\" / \"birdclef-2025\" / \"train.csv\",\n        \"label_col\":          \"primary_label\",\n        \"secondary_col\":      \"secondary_labels\",\n        \"filename_col\":       \"filename\",\n        \"use_species_subdir\": False,\n    },\n}\n\n# Pretrain output dir (Kaggle: /kaggle/working)\nOUTPUT_DIR = Path.cwd() / \"pretrain_output\"\nOUTPUT_DIR.mkdir(exist_ok=True, parents=True)\n","metadata":{},"outputs":[],"execution_count":null},{"id":"35166378","cell_type":"code","source":"def set_random_seed(seed: int = 42, deterministic: bool = True):\n    \"\"\"Set seeds\"\"\"\n    os.environ[\"PYTHONHASHSEED\"] = str(seed)  # python\n    random.seed(seed)  # python\n    np.random.seed(seed)  # cpu\n    torch.manual_seed(seed)  # cpu\n    if torch.cuda.is_available():  # gpu\n        torch.cuda.manual_seed(seed)\n        torch.cuda.manual_seed_all(seed)\n    torch.backends.cudnn.deterministic = deterministic\n\nset_random_seed(RANDOM_SEED)","metadata":{"execution":{"iopub.execute_input":"2026-05-25T01:00:14.737602Z","iopub.status.busy":"2026-05-25T01:00:14.737014Z","iopub.status.idle":"2026-05-25T01:00:14.747941Z","shell.execute_reply":"2026-05-25T01:00:14.747156Z"},"papermill":{"duration":0.030444,"end_time":"2026-05-25T01:00:14.749396+00:00","exception":false,"start_time":"2026-05-25T01:00:14.718952+00:00","status":"completed"},"tags":[]},"outputs":[],"execution_count":null},{"id":"5dbb1555-612c-4127-ad5c-409c252d9d48","cell_type":"markdown","source":"### load taxonomy\n","metadata":{}},{"id":"aa67a746","cell_type":"code","source":"taxonomy = pd.read_csv(DATA / \"taxonomy.csv\")\n\nSPECIES = taxonomy.primary_label.values.tolist()\n\nlabel2idx = {label: idx for idx, label in enumerate(taxonomy.primary_label.values)}\nidx2label = {idx: label for label, idx in label2idx.items()}\n\nlabel2cls = {label: cls for label, cls in taxonomy[[\"primary_label\", \"class_name\"]].values}\n\nCLASSES = sorted(taxonomy[\"class_name\"].unique())\ncls2idx = {cls: idx for idx, cls in enumerate(CLASSES)}","metadata":{"execution":{"iopub.execute_input":"2026-05-25T01:00:15.062231Z","iopub.status.busy":"2026-05-25T01:00:15.061686Z","iopub.status.idle":"2026-05-25T01:00:15.080635Z","shell.execute_reply":"2026-05-25T01:00:15.079890Z"},"papermill":{"duration":0.038543,"end_time":"2026-05-25T01:00:15.082045+00:00","exception":false,"start_time":"2026-05-25T01:00:15.043502+00:00","status":"completed"},"tags":[]},"outputs":[],"execution_count":null},{"id":"04ccb2ac","cell_type":"code","source":"idxs_list_for_classes = [\n    taxonomy.query(\"class_name == @c\").index.values\n    for c in CLASSES\n]\nfor i in range(N_CLASSES):\n    print(f\"{CLASSES[i]}: {idxs_list_for_classes[i].shape[0]}\")","metadata":{"execution":{"iopub.execute_input":"2026-05-25T01:00:15.119148Z","iopub.status.busy":"2026-05-25T01:00:15.118640Z","iopub.status.idle":"2026-05-25T01:00:15.137050Z","shell.execute_reply":"2026-05-25T01:00:15.136169Z"},"papermill":{"duration":0.038533,"end_time":"2026-05-25T01:00:15.138503+00:00","exception":false,"start_time":"2026-05-25T01:00:15.099970+00:00","status":"completed"},"tags":[]},"outputs":[],"execution_count":null},{"id":"d977276a-22a6-4006-bc33-447676782871","cell_type":"markdown","source":"### prepare pretrain train dataframe (filtered to 2026 species)\n","metadata":{}},{"id":"27213f0c-273b-4919-b04a-53dc53a49559","cell_type":"code","source":"# pretrain uses primary label only (year-to-year secondary label reliability differs)\nSECONDARY_LABEL_CONFIDENCE = 1.0\n\nSPECIES_2026 = set(SPECIES)\nprint(f\"2026 species set size: {len(SPECIES_2026)}\")\n","metadata":{},"outputs":[],"execution_count":null},{"id":"8686df21-fc38-4e9d-b627-c6b1c449e2b2","cell_type":"code","source":"def load_past_birdclef(source_key, cfg, species_2026):\n    audio_dir = cfg[\"audio_dir\"]\n    csv_path  = cfg[\"metadata_csv\"]\n    if not csv_path.exists():\n        print(f\"[{source_key}] metadata csv not found: {csv_path} -- skipping\")\n        return None\n    df = pd.read_csv(csv_path)\n    n_raw = len(df)\n\n    # column normalisation (some years use ebird_code instead of primary_label)\n    if \"ebird_code\" in df.columns and \"primary_label\" not in df.columns:\n        df = df.rename(columns={\"ebird_code\": \"primary_label\"})\n\n    # filter to species present in the 2026 taxonomy\n    df = df[df[\"primary_label\"].isin(species_2026)].copy()\n    n_after_species = len(df)\n    if n_after_species == 0:\n        print(f\"[{source_key}] raw={n_raw} -> after species filter={n_after_species} -- skipping\")\n        return None\n\n    # build file_path\n    # NOTE: bc2023/2024/2025 store filename as \"<species>/<file>.ogg\" already,\n    # so use_species_subdir must be False for those years.\n    if cfg[\"use_species_subdir\"]:\n        df[\"file_path\"] = [\n            str(audio_dir / pl / fn)\n            for pl, fn in df[[\"primary_label\", cfg[\"filename_col\"]]].values\n        ]\n    else:\n        df[\"file_path\"] = [str(audio_dir / fn) for fn in df[cfg[\"filename_col\"]].values]\n\n    # diagnostic: show a sample path before the existence filter (one-shot)\n    sample_path = df[\"file_path\"].iloc[0]\n    print(f\"[{source_key}] sample path: {sample_path} (exists={Path(sample_path).exists()})\")\n\n    # drop rows whose audio file does not exist (safety against year-to-year layout drift)\n    df = df[df[\"file_path\"].apply(lambda p: Path(p).exists())].reset_index(drop=True)\n    n_after_exists = len(df)\n    print(f\"[{source_key}] raw={n_raw} -> species_filter={n_after_species} -> file_exists={n_after_exists}\")\n    if n_after_exists == 0:\n        return None\n\n    # labels: primary only (drop secondary across years for consistency)\n    df[\"labels\"] = df[\"primary_label\"]\n    df[\"audio_id\"] = (source_key + \"_\" + df[cfg[\"filename_col\"]].astype(str)\n                      ).str.replace(r\"\\.[^.]+$\", \"\", regex=True)\n    df[\"filename\"]     = df[cfg[\"filename_col\"]]\n    df[\"source\"]       = source_key\n    df[\"is_external\"]  = False\n    df[\"fold\"]         = -1\n    return df[[\"audio_id\", \"filename\", \"primary_label\", \"labels\",\n               \"file_path\", \"source\", \"is_external\", \"fold\"]]\n\n\n_past_dfs = []\nfor _src_key, _src_cfg in PAST_COMPETITIONS.items():\n    _sub = load_past_birdclef(_src_key, _src_cfg, SPECIES_2026)\n    if _sub is None or len(_sub) == 0:\n        continue\n    print(f\"[{_src_key}] {len(_sub)} files, {_sub['primary_label'].nunique()} species\")\n    _past_dfs.append(_sub)\nassert len(_past_dfs) > 0, \"no past BirdCLEF data loaded -- did you attach the competitions?\"\n\ntrain_df = pd.concat(_past_dfs, axis=0, ignore_index=True)\nprint(f\"[pretrain total] {len(train_df)} files, \"\n      f\"{train_df['primary_label'].nunique()} species, \"\n      f\"{train_df['source'].value_counts().to_dict()}\")\n","metadata":{},"outputs":[],"execution_count":null},{"id":"88a7e927","cell_type":"code","source":"labels_arr = np.zeros((len(train_df), len(label2idx)), dtype=np.float32)\n\ncls_arr = np.zeros((len(train_df), len(cls2idx)), dtype=np.float32)\n\n\nfor idx, (labels_str, primary) in enumerate(zip(train_df[\"labels\"].values, train_df[\"primary_label\"].values)):\n\n    for l in labels_str.split(\";\"):\n\n        conf = 1.0 if l == primary else SECONDARY_LABEL_CONFIDENCE\n\n        labels_arr[idx, label2idx[l]] = conf\n\n        cls_arr[idx, cls2idx[label2cls[l]]] = max(cls_arr[idx, cls2idx[label2cls[l]]], conf)","metadata":{"execution":{"iopub.execute_input":"2026-05-25T01:00:25.324577Z","iopub.status.busy":"2026-05-25T01:00:25.324021Z","iopub.status.idle":"2026-05-25T01:00:25.413459Z","shell.execute_reply":"2026-05-25T01:00:25.412852Z"},"papermill":{"duration":0.110759,"end_time":"2026-05-25T01:00:25.414912+00:00","exception":false,"start_time":"2026-05-25T01:00:25.304153+00:00","status":"completed"},"tags":[]},"outputs":[],"execution_count":null},{"id":"7545a78e","cell_type":"code","source":"print(train_df.shape)\nlabel_df = pd.DataFrame(\n    np.concat([labels_arr, cls_arr], axis=1),\n    columns=list(label2idx.keys()) + list(cls2idx.keys())\n)\ntrain_df = pd.concat([train_df, label_df], axis=1)\nprint(train_df.shape)","metadata":{"execution":{"iopub.execute_input":"2026-05-25T01:00:25.455114Z","iopub.status.busy":"2026-05-25T01:00:25.454729Z","iopub.status.idle":"2026-05-25T01:00:25.519236Z","shell.execute_reply":"2026-05-25T01:00:25.518340Z"},"papermill":{"duration":0.086266,"end_time":"2026-05-25T01:00:25.520944+00:00","exception":false,"start_time":"2026-05-25T01:00:25.434678+00:00","status":"completed"},"tags":[]},"outputs":[],"execution_count":null},{"id":"07e6c6f2","cell_type":"markdown","source":"## Training","metadata":{"papermill":{"duration":0.018132,"end_time":"2026-05-25T01:00:33.093631+00:00","exception":false,"start_time":"2026-05-25T01:00:33.075499+00:00","status":"completed"},"tags":[]}},{"id":"b619261e","cell_type":"markdown","source":"### definition","metadata":{"papermill":{"duration":0.017848,"end_time":"2026-05-25T01:00:33.129547+00:00","exception":false,"start_time":"2026-05-25T01:00:33.111699+00:00","status":"completed"},"tags":[]}},{"id":"b2b205d9","cell_type":"markdown","source":"#### dataset","metadata":{"papermill":{"duration":0.018021,"end_time":"2026-05-25T01:00:33.165516+00:00","exception":false,"start_time":"2026-05-25T01:00:33.147495+00:00","status":"completed"},"tags":[]}},{"id":"c840366e","cell_type":"code","source":"class BirdTrainDataset(Dataset):\n    \"\"\"\"\"\"\n\n    def __init__(self, paths, labels, sampling_rate=32_000, clip_sec=5,\n                 bg_noise_cache=None, bg_noise_cfg=None):\n        \"\"\"\"\"\"\n        self.paths = paths\n        self.labels = labels\n        self.sampling_rate = sampling_rate\n        self.clip_sec = clip_sec\n        self.bg_noise_cache = bg_noise_cache\n        self.bg_noise_cfg = bg_noise_cfg or {}\n\n    def __len__(self):\n        \"\"\"\"\"\"\n        return len(self.paths)\n\n    def __getitem__(self, idx):\n        path = self.paths[idx]\n        wave = self._load_audio_file(path)\n        if self.bg_noise_cache and random.random() < self.bg_noise_cfg.get(\"prob\", 0.0):\n            wave = self._mix_bg_noise(wave)\n        label = self.labels[idx].astype(np.float32)\n        return {\n            \"wave\": wave,\n            \"label\": label,\n        }\n\n    def _mix_bg_noise(self, wave):\n        \"\"\"add a random background noise clip at a randomly sampled SNR (dB).\"\"\"\n        noise = self.bg_noise_cache[random.randrange(len(self.bg_noise_cache))]\n        if len(noise) >= len(wave):\n            s = np.random.randint(len(noise) - len(wave) + 1)\n            noise = noise[s:s + len(wave)]\n        else:\n            reps = len(wave) // len(noise) + 1\n            noise = np.tile(noise, reps)[:len(wave)]\n        sig_rms = float(np.sqrt(np.mean(wave * wave) + 1e-10))\n        noise_rms = float(np.sqrt(np.mean(noise * noise) + 1e-10))\n        snr_db = np.random.uniform(\n            self.bg_noise_cfg[\"min_snr_db\"], self.bg_noise_cfg[\"max_snr_db\"])\n        target_noise_rms = sig_rms / (10 ** (snr_db / 20))\n        return (wave + noise * (target_noise_rms / noise_rms)).astype(np.float32)\n\n    def _load_audio_file(self, path):\n        \"\"\"\"\"\"\n        duration = int(self.sampling_rate * self.clip_sec)\n        with soundfile.SoundFile(path) as f:\n            n_frames = f.frames\n\n            if n_frames < duration:\n                # 0-padding\n                wave = np.zeros(duration, dtype=\"float32\")\n                start = np.random.randint(duration - n_frames + 1)\n                wave[start: start + n_frames] = f.read(dtype=\"float32\")\n            else:\n                # random cropping\n                start = np.random.randint(n_frames - duration + 1)\n                f.seek(start)\n                wave = f.read(frames=duration, dtype=\"float32\")\n\n        return wave\n\n\nclass BirdValidDataset(Dataset):\n    \"\"\"\"\"\"\n    \n    def __init__(self, paths, labels, sampling_rate=32_000, clip_sec=5):\n        \"\"\"\"\"\"\n        self.paths = paths\n        self.labels = labels\n        self.sampling_rate = sampling_rate\n        self.clip_sec = clip_sec\n\n    def __len__(self):\n        \"\"\"\"\"\"\n        return len(self.paths)\n\n    def __getitem__(self, idx):\n        path = self.paths[idx]\n        wave = self._load_audio_file(path)\n        label = self.labels[idx]\n\n        return {\n            \"wave\": wave,\n            \"label\": label.astype(np.float32),\n        }\n\n    def _load_audio_file(self, path):\n        \"\"\"\"\"\"\n        duration = int(self.sampling_rate * self.clip_sec)\n        \n        with soundfile.SoundFile(path) as f:\n            n_frames = f.frames\n\n            if n_frames < duration:\n                # 0-padding\n                wave = np.zeros(duration, dtype=\"float32\")\n                wave[:n_frames] = f.read(dtype=\"float32\")\n            else:\n                # head cropping\n                wave = f.read(frames=duration, dtype=\"float32\")\n        \n        return wave\n","metadata":{"execution":{"iopub.execute_input":"2026-05-25T01:00:33.203262Z","iopub.status.busy":"2026-05-25T01:00:33.203038Z","iopub.status.idle":"2026-05-25T01:00:33.215284Z","shell.execute_reply":"2026-05-25T01:00:33.214726Z"},"papermill":{"duration":0.032775,"end_time":"2026-05-25T01:00:33.216532+00:00","exception":false,"start_time":"2026-05-25T01:00:33.183757+00:00","status":"completed"},"tags":[]},"outputs":[],"execution_count":null},{"id":"c15b9953","cell_type":"markdown","source":"#### preprocessing","metadata":{"papermill":{"duration":0.018034,"end_time":"2026-05-25T01:00:33.252275+00:00","exception":false,"start_time":"2026-05-25T01:00:33.234241+00:00","status":"completed"},"tags":[]}},{"id":"38e3f99d","cell_type":"code","source":"class LogMelSpectrogramTransform(nn.Module):\n    \"\"\"\"\"\"\n    def __init__(\n        self,\n        mel_spectrogram_params: tp.Dict,\n        top_db: float,\n        lms_shape=tp.Tuple[int, int],\n    ):\n        \"\"\"\"\"\"\n        super().__init__()\n        self.mel_transform = torchaudio.transforms.MelSpectrogram(**mel_spectrogram_params)\n        self.db = torchaudio.transforms.AmplitudeToDB(stype=\"power\", top_db=top_db)\n        self.resize = tvt_v2.Resize(size=lms_shape)\n\n    @torch.no_grad()\n    def forward(self, wave):\n        \"\"\"\n        wave: (B, sampling_rate * clip_sec)\n        \"\"\"\n        mel_spec = self.mel_transform(wave)\n        lms = self.db(mel_spec)  # shape: (B, n_mels, time)\n        lms = self.resize(lms)   # shape: (B, *(lms_shape))\n        \n        batch_size = lms.shape[0]\n        lms_flat = lms.reshape(batch_size, -1)\n        lms_min = lms_flat.min(dim=1)[0][:, None, None]\n        lms_max = lms_flat.max(dim=1)[0][:, None, None]\n        lms = (lms - lms_min) / (lms_max - lms_min + 1e-7)\n\n        return lms[:, None, :, :]","metadata":{"execution":{"iopub.execute_input":"2026-05-25T01:00:33.289093Z","iopub.status.busy":"2026-05-25T01:00:33.288875Z","iopub.status.idle":"2026-05-25T01:00:33.295024Z","shell.execute_reply":"2026-05-25T01:00:33.294363Z"},"papermill":{"duration":0.026184,"end_time":"2026-05-25T01:00:33.296330+00:00","exception":false,"start_time":"2026-05-25T01:00:33.270146+00:00","status":"completed"},"tags":[]},"outputs":[],"execution_count":null},{"id":"b0fcead8","cell_type":"code","source":"class MixUp(nn.Module):\n    \"\"\"mixup for Log Mel Spectrogram\"\"\"\n    \n    def __init__(self, alpha=0.5, theta=1):\n        \"\"\"\"\"\"\n        super().__init__()\n        self.beta_dist = torch.distributions.beta.Beta(alpha, alpha)\n        self.theta = theta\n\n    @torch.no_grad()\n    def forward(self, lms, label):\n        \"\"\"\n        lms  : (B, C, Freq, Time)\n        label: (B, N_CLS) \n        \"\"\"\n        batch_size = lms.shape[0]\n        device = lms.device\n        \n        lambda_tensor = self.beta_dist.sample(sample_shape=(batch_size,)).to(device)\n        lambda_tensor = torch.maximum(lambda_tensor, 1 - lambda_tensor).float()\n        \n        shuffle_idxs = torch.randperm(batch_size).to(device)\n\n        lms_lambda = lambda_tensor[:, None, None, None]\n        lms = lms_lambda * lms + (1 - lms_lambda) * lms[shuffle_idxs]\n\n        label_lambda = lambda_tensor[..., None]\n        label = label_lambda * label + (1 - label_lambda) * label[shuffle_idxs]\n        label[label >= self.theta] = 1\n        \n        return lms, label\n\ndef dummy_mixup(lms, label):\n    return lms, label","metadata":{"execution":{"iopub.execute_input":"2026-05-25T01:00:33.334776Z","iopub.status.busy":"2026-05-25T01:00:33.334552Z","iopub.status.idle":"2026-05-25T01:00:33.340968Z","shell.execute_reply":"2026-05-25T01:00:33.340221Z"},"papermill":{"duration":0.027683,"end_time":"2026-05-25T01:00:33.342511+00:00","exception":false,"start_time":"2026-05-25T01:00:33.314828+00:00","status":"completed"},"tags":[]},"outputs":[],"execution_count":null},{"id":"656e0fb4","cell_type":"code","source":"class SpecAugment(nn.Module):\n    \"\"\"frequency/time masking applied to log-mel spectrogram (training only).\"\"\"\n    def __init__(self, freq_mask_param=32, time_mask_param=32,\n                 n_freq_masks=2, n_time_masks=2):\n        super().__init__()\n        self.freq_masks = nn.ModuleList([\n            torchaudio.transforms.FrequencyMasking(freq_mask_param=freq_mask_param)\n            for _ in range(n_freq_masks)\n        ])\n        self.time_masks = nn.ModuleList([\n            torchaudio.transforms.TimeMasking(time_mask_param=time_mask_param)\n            for _ in range(n_time_masks)\n        ])\n\n    @torch.no_grad()\n    def forward(self, lms):\n        for m in self.freq_masks:\n            lms = m(lms)\n        for m in self.time_masks:\n            lms = m(lms)\n        return lms\n","metadata":{"execution":{"iopub.execute_input":"2026-05-25T01:00:33.381241Z","iopub.status.busy":"2026-05-25T01:00:33.380861Z","iopub.status.idle":"2026-05-25T01:00:33.386104Z","shell.execute_reply":"2026-05-25T01:00:33.385338Z"},"papermill":{"duration":0.026367,"end_time":"2026-05-25T01:00:33.387569+00:00","exception":false,"start_time":"2026-05-25T01:00:33.361202+00:00","status":"completed"},"tags":[]},"outputs":[],"execution_count":null},{"id":"a14d8d88","cell_type":"markdown","source":"#### model","metadata":{"papermill":{"duration":0.018595,"end_time":"2026-05-25T01:00:33.424963+00:00","exception":false,"start_time":"2026-05-25T01:00:33.406368+00:00","status":"completed"},"tags":[]}},{"id":"3e626a9b","cell_type":"code","source":"class GeMPooling(nn.Module):\n    \"\"\"\"\"\"\n    def __init__(self, init_p=3.0, mean_axis=(1, 2), eps=1e-6):\n        \"\"\"\"\"\"\n        super().__init__()\n        self.p = nn.Parameter(torch.tensor(init_p))\n        self.mean_axis = mean_axis\n        self.eps = eps\n    \n    def forward(self, h):\n        \"\"\"\n        h: shape=(B, C, H, W)\n        \"\"\"\n        p = self.p.clip(min=1.0)\n        h = h.clip(min=self.eps).pow(self.p)\n        h = h.mean(dim=self.mean_axis)\n        h = h.pow(1.0 / self.p)\n        return h\n\n\nclass AttnSEDHead(nn.Module):\n    \"\"\"\"\"\"\n    \n    def __init__(self, num_features, num_classes, dropout=0.1):\n        \"\"\"\"\"\"\n        super().__init__()\n        self.pre_fc = nn.Sequential(\n            nn.Linear(num_features, num_features),\n            nn.ReLU(inplace=True), nn.Dropout(dropout),\n        )\n        self.att_fc = nn.Linear(num_features, num_classes)\n        self.cls_fc = nn.Linear(num_features, num_classes)\n\n    def forward(self, h):\n        \"\"\"\n        h: (B, C, Time)\n        \"\"\"\n        h = h.permute(0, 2, 1)  # (B, Time, C)\n        h = self.pre_fc(h)      # (B, Time, C)\n        att_w = torch.tanh(self.att_fc(h))  # (B, Time, N_CLS)\n        att_w = F.softmax(att_w, dim=1)     # (B, Time, N_CLS)\n        timewise_logits = self.cls_fc(h)    # (B, Time, N_CLS)\n        logits = (att_w * timewise_logits).sum(dim=1)  # (B, N_CLS)\n        return logits, timewise_logits\n\nclass AttnSEDModel(nn.Module):\n    \"\"\"\"\"\"\n    def __init__(\n        self,\n        model_name: str, pretrained: bool, drop_path_rate: float = 0.0,\n        head_dropout: float = 0.1, num_classes: int = 234, \n    ):\n        \"\"\"\"\"\"\n        super().__init__()\n        self.backbone = timm.create_model(\n            model_name, pretrained=pretrained, in_chans=1,\n            global_pool=\"\", num_classes=0, drop_path_rate=drop_path_rate)\n\n        # Some backbone's num_features don't match its output\n        dummy_input = torch.randn(1, 1, 256, 256)\n        with torch.no_grad():\n            dummy_output = self.backbone(dummy_input)\n        num_features = dummy_output.shape[1]\n        print(f\"num_features: {self.backbone.num_features}, dummy_output's dim: {num_features}\")\n        self.gem_pool = GeMPooling(mean_axis=2)\n        self.head = AttnSEDHead(num_features, num_classes, head_dropout)\n\n    def forward_for_training(self, x):\n        \"\"\"\"\"\"\n        h = self.backbone(x)  # (B, C, Freq, Time)\n        h = self.gem_pool(h)  # (B, C, Time)\n        logits, timewise_logits = self.head(h)  # (B, N_CLS), (B, N_CLS, Freq' * Time')\n        return logits, timewise_logits\n    \n    def forward(self, x):\n        \"\"\"\"\"\"\n        logits, _ = self.forward_for_training(x)\n        \n        return logits","metadata":{"_kg_hide-input":true,"execution":{"iopub.execute_input":"2026-05-25T01:00:33.463176Z","iopub.status.busy":"2026-05-25T01:00:33.462760Z","iopub.status.idle":"2026-05-25T01:00:33.473866Z","shell.execute_reply":"2026-05-25T01:00:33.473021Z"},"jupyter":{"source_hidden":true},"papermill":{"duration":0.031805,"end_time":"2026-05-25T01:00:33.475305+00:00","exception":false,"start_time":"2026-05-25T01:00:33.443500+00:00","status":"completed"},"tags":[]},"outputs":[],"execution_count":null},{"id":"b3cc2b9c","cell_type":"code","source":"class LSEPooling(nn.Module):\n    \"\"\"\"\"\"\n    def __init__(\n        self,\n        pool_axis  : int   = 1,\n        temperature: float = 1.0,\n        trainable  : bool  = False, \n    ):\n        \"\"\"\"\"\"\n        super().__init__()\n        self.pool_axis = pool_axis\n        log_T = torch.tensor(math.log(1.0))\n        if trainable:\n            self.log_T = nn.Parameter(log_T)\n        else:\n            self.register_buffer(\"log_T\", log_T)\n        \n\n    def forward(self, h: torch.FloatTensor):\n        \"\"\"\n        h: (B, L, C) or (B, C, L)\n        \"\"\"\n        deno = h.shape[self.pool_axis]\n        T = torch.exp(self.log_T)\n        h_pool = T * (   # (B, C)\n            torch.logsumexp(h / T, axis=self.pool_axis)\n            - math.log(deno))\n        return h_pool\n\n\nclass LSEHead(nn.Module):\n    \"\"\"\"\"\"\n    \n    def __init__(\n        self,\n        num_features    : int,\n        num_classes     : int,\n        dropout         : float = 0.2,\n        is_lse_trainable: bool = False,\n    ):\n        \"\"\"\"\"\"\n        super().__init__()\n        self.cls_fc = nn.Sequential(\n            nn.Dropout(dropout),\n            nn.Linear(num_features, num_features), nn.ReLU(inplace=True),\n            nn.Dropout(dropout),\n            nn.Linear(num_features, num_classes),\n        )\n        self.lse_pool = LSEPooling(pool_axis=1, trainable=is_lse_trainable)\n\n    def forward(self, h):\n        \"\"\"\n        h : (B, C, Freq, Time)\n        \"\"\"\n        h = h.mean(axis=2)                 # (B, C, Time)\n        h = h.transpose(1, 2)              # (B, Time, C)\n        tw_logits = self.cls_fc(h)         # (B, Time, N_CLS)\n        logits = self.lse_pool(tw_logits)  # (B, N_CLS)\n\n        return logits\n\n\nclass LSEModel(nn.Module):\n    \"\"\"\"\"\"\n    def __init__(\n        self,\n        model_name      : str,\n        pretrained      : bool,\n        drop_path_rate  : float,\n        num_classes     : int,\n        head_dropout    : float = 0.0,\n        is_lse_trainable: bool = False,\n    ):\n        \"\"\"\"\"\"\n        super().__init__()\n        self.backbone = timm.create_model(\n            model_name, pretrained=pretrained, in_chans=1,\n            global_pool=\"\", num_classes=0, drop_path_rate=drop_path_rate)\n\n        # Some backbone's num_features don't match its output\n        dummy_input = torch.randn(1, 1, 256, 256)\n        self.backbone.eval()\n        with torch.no_grad():\n            dummy_output = self.backbone(dummy_input)\n        self.backbone.train()\n        num_features = dummy_output.shape[1]\n        self.head = LSEHead(\n            num_features, num_classes, head_dropout, is_lse_trainable)\n\n    def forward(self, x):\n        h = self.backbone(x)   # (B, C, Freq, Time)\n        logits = self.head(h)  # (B, N_CLS)\n        return logits","metadata":{"execution":{"iopub.execute_input":"2026-05-25T01:00:33.513591Z","iopub.status.busy":"2026-05-25T01:00:33.513305Z","iopub.status.idle":"2026-05-25T01:00:33.523127Z","shell.execute_reply":"2026-05-25T01:00:33.522390Z"},"papermill":{"duration":0.031107,"end_time":"2026-05-25T01:00:33.524692+00:00","exception":false,"start_time":"2026-05-25T01:00:33.493585+00:00","status":"completed"},"tags":[]},"outputs":[],"execution_count":null},{"id":"2e9ae276","cell_type":"markdown","source":"#### utility","metadata":{"papermill":{"duration":0.01866,"end_time":"2026-05-25T01:00:33.562001+00:00","exception":false,"start_time":"2026-05-25T01:00:33.543341+00:00","status":"completed"},"tags":[]}},{"id":"b555ef19","cell_type":"code","source":"def to_device(\n    tensors: tp.Union[tp.Tuple[torch.Tensor], tp.Dict[str, torch.Tensor]],\n    device: torch.device, *args, **kwargs\n):\n    if isinstance(tensors, tuple):\n        return (t.to(device, *args, **kwargs) for t in tensors)\n    elif isinstance(tensors, dict):\n        return {\n            k: t.to(device, *args, **kwargs) for k, t in tensors.items()}\n    else:\n        return tensors.to(device, *args, **kwargs)","metadata":{"execution":{"iopub.execute_input":"2026-05-25T01:00:33.600299Z","iopub.status.busy":"2026-05-25T01:00:33.600096Z","iopub.status.idle":"2026-05-25T01:00:33.604787Z","shell.execute_reply":"2026-05-25T01:00:33.604067Z"},"papermill":{"duration":0.024576,"end_time":"2026-05-25T01:00:33.606146+00:00","exception":false,"start_time":"2026-05-25T01:00:33.581570+00:00","status":"completed"},"tags":[]},"outputs":[],"execution_count":null},{"id":"5cc40ba5-9326-432b-a665-564a194663bd","cell_type":"code","source":"def get_data_loader_pretrain(train_df, device=None):\n    # pretrain: use all rows for training, no validation split\n    trn_idxs = train_df.index.values\n\n    # oversample minority classes so each has >= CFG.min_samples_per_class samples\n    _trn_real = train_df[train_df[\"primary_label\"] != CFG.nocall_label_token]\n    _extra = []\n    for _label, _grp in _trn_real.groupby(\"primary_label\"):\n        _n = len(_grp)\n        if _n < CFG.min_samples_per_class:\n            _needed = CFG.min_samples_per_class - _n\n            _extra.append(np.random.choice(_grp.index.values, size=_needed, replace=True))\n    if _extra:\n        trn_idxs = np.concatenate([trn_idxs] + _extra)\n        np.random.shuffle(trn_idxs)\n\n    file_paths = train_df[\"file_path\"].values.tolist()\n    labels_arr = train_df[SPECIES].values\n\n    trn_paths  = [file_paths[idx] for idx in trn_idxs]\n    trn_labels = [labels_arr[idx] for idx in trn_idxs]\n\n    trn_dataset = BirdTrainDataset(\n        trn_paths, trn_labels,\n        bg_noise_cache=BG_NOISE_CACHE if CFG.use_bg_noise else None,\n        bg_noise_cfg=CFG.bg_noise,\n    )\n\n    trn_loader = DataLoader(\n        trn_dataset,\n        batch_size=CFG.batch_size, shuffle=True, drop_last=True,\n        num_workers=16, pin_memory=True, prefetch_factor=2)\n\n    return trn_loader\n","metadata":{},"outputs":[],"execution_count":null},{"id":"99562748","cell_type":"markdown","source":"### run training","metadata":{"papermill":{"duration":0.019256,"end_time":"2026-05-25T01:00:33.691957+00:00","exception":false,"start_time":"2026-05-25T01:00:33.672701+00:00","status":"completed"},"tags":[]}},{"id":"e827ffb6-dd5c-4574-b008-60121eba4f60","cell_type":"code","source":"class CFG:\n    # pretrain schedule: shorter than fine-tune (10 vs 20 epochs)\n    max_epoch     = 10\n    warmup_epoch  = 2\n    batch_size    = 64\n    lr            = 5.0e-04\n    init_lr       = 2.0e-05\n    final_lr      = 1.0e-04\n    weight_decay  = 1.0e-04\n\n    # model (identical to fine-tune for full state_dict warm-start)\n    model_name       = \"hgnetv2_b0.ssld_stage2_ft_in1k\"\n    pretrained       = True\n    drop_path_rate   = 0.0\n    head_dropout     = 0.3\n    is_lse_trainable = True\n\n    # log mel spectrogram transform (same as fine-tune)\n    mel_spectrogram_params = dict(\n        sample_rate= 32_000,\n        n_fft       = 2048,\n        win_length  = 626,\n        hop_length  = 313,\n        f_min       = 20,\n        n_mels      = 256,\n        power       = 2.0,\n        center      = True,\n        pad_mode    = \"reflect\",\n        norm        = \"slaney\",\n        mel_scale   = 'htk',\n    )\n    lms_shape = (256, 256)\n    top_db    = 80.0\n\n    # augmentation (same as fine-tune)\n    mixup   = dict(alpha=1.0, theta=0.8)\n    use_amp = True\n\n    use_specaug = True\n    specaug = dict(\n        freq_mask_param = 32,\n        time_mask_param = 32,\n        n_freq_masks    = 2,\n        n_time_masks    = 2,\n    )\n\n    use_ema    = True\n    ema_params = dict(\n        decay        = 0.999,\n        use_warmup   = True,\n        warmup_gamma = 1.0,\n        warmup_power = 2 / 3,\n    )\n\n    # secondary label confidence (pretrain uses primary only; kept for label-build cell compat)\n    secondary_label_confidence = 1.0\n\n    # pretrain disables perch cleansing / external / nocall\n    use_perch_cleansing       = False\n    perch_score_min           = 7.80\n    perch_min_files_per_class = 5\n\n    # oversampling (kept to compensate rare species)\n    min_samples_per_class = 50\n\n    # background-noise augmentation (same as fine-tune)\n    use_bg_noise = True\n    noise_dir = str(INPUT / \"datasets\" / \"christofhenkel\" / \"birdclef2021-background-noise\")\n    bg_noise = dict(prob=0.5, min_snr_db=3.0, max_snr_db=30.0)\n    bg_noise_max_files = 0  # 0 = no cap\n\n    # nocall samples disabled for pretrain\n    add_nocall_samples = False\n    nocall_num_samples = 0\n    nocall_label_token = \"__nocall__\"\n","metadata":{},"outputs":[],"execution_count":null},{"id":"56470507","cell_type":"code","source":"# ---- build BG noise cache (RAM, float32) ----\n# Each clip is normalised to 5 seconds (sample_rate * 5) and kept in memory so\n# the per-batch mix step in BirdTrainDataset only does numpy ops, not disk I/O.\nBG_NOISE_PATHS = []\nBG_NOISE_CACHE = []\nif CFG.use_bg_noise:\n    _noise_dir = Path(CFG.noise_dir)\n    if _noise_dir.is_dir():\n        _paths = sorted(_noise_dir.rglob(\"*.ogg\"))\n        if CFG.bg_noise_max_files > 0:\n            _paths = _paths[:CFG.bg_noise_max_files]\n        BG_NOISE_PATHS = _paths\n        _target_len = int(CFG.mel_spectrogram_params[\"sample_rate\"] * 5)\n        for _p in BG_NOISE_PATHS:\n            with soundfile.SoundFile(str(_p)) as _f:\n                _n = _f.frames\n                if _n > _target_len:\n                    _s = np.random.randint(_n - _target_len + 1)\n                    _f.seek(_s)\n                    _w = _f.read(frames=_target_len, dtype=\"float32\")\n                else:\n                    _w = _f.read(dtype=\"float32\")\n                    if len(_w) < _target_len:\n                        _reps = _target_len // max(len(_w), 1) + 1\n                        _w = np.tile(_w, _reps)[:_target_len]\n            BG_NOISE_CACHE.append(_w.astype(np.float32))\n        print(\n            f\"[BG noise] loaded {len(BG_NOISE_CACHE)} clips, \"\n            f\"approx {sum(c.nbytes for c in BG_NOISE_CACHE) / 1e6:.1f} MB\"\n        )\n    else:\n        print(f\"[BG noise] noise_dir not found: {_noise_dir} -- disabling\")\n        CFG.use_bg_noise = False\n","metadata":{"execution":{"iopub.execute_input":"2026-05-25T01:00:33.774678Z","iopub.status.busy":"2026-05-25T01:00:33.774467Z","iopub.status.idle":"2026-05-25T01:00:33.781619Z","shell.execute_reply":"2026-05-25T01:00:33.780742Z"},"papermill":{"duration":0.027236,"end_time":"2026-05-25T01:00:33.782993+00:00","exception":false,"start_time":"2026-05-25T01:00:33.755757+00:00","status":"completed"},"tags":[]},"outputs":[],"execution_count":null},{"id":"ffc0f8c4","cell_type":"code","source":"torch.cuda.empty_cache()\ntorch.cuda.reset_peak_memory_stats()\ngc.collect()","metadata":{"execution":{"iopub.execute_input":"2026-05-25T01:00:33.865617Z","iopub.status.busy":"2026-05-25T01:00:33.865184Z","iopub.status.idle":"2026-05-25T01:00:34.119048Z","shell.execute_reply":"2026-05-25T01:00:34.118309Z"},"papermill":{"duration":0.274124,"end_time":"2026-05-25T01:00:34.120467+00:00","exception":false,"start_time":"2026-05-25T01:00:33.846343+00:00","status":"completed"},"tags":[]},"outputs":[],"execution_count":null},{"id":"36712835-b2d0-4875-a44e-3fbe35abf2b6","cell_type":"code","source":"def train_pretrain(train_df, device, output_dir):\n    output_dir.mkdir(exist_ok=True, parents=True)\n\n    print(f\"[pretrain] total rows: {len(train_df)}\")\n    set_random_seed(RANDOM_SEED)\n    trn_loader = get_data_loader_pretrain(train_df, device)\n\n    lms_transform = LogMelSpectrogramTransform(\n        CFG.mel_spectrogram_params, CFG.top_db, CFG.lms_shape).eval().to(device)\n    mixup = MixUp(**CFG.mixup)\n    specaug = SpecAugment(**CFG.specaug).to(device) if CFG.use_specaug else None\n    model = LSEModel(\n        CFG.model_name, CFG.pretrained, drop_path_rate=CFG.drop_path_rate,\n        num_classes=N_SPECIES, head_dropout=CFG.head_dropout, is_lse_trainable=CFG.is_lse_trainable)\n    model = model.to(device)\n\n    if CFG.use_ema:\n        model_ema = timm.utils.ModelEmaV3(model, **CFG.ema_params)\n\n    optimizer = torch.optim.AdamW(\n        params=model.parameters(), lr=CFG.lr, weight_decay=CFG.weight_decay)\n    optimizer.zero_grad()\n    scheduler = OneCycleLR(\n        optimizer=optimizer, epochs=CFG.max_epoch,\n        pct_start=CFG.warmup_epoch / CFG.max_epoch,\n        max_lr=CFG.lr, div_factor=CFG.lr / CFG.init_lr,\n        final_div_factor=CFG.init_lr / CFG.final_lr,\n        steps_per_epoch=len(trn_loader),\n    )\n\n    loss_func = nn.BCEWithLogitsLoss().to(device)\n    grad_scaler = torch.GradScaler(enabled=CFG.use_amp)\n\n    result_list = []\n    for epoch in trange(CFG.max_epoch):\n        epoch_start = time()\n        trn_loss = 0.0\n        tmp_mixup = mixup if epoch >= CFG.warmup_epoch else dummy_mixup\n        model = model.train()\n        for batch in trn_loader:\n            batch = to_device(batch, device, non_blocking=True)\n            wave, label = batch[\"wave\"], batch[\"label\"]\n            lms = lms_transform(wave)\n            if specaug is not None:\n                lms = specaug(lms)\n            lms, label = tmp_mixup(lms, label)\n\n            with torch.autocast(device.type, enabled=grad_scaler.is_enabled()):\n                logits = model(lms.detach())\n                loss = loss_func(logits, label)\n\n            grad_scaler.scale(loss).backward()\n            grad_scaler.step(optimizer)\n            grad_scaler.update()\n            optimizer.zero_grad()\n            scheduler.step()\n            if CFG.use_ema:\n                model_ema.update(model)\n\n            trn_loss += loss.item()\n            del batch, wave, label, lms, logits, loss\n\n        trn_loss /= len(trn_loader)\n        epoch_end = time()\n        cur_lr = scheduler.get_last_lr()[0]\n        result_list.append([epoch, cur_lr, trn_loss, epoch_end - epoch_start])\n        print(\"[epoch {}] lr={:.6f}, trn_loss={:.5f}, elapsed={:.2f}\".format(*result_list[-1]))\n\n        # save checkpoint each epoch (overwrite) so a crash mid-training keeps the latest\n        ema_state = (model_ema.module if CFG.use_ema else model).state_dict()\n        ckpt = {\n            \"model_state_dict\":     {k: v.detach().cpu() for k, v in ema_state.items()},\n            \"raw_model_state_dict\": {k: v.detach().cpu() for k, v in model.state_dict().items()},\n            \"epoch\":                epoch,\n            \"n_species\":            N_SPECIES,\n            \"cfg_repr\":             repr({k: getattr(CFG, k) for k in dir(CFG)\n                                          if not k.startswith(\"_\") and not callable(getattr(CFG, k))}),\n        }\n        torch.save(ckpt, output_dir / \"hgnetv2_b0_pretrained.pth\")\n\n    result_df = pd.DataFrame(\n        result_list, columns=[\"epoch\", \"lr\", \"trn_loss\", \"elapsed_time\"])\n    result_df.to_csv(output_dir / \"pretrain_result_df.csv\", index=False)\n    print(f\"[pretrain] done. checkpoint -> {output_dir / 'hgnetv2_b0_pretrained.pth'}\")\n","metadata":{},"outputs":[],"execution_count":null},{"id":"159236be","cell_type":"code","source":"warnings.simplefilter(\"ignore\", UserWarning)","metadata":{"execution":{"iopub.execute_input":"2026-05-25T01:00:34.211871Z","iopub.status.busy":"2026-05-25T01:00:34.211405Z","iopub.status.idle":"2026-05-25T01:00:34.214648Z","shell.execute_reply":"2026-05-25T01:00:34.214097Z"},"papermill":{"duration":0.023422,"end_time":"2026-05-25T01:00:34.216040+00:00","exception":false,"start_time":"2026-05-25T01:00:34.192618+00:00","status":"completed"},"tags":[]},"outputs":[],"execution_count":null},{"id":"ac845271-15fa-4dc4-be10-d9c703a76b72","cell_type":"code","source":"print(list(filter(lambda x: x[0][:2] != \"__\", CFG.__dict__.items())))\ntrain_pretrain(train_df, device, OUTPUT_DIR)\n","metadata":{},"outputs":[],"execution_count":null},{"id":"b506ff11-b788-4daf-aa01-57706a455599","cell_type":"markdown","source":"## EOF\n","metadata":{}}]}