{"cells":[{"cell_type":"code","source":["!pip install wandb onnx onnxruntime -q\n","!sudo apt-get install texlive-latex-recommended \n","!sudo apt-get install dvipng texlive-latex-extra texlive-fonts-recommended \n","!wget http://mirrors.ctan.org/macros/latex/contrib/type1cm.zip \n","!unzip type1cm.zip -d /tmp/type1cm \n","!cd /tmp/type1cm/type1cm/ && sudo latex type1cm.ins\n","!sudo mkdir /usr/share/texmf/tex/latex/type1cm \n","!sudo cp /tmp/type1cm/type1cm/type1cm.sty /usr/share/texmf/tex/latex/type1cm \n","!sudo texhash \n","!apt install cm-super"],"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"xd9Xp3GlBptW","executionInfo":{"status":"ok","timestamp":1682933971106,"user_tz":0,"elapsed":115219,"user":{"displayName":"Kranklything","userId":"02979056772560081296"}},"outputId":"0f4fe301-0bda-45a0-c74f-e6be396a0045"},"id":"xd9Xp3GlBptW","execution_count":1,"outputs":[{"output_type":"stream","name":"stdout","text":["\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m2.0/2.0 MB\u001b[0m \u001b[31m26.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n","\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m13.5/13.5 MB\u001b[0m \u001b[31m52.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n","\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m5.0/5.0 MB\u001b[0m \u001b[31m48.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n","\u001b[?25h Preparing metadata (setup.py) ... \u001b[?25l\u001b[?25hdone\n","\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m201.7/201.7 kB\u001b[0m \u001b[31m11.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n","\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m184.3/184.3 kB\u001b[0m \u001b[31m9.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n","\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m46.0/46.0 kB\u001b[0m \u001b[31m2.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n","\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m62.7/62.7 kB\u001b[0m \u001b[31m5.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n","\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m86.8/86.8 kB\u001b[0m \u001b[31m10.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n","\u001b[?25h Building wheel for pathtools (setup.py) ... \u001b[?25l\u001b[?25hdone\n","Reading package lists... Done\n","Building dependency tree \n","Reading state information... Done\n","The following additional packages will be installed:\n"," dvisvgm fonts-droid-fallback fonts-lmodern fonts-noto-mono fonts-urw-base35\n"," libfontenc1 libgs9 libgs9-common libharfbuzz-icu0 libidn11 libijs-0.35\n"," libjbig2dec0 libkpathsea6 libptexenc1 libsynctex2 libteckit0 libtexlua53\n"," libtexluajit2 libwoff1 libzzip-0-13 lmodern poppler-data t1utils tex-common\n"," texlive-base texlive-binaries texlive-latex-base xfonts-encodings\n"," xfonts-utils\n","Suggested packages:\n"," fonts-noto fonts-freefont-otf | fonts-freefont-ttf fonts-texgyre\n"," poppler-utils ghostscript fonts-japanese-mincho | fonts-ipafont-mincho\n"," fonts-japanese-gothic | fonts-ipafont-gothic fonts-arphic-ukai\n"," fonts-arphic-uming fonts-nanum debhelper gv | postscript-viewer perl-tk xpdf\n"," | pdf-viewer xzdec texlive-latex-base-doc texlive-latex-recommended-doc\n"," texlive-luatex texlive-pstricks\n","The following NEW packages will be installed:\n"," dvisvgm fonts-droid-fallback fonts-lmodern fonts-noto-mono fonts-urw-base35\n"," libfontenc1 libgs9 libgs9-common libharfbuzz-icu0 libidn11 libijs-0.35\n"," libjbig2dec0 libkpathsea6 libptexenc1 libsynctex2 libteckit0 libtexlua53\n"," libtexluajit2 libwoff1 libzzip-0-13 lmodern poppler-data t1utils tex-common\n"," texlive-base texlive-binaries texlive-latex-base texlive-latex-recommended\n"," xfonts-encodings xfonts-utils\n","0 upgraded, 30 newly installed, 0 to remove and 24 not upgraded.\n","Need to get 74.9 MB of archives.\n","After this operation, 260 MB of additional disk space will be used.\n","Get:1 http://archive.ubuntu.com/ubuntu focal/main amd64 fonts-droid-fallback all 1:6.0.1r16-1.1 [1,805 kB]\n","Get:2 http://archive.ubuntu.com/ubuntu focal/main amd64 poppler-data all 0.4.9-2 [1,475 kB]\n","Get:3 http://archive.ubuntu.com/ubuntu focal/universe amd64 tex-common all 6.13 [32.7 kB]\n","Get:4 http://archive.ubuntu.com/ubuntu focal/main amd64 fonts-urw-base35 all 20170801.1-3 [6,333 kB]\n","Get:5 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libgs9-common all 9.50~dfsg-5ubuntu4.7 [681 kB]\n","Get:6 http://archive.ubuntu.com/ubuntu focal/main amd64 libidn11 amd64 1.33-2.2ubuntu2 [46.2 kB]\n","Get:7 http://archive.ubuntu.com/ubuntu focal/main amd64 libijs-0.35 amd64 0.35-15 [15.7 kB]\n","Get:8 http://archive.ubuntu.com/ubuntu focal/main amd64 libjbig2dec0 amd64 0.18-1ubuntu1 [60.0 kB]\n","Get:9 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libgs9 amd64 9.50~dfsg-5ubuntu4.7 [2,173 kB]\n","Get:10 http://archive.ubuntu.com/ubuntu focal/main amd64 libkpathsea6 amd64 2019.20190605.51237-3build2 [57.0 kB]\n","Get:11 http://archive.ubuntu.com/ubuntu focal/main amd64 libwoff1 amd64 1.0.2-1build2 [42.0 kB]\n","Get:12 http://archive.ubuntu.com/ubuntu focal/universe amd64 dvisvgm amd64 2.8.1-1build1 [1,048 kB]\n","Get:13 http://archive.ubuntu.com/ubuntu focal/universe amd64 fonts-lmodern all 2.004.5-6 [4,532 kB]\n","Get:14 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 fonts-noto-mono all 20200323-1build1~ubuntu20.04.1 [80.6 kB]\n","Get:15 http://archive.ubuntu.com/ubuntu focal/main amd64 libfontenc1 amd64 1:1.1.4-0ubuntu1 [14.0 kB]\n","Get:16 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libharfbuzz-icu0 amd64 2.6.4-1ubuntu4.2 [5,580 B]\n","Get:17 http://archive.ubuntu.com/ubuntu focal/main amd64 libptexenc1 amd64 2019.20190605.51237-3build2 [35.5 kB]\n","Get:18 http://archive.ubuntu.com/ubuntu focal/main amd64 libsynctex2 amd64 2019.20190605.51237-3build2 [55.0 kB]\n","Get:19 http://archive.ubuntu.com/ubuntu focal/universe amd64 libteckit0 amd64 2.5.8+ds2-5ubuntu2 [320 kB]\n","Get:20 http://archive.ubuntu.com/ubuntu focal/main amd64 libtexlua53 amd64 2019.20190605.51237-3build2 [105 kB]\n","Get:21 http://archive.ubuntu.com/ubuntu focal/main amd64 libtexluajit2 amd64 2019.20190605.51237-3build2 [235 kB]\n","Get:22 http://archive.ubuntu.com/ubuntu focal/universe amd64 libzzip-0-13 amd64 0.13.62-3.2ubuntu1 [26.2 kB]\n","Get:23 http://archive.ubuntu.com/ubuntu focal/main amd64 xfonts-encodings all 1:1.0.5-0ubuntu1 [573 kB]\n","Get:24 http://archive.ubuntu.com/ubuntu focal/main amd64 xfonts-utils amd64 1:7.7+6 [91.5 kB]\n","Get:25 http://archive.ubuntu.com/ubuntu focal/universe amd64 lmodern all 2.004.5-6 [9,474 kB]\n","Get:26 http://archive.ubuntu.com/ubuntu focal/main amd64 t1utils amd64 1.41-3 [56.1 kB]\n","Get:27 http://archive.ubuntu.com/ubuntu focal/universe amd64 texlive-binaries amd64 2019.20190605.51237-3build2 [8,041 kB]\n","Get:28 http://archive.ubuntu.com/ubuntu focal/universe amd64 texlive-base all 2019.20200218-1 [20.8 MB]\n","Get:29 http://archive.ubuntu.com/ubuntu focal/universe amd64 texlive-latex-base all 2019.20200218-1 [990 kB]\n","Get:30 http://archive.ubuntu.com/ubuntu focal/universe amd64 texlive-latex-recommended all 2019.20200218-1 [15.7 MB]\n","Fetched 74.9 MB in 10s (7,477 kB/s)\n","debconf: unable to initialize frontend: Dialog\n","debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 76, <> line 30.)\n","debconf: falling back to frontend: Readline\n","debconf: unable to initialize frontend: Readline\n","debconf: (This frontend requires a controlling tty.)\n","debconf: falling back to frontend: Teletype\n","dpkg-preconfigure: unable to re-open stdin: \n","Selecting previously unselected package fonts-droid-fallback.\n","(Reading database ... 122518 files and directories currently installed.)\n","Preparing to unpack .../00-fonts-droid-fallback_1%3a6.0.1r16-1.1_all.deb ...\n","Unpacking fonts-droid-fallback (1:6.0.1r16-1.1) ...\n","Selecting previously unselected package poppler-data.\n","Preparing to unpack .../01-poppler-data_0.4.9-2_all.deb ...\n","Unpacking poppler-data (0.4.9-2) ...\n","Selecting previously unselected package tex-common.\n","Preparing to unpack .../02-tex-common_6.13_all.deb ...\n","Unpacking tex-common (6.13) ...\n","Selecting previously unselected package fonts-urw-base35.\n","Preparing to unpack .../03-fonts-urw-base35_20170801.1-3_all.deb ...\n","Unpacking fonts-urw-base35 (20170801.1-3) ...\n","Selecting previously unselected package libgs9-common.\n","Preparing to unpack .../04-libgs9-common_9.50~dfsg-5ubuntu4.7_all.deb ...\n","Unpacking libgs9-common (9.50~dfsg-5ubuntu4.7) ...\n","Selecting previously unselected package libidn11:amd64.\n","Preparing to unpack .../05-libidn11_1.33-2.2ubuntu2_amd64.deb ...\n","Unpacking libidn11:amd64 (1.33-2.2ubuntu2) ...\n","Selecting previously unselected package libijs-0.35:amd64.\n","Preparing to unpack .../06-libijs-0.35_0.35-15_amd64.deb ...\n","Unpacking libijs-0.35:amd64 (0.35-15) ...\n","Selecting previously unselected package libjbig2dec0:amd64.\n","Preparing to unpack .../07-libjbig2dec0_0.18-1ubuntu1_amd64.deb ...\n","Unpacking libjbig2dec0:amd64 (0.18-1ubuntu1) ...\n","Selecting previously unselected package libgs9:amd64.\n","Preparing to unpack .../08-libgs9_9.50~dfsg-5ubuntu4.7_amd64.deb ...\n","Unpacking libgs9:amd64 (9.50~dfsg-5ubuntu4.7) ...\n","Selecting previously unselected package libkpathsea6:amd64.\n","Preparing to unpack .../09-libkpathsea6_2019.20190605.51237-3build2_amd64.deb ...\n","Unpacking libkpathsea6:amd64 (2019.20190605.51237-3build2) ...\n","Selecting previously unselected package libwoff1:amd64.\n","Preparing to unpack .../10-libwoff1_1.0.2-1build2_amd64.deb ...\n","Unpacking libwoff1:amd64 (1.0.2-1build2) ...\n","Selecting previously unselected package dvisvgm.\n","Preparing to unpack .../11-dvisvgm_2.8.1-1build1_amd64.deb ...\n","Unpacking dvisvgm (2.8.1-1build1) ...\n","Selecting previously unselected package fonts-lmodern.\n","Preparing to unpack .../12-fonts-lmodern_2.004.5-6_all.deb ...\n","Unpacking fonts-lmodern (2.004.5-6) ...\n","Selecting previously unselected package fonts-noto-mono.\n","Preparing to unpack .../13-fonts-noto-mono_20200323-1build1~ubuntu20.04.1_all.deb ...\n","Unpacking fonts-noto-mono (20200323-1build1~ubuntu20.04.1) ...\n","Selecting previously unselected package libfontenc1:amd64.\n","Preparing to unpack .../14-libfontenc1_1%3a1.1.4-0ubuntu1_amd64.deb ...\n","Unpacking libfontenc1:amd64 (1:1.1.4-0ubuntu1) ...\n","Selecting previously unselected package libharfbuzz-icu0:amd64.\n","Preparing to unpack .../15-libharfbuzz-icu0_2.6.4-1ubuntu4.2_amd64.deb ...\n","Unpacking libharfbuzz-icu0:amd64 (2.6.4-1ubuntu4.2) ...\n","Selecting previously unselected package libptexenc1:amd64.\n","Preparing to unpack .../16-libptexenc1_2019.20190605.51237-3build2_amd64.deb ...\n","Unpacking libptexenc1:amd64 (2019.20190605.51237-3build2) ...\n","Selecting previously unselected package libsynctex2:amd64.\n","Preparing to unpack .../17-libsynctex2_2019.20190605.51237-3build2_amd64.deb ...\n","Unpacking libsynctex2:amd64 (2019.20190605.51237-3build2) ...\n","Selecting previously unselected package libteckit0:amd64.\n","Preparing to unpack .../18-libteckit0_2.5.8+ds2-5ubuntu2_amd64.deb ...\n","Unpacking libteckit0:amd64 (2.5.8+ds2-5ubuntu2) ...\n","Selecting previously unselected package libtexlua53:amd64.\n","Preparing to unpack .../19-libtexlua53_2019.20190605.51237-3build2_amd64.deb ...\n","Unpacking libtexlua53:amd64 (2019.20190605.51237-3build2) ...\n","Selecting previously unselected package libtexluajit2:amd64.\n","Preparing to unpack .../20-libtexluajit2_2019.20190605.51237-3build2_amd64.deb ...\n","Unpacking libtexluajit2:amd64 (2019.20190605.51237-3build2) ...\n","Selecting previously unselected package libzzip-0-13:amd64.\n","Preparing to unpack .../21-libzzip-0-13_0.13.62-3.2ubuntu1_amd64.deb ...\n","Unpacking libzzip-0-13:amd64 (0.13.62-3.2ubuntu1) ...\n","Selecting previously unselected package xfonts-encodings.\n","Preparing to unpack .../22-xfonts-encodings_1%3a1.0.5-0ubuntu1_all.deb ...\n","Unpacking xfonts-encodings (1:1.0.5-0ubuntu1) ...\n","Selecting previously unselected package xfonts-utils.\n","Preparing to unpack .../23-xfonts-utils_1%3a7.7+6_amd64.deb ...\n","Unpacking xfonts-utils (1:7.7+6) ...\n","Selecting previously unselected package lmodern.\n","Preparing to unpack .../24-lmodern_2.004.5-6_all.deb ...\n","Unpacking lmodern (2.004.5-6) ...\n","Selecting previously unselected package t1utils.\n","Preparing to unpack .../25-t1utils_1.41-3_amd64.deb ...\n","Unpacking t1utils (1.41-3) ...\n","Selecting previously unselected package texlive-binaries.\n","Preparing to unpack .../26-texlive-binaries_2019.20190605.51237-3build2_amd64.deb ...\n","Unpacking texlive-binaries (2019.20190605.51237-3build2) ...\n","Selecting previously unselected package texlive-base.\n","Preparing to unpack .../27-texlive-base_2019.20200218-1_all.deb ...\n","Unpacking texlive-base (2019.20200218-1) ...\n","Selecting previously unselected package texlive-latex-base.\n","Preparing to unpack .../28-texlive-latex-base_2019.20200218-1_all.deb ...\n","Unpacking texlive-latex-base (2019.20200218-1) ...\n","Selecting previously unselected package texlive-latex-recommended.\n","Preparing to unpack .../29-texlive-latex-recommended_2019.20200218-1_all.deb ...\n","Unpacking texlive-latex-recommended (2019.20200218-1) ...\n","Setting up libharfbuzz-icu0:amd64 (2.6.4-1ubuntu4.2) ...\n","Setting up fonts-noto-mono (20200323-1build1~ubuntu20.04.1) ...\n","Setting up libwoff1:amd64 (1.0.2-1build2) ...\n","Setting up libtexlua53:amd64 (2019.20190605.51237-3build2) ...\n","Setting up libijs-0.35:amd64 (0.35-15) ...\n","Setting up libtexluajit2:amd64 (2019.20190605.51237-3build2) ...\n","Setting up libzzip-0-13:amd64 (0.13.62-3.2ubuntu1) ...\n","Setting up fonts-urw-base35 (20170801.1-3) ...\n","Setting up poppler-data (0.4.9-2) ...\n","Setting up tex-common (6.13) ...\n","debconf: unable to initialize frontend: Dialog\n","debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 76.)\n","debconf: falling back to frontend: Readline\n","update-language: texlive-base not installed and configured, doing nothing!\n","Setting up libfontenc1:amd64 (1:1.1.4-0ubuntu1) ...\n","Setting up libjbig2dec0:amd64 (0.18-1ubuntu1) ...\n","Setting up libidn11:amd64 (1.33-2.2ubuntu2) ...\n","Setting up libteckit0:amd64 (2.5.8+ds2-5ubuntu2) ...\n","Setting up xfonts-encodings (1:1.0.5-0ubuntu1) ...\n","Setting up t1utils (1.41-3) ...\n","Setting up libkpathsea6:amd64 (2019.20190605.51237-3build2) ...\n","Setting up fonts-lmodern (2.004.5-6) ...\n","Setting up fonts-droid-fallback (1:6.0.1r16-1.1) ...\n","Setting up libsynctex2:amd64 (2019.20190605.51237-3build2) ...\n","Setting up libgs9-common (9.50~dfsg-5ubuntu4.7) ...\n","Setting up libgs9:amd64 (9.50~dfsg-5ubuntu4.7) ...\n","Setting up dvisvgm (2.8.1-1build1) ...\n","Setting up xfonts-utils (1:7.7+6) ...\n","Setting up libptexenc1:amd64 (2019.20190605.51237-3build2) ...\n","Setting up texlive-binaries (2019.20190605.51237-3build2) ...\n","update-alternatives: using /usr/bin/xdvi-xaw to provide /usr/bin/xdvi.bin (xdvi.bin) in auto mode\n","update-alternatives: using /usr/bin/bibtex.original to provide /usr/bin/bibtex (bibtex) in auto mode\n","Setting up lmodern (2.004.5-6) ...\n","Setting up texlive-base (2019.20200218-1) ...\n","mktexlsr: Updating /var/lib/texmf/ls-R-TEXLIVEDIST... \n","mktexlsr: Updating /var/lib/texmf/ls-R-TEXMFMAIN... \n","mktexlsr: Updating /var/lib/texmf/ls-R... \n","mktexlsr: Done.\n","tl-paper: setting paper size for dvips to a4: /var/lib/texmf/dvips/config/config-paper.ps\n","tl-paper: setting paper size for dvipdfmx to a4: /var/lib/texmf/dvipdfmx/dvipdfmx-paper.cfg\n","tl-paper: setting paper size for xdvi to a4: /var/lib/texmf/xdvi/XDvi-paper\n","tl-paper: setting paper size for pdftex to a4: /var/lib/texmf/tex/generic/config/pdftexconfig.tex\n","debconf: unable to initialize frontend: Dialog\n","debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 76.)\n","debconf: falling back to frontend: Readline\n","Setting up texlive-latex-base (2019.20200218-1) ...\n","Setting up texlive-latex-recommended (2019.20200218-1) ...\n","Processing triggers for mime-support (3.64ubuntu1) ...\n","Processing triggers for libc-bin (2.31-0ubuntu9.9) ...\n","Processing triggers for man-db (2.9.1-1) ...\n","Processing triggers for fontconfig (2.13.1-2ubuntu3) ...\n","Processing triggers for tex-common (6.13) ...\n","debconf: unable to initialize frontend: Dialog\n","debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 76.)\n","debconf: falling back to frontend: Readline\n","Running updmap-sys. This may take some time... done.\n","Running mktexlsr /var/lib/texmf ... done.\n","Building format(s) --all.\n","\tThis may take some time... done.\n","Reading package lists... Done\n","Building dependency tree \n","Reading state information... Done\n","The following additional packages will be installed:\n"," fonts-lato fonts-texgyre ghostscript javascript-common libapache-pom-java\n"," libcommons-logging-java libcommons-parent-java libfontbox-java libjs-jquery\n"," libpdfbox-java libruby2.7 preview-latex-style rake ruby ruby-minitest\n"," ruby-net-telnet ruby-power-assert ruby-test-unit ruby-xmlrpc ruby2.7\n"," rubygems-integration tex-gyre texlive-pictures texlive-plain-generic tipa\n","Suggested packages:\n"," ghostscript-x apache2 | lighttpd | httpd libavalon-framework-java\n"," libcommons-logging-java-doc libexcalibur-logkit-java liblog4j1.2-java ri\n"," ruby-dev bundler texlive-fonts-recommended-doc python3-pygments icc-profiles\n"," libfile-which-perl libspreadsheet-parseexcel-perl texlive-latex-extra-doc\n"," dot2tex prerex ruby-tcltk | libtcltk-ruby texlive-pictures-doc vprerex\n"," default-jre-headless\n","The following NEW packages will be installed:\n"," dvipng fonts-lato fonts-texgyre ghostscript javascript-common\n"," libapache-pom-java libcommons-logging-java libcommons-parent-java\n"," libfontbox-java libjs-jquery libpdfbox-java libruby2.7 preview-latex-style\n"," rake ruby ruby-minitest ruby-net-telnet ruby-power-assert ruby-test-unit\n"," ruby-xmlrpc ruby2.7 rubygems-integration tex-gyre texlive-fonts-recommended\n"," texlive-latex-extra texlive-pictures texlive-plain-generic tipa\n","0 upgraded, 28 newly installed, 0 to remove and 24 not upgraded.\n","Need to get 78.6 MB of archives.\n","After this operation, 245 MB of additional disk space will be used.\n","Get:1 http://archive.ubuntu.com/ubuntu focal/main amd64 fonts-lato all 2.0-2 [2,698 kB]\n","Get:2 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 ghostscript amd64 9.50~dfsg-5ubuntu4.7 [51.9 kB]\n","Get:3 http://archive.ubuntu.com/ubuntu focal/universe amd64 dvipng amd64 1.15-1.1 [78.9 kB]\n","Get:4 http://archive.ubuntu.com/ubuntu focal/universe amd64 fonts-texgyre all 20180621-3 [10.2 MB]\n","Get:5 http://archive.ubuntu.com/ubuntu focal/main amd64 javascript-common all 11 [6,066 B]\n","Get:6 http://archive.ubuntu.com/ubuntu focal/universe amd64 libapache-pom-java all 18-1 [4,720 B]\n","Get:7 http://archive.ubuntu.com/ubuntu focal/universe amd64 libcommons-parent-java all 43-1 [10.8 kB]\n","Get:8 http://archive.ubuntu.com/ubuntu focal/universe amd64 libcommons-logging-java all 1.2-2 [60.3 kB]\n","Get:9 http://archive.ubuntu.com/ubuntu focal/main amd64 libjs-jquery all 3.3.1~dfsg-3 [329 kB]\n","Get:10 http://archive.ubuntu.com/ubuntu focal/main amd64 rubygems-integration all 1.16 [5,092 B]\n","Get:11 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 ruby2.7 amd64 2.7.0-5ubuntu1.8 [95.6 kB]\n","Get:12 http://archive.ubuntu.com/ubuntu focal/main amd64 ruby amd64 1:2.7+1 [5,412 B]\n","Get:13 http://archive.ubuntu.com/ubuntu focal/main amd64 rake all 13.0.1-4 [61.6 kB]\n","Get:14 http://archive.ubuntu.com/ubuntu focal/main amd64 ruby-minitest all 5.13.0-1 [40.9 kB]\n","Get:15 http://archive.ubuntu.com/ubuntu focal/main amd64 ruby-net-telnet all 0.1.1-2 [12.6 kB]\n","Get:16 http://archive.ubuntu.com/ubuntu focal/main amd64 ruby-power-assert all 1.1.7-1 [11.4 kB]\n","Get:17 http://archive.ubuntu.com/ubuntu focal/main amd64 ruby-test-unit all 3.3.5-1 [73.2 kB]\n","Get:18 http://archive.ubuntu.com/ubuntu focal/main amd64 ruby-xmlrpc all 0.3.0-2 [23.8 kB]\n","Get:19 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libruby2.7 amd64 2.7.0-5ubuntu1.8 [3,532 kB]\n","Get:20 http://archive.ubuntu.com/ubuntu focal/universe amd64 preview-latex-style all 11.91-2ubuntu2 [184 kB]\n","Get:21 http://archive.ubuntu.com/ubuntu focal/universe amd64 tex-gyre all 20180621-3 [6,209 kB]\n","Get:22 http://archive.ubuntu.com/ubuntu focal/universe amd64 texlive-fonts-recommended all 2019.20200218-1 [4,972 kB]\n","Get:23 http://archive.ubuntu.com/ubuntu focal/universe amd64 libfontbox-java all 1:1.8.16-2 [207 kB]\n","Get:24 http://archive.ubuntu.com/ubuntu focal/universe amd64 libpdfbox-java all 1:1.8.16-2 [5,199 kB]\n","Get:25 http://archive.ubuntu.com/ubuntu focal/universe amd64 texlive-pictures all 2019.20200218-1 [4,492 kB]\n","Get:26 http://archive.ubuntu.com/ubuntu focal/universe amd64 texlive-latex-extra all 2019.202000218-1 [12.5 MB]\n","Get:27 http://archive.ubuntu.com/ubuntu focal/universe amd64 texlive-plain-generic all 2019.202000218-1 [24.6 MB]\n","Get:28 http://archive.ubuntu.com/ubuntu focal/universe amd64 tipa all 2:1.3-20 [2,978 kB]\n","Fetched 78.6 MB in 13s (6,260 kB/s)\n","debconf: unable to initialize frontend: Dialog\n","debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 76, <> line 28.)\n","debconf: falling back to frontend: Readline\n","debconf: unable to initialize frontend: Readline\n","debconf: (This frontend requires a controlling tty.)\n","debconf: falling back to frontend: Teletype\n","dpkg-preconfigure: unable to re-open stdin: \n","Selecting previously unselected package fonts-lato.\n","(Reading database ... 131717 files and directories currently installed.)\n","Preparing to unpack .../00-fonts-lato_2.0-2_all.deb ...\n","Unpacking fonts-lato (2.0-2) ...\n","Selecting previously unselected package ghostscript.\n","Preparing to unpack .../01-ghostscript_9.50~dfsg-5ubuntu4.7_amd64.deb ...\n","Unpacking ghostscript (9.50~dfsg-5ubuntu4.7) ...\n","Selecting previously unselected package dvipng.\n","Preparing to unpack .../02-dvipng_1.15-1.1_amd64.deb ...\n","Unpacking dvipng (1.15-1.1) ...\n","Selecting previously unselected package fonts-texgyre.\n","Preparing to unpack .../03-fonts-texgyre_20180621-3_all.deb ...\n","Unpacking fonts-texgyre (20180621-3) ...\n","Selecting previously unselected package javascript-common.\n","Preparing to unpack .../04-javascript-common_11_all.deb ...\n","Unpacking javascript-common (11) ...\n","Selecting previously unselected package libapache-pom-java.\n","Preparing to unpack .../05-libapache-pom-java_18-1_all.deb ...\n","Unpacking libapache-pom-java (18-1) ...\n","Selecting previously unselected package libcommons-parent-java.\n","Preparing to unpack .../06-libcommons-parent-java_43-1_all.deb ...\n","Unpacking libcommons-parent-java (43-1) ...\n","Selecting previously unselected package libcommons-logging-java.\n","Preparing to unpack .../07-libcommons-logging-java_1.2-2_all.deb ...\n","Unpacking libcommons-logging-java (1.2-2) ...\n","Selecting previously unselected package libjs-jquery.\n","Preparing to unpack .../08-libjs-jquery_3.3.1~dfsg-3_all.deb ...\n","Unpacking libjs-jquery (3.3.1~dfsg-3) ...\n","Selecting previously unselected package rubygems-integration.\n","Preparing to unpack .../09-rubygems-integration_1.16_all.deb ...\n","Unpacking rubygems-integration (1.16) ...\n","Selecting previously unselected package ruby2.7.\n","Preparing to unpack .../10-ruby2.7_2.7.0-5ubuntu1.8_amd64.deb ...\n","Unpacking ruby2.7 (2.7.0-5ubuntu1.8) ...\n","Selecting previously unselected package ruby.\n","Preparing to unpack .../11-ruby_1%3a2.7+1_amd64.deb ...\n","Unpacking ruby (1:2.7+1) ...\n","Selecting previously unselected package rake.\n","Preparing to unpack .../12-rake_13.0.1-4_all.deb ...\n","Unpacking rake (13.0.1-4) ...\n","Selecting previously unselected package ruby-minitest.\n","Preparing to unpack .../13-ruby-minitest_5.13.0-1_all.deb ...\n","Unpacking ruby-minitest (5.13.0-1) ...\n","Selecting previously unselected package ruby-net-telnet.\n","Preparing to unpack .../14-ruby-net-telnet_0.1.1-2_all.deb ...\n","Unpacking ruby-net-telnet (0.1.1-2) ...\n","Selecting previously unselected package ruby-power-assert.\n","Preparing to unpack .../15-ruby-power-assert_1.1.7-1_all.deb ...\n","Unpacking ruby-power-assert (1.1.7-1) ...\n","Selecting previously unselected package ruby-test-unit.\n","Preparing to unpack .../16-ruby-test-unit_3.3.5-1_all.deb ...\n","Unpacking ruby-test-unit (3.3.5-1) ...\n","Selecting previously unselected package ruby-xmlrpc.\n","Preparing to unpack .../17-ruby-xmlrpc_0.3.0-2_all.deb ...\n","Unpacking ruby-xmlrpc (0.3.0-2) ...\n","Selecting previously unselected package libruby2.7:amd64.\n","Preparing to unpack .../18-libruby2.7_2.7.0-5ubuntu1.8_amd64.deb ...\n","Unpacking libruby2.7:amd64 (2.7.0-5ubuntu1.8) ...\n","Selecting previously unselected package preview-latex-style.\n","Preparing to unpack .../19-preview-latex-style_11.91-2ubuntu2_all.deb ...\n","Unpacking preview-latex-style (11.91-2ubuntu2) ...\n","Selecting previously unselected package tex-gyre.\n","Preparing to unpack .../20-tex-gyre_20180621-3_all.deb ...\n","Unpacking tex-gyre (20180621-3) ...\n","Selecting previously unselected package texlive-fonts-recommended.\n","Preparing to unpack .../21-texlive-fonts-recommended_2019.20200218-1_all.deb ...\n","Unpacking texlive-fonts-recommended (2019.20200218-1) ...\n","Selecting previously unselected package libfontbox-java.\n","Preparing to unpack .../22-libfontbox-java_1%3a1.8.16-2_all.deb ...\n","Unpacking libfontbox-java (1:1.8.16-2) ...\n","Selecting previously unselected package libpdfbox-java.\n","Preparing to unpack .../23-libpdfbox-java_1%3a1.8.16-2_all.deb ...\n","Unpacking libpdfbox-java (1:1.8.16-2) ...\n","Selecting previously unselected package texlive-pictures.\n","Preparing to unpack .../24-texlive-pictures_2019.20200218-1_all.deb ...\n","Unpacking texlive-pictures (2019.20200218-1) ...\n","Selecting previously unselected package texlive-latex-extra.\n","Preparing to unpack .../25-texlive-latex-extra_2019.202000218-1_all.deb ...\n","Unpacking texlive-latex-extra (2019.202000218-1) ...\n","Selecting previously unselected package texlive-plain-generic.\n","Preparing to unpack .../26-texlive-plain-generic_2019.202000218-1_all.deb ...\n","Unpacking texlive-plain-generic (2019.202000218-1) ...\n","Selecting previously unselected package tipa.\n","Preparing to unpack .../27-tipa_2%3a1.3-20_all.deb ...\n","Unpacking tipa (2:1.3-20) ...\n","Setting up javascript-common (11) ...\n","Setting up fonts-lato (2.0-2) ...\n","Setting up ruby-power-assert (1.1.7-1) ...\n","Setting up preview-latex-style (11.91-2ubuntu2) ...\n","Setting up libfontbox-java (1:1.8.16-2) ...\n","Setting up texlive-plain-generic (2019.202000218-1) ...\n","Setting up rubygems-integration (1.16) ...\n","Setting up ghostscript (9.50~dfsg-5ubuntu4.7) ...\n","Setting up ruby-minitest (5.13.0-1) ...\n","Setting up ruby-test-unit (3.3.5-1) ...\n","Setting up libapache-pom-java (18-1) ...\n","Setting up ruby-net-telnet (0.1.1-2) ...\n","Setting up fonts-texgyre (20180621-3) ...\n","Setting up texlive-pictures (2019.20200218-1) ...\n","Setting up texlive-fonts-recommended (2019.20200218-1) ...\n","Setting up tipa (2:1.3-20) ...\n","Regenerating '/var/lib/texmf/fmtutil.cnf-DEBIAN'... done.\n","Regenerating '/var/lib/texmf/fmtutil.cnf-TEXLIVEDIST'... done.\n","update-fmtutil has updated the following file(s):\n","\t/var/lib/texmf/fmtutil.cnf-DEBIAN\n","\t/var/lib/texmf/fmtutil.cnf-TEXLIVEDIST\n","If you want to activate the changes in the above file(s),\n","you should run fmtutil-sys or fmtutil.\n","Setting up libjs-jquery (3.3.1~dfsg-3) ...\n","Setting up ruby-xmlrpc (0.3.0-2) ...\n","Setting up tex-gyre (20180621-3) ...\n","Setting up libpdfbox-java (1:1.8.16-2) ...\n","Setting up dvipng (1.15-1.1) ...\n","Setting up libcommons-parent-java (43-1) ...\n","Setting up libcommons-logging-java (1.2-2) ...\n","Setting up texlive-latex-extra (2019.202000218-1) ...\n","Setting up libruby2.7:amd64 (2.7.0-5ubuntu1.8) ...\n","Setting up ruby2.7 (2.7.0-5ubuntu1.8) ...\n","Setting up ruby (1:2.7+1) ...\n","Setting up rake (13.0.1-4) ...\n","Processing triggers for fontconfig (2.13.1-2ubuntu3) ...\n","Processing triggers for libc-bin (2.31-0ubuntu9.9) ...\n","Processing triggers for man-db (2.9.1-1) ...\n","Processing triggers for tex-common (6.13) ...\n","debconf: unable to initialize frontend: Dialog\n","debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 76.)\n","debconf: falling back to frontend: Readline\n","Running mktexlsr. This may take some time... done.\n","Running updmap-sys. This may take some time... done.\n","Running mktexlsr /var/lib/texmf ... done.\n","Building format(s) --all.\n","\tThis may take some time... done.\n","--2023-05-01 09:39:16-- http://mirrors.ctan.org/macros/latex/contrib/type1cm.zip\n","Resolving mirrors.ctan.org (mirrors.ctan.org)... 5.35.249.60\n","Connecting to mirrors.ctan.org (mirrors.ctan.org)|5.35.249.60|:80... connected.\n","HTTP request sent, awaiting response... 302 Found\n","Location: https://download.nus.edu.sg/mirror/ctan/macros/latex/contrib/type1cm.zip [following]\n","--2023-05-01 09:39:16-- https://download.nus.edu.sg/mirror/ctan/macros/latex/contrib/type1cm.zip\n","Resolving download.nus.edu.sg (download.nus.edu.sg)... 137.132.155.197\n","Connecting to download.nus.edu.sg (download.nus.edu.sg)|137.132.155.197|:443... connected.\n","HTTP request sent, awaiting response... 200 OK\n","Length: 328566 (321K) [application/zip]\n","Saving to: ‘type1cm.zip’\n","\n","type1cm.zip 100%[===================>] 320.87K --.-KB/s in 0.01s \n","\n","2023-05-01 09:39:17 (21.3 MB/s) - ‘type1cm.zip’ saved [328566/328566]\n","\n","Archive: type1cm.zip\n"," creating: /tmp/type1cm/type1cm/\n"," inflating: /tmp/type1cm/type1cm/type1cm.fdd \n"," inflating: /tmp/type1cm/type1cm/type1cm.ins \n"," inflating: /tmp/type1cm/type1cm/type1cm.txt \n"," inflating: /tmp/type1cm/type1cm/type1cm-doc.pdf \n"," inflating: /tmp/type1cm/type1cm/type1cm-doc.tex \n","This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019/Debian) (preloaded format=latex)\n"," restricted \\write18 enabled.\n","entering extended mode\n","(./type1cm.ins\n","LaTeX2e <2020-02-02> patch level 2\n","L3 programming layer <2020-02-14>\n","(/usr/share/texlive/texmf-dist/tex/latex/base/docstrip.tex\n","Utility: `docstrip' 2.5g <2018/05/03>\n","English documentation <2018/05/03>\n","\n","**********************************************************\n","* This program converts documented macro-files into fast *\n","* loadable files by stripping off (nearly) all comments! *\n","**********************************************************\n","\n","********************************************************\n","* No Configuration file found, using default settings. *\n","********************************************************\n","\n","(./type1cm.ins\n","\n","Generating file(s) ./type1cm.sty \n","\n","Processing file type1cm.fdd (package,ams) -> type1cm.sty\n","Lines processed: 410\n","Comments removed: 25\n","Comments passed: 7\n","Codelines passed: 263\n","\n",") ) )\n","No pages of output.\n","Transcript written on type1cm.log.\n","texhash: Updating /usr/local/share/texmf/ls-R... \n","texhash: Updating /var/lib/texmf/ls-R-TEXLIVEDIST... \n","texhash: Updating /var/lib/texmf/ls-R-TEXMFMAIN... \n","texhash: Updating /var/lib/texmf/ls-R... \n","texhash: Done.\n","Reading package lists... Done\n","Building dependency tree \n","Reading state information... Done\n","The following additional packages will be installed:\n"," cm-super-minimal pfb2t1c2pfb\n","The following NEW packages will be installed:\n"," cm-super cm-super-minimal pfb2t1c2pfb\n","0 upgraded, 3 newly installed, 0 to remove and 24 not upgraded.\n","Need to get 24.5 MB of archives.\n","After this operation, 59.9 MB of additional disk space will be used.\n","Get:1 http://archive.ubuntu.com/ubuntu focal/universe amd64 cm-super-minimal all 0.3.4-15 [5,811 kB]\n","Get:2 http://archive.ubuntu.com/ubuntu focal/universe amd64 pfb2t1c2pfb amd64 0.3-11 [9,342 B]\n","Get:3 http://archive.ubuntu.com/ubuntu focal/universe amd64 cm-super all 0.3.4-15 [18.7 MB]\n","Fetched 24.5 MB in 4s (6,212 kB/s)\n","Selecting previously unselected package cm-super-minimal.\n","(Reading database ... 152944 files and directories currently installed.)\n","Preparing to unpack .../cm-super-minimal_0.3.4-15_all.deb ...\n","Unpacking cm-super-minimal (0.3.4-15) ...\n","Selecting previously unselected package pfb2t1c2pfb.\n","Preparing to unpack .../pfb2t1c2pfb_0.3-11_amd64.deb ...\n","Unpacking pfb2t1c2pfb (0.3-11) ...\n","Selecting previously unselected package cm-super.\n","Preparing to unpack .../cm-super_0.3.4-15_all.deb ...\n","Unpacking cm-super (0.3.4-15) ...\n","Setting up pfb2t1c2pfb (0.3-11) ...\n","Setting up cm-super-minimal (0.3.4-15) ...\n","Setting up cm-super (0.3.4-15) ...\n","Creating fonts. This may take some time... done.\n","Processing triggers for man-db (2.9.1-1) ...\n","Processing triggers for tex-common (6.13) ...\n","Running mktexlsr. This may take some time... done.\n","Running updmap-sys. This may take some time... done.\n","Running mktexlsr /var/lib/texmf ... done.\n","Processing triggers for fontconfig (2.13.1-2ubuntu3) ...\n"]}]},{"cell_type":"code","execution_count":2,"id":"747ddcf2","metadata":{"colab":{"base_uri":"https://localhost:8080/","height":121},"id":"747ddcf2","executionInfo":{"status":"ok","timestamp":1682933991673,"user_tz":0,"elapsed":20584,"user":{"displayName":"Kranklything","userId":"02979056772560081296"}},"outputId":"e0fd939b-acea-4244-d17f-e9440ebd876a"},"outputs":[{"output_type":"display_data","data":{"text/plain":[""],"application/javascript":["\n"," window._wandbApiKey = new Promise((resolve, reject) => {\n"," function loadScript(url) {\n"," return new Promise(function(resolve, reject) {\n"," let newScript = document.createElement(\"script\");\n"," newScript.onerror = reject;\n"," newScript.onload = resolve;\n"," document.body.appendChild(newScript);\n"," newScript.src = url;\n"," });\n"," }\n"," loadScript(\"https://cdn.jsdelivr.net/npm/postmate/build/postmate.min.js\").then(() => {\n"," const iframe = document.createElement('iframe')\n"," iframe.style.cssText = \"width:0;height:0;border:none\"\n"," document.body.appendChild(iframe)\n"," const handshake = new Postmate({\n"," container: iframe,\n"," url: 'https://wandb.ai/authorize'\n"," });\n"," const timeout = setTimeout(() => reject(\"Couldn't auto authenticate\"), 5000)\n"," handshake.then(function(child) {\n"," child.on('authorize', data => {\n"," clearTimeout(timeout)\n"," resolve(data)\n"," });\n"," });\n"," })\n"," });\n"," "]},"metadata":{}},{"output_type":"stream","name":"stderr","text":["\u001b[34m\u001b[1mwandb\u001b[0m: Logging into wandb.ai. (Learn how to deploy a W&B server locally: https://wandb.me/wandb-server)\n","\u001b[34m\u001b[1mwandb\u001b[0m: You can find your API key in your browser here: https://wandb.ai/authorize\n","wandb: Paste an API key from your profile and hit enter, or press ctrl+c to quit:"]},{"name":"stdout","output_type":"stream","text":[" ··········\n"]},{"output_type":"stream","name":"stderr","text":["\u001b[34m\u001b[1mwandb\u001b[0m: Appending key for api.wandb.ai to your netrc file: /root/.netrc\n"]},{"output_type":"execute_result","data":{"text/plain":["True"]},"metadata":{},"execution_count":2}],"source":["import wandb\n","\n","wandb.login()"]},{"cell_type":"code","execution_count":3,"id":"c37343d6","metadata":{"id":"c37343d6","executionInfo":{"status":"ok","timestamp":1682933997906,"user_tz":0,"elapsed":6233,"user":{"displayName":"Kranklything","userId":"02979056772560081296"}}},"outputs":[],"source":["import torch\n","import torch.optim as optim\n","import torch.nn.functional as F\n","import torch.nn as nn\n","from torchvision import datasets, transforms\n","from torchvision.models import resnet50, ResNet50_Weights\n","from torch.utils.data import Dataset, DataLoader, random_split, SubsetRandomSampler\n","from sklearn.model_selection import KFold, StratifiedKFold\n","import numpy as np\n","import os\n","import time\n","import copy\n","import random\n","import onnx\n","from sklearn import metrics\n","from sklearn.metrics import roc_curve, RocCurveDisplay, auc\n","import seaborn as sns\n","import matplotlib.pyplot as plt\n","from tqdm.auto import tqdm\n","\n","torch.manual_seed(42)\n","torch.backends.cudnn.deterministic = True\n","random.seed(42)\n","np.random.seed(42)\n","torch.cuda.manual_seed_all(42)\n","\n","device = torch.device(\"cuda\" if torch.cuda.is_available() else \"cpu\")"]},{"cell_type":"code","source":["from google.colab import drive\n","drive.mount('/content/drive')"],"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"3jcZsJkvCFYN","executionInfo":{"status":"ok","timestamp":1682934021957,"user_tz":0,"elapsed":24067,"user":{"displayName":"Kranklything","userId":"02979056772560081296"}},"outputId":"584e7472-5547-4dbe-e15a-61200c504bf3"},"id":"3jcZsJkvCFYN","execution_count":4,"outputs":[{"output_type":"stream","name":"stdout","text":["Mounted at /content/drive\n"]}]},{"cell_type":"code","source":["def set_size(width, fraction=1, subplots=(1, 1)):\n"," # Width of figure (in pts)\n"," fig_width_pt = width * fraction\n"," # Convert from pt to inches\n"," inches_per_pt = 1 / 72.27\n"," # Golden ratio to set aesthetic figure height\n"," # https://disq.us/p/2940ij3\n"," golden_ratio = (5**.5 - 1) / 2\n"," # Figure width in inches\n"," fig_width_in = fig_width_pt * inches_per_pt\n"," # Figure height in inches\n"," fig_height_in = fig_width_in * golden_ratio * (subplots[0] / subplots[1])\n","\n"," fig_dim = (fig_width_in, fig_height_in)\n","\n"," return fig_dim"],"metadata":{"id":"9kAalkZjkZss","executionInfo":{"status":"ok","timestamp":1682934021957,"user_tz":0,"elapsed":17,"user":{"displayName":"Kranklything","userId":"02979056772560081296"}}},"id":"9kAalkZjkZss","execution_count":5,"outputs":[]},{"cell_type":"code","source":["plt.rcParams['mathtext.fontset'] = 'cm'\n","plt.rcParams['font.family'] = 'STIXGeneral'"],"metadata":{"id":"hHslzk9d4dnq","executionInfo":{"status":"ok","timestamp":1682934021957,"user_tz":0,"elapsed":17,"user":{"displayName":"Kranklything","userId":"02979056772560081296"}}},"id":"hHslzk9d4dnq","execution_count":6,"outputs":[]},{"cell_type":"code","execution_count":7,"id":"17b25dc7","metadata":{"id":"17b25dc7","executionInfo":{"status":"ok","timestamp":1682934021957,"user_tz":0,"elapsed":17,"user":{"displayName":"Kranklything","userId":"02979056772560081296"}}},"outputs":[],"source":["def build_dataset(batch_size): \n"," data_transforms = {\n"," 'train': transforms.Compose([\n"," transforms.RandomResizedCrop(224),\n"," transforms.RandomHorizontalFlip(),\n"," transforms.ToTensor(),\n"," transforms.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225])\n"," ]),\n"," 'test': transforms.Compose([\n"," transforms.Resize(256),\n"," transforms.CenterCrop(224),\n"," transforms.ToTensor(),\n"," transforms.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225])\n"," ]),\n"," }\n","\n"," data_dir = '/content/drive/MyDrive/plantsdata'\n"," dataset = datasets.ImageFolder(os.path.join(data_dir))\n"," dataset.transform = data_transforms['test']\n","\n"," # 90/10 split\n"," train_dataset, test_dataset = random_split(dataset, [0.9, 0.1])\n","\n"," train_dataset.dataset.transform = data_transforms['train']\n"," test_dataset.dataset.transform = data_transforms['test']\n","\n"," train_loader = torch.utils.data.DataLoader(train_dataset, batch_size=batch_size,\n"," shuffle=True, num_workers=4)\n"," test_loader = torch.utils.data.DataLoader(test_dataset, batch_size=batch_size,\n"," shuffle=True, num_workers=4)\n","\n"," dataloaders = {'train': train_loader, 'test': test_loader}\n"," dataset_size = len(dataset)\n"," dataset_sizes = {'train': len(train_dataset), 'test': len(test_dataset)}\n"," class_names = dataset.classes\n","\n"," return dataset\n","\n","def build_network():\n"," network = resnet50(weights=ResNet50_Weights.DEFAULT)\n"," num_ftrs = network.fc.in_features\n","\n"," # Add linear layer with number of classes\n"," network.fc = nn.Linear(num_ftrs, 2)\n","\n"," return network.to(device)\n","\n","def build_optimizer(network, optimizer, learning_rate):\n"," optimizer = optim.SGD(network.parameters(),\n"," lr=learning_rate, momentum=0.9)\n"," return optimizer\n","\n","def train_epoch(network, loader, optimizer, criterion, scheduler, dataset_sizes):\n"," network.train()\n"," confusion = torch.empty([0, 1])\n"," confusion = confusion.to(device)\n"," running_loss = 0.0\n"," running_corrects = 0\n"," for _, (data, target) in enumerate(loader):\n"," data, target = data.to(device), target.to(device)\n"," optimizer.zero_grad()\n","\n"," # ➡ Forward pass\n"," #loss = F.nll_loss(network(data), target)\n"," with torch.set_grad_enabled(True):\n"," outputs = network(data)\n"," _, preds = torch.max(outputs, 1)\n"," loss = criterion(outputs, target)\n"," \n"," #cumu_loss += loss.item()\n"," \n"," running_loss += loss.item() * data.size(0)\n"," running_corrects += torch.sum(preds == target.data)\n","\n"," confusion = torch.cat((confusion, preds[:, None] / target.data[:, None]))\n","\n"," # ⬅ Backward pass + weight update\n"," loss.backward()\n"," optimizer.step()\n","\n"," wandb.log({'train/batch_loss': loss.item()})\n","\n"," scheduler.step()\n","\n"," tp = torch.sum(confusion == 1).item()\n"," fp = torch.sum(confusion == float('inf')).item()\n"," tn = torch.sum(torch.isnan(confusion)).item()\n"," fn = torch.sum(confusion == 0).item()\n"," \n"," precision = tp / (tp + fp)\n"," recall = tp / (tp + fn)\n"," f = 2 * ((precision * recall) / (precision + recall))\n"," \n"," epoch_loss = running_loss / dataset_sizes['train']\n"," epoch_acc = running_corrects.double() / dataset_sizes['train']\n"," \n"," return (epoch_loss, epoch_acc, precision, recall, f, tp, fp, tn, fn)\n","\n","def test(network, loader, optimizer, criterion, dataset_sizes):\n"," network.eval()\n"," confusion = torch.empty([0, 1])\n"," confusion = confusion.to(device)\n"," probabilities = torch.empty([0])\n"," probabilities = probabilities.to(device)\n"," targets = torch.empty([0])\n"," targets = targets.to(device)\n"," running_loss = 0.0\n"," test_corrects = 0\n"," for _, (data, target) in enumerate(loader):\n"," data, target = data.to(device), target.to(device)\n"," optimizer.zero_grad()\n","\n"," # ➡ Forward pass\n"," with torch.set_grad_enabled(False):\n"," outputs = network(data)\n"," _, preds = torch.max(outputs, 1)\n"," # Convert logits to probabilities\n"," targets = torch.cat((targets, target))\n"," probabilities = torch.cat((probabilities, F.softmax(outputs, dim=1)[:, 1]))\n"," loss = criterion(outputs, target)\n","\n"," running_loss += loss.item() * data.size(0)\n"," test_corrects += torch.sum(preds == target.data)\n"," \n"," confusion = torch.cat((confusion, preds[:, None] / target.data[:, None]))\n","\n"," tp = torch.sum(confusion == 1).item()\n"," fp = torch.sum(confusion == float('inf')).item()\n"," tn = torch.sum(torch.isnan(confusion)).item()\n"," fn = torch.sum(confusion == 0).item()\n"," \n"," precision = tp / (tp + fp)\n"," recall = tp / (tp + fn)\n"," f = 2 * ((precision * recall) / (precision + recall))\n"," \n"," epoch_loss = running_loss / dataset_sizes['test']\n"," epoch_acc = test_corrects.double() / dataset_sizes['test']\n"," \n"," y_true = targets.detach().cpu().numpy()\n"," y_score = probabilities.detach().cpu().numpy()\n","\n"," nn_fpr, nn_tpr, nn_thresholds = roc_curve(y_true, y_score)\n","\n"," auc = metrics.roc_auc_score(y_true, y_score)\n"," \n"," return (epoch_loss, epoch_acc, precision, recall, f, tp, fp, tn, fn, y_true, y_score, auc)"]},{"cell_type":"code","execution_count":8,"id":"5eff68bf","metadata":{"id":"5eff68bf","executionInfo":{"status":"ok","timestamp":1682934021957,"user_tz":0,"elapsed":17,"user":{"displayName":"Kranklything","userId":"02979056772560081296"}}},"outputs":[],"source":["def train(config=None):\n"," # Style the plots (with grid this time)\n"," width = 418\n"," sns.set_theme(style='whitegrid',\n"," rc={'text.usetex': True, 'font.family': 'serif', 'axes.labelsize': 10,\n"," 'font.size': 10, 'legend.fontsize': 8,\n"," 'xtick.labelsize': 8, 'ytick.labelsize': 8})\n","\n"," fig_save_dir = '../../thesis/graphics/'\n"," # Initialize a new wandb run\n"," with wandb.init(config=config):\n"," # If called by wandb.agent, as below,\n"," # this config will be set by Sweep Controller\n"," config = wandb.config\n"," \n"," dataset = build_dataset(config.batch_size)\n","\n"," print(\"Dataset targets: \", dataset.targets)\n"," \n"," splits = StratifiedKFold(n_splits=config.k_splits, shuffle=True, random_state=42)\n"," foldperf={}\n","\n"," # Aggregate metrics from best epochs for ROC plot\n"," tprs = []\n"," aucs = []\n"," mean_fpr = np.linspace(0, 1, 100)\n","\n"," # Style the plots (with grid this time)\n"," sns.set_palette('ch:light=0.8,gamma=1.2', n_colors=12)\n"," fig, ax = plt.subplots(1, 1, figsize=(6, 6))\n"," \n"," # Iterate over the folds\n"," for fold, (train_idx, val_idx) in enumerate(splits.split(np.zeros(len(dataset)), dataset.targets)):\n","\n"," print('Fold {}'.format(fold + 1))\n","\n"," train_sampler = SubsetRandomSampler(train_idx)\n"," test_sampler = SubsetRandomSampler(val_idx)\n"," train_loader = DataLoader(dataset, batch_size=config.batch_size, sampler=train_sampler)\n"," test_loader = DataLoader(dataset, batch_size=config.batch_size, sampler=test_sampler)\n"," \n"," dataset_sizes = {'train': len(train_loader.sampler), 'test': len(test_loader.sampler)}\n","\n"," print(\"Dataset sizes: \", dataset_sizes)\n","\n"," network = build_network()\n"," optimizer = build_optimizer(network, config.optimizer, config.learning_rate)\n"," criterion = nn.CrossEntropyLoss()\n"," # Decay LR by a factor of 0.1 every 5 epochs\n"," exp_lr_scheduler = optim.lr_scheduler.StepLR(optimizer, config.step_size)\n","\n"," best_test_auc = 0.0\n"," best_y_true = []\n"," best_y_score = []\n","\n"," for epoch in tqdm(range(config.epochs)): \n"," (train_loss, train_acc, train_precision, train_recall, train_f,\n"," train_tp, train_fp, train_tn, train_fn) = train_epoch(network, train_loader, optimizer,\n"," criterion, exp_lr_scheduler,\n"," dataset_sizes)\n"," wandb.log({'epoch': epoch, 'train/epoch_loss': train_loss, 'train/epoch_acc': train_acc, \n"," 'train/precision': train_precision, 'train/recall': train_recall, 'train/f1-score': train_f,\n"," 'train/tp': train_tp, 'train/fp': train_fp, 'train/tn': train_tn, 'train/fn': train_fn})\n"," \n"," (test_loss, test_acc, test_precision, test_recall, test_f,\n"," test_tp, test_fp, test_tn, test_fn, y_true, y_score, test_auc) = test(network, test_loader,\n"," optimizer, criterion,\n"," dataset_sizes)\n"," wandb.log({'test/epoch_loss': test_loss, 'test/epoch_acc': test_acc,\n"," 'test/precision': test_precision, 'test/recall': test_recall, 'test/f1-score': test_f,\n"," 'test/tp': test_tp, 'test/fp': test_fp, 'test/tn': test_tn, 'test/fn': test_fn,\n"," 'test/y_true': y_true, 'test/y_score': y_score, 'test/auc': test_auc})\n"," if test_auc > best_test_auc:\n"," best_y_true = y_true\n"," best_y_score = y_score\n"," best_test_auc = test_auc\n"," \n"," # Get tpr and fpr\n"," fpr, tpr, thresh = metrics.roc_curve(best_y_true, best_y_score)\n"," ax.plot(fpr,\n"," tpr,\n"," label=r\"Fold %d (AUC = %0.2f)\" % (fold, best_test_auc),\n"," lw=1,\n"," alpha=0.5)\n"," interp_tpr = np.interp(mean_fpr, fpr, tpr)\n"," interp_tpr[0] = 0.0\n"," tprs.append(interp_tpr)\n"," aucs.append(best_test_auc)\n","\n"," network = network.to(torch.device('cpu'))\n"," network.eval() \n"," # Save model as artifact\n"," model_pt = wandb.Artifact(\n"," \"trained-model-pt\", type=\"model\",\n"," description=\"Best Epoch per Fold Pytorch\"\n"," )\n"," torch.save(network.state_dict(), \"resnet-fold-{}.pt\".format(fold))\n"," model_pt.add_file(\"resnet-fold-{}.pt\".format(fold))\n"," #wandb.save(\"resnet-fold-{}.pt\".format(fold))\n"," wandb.log_artifact(model_pt)\n","\n"," # Export model to onnx\n"," model_onnx = wandb.Artifact(\n"," \"trained-model-onnx\", type=\"model\",\n"," description=\"Best Epoch per Fold ONNX\"\n"," )\n"," # Let's create a dummy input tensor \n"," dummy_input = torch.randn(1, 3, 224, 224, requires_grad=True) \n","\n"," # Export the model \n"," torch.onnx.export(network,\n"," dummy_input,\n"," \"resnet-fold-{}.onnx\".format(fold),\n"," export_params=True,\n"," opset_version=11,\n"," do_constant_folding=True,\n"," input_names = ['input'],\n"," output_names = ['output']\n"," ) \n"," model_onnx.add_file(\"resnet-fold-{}.onnx\".format(fold))\n"," wandb.log_artifact(model_onnx)\n"," #wandb.save(\"resnet-fold-{}.onnx\".format(fold))\n","\n"," ax.plot([0, 1], [0, 1], \"k--\", label=\"chance level (AUC = 0.5)\")\n"," mean_tpr = np.mean(tprs, axis=0)\n"," mean_tpr[-1] = 1.0\n"," mean_auc = auc(mean_fpr, mean_tpr)\n"," std_auc = np.std(aucs)\n"," ax.plot(\n"," mean_fpr,\n"," mean_tpr,\n"," #color=\"b\",\n"," label=r\"Mean ROC (AUC = %0.2f $\\pm$ %0.2f\" % (mean_auc, std_auc),\n"," lw=1,\n"," alpha=1,\n"," )\n","\n"," std_tpr = np.std(tprs, axis=0)\n"," tprs_upper = np.minimum(mean_tpr + std_tpr, 1)\n"," tprs_lower = np.maximum(mean_tpr - std_tpr, 0)\n"," ax.fill_between(\n"," mean_fpr,\n"," tprs_lower,\n"," tprs_upper,\n"," color=\"grey\",\n"," alpha=0.4,\n"," label=r\"$\\pm$ 1 std. dev.\",\n"," )\n","\n"," ax.set(\n"," xlim=[-0.05, 1.05],\n"," ylim=[-0.05, 1.05],\n"," xlabel=\"False Positive Rate\",\n"," ylabel=\"True Positive Rate\",\n"," title=f\"Mean ROC curve with variability\\n(Positive label `{dataset.classes[1]}')\",\n"," )\n"," ax.axis(\"square\")\n"," ax.legend(loc=\"lower right\")\n"," fig.tight_layout()\n","\n"," fig.savefig('classifier-hyp-folds.pdf', format='pdf', bbox_inches='tight')\n"," artifact_plot = wandb.Artifact(name=\"ROC\", type=\"metric\")\n"," artifact_plot.add_file(\n"," local_path='classifier-hyp-folds.pdf'\n"," )\n"," wandb.log_artifact(artifact_plot) "]},{"cell_type":"code","execution_count":12,"id":"732a83df","metadata":{"id":"732a83df","executionInfo":{"status":"ok","timestamp":1682934128109,"user_tz":0,"elapsed":0,"user":{"displayName":"Kranklything","userId":"02979056772560081296"}}},"outputs":[],"source":["sweep_config = {\n"," 'method': 'random'\n","}\n","\n","metric = {\n"," 'name': 'test/f1-score',\n"," 'goal': 'maximize' \n","}\n","\n","sweep_config['metric'] = metric\n","\n","parameters_dict = {\n"," 'optimizer': {\n"," 'values': ['sgd']\n"," },\n","}\n","\n","sweep_config['parameters'] = parameters_dict\n","\n","parameters_dict.update({\n"," 'epochs': {\n"," 'value': 25},\n"," 'batch_size': {\n"," 'value': 64},\n"," 'learning_rate': {\n"," 'value': 0.01},\n"," 'step_size': {\n"," 'value': 5},\n"," 'k_splits': {\n"," 'value': 10},\n","})"]},{"cell_type":"code","execution_count":13,"id":"9a01fef6","metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"9a01fef6","executionInfo":{"status":"ok","timestamp":1682934130376,"user_tz":0,"elapsed":1834,"user":{"displayName":"Kranklything","userId":"02979056772560081296"}},"outputId":"d227e860-eb90-4d23-d299-99863f931d46"},"outputs":[{"output_type":"stream","name":"stdout","text":["Create sweep with ID: bq0rvyfn\n","Sweep URL: https://wandb.ai/flower-classification/classifier-optimized/sweeps/bq0rvyfn\n"]}],"source":["sweep_id = wandb.sweep(sweep_config, project=\"classifier-optimized\")"]},{"cell_type":"code","execution_count":null,"id":"e80d1730","metadata":{"scrolled":true,"colab":{"base_uri":"https://localhost:8080/","height":1000,"referenced_widgets":["e5784a8d425b45418ab8558ec841c9a3","151e0d6b3c9c40e6ba932e41a5d97dde","13f26d6e60244562a97a1be6de5eefa7","218deef5c6f2499b942cbcad4eb8a509","dbc2484f228c45e9be617332acbc57e0","e37623ceba1a4b32bb08793d71b7ad89","22606339a44e460ab133da2f13da46d7","bc479ed213d245928630208b4586e570","45c1afaa005e4be690e29e2681f32103","95fa297b33f143a98a96caf596bb6e1b","9dd978a9a04047aeae237f7532a0b957","c1e99ab4f9f442e993d5baadbbe41d4a","fd313f1abdf54dc5b4d6aa8a321a6a0b","eaaea99808a0421ab6f890c02c55e8cf","053cfc47e12048e7854567cf2cc5a35f","76e66680fd794fb6977f140bd1daf951","9374f7eb5f21491b9aca3bfe855d16f9","5d75d43bc5c44be1bbef697027c3b326","539c0821b8b349fd93e1573d936b2897","f9e2b5002da743fa97422b98a8d67cce","9df0b7f5d813457aa03e8e6b59263867","f275ccbb4ec24c81ba2571177ec6a9cb","1104d0e89c06462b9a43701edca3b7ae","a8468fa720a8487aaf1d36ffab086f1e","61d13211abfa479387e445467d0bd911","95e6bab18f8a455e88e31e058005bcc9","376ebbc3287044ab99c8353726259163","77cf087041c0445386911498b021b764","f0ccbc04a2764ffe9226acfa40f55e6b","e6cc7b68e2f44c77accb0a6e916c13a2","71b75595d4b74bbd9c2b81e37848437b","b8f703db3d2345a895813143280ea1bd","537d611d4f0b4649b47e0e5a799a5650","7b5565a86c1641a39312fb9c00d4e0a3","fbd340ec82224c62ba131f4718ac268c","0f43b20b07a34ffcb2777c62505baf79","734dfb4b89334a3eb6200503ff2e93f2","6601cb764c2f404a997a050d6908ca95","d1f97e8c2a534f1cb7764c4cdfdaf3b3","fe468e64db834e708bbaadd1221061a1","5e11f24aef1f4e849ba3b2942ca63fc0","3553c40772b14f1e924fe595d90e902e","77e69995f4ed48528190702c01a8878e","3fdc5b95109c4ab181a62a6ecc224bac","190d49b674df4f4694676ca83559c78c","3780ebb3e8004e0f9dcd277b14ebc26d","19adaa8f366c4a3eb6427b9c64ab56c4","5a7d02e66c914532a98c60312cdb1448","22d523adbb5a41729cdf7261b8c63642","e2a0a8c0365b4ecf964579955f393566","0f1cd82739b64e74a2875a0749362091","ad41a3c6ca2440d1aaa7b75a56c0b05e","6e0990a3e5f34ced8b82e2a5ec149f87","9bf2f554ffb044019f8f1f7cb4d3dd59","10753f6faf2f4db88e930351a97c0ab2","11b6cc7d783e4d6f810293235b7d0243","513c0f038c324764b309b813ab0e74c3","0d6959a3038d4930a1bda9eb8dbb8bda","cd6a1d684efb4b4590c28a84159d9065","90ee236f911046a59516a66010926871","e44b704112b4446e99c202114a035108","cbcfd6bcaec5465fb5bf02cb45ec8c5b","5543960d389e4a9a87bc84485b2b5137","8ce457c6d53c47aa9f7d10681fd2c432","905f6c41655246cdb8aafce57b50129f","bcf1d71564ce499981a8064a86d4724a","716c02127a72437c836ec28a50800aec","ed430882d187410985ebb9de38fa9c20","6bae42ba03644f49b9d1bd73c35b3055","04a19b5de03b4d498c30faf198ed78f2","43d374e4839341da9402b20312841090","12f2a79ed5ba46619a4033adfe23787a","486260c4d5374f29b55dd575e5fe2692","5b8162641d20420b88180e03d2c922a5","c5cd9cab6d424cc4897dfb677bc11c27","74f1d92b9933401ba46c021c2e00550f","95837d2d8c2f4b98b95ae3c3985b7108","bae73a0fa24a4400b2b93045f1423c99","a810e6ab77d64aeeac6d0385e379fc28","a1c06d46b19d478097485f8b508109f0","01f865e7476b4c38a7fe9b7f36168631","9e88a26843fc4c008063a06117f0e3e5","03153930e9d346c2b86bbeca94386b74","703cc702ac8640fc86f808fe2985d558","e299d2cdf56f404189f550f778074933","8d13f8238a38416890cb1a3715e66c63","074b92d3932c44ad95077cd75a9a0d19","75b6dcd206a94adcaf3527503b403613","bf26228e12614dbdb2ad1ba7ba44609c","f71a099ea4244b31b83a7465d987bbbb","83c324533e444a7fbeae7a3a3f8be7c8","d351e1ddae8d4503ba08a92653c4acab","fe3e49e1c6984bd28f68607813128883","cf40ae9765e643169352a525778d7166","da859d0df0f342a8ae9de47b85f08a8c","5687662c752b4eaf9a23048a9804708c","2f21e27379c74cf0bc8804c3f70ac9ae","7a0294853ccd4edcb9b3ed859752cdc4","d283e4d0fd4045cb9064ff71f4390438","c8e0dffe0021410e989d8390195b7f93","a4efed363bd44b9bba85f7337e386668","713bce13549e4f82a12171022dc78a6f","56d4fc0986dc49b58299463e934e7f3c","4fc7d64ad91d493f9d41c9606cb30ad5","dddcb49774024d9cb128b44c330aecb0","6e68165e5ffb4b13913be67b9136ff0f","9c5e1a0992ff49bd8c4a1028201a4d4b","b305d80962e44a108578c0d91ba6a4ea","a648043344c54565abe9f0dd6bcf0c7d","17f7aa15b29c49d2bec99be9b3bc99b2"]},"id":"e80d1730","outputId":"00a8efb3-3d78-4a98-dfe6-c189fcd77f07"},"outputs":[{"output_type":"stream","name":"stderr","text":["\u001b[34m\u001b[1mwandb\u001b[0m: Agent Starting Run: qxhbaz0l with config:\n","\u001b[34m\u001b[1mwandb\u001b[0m: \tbatch_size: 64\n","\u001b[34m\u001b[1mwandb\u001b[0m: \tepochs: 25\n","\u001b[34m\u001b[1mwandb\u001b[0m: \tk_splits: 10\n","\u001b[34m\u001b[1mwandb\u001b[0m: \tlearning_rate: 0.01\n","\u001b[34m\u001b[1mwandb\u001b[0m: \toptimizer: sgd\n","\u001b[34m\u001b[1mwandb\u001b[0m: \tstep_size: 5\n"]},{"output_type":"display_data","data":{"text/plain":[""],"text/html":["Tracking run with wandb version 0.15.0"]},"metadata":{}},{"output_type":"display_data","data":{"text/plain":[""],"text/html":["Run data is saved locally in /content/wandb/run-20230501_094215-qxhbaz0l"]},"metadata":{}},{"output_type":"display_data","data":{"text/plain":[""],"text/html":["Syncing run good-sweep-1 to Weights & Biases (docs)
Sweep page: https://wandb.ai/flower-classification/classifier-optimized/sweeps/bq0rvyfn"]},"metadata":{}},{"output_type":"display_data","data":{"text/plain":[""],"text/html":[" View project at https://wandb.ai/flower-classification/classifier-optimized"]},"metadata":{}},{"output_type":"display_data","data":{"text/plain":[""],"text/html":[" View sweep at https://wandb.ai/flower-classification/classifier-optimized/sweeps/bq0rvyfn"]},"metadata":{}},{"output_type":"display_data","data":{"text/plain":[""],"text/html":[" View run at https://wandb.ai/flower-classification/classifier-optimized/runs/qxhbaz0l"]},"metadata":{}},{"output_type":"stream","name":"stderr","text":["/usr/local/lib/python3.10/dist-packages/torch/utils/data/dataloader.py:561: UserWarning: This DataLoader will create 4 worker processes in total. Our suggested max number of worker in current system is 2, which is smaller than what this DataLoader is going to create. Please be aware that excessive worker creation might get DataLoader running slow or even freeze, lower the worker number to avoid potential slowness/freeze if necessary.\n"," warnings.warn(_create_warning_msg(\n"]},{"output_type":"stream","name":"stdout","text":["Dataset targets: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]\n","Fold 1\n","Dataset sizes: {'train': 813, 'test': 91}\n"]},{"output_type":"stream","name":"stderr","text":["Downloading: \"https://download.pytorch.org/models/resnet50-11ad3fa6.pth\" to /root/.cache/torch/hub/checkpoints/resnet50-11ad3fa6.pth\n","100%|██████████| 97.8M/97.8M [00:00<00:00, 206MB/s]\n"]},{"output_type":"display_data","data":{"text/plain":[" 0%| | 0/25 [00:00