Skip to content
Snippets Groups Projects
Baseline_JC.ipynb 45.8 KiB
Newer Older
  • Learn to ignore specific revisions
  • John Carter's avatar
    John Carter committed
    {
      "cells": [
        {
          "cell_type": "code",
    
          "execution_count": null,
    
    John Carter's avatar
    John Carter committed
          "metadata": {
            "id": "U_ZJ2LqDiu_v"
          },
          "outputs": [],
          "source": [
            "import numpy as np\n",
            "import torch\n",
            "import torch.nn as nn\n",
            "import torch.nn.functional as F\n",
            "import torch.optim as optim\n",
            "import torch.utils.data as data_utils\n",
            "import torchvision\n",
    
            "import torchvision.datasets as datasets\n",
            "from tqdm import trange"
    
    John Carter's avatar
    John Carter committed
          ]
        },
        {
          "cell_type": "code",
    
          "execution_count": null,
    
    John Carter's avatar
    John Carter committed
          "metadata": {
            "id": "4ksS_duLFADW"
          },
          "outputs": [],
          "source": [
            "\"\"\"Define internal NN module that trains on the dataset\"\"\"\n",
            "class LeNet(nn.Module):\n",
    
            "    def __init__(self, img_height, img_width, num_labels, img_channels):\n",
    
    John Carter's avatar
    John Carter committed
            "        super().__init__()\n",
    
            "        self.conv1 = nn.Conv2d(img_channels, 6, 5)\n",
    
    John Carter's avatar
    John Carter committed
            "        self.relu1 = nn.ReLU()\n",
            "        self.pool1 = nn.MaxPool2d(2)\n",
            "        self.conv2 = nn.Conv2d(6, 16, 5)\n",
            "        self.relu2 = nn.ReLU()\n",
            "        self.pool2 = nn.MaxPool2d(2)\n",
    
            "        self.fc1 = nn.Linear(int((((img_height-4)/2-4)/2)*(((img_width-4)/2-4)/2)*16), 120)\n",
    
    John Carter's avatar
    John Carter committed
            "        self.relu3 = nn.ReLU()\n",
            "        self.fc2 = nn.Linear(120, 84)\n",
            "        self.relu4 = nn.ReLU()\n",
    
            "        self.fc3 = nn.Linear(84, num_labels)\n",
    
    John Carter's avatar
    John Carter committed
            "        self.relu5 = nn.ReLU()\n",
            "\n",
            "    def forward(self, x):\n",
            "        y = self.conv1(x)\n",
            "        y = self.relu1(y)\n",
            "        y = self.pool1(y)\n",
            "        y = self.conv2(y)\n",
            "        y = self.relu2(y)\n",
            "        y = self.pool2(y)\n",
            "        y = y.view(y.shape[0], -1)\n",
            "        y = self.fc1(y)\n",
            "        y = self.relu3(y)\n",
            "        y = self.fc2(y)\n",
            "        y = self.relu4(y)\n",
            "        y = self.fc3(y)\n",
            "        y = self.relu5(y)\n",
            "        return y"
          ]
        },
        {
          "cell_type": "code",
    
          "source": [
            "\"\"\"Define internal NN module that trains on the dataset\"\"\"\n",
            "class EasyNet(nn.Module):\n",
            "    def __init__(self, img_height, img_width, num_labels, img_channels):\n",
            "        super().__init__()\n",
            "        self.fc1 = nn.Linear(img_height*img_width*img_channels, 2048)\n",
            "        self.relu1 = nn.ReLU()\n",
            "        self.fc2 = nn.Linear(2048, num_labels)\n",
            "        self.relu2 = nn.ReLU()\n",
            "\n",
            "    def forward(self, x):\n",
            "        y = x.view(x.shape[0], -1)\n",
            "        y = self.fc1(y)\n",
            "        y = self.relu1(y)\n",
            "        y = self.fc2(y)\n",
            "        y = self.relu2(y)\n",
            "        return y"
          ],
          "metadata": {
            "id": "ukf2-C94UWzs"
          },
          "execution_count": null,
          "outputs": []
        },
        {
          "cell_type": "code",
          "source": [
            "\"\"\"Define internal NN module that trains on the dataset\"\"\"\n",
            "class SimpleNet(nn.Module):\n",
            "    def __init__(self, img_height, img_width, num_labels, img_channels):\n",
            "        super().__init__()\n",
            "        self.fc1 = nn.Linear(img_height*img_width*img_channels, num_labels)\n",
            "        self.relu1 = nn.ReLU()\n",
            "\n",
            "    def forward(self, x):\n",
            "        y = x.view(x.shape[0], -1)\n",
            "        y = self.fc1(y)\n",
            "        y = self.relu1(y)\n",
            "        return y"
          ],
          "metadata": {
            "id": "Fd9_36R3zx5B"
          },
          "execution_count": null,
          "outputs": []
        },
        {
          "cell_type": "code",
          "execution_count": null,
    
    John Carter's avatar
    John Carter committed
          "metadata": {
            "id": "xujQtvVWBgMH"
          },
          "outputs": [],
          "source": [
            "\"\"\"Make toy dataset\"\"\"\n",
            "\n",
            "def create_toy(train_dataset, test_dataset, batch_size, n_samples):\n",
            "    \n",
            "    # shuffle and take first n_samples %age of training dataset\n",
            "    shuffle_order_train = np.random.RandomState(seed=100).permutation(len(train_dataset))\n",
            "    shuffled_train_dataset = torch.utils.data.Subset(train_dataset, shuffle_order_train)\n",
            "    indices_train = torch.arange(int(n_samples*len(train_dataset)))\n",
            "    reduced_train_dataset = data_utils.Subset(shuffled_train_dataset, indices_train)\n",
            "\n",
            "    # shuffle and take first n_samples %age of test dataset\n",
            "    shuffle_order_test = np.random.RandomState(seed=1000).permutation(len(test_dataset))\n",
            "    shuffled_test_dataset = torch.utils.data.Subset(test_dataset, shuffle_order_test)\n",
            "    indices_test = torch.arange(int(n_samples*len(test_dataset)))\n",
            "    reduced_test_dataset = data_utils.Subset(shuffled_test_dataset, indices_test)\n",
            "\n",
            "    # push into DataLoader\n",
            "    train_loader = torch.utils.data.DataLoader(reduced_train_dataset, batch_size=batch_size)\n",
            "    test_loader = torch.utils.data.DataLoader(reduced_test_dataset, batch_size=batch_size)\n",
            "\n",
            "    return train_loader, test_loader"
          ]
        },
        {
          "cell_type": "code",
    
          "execution_count": null,
    
    John Carter's avatar
    John Carter committed
          "metadata": {
            "id": "vu_4I4qkbx73"
          },
          "outputs": [],
          "source": [
    
            "def run_baseline(batch_size=32, learning_rate=1e-1, ds=\"MNIST\", toy_size=0.02, max_epochs=100, early_stop_num=10, early_stop_flag=True, average_validation=[15,25], IsLeNet=\"LeNet\"):\n",
    
    John Carter's avatar
    John Carter committed
            "\n",
            "    # create transformations using above info\n",
            "    transform = torchvision.transforms.Compose([\n",
            "        torchvision.transforms.ToTensor()])\n",
            "\n",
            "    # open data and apply these transformations\n",
    
            "    if ds == \"MNIST\":\n",
            "        train_dataset = datasets.MNIST(root='./MetaAugment/train', train=True, download=True, transform=transform)\n",
            "        test_dataset = datasets.MNIST(root='./MetaAugment/test', train=False, download=True, transform=transform)\n",
            "    elif ds == \"KMNIST\":\n",
            "        train_dataset = datasets.KMNIST(root='./MetaAugment/train', train=True, download=True, transform=transform)\n",
            "        test_dataset = datasets.KMNIST(root='./MetaAugment/test', train=False, download=True, transform=transform)\n",
            "    elif ds == \"FashionMNIST\":\n",
            "        train_dataset = datasets.FashionMNIST(root='./MetaAugment/train', train=True, download=True, transform=transform)\n",
            "        test_dataset = datasets.FashionMNIST(root='./MetaAugment/test', train=False, download=True, transform=transform)\n",
            "    elif ds == \"CIFAR10\":\n",
            "        train_dataset = datasets.CIFAR10(root='./MetaAugment/train', train=True, download=True, transform=transform)\n",
            "        test_dataset = datasets.CIFAR10(root='./MetaAugment/test', train=False, download=True, transform=transform)\n",
            "    elif ds == \"CIFAR100\":\n",
            "        train_dataset = datasets.CIFAR100(root='./MetaAugment/train', train=True, download=True, transform=transform)\n",
            "        test_dataset = datasets.CIFAR100(root='./MetaAugment/test', train=False, download=True, transform=transform)\n",
            "\n",
            "    # check sizes of images\n",
            "    img_height = len(train_dataset[0][0][0])\n",
            "    img_width = len(train_dataset[0][0][0][0])\n",
            "    img_channels = len(train_dataset[0][0])\n",
            "\n",
            "    # check output labels\n",
            "    if ds == \"CIFAR10\" or ds == \"CIFAR100\":\n",
            "        num_labels = (max(train_dataset.targets) - min(train_dataset.targets) + 1)\n",
            "    else:\n",
            "        num_labels = (max(train_dataset.targets) - min(train_dataset.targets) + 1).item()\n",
    
    John Carter's avatar
    John Carter committed
            "\n",
            "    # create toy dataset from above uploaded data\n",
            "    train_loader, test_loader = create_toy(train_dataset, test_dataset, batch_size, toy_size)\n",
            "\n",
            "    # create model\n",
    
            "    if IsLeNet == \"LeNet\":\n",
            "        model = LeNet(img_height, img_width, num_labels, img_channels)\n",
            "    elif IsLeNet == \"EasyNet\":\n",
            "        model = EasyNet(img_height, img_width, num_labels, img_channels)\n",
            "    else:\n",
            "        model = SimpleNet(img_height, img_width, num_labels, img_channels)\n",
            "    sgd = optim.SGD(model.parameters(), lr=learning_rate)\n",
    
    John Carter's avatar
    John Carter committed
            "    cost = nn.CrossEntropyLoss()\n",
            "\n",
            "    # set variables for best validation accuracy and early stop count\n",
            "    best_acc = 0\n",
            "    early_stop_cnt = 0\n",
            "    total_val = 0\n",
            "\n",
            "    # train model and check validation accuracy each epoch\n",
            "    for _epoch in range(max_epochs):\n",
            "\n",
            "        # train model\n",
            "        model.train()\n",
            "        for idx, (train_x, train_label) in enumerate(train_loader):\n",
    
            "            label_np = np.zeros((train_label.shape[0], num_labels))\n",
    
    John Carter's avatar
    John Carter committed
            "            sgd.zero_grad()\n",
            "            predict_y = model(train_x.float())\n",
            "            loss = cost(predict_y, train_label.long())\n",
            "            loss.backward()\n",
            "            sgd.step()\n",
            "\n",
            "        # check validation accuracy on validation set\n",
            "        correct = 0\n",
            "        _sum = 0\n",
            "        model.eval()\n",
            "        for idx, (test_x, test_label) in enumerate(test_loader):\n",
            "            predict_y = model(test_x.float()).detach()\n",
            "            predict_ys = np.argmax(predict_y, axis=-1)\n",
            "            label_np = test_label.numpy()\n",
            "            _ = predict_ys == test_label\n",
            "            correct += np.sum(_.numpy(), axis=-1)\n",
            "            _sum += _.shape[0]\n",
            "\n",
            "        acc = correct / _sum\n",
            "\n",
            "        # update the total validation\n",
            "        if average_validation[0] <= _epoch <= average_validation[1]:\n",
            "            total_val += acc\n",
            "\n",
            "        # update best validation accuracy if it was higher, otherwise increase early stop count\n",
            "        if acc > best_acc:\n",
            "            best_acc = acc\n",
            "            early_stop_cnt = 0\n",
            "        else:\n",
            "            early_stop_cnt += 1\n",
            "\n",
            "        # exit if validation gets worse over 10 runs and using early stopping\n",
            "        if early_stop_cnt >= early_stop_num and early_stop_flag:\n",
            "            return best_acc\n",
            "\n",
            "        # exit if using fixed epoch length\n",
            "        if _epoch >= average_validation[1] and not early_stop_flag:\n",
            "            return total_val / (average_validation[1] - average_validation[0] + 1)"
          ]
        },
        {
          "cell_type": "code",
          "source": [
            "batch_size = 32               # size of batch the inner NN is trained with\n",
    
            "learning_rate = 1e-1          # fix learning rate\n",
            "ds = \"CIFAR100\"               # pick dataset (MNIST, KMNIST, FashionMNIST, CIFAR10,...)\n",
    
    John Carter's avatar
    John Carter committed
            "toy_size = 0.02               # total propeortion of training and test set we use\n",
            "max_epochs = 100              # max number of epochs that is run if early stopping is not hit\n",
            "early_stop_num = 10           # max number of worse validation scores before early stopping is triggered\n",
            "early_stop_flag = True        # implement early stopping or not\n",
            "average_validation = [15,25]  # if not implementing early stopping, what epochs are we averaging over\n",
    
            "num_iterations = 5            # how many iterations are we averaging over\n",
            "IsLeNet = \"LeNet\"             # using LeNet or EasyNet or SimpleNet\n",
    
    John Carter's avatar
    John Carter committed
            "\n",
            "# run using early stopping\n",
            "best_accuracies = []\n",
    
            "for baselines in trange(num_iterations):\n",
            "    best_acc = run_baseline(batch_size, learning_rate, ds, toy_size, max_epochs, early_stop_num, early_stop_flag, average_validation, IsLeNet)\n",
    
    John Carter's avatar
    John Carter committed
            "    best_accuracies.append(best_acc)\n",
            "    if baselines % 10 == 0:\n",
            "        print(\"{}\\tBest accuracy: {:.2f}%\".format(baselines, best_acc*100))\n",
            "print(\"Average best accuracy: {:.2f}%\\n\".format(np.mean(best_accuracies)*100))\n",
            "\n",
            "# run using average validation losses\n",
            "early_stop_flag = False\n",
            "best_accuracies = []\n",
    
            "for baselines in trange(num_iterations):\n",
            "    best_acc = run_baseline(batch_size, learning_rate, ds, toy_size, max_epochs, early_stop_num, early_stop_flag, average_validation, IsLeNet)\n",
    
    John Carter's avatar
    John Carter committed
            "    best_accuracies.append(best_acc)\n",
            "    if baselines % 10 == 0:\n",
            "        print(\"{}\\tAverage accuracy: {:.2f}%\".format(baselines, best_acc*100))\n",
            "print(\"Average average accuracy: {:.2f}%\\n\".format(np.mean(best_accuracies)*100))"
          ],
          "metadata": {
            "colab": {
    
              "base_uri": "https://localhost:8080/",
              "height": 628,
              "referenced_widgets": [
                "3444759606834a61b3e1600265be1209",
                "5bc0168880224bcf80e24f063092dd5c",
                "e5f811f9dda3441dbe65720445f65a2a",
                "2e6d4b79fe44499ea169b2bc4b19dbf9",
                "74698cccbe58479099794d1225c20845",
                "4d2518608b744df4a01c1054c946f7b7",
                "7f56d005bba744c99616b0de1a04edd7",
                "2751bf11c3f642caa95e4fd3d984f587",
                "f22c99aefa3a481a9684c7e3499a2cf7",
                "f21e438dfe574505a197bf6e79ac5b81",
                "f31f480d91044a1a9e9ca29d28aa602e",
                "9e520f656fa142f49eca4f18ba7e6925",
                "d93cea42368d471a88b415c81547902f",
                "d4b1a281cb004fd58322007e93624e8d",
                "580c2f044ee44d5bb713723164924742",
                "d2f8a05ad2994e1ebfc2c26f8271b689",
                "7b268a2bfa824057b9d79fc15a92bea5",
                "a8c801adeed34526902c1c4b50b98586",
                "179583ccc6c4403b8ecc114b9d14b449",
                "a919f3d64c654ee69661c6e1c65eae88",
                "0f8499130e7f4b07b25ff8df6ccbe195",
                "4aaa1d729df34f9ab8ae8f07df8ba0e2"
              ]
    
    John Carter's avatar
    John Carter committed
            },
            "id": "KVhYheLfBP33",
    
            "outputId": "a81aee8f-4c8d-4f8c-9304-4a93ce77535e"
    
    John Carter's avatar
    John Carter committed
          },
    
          "execution_count": null,
    
    John Carter's avatar
    John Carter committed
          "outputs": [
    
            {
              "output_type": "stream",
              "name": "stderr",
              "text": [
                "\r  0%|          | 0/5 [00:00<?, ?it/s]"
              ]
            },
            {
              "output_type": "stream",
              "name": "stdout",
              "text": [
                "Downloading https://www.cs.toronto.edu/~kriz/cifar-100-python.tar.gz to ./MetaAugment/train/cifar-100-python.tar.gz\n"
              ]
            },
            {
              "output_type": "display_data",
              "data": {
                "text/plain": [
                  "  0%|          | 0/169001437 [00:00<?, ?it/s]"
                ],
                "application/vnd.jupyter.widget-view+json": {
                  "version_major": 2,
                  "version_minor": 0,
                  "model_id": "3444759606834a61b3e1600265be1209"
                }
              },
              "metadata": {}
            },
            {
              "output_type": "stream",
              "name": "stdout",
              "text": [
                "Extracting ./MetaAugment/train/cifar-100-python.tar.gz to ./MetaAugment/train\n",
                "Downloading https://www.cs.toronto.edu/~kriz/cifar-100-python.tar.gz to ./MetaAugment/test/cifar-100-python.tar.gz\n"
              ]
            },
            {
              "output_type": "display_data",
              "data": {
                "text/plain": [
                  "  0%|          | 0/169001437 [00:00<?, ?it/s]"
                ],
                "application/vnd.jupyter.widget-view+json": {
                  "version_major": 2,
                  "version_minor": 0,
                  "model_id": "9e520f656fa142f49eca4f18ba7e6925"
                }
              },
              "metadata": {}
            },
            {
              "output_type": "stream",
              "name": "stdout",
              "text": [
                "Extracting ./MetaAugment/test/cifar-100-python.tar.gz to ./MetaAugment/test\n"
              ]
            },
            {
              "output_type": "stream",
              "name": "stderr",
              "text": [
                "\r 20%|██        | 1/5 [00:19<01:16, 19.24s/it]"
              ]
            },
            {
              "output_type": "stream",
              "name": "stdout",
              "text": [
                "0\tBest accuracy: 1.00%\n",
                "Files already downloaded and verified\n",
                "Files already downloaded and verified\n"
              ]
            },
            {
              "output_type": "stream",
              "name": "stderr",
              "text": [
                "\r 40%|████      | 2/5 [00:35<00:51, 17.21s/it]"
              ]
            },
            {
              "output_type": "stream",
              "name": "stdout",
              "text": [
                "Files already downloaded and verified\n",
                "Files already downloaded and verified\n"
              ]
            },
            {
              "output_type": "stream",
              "name": "stderr",
              "text": [
                "\r 60%|██████    | 3/5 [00:43<00:26, 13.33s/it]"
              ]
            },
            {
              "output_type": "stream",
              "name": "stdout",
              "text": [
                "Files already downloaded and verified\n",
                "Files already downloaded and verified\n"
              ]
            },
            {
              "output_type": "stream",
              "name": "stderr",
              "text": [
                "\r 80%|████████  | 4/5 [01:12<00:19, 19.50s/it]"
              ]
            },
            {
              "output_type": "stream",
              "name": "stdout",
              "text": [
                "Files already downloaded and verified\n",
                "Files already downloaded and verified\n"
              ]
            },
            {
              "output_type": "stream",
              "name": "stderr",
              "text": [
                "100%|██████████| 5/5 [01:18<00:00, 15.67s/it]\n"
              ]
            },
            {
              "output_type": "stream",
              "name": "stdout",
              "text": [
                "Average best accuracy: 4.00%\n",
                "\n"
              ]
            },
            {
              "output_type": "stream",
              "name": "stderr",
              "text": [
                "\r  0%|          | 0/5 [00:00<?, ?it/s]"
              ]
            },
            {
              "output_type": "stream",
              "name": "stdout",
              "text": [
                "Files already downloaded and verified\n",
                "Files already downloaded and verified\n"
              ]
            },
            {
              "output_type": "stream",
              "name": "stderr",
              "text": [
                "\r 20%|██        | 1/5 [00:11<00:44, 11.15s/it]"
              ]
            },
            {
              "output_type": "stream",
              "name": "stdout",
              "text": [
                "0\tAverage accuracy: 1.86%\n",
                "Files already downloaded and verified\n",
                "Files already downloaded and verified\n"
              ]
            },
            {
              "output_type": "stream",
              "name": "stderr",
              "text": [
                "\r 40%|████      | 2/5 [00:22<00:33, 11.04s/it]"
              ]
            },
            {
              "output_type": "stream",
              "name": "stdout",
              "text": [
                "Files already downloaded and verified\n",
                "Files already downloaded and verified\n"
              ]
            },
            {
              "output_type": "stream",
              "name": "stderr",
              "text": [
                "\r 60%|██████    | 3/5 [00:33<00:21, 10.98s/it]"
              ]
            },
            {
              "output_type": "stream",
              "name": "stdout",
              "text": [
                "Files already downloaded and verified\n",
                "Files already downloaded and verified\n"
              ]
            },
            {
              "output_type": "stream",
              "name": "stderr",
              "text": [
                "\r 80%|████████  | 4/5 [00:44<00:11, 11.05s/it]"
              ]
            },
            {
              "output_type": "stream",
              "name": "stdout",
              "text": [
                "Files already downloaded and verified\n",
                "Files already downloaded and verified\n"
              ]
            },
            {
              "output_type": "stream",
              "name": "stderr",
              "text": [
                "100%|██████████| 5/5 [00:55<00:00, 11.06s/it]"
              ]
            },
    
    John Carter's avatar
    John Carter committed
            {
              "output_type": "stream",
              "name": "stdout",
              "text": [
    
                "Average average accuracy: 1.97%\n",
                "\n"
              ]
            },
            {
              "output_type": "stream",
              "name": "stderr",
              "text": [
    
    John Carter's avatar
    John Carter committed
                "\n"
              ]
            }
          ]
        }
      ],
      "metadata": {
        "colab": {
          "collapsed_sections": [],
          "name": "Baseline.ipynb",
          "provenance": []
        },
        "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.7.7"
    
    573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000
        },
        "accelerator": "GPU",
        "widgets": {
          "application/vnd.jupyter.widget-state+json": {
            "3444759606834a61b3e1600265be1209": {
              "model_module": "@jupyter-widgets/controls",
              "model_name": "HBoxModel",
              "model_module_version": "1.5.0",
              "state": {
                "_dom_classes": [],
                "_model_module": "@jupyter-widgets/controls",
                "_model_module_version": "1.5.0",
                "_model_name": "HBoxModel",
                "_view_count": null,
                "_view_module": "@jupyter-widgets/controls",
                "_view_module_version": "1.5.0",
                "_view_name": "HBoxView",
                "box_style": "",
                "children": [
                  "IPY_MODEL_5bc0168880224bcf80e24f063092dd5c",
                  "IPY_MODEL_e5f811f9dda3441dbe65720445f65a2a",
                  "IPY_MODEL_2e6d4b79fe44499ea169b2bc4b19dbf9"
                ],
                "layout": "IPY_MODEL_74698cccbe58479099794d1225c20845"
              }
            },
            "5bc0168880224bcf80e24f063092dd5c": {
              "model_module": "@jupyter-widgets/controls",
              "model_name": "HTMLModel",
              "model_module_version": "1.5.0",
              "state": {
                "_dom_classes": [],
                "_model_module": "@jupyter-widgets/controls",
                "_model_module_version": "1.5.0",
                "_model_name": "HTMLModel",
                "_view_count": null,
                "_view_module": "@jupyter-widgets/controls",
                "_view_module_version": "1.5.0",
                "_view_name": "HTMLView",
                "description": "",
                "description_tooltip": null,
                "layout": "IPY_MODEL_4d2518608b744df4a01c1054c946f7b7",
                "placeholder": "​",
                "style": "IPY_MODEL_7f56d005bba744c99616b0de1a04edd7",
                "value": ""
              }
            },
            "e5f811f9dda3441dbe65720445f65a2a": {
              "model_module": "@jupyter-widgets/controls",
              "model_name": "FloatProgressModel",
              "model_module_version": "1.5.0",
              "state": {
                "_dom_classes": [],
                "_model_module": "@jupyter-widgets/controls",
                "_model_module_version": "1.5.0",
                "_model_name": "FloatProgressModel",
                "_view_count": null,
                "_view_module": "@jupyter-widgets/controls",
                "_view_module_version": "1.5.0",
                "_view_name": "ProgressView",
                "bar_style": "success",
                "description": "",
                "description_tooltip": null,
                "layout": "IPY_MODEL_2751bf11c3f642caa95e4fd3d984f587",
                "max": 169001437,
                "min": 0,
                "orientation": "horizontal",
                "style": "IPY_MODEL_f22c99aefa3a481a9684c7e3499a2cf7",
                "value": 169001437
              }
            },
            "2e6d4b79fe44499ea169b2bc4b19dbf9": {
              "model_module": "@jupyter-widgets/controls",
              "model_name": "HTMLModel",
              "model_module_version": "1.5.0",
              "state": {
                "_dom_classes": [],
                "_model_module": "@jupyter-widgets/controls",
                "_model_module_version": "1.5.0",
                "_model_name": "HTMLModel",
                "_view_count": null,
                "_view_module": "@jupyter-widgets/controls",
                "_view_module_version": "1.5.0",
                "_view_name": "HTMLView",
                "description": "",
                "description_tooltip": null,
                "layout": "IPY_MODEL_f21e438dfe574505a197bf6e79ac5b81",
                "placeholder": "​",
                "style": "IPY_MODEL_f31f480d91044a1a9e9ca29d28aa602e",
                "value": " 169001984/? [00:03&lt;00:00, 51293490.50it/s]"
              }
            },
            "74698cccbe58479099794d1225c20845": {
              "model_module": "@jupyter-widgets/base",
              "model_name": "LayoutModel",
              "model_module_version": "1.2.0",
              "state": {
                "_model_module": "@jupyter-widgets/base",
                "_model_module_version": "1.2.0",
                "_model_name": "LayoutModel",
                "_view_count": null,
                "_view_module": "@jupyter-widgets/base",
                "_view_module_version": "1.2.0",
                "_view_name": "LayoutView",
                "align_content": null,
                "align_items": null,
                "align_self": null,
                "border": 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,
                "overflow_x": null,
                "overflow_y": null,
                "padding": null,
                "right": null,
                "top": null,
                "visibility": null,
                "width": null
              }
            },
            "4d2518608b744df4a01c1054c946f7b7": {
              "model_module": "@jupyter-widgets/base",
              "model_name": "LayoutModel",
              "model_module_version": "1.2.0",
              "state": {
                "_model_module": "@jupyter-widgets/base",
                "_model_module_version": "1.2.0",
                "_model_name": "LayoutModel",
                "_view_count": null,
                "_view_module": "@jupyter-widgets/base",
                "_view_module_version": "1.2.0",
                "_view_name": "LayoutView",
                "align_content": null,
                "align_items": null,
                "align_self": null,
                "border": 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,
                "overflow_x": null,
                "overflow_y": null,
                "padding": null,
                "right": null,
                "top": null,
                "visibility": null,
                "width": null
              }
            },
            "7f56d005bba744c99616b0de1a04edd7": {
              "model_module": "@jupyter-widgets/controls",
              "model_name": "DescriptionStyleModel",
              "model_module_version": "1.5.0",
              "state": {
                "_model_module": "@jupyter-widgets/controls",
                "_model_module_version": "1.5.0",
                "_model_name": "DescriptionStyleModel",
                "_view_count": null,
                "_view_module": "@jupyter-widgets/base",
                "_view_module_version": "1.2.0",
                "_view_name": "StyleView",
                "description_width": ""
              }
            },
            "2751bf11c3f642caa95e4fd3d984f587": {
              "model_module": "@jupyter-widgets/base",
              "model_name": "LayoutModel",
              "model_module_version": "1.2.0",
              "state": {
                "_model_module": "@jupyter-widgets/base",
                "_model_module_version": "1.2.0",
                "_model_name": "LayoutModel",
                "_view_count": null,
                "_view_module": "@jupyter-widgets/base",
                "_view_module_version": "1.2.0",
                "_view_name": "LayoutView",
                "align_content": null,
                "align_items": null,
                "align_self": null,
                "border": 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,
                "overflow_x": null,
                "overflow_y": null,
                "padding": null,
                "right": null,
                "top": null,
                "visibility": null,
                "width": null
              }
            },
            "f22c99aefa3a481a9684c7e3499a2cf7": {
              "model_module": "@jupyter-widgets/controls",
              "model_name": "ProgressStyleModel",
              "model_module_version": "1.5.0",
              "state": {
                "_model_module": "@jupyter-widgets/controls",
                "_model_module_version": "1.5.0",
                "_model_name": "ProgressStyleModel",
                "_view_count": null,
                "_view_module": "@jupyter-widgets/base",
                "_view_module_version": "1.2.0",
                "_view_name": "StyleView",
                "bar_color": null,
                "description_width": ""
              }
            },
            "f21e438dfe574505a197bf6e79ac5b81": {
              "model_module": "@jupyter-widgets/base",
              "model_name": "LayoutModel",
              "model_module_version": "1.2.0",
              "state": {
                "_model_module": "@jupyter-widgets/base",
                "_model_module_version": "1.2.0",
                "_model_name": "LayoutModel",
                "_view_count": null,
                "_view_module": "@jupyter-widgets/base",
                "_view_module_version": "1.2.0",
                "_view_name": "LayoutView",
                "align_content": null,
                "align_items": null,
                "align_self": null,
                "border": 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,
                "overflow_x": null,
                "overflow_y": null,
                "padding": null,
                "right": null,
                "top": null,
                "visibility": null,
                "width": null
              }
            },
            "f31f480d91044a1a9e9ca29d28aa602e": {
              "model_module": "@jupyter-widgets/controls",
              "model_name": "DescriptionStyleModel",
              "model_module_version": "1.5.0",
              "state": {
                "_model_module": "@jupyter-widgets/controls",
                "_model_module_version": "1.5.0",
                "_model_name": "DescriptionStyleModel",
                "_view_count": null,
                "_view_module": "@jupyter-widgets/base",
                "_view_module_version": "1.2.0",
                "_view_name": "StyleView",
                "description_width": ""
              }
            },
            "9e520f656fa142f49eca4f18ba7e6925": {
              "model_module": "@jupyter-widgets/controls",
              "model_name": "HBoxModel",
              "model_module_version": "1.5.0",
              "state": {
                "_dom_classes": [],
                "_model_module": "@jupyter-widgets/controls",
                "_model_module_version": "1.5.0",
                "_model_name": "HBoxModel",
                "_view_count": null,
                "_view_module": "@jupyter-widgets/controls",
                "_view_module_version": "1.5.0",
                "_view_name": "HBoxView",
                "box_style": "",
                "children": [
                  "IPY_MODEL_d93cea42368d471a88b415c81547902f",
                  "IPY_MODEL_d4b1a281cb004fd58322007e93624e8d",
                  "IPY_MODEL_580c2f044ee44d5bb713723164924742"
                ],
                "layout": "IPY_MODEL_d2f8a05ad2994e1ebfc2c26f8271b689"
              }
            },
            "d93cea42368d471a88b415c81547902f": {
              "model_module": "@jupyter-widgets/controls",
              "model_name": "HTMLModel",
              "model_module_version": "1.5.0",
              "state": {
                "_dom_classes": [],
                "_model_module": "@jupyter-widgets/controls",
                "_model_module_version": "1.5.0",
                "_model_name": "HTMLModel",
                "_view_count": null,
                "_view_module": "@jupyter-widgets/controls",
                "_view_module_version": "1.5.0",
                "_view_name": "HTMLView",
                "description": "",
                "description_tooltip": null,
                "layout": "IPY_MODEL_7b268a2bfa824057b9d79fc15a92bea5",
                "placeholder": "​",
                "style": "IPY_MODEL_a8c801adeed34526902c1c4b50b98586",
                "value": ""
              }
            },
            "d4b1a281cb004fd58322007e93624e8d": {
              "model_module": "@jupyter-widgets/controls",
              "model_name": "FloatProgressModel",
              "model_module_version": "1.5.0",
              "state": {
                "_dom_classes": [],
                "_model_module": "@jupyter-widgets/controls",
                "_model_module_version": "1.5.0",
                "_model_name": "FloatProgressModel",
                "_view_count": null,
                "_view_module": "@jupyter-widgets/controls",
                "_view_module_version": "1.5.0",
                "_view_name": "ProgressView",
                "bar_style": "success",
                "description": "",
                "description_tooltip": null,
                "layout": "IPY_MODEL_179583ccc6c4403b8ecc114b9d14b449",
                "max": 169001437,
                "min": 0,
                "orientation": "horizontal",
                "style": "IPY_MODEL_a919f3d64c654ee69661c6e1c65eae88",
                "value": 169001437
              }
            },
            "580c2f044ee44d5bb713723164924742": {
              "model_module": "@jupyter-widgets/controls",
              "model_name": "HTMLModel",
              "model_module_version": "1.5.0",
              "state": {
                "_dom_classes": [],
                "_model_module": "@jupyter-widgets/controls",
                "_model_module_version": "1.5.0",
                "_model_name": "HTMLModel",
                "_view_count": null,
                "_view_module": "@jupyter-widgets/controls",
                "_view_module_version": "1.5.0",
                "_view_name": "HTMLView",
                "description": "",
                "description_tooltip": null,