diff --git a/classification/classifier/classifier_hyp.ipynb b/classification/classifier/classifier_hyp.ipynb index 5eac981..23456a2 100644 --- a/classification/classifier/classifier_hyp.ipynb +++ b/classification/classifier/classifier_hyp.ipynb @@ -1,3370 +1,3400 @@ { - "cells": [ - { - "cell_type": "code", - "execution_count": 1, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "CkZsS-w4atkF", - "outputId": "f3a78987-dbd2-4771-92ca-69cdf97d0571" - }, - "outputs": [ - { - "output_type": "stream", - "name": "stdout", - "text": [ - "Mounted at /content/drive\n" - ] - } - ], - "source": [ - "from google.colab import drive\n", - "drive.mount('/content/drive')" - ], - "id": "CkZsS-w4atkF" - }, - { - "cell_type": "code", - "execution_count": 2, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "zzWoPgRpd1xn", - "outputId": "daa8edca-5ddf-4ac8-cb91-b4e77f9cc858" - }, - "outputs": [ - { - "output_type": "stream", - "name": "stdout", - "text": [ - "Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/\n", - "Collecting wandb\n", - " Downloading wandb-0.14.0-py3-none-any.whl (2.0 MB)\n", - "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m2.0/2.0 MB\u001b[0m \u001b[31m27.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", - "\u001b[?25hCollecting sentry-sdk>=1.0.0\n", - " Downloading sentry_sdk-1.19.0-py2.py3-none-any.whl (199 kB)\n", - "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m199.2/199.2 KB\u001b[0m \u001b[31m25.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", - "\u001b[?25hRequirement already satisfied: setuptools in /usr/local/lib/python3.9/dist-packages (from wandb) (67.6.1)\n", - "Requirement already satisfied: protobuf!=4.21.0,<5,>=3.15.0 in /usr/local/lib/python3.9/dist-packages (from wandb) (3.20.3)\n", - "Requirement already satisfied: psutil>=5.0.0 in /usr/local/lib/python3.9/dist-packages (from wandb) (5.9.4)\n", - "Requirement already satisfied: requests<3,>=2.0.0 in /usr/local/lib/python3.9/dist-packages (from wandb) (2.27.1)\n", - "Collecting GitPython!=3.1.29,>=1.0.0\n", - " Downloading GitPython-3.1.31-py3-none-any.whl (184 kB)\n", - "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m184.3/184.3 KB\u001b[0m \u001b[31m22.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", - "\u001b[?25hRequirement already satisfied: appdirs>=1.4.3 in /usr/local/lib/python3.9/dist-packages (from wandb) (1.4.4)\n", - "Collecting docker-pycreds>=0.4.0\n", - " Downloading docker_pycreds-0.4.0-py2.py3-none-any.whl (9.0 kB)\n", - "Collecting setproctitle\n", - " Downloading setproctitle-1.3.2-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (30 kB)\n", - "Requirement already satisfied: Click!=8.0.0,>=7.0 in /usr/local/lib/python3.9/dist-packages (from wandb) (8.1.3)\n", - "Requirement already satisfied: PyYAML in /usr/local/lib/python3.9/dist-packages (from wandb) (6.0)\n", - "Requirement already satisfied: typing-extensions in /usr/local/lib/python3.9/dist-packages (from wandb) (4.5.0)\n", - "Collecting pathtools\n", - " Downloading pathtools-0.1.2.tar.gz (11 kB)\n", - " Preparing metadata (setup.py) ... \u001b[?25l\u001b[?25hdone\n", - "Requirement already satisfied: six>=1.4.0 in /usr/local/lib/python3.9/dist-packages (from docker-pycreds>=0.4.0->wandb) (1.16.0)\n", - "Collecting gitdb<5,>=4.0.1\n", - " Downloading gitdb-4.0.10-py3-none-any.whl (62 kB)\n", - "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m62.7/62.7 KB\u001b[0m \u001b[31m8.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", - "\u001b[?25hRequirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.9/dist-packages (from requests<3,>=2.0.0->wandb) (3.4)\n", - "Requirement already satisfied: charset-normalizer~=2.0.0 in /usr/local/lib/python3.9/dist-packages (from requests<3,>=2.0.0->wandb) (2.0.12)\n", - "Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.9/dist-packages (from requests<3,>=2.0.0->wandb) (2022.12.7)\n", - "Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/local/lib/python3.9/dist-packages (from requests<3,>=2.0.0->wandb) (1.26.15)\n", - "Collecting smmap<6,>=3.0.1\n", - " Downloading smmap-5.0.0-py3-none-any.whl (24 kB)\n", - "Building wheels for collected packages: pathtools\n", - " Building wheel for pathtools (setup.py) ... \u001b[?25l\u001b[?25hdone\n", - " Created wheel for pathtools: filename=pathtools-0.1.2-py3-none-any.whl size=8807 sha256=e0132d67db355152a3925f1b0367a996c977716084c67122838eac002d321662\n", - " Stored in directory: /root/.cache/pip/wheels/b7/0a/67/ada2a22079218c75a88361c0782855cc72aebc4d18d0289d05\n", - "Successfully built pathtools\n", - "Installing collected packages: pathtools, smmap, setproctitle, sentry-sdk, docker-pycreds, gitdb, GitPython, wandb\n", - "Successfully installed GitPython-3.1.31 docker-pycreds-0.4.0 gitdb-4.0.10 pathtools-0.1.2 sentry-sdk-1.19.0 setproctitle-1.3.2 smmap-5.0.0 wandb-0.14.0\n" - ] - } - ], - "source": [ - "!pip install wandb" - ], - "id": "zzWoPgRpd1xn" - }, - { - "cell_type": "code", - "execution_count": 3, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/", - "height": 121 - }, - "id": "747ddcf2", - "outputId": "ebf3b723-ac7b-41ba-a9a6-e2e82e907879" - }, - "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": 3 - } - ], - "source": [ - "import wandb\n", - "\n", - "wandb.login()" - ], - "id": "747ddcf2" - }, - { - "cell_type": "code", - "execution_count": 4, - "metadata": { - "id": "c37343d6" - }, - "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", - "import numpy as np\n", - "import os\n", - "import time\n", - "import copy\n", - "import random\n", - "from sklearn import metrics\n", - "\n", - "torch.manual_seed(42)\n", - "np.random.seed(42)\n", - "\n", - "device = torch.device(\"cuda\" if torch.cuda.is_available() else \"cpu\")" - ], - "id": "c37343d6" - }, - { - "cell_type": "code", - "execution_count": 5, - "metadata": { - "id": "17b25dc7" - }, - "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", - "\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 (dataloaders, dataset_sizes)\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, beta_one, beta_two, eps):\n", - " if optimizer == \"sgd\":\n", - " optimizer = optim.SGD(network.parameters(),\n", - " lr=learning_rate, momentum=0.9)\n", - " elif optimizer == \"adam\":\n", - " optimizer = optim.Adam(network.parameters(),\n", - " lr=learning_rate,\n", - " betas=(beta_one, beta_two),\n", - " eps=eps)\n", - " return optimizer\n", - "\n", - "def train_epoch(network, loader, optimizer, criterion, scheduler, dataset_sizes):\n", - " network.train()\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", - " # ⬅ 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", - " epoch_loss = running_loss / dataset_sizes['train']\n", - " epoch_acc = running_corrects.double() / dataset_sizes['train']\n", - " \n", - " return (epoch_loss, epoch_acc)\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", - " 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", - " 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", - " return (epoch_loss, epoch_acc, precision, recall, f)" - ], - "id": "17b25dc7" - }, - { - "cell_type": "code", - "execution_count": 6, - "metadata": { - "id": "5eff68bf" - }, - "outputs": [], - "source": [ - "def train(config=None):\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", - " (dataloaders, dataset_sizes) = build_dataset(config.batch_size)\n", - " network = build_network()\n", - " optimizer = build_optimizer(network, config.optimizer, config.learning_rate, config.beta_one,\n", - " config.beta_two, config.eps)\n", - " criterion = nn.CrossEntropyLoss()\n", - " # Decay LR by a factor of 0.1 every 7 epochs\n", - " exp_lr_scheduler = optim.lr_scheduler.StepLR(optimizer, config.step_size, config.gamma)\n", - "\n", - " for epoch in range(config.epochs): \n", - " (epoch_loss, epoch_acc) = train_epoch(network, dataloaders['train'], optimizer,\n", - " criterion, exp_lr_scheduler,\n", - " dataset_sizes)\n", - " wandb.log({\"epoch\": epoch, 'train/epoch_loss': epoch_loss, 'train/epoch_acc': epoch_acc})\n", - " \n", - " (test_loss, test_acc, test_precision, test_recall, test_f) = test(network, dataloaders['test'],\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,\n", - " 'test/f1-score': test_f})" - ], - "id": "5eff68bf" - }, - { - "cell_type": "code", - "execution_count": 7, - "metadata": { - "id": "732a83df" - }, - "outputs": [], - "source": [ - "sweep_config = {\n", - " 'method': 'random'\n", - "}\n", - "\n", - "metric = {\n", - " 'name': 'test/epoch_acc',\n", - " 'goal': 'maximize' \n", - "}\n", - "\n", - "sweep_config['metric'] = metric\n", - "\n", - "parameters_dict = {\n", - " 'optimizer': {\n", - " 'values': ['adam', 'sgd']\n", - " },\n", - "}\n", - "\n", - "sweep_config['parameters'] = parameters_dict\n", - "\n", - "parameters_dict.update({\n", - " 'epochs': {\n", - " 'value': 10},\n", - " 'batch_size': {\n", - " 'values': [4, 8, 16, 32, 64]},\n", - " 'learning_rate': {\n", - " 'values': [0.1, 0.01, 0.003, 0.001, 0.0003, 0.0001]},\n", - " 'step_size': {\n", - " 'values': [2, 3, 5, 7]},\n", - " 'gamma': {\n", - " 'values': [0.1, 0.5]},\n", - " 'beta_one': {\n", - " 'values': [0.9, 0.99]},\n", - " 'beta_two': {\n", - " 'values': [0.5, 0.9, 0.99, 0.999]},\n", - " 'eps': {\n", - " 'values': [1e-08, 0.1, 1]}\n", - "})" - ], - "id": "732a83df" - }, - { - "cell_type": "code", - "execution_count": 8, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "9a01fef6", - "outputId": "dd802f5b-fd67-4e16-c042-f7fdbe65d568" - }, - "outputs": [ - { - "output_type": "stream", - "name": "stdout", - "text": [ - "Create sweep with ID: 9681wnh0\n", - "Sweep URL: https://wandb.ai/flower-classification/pytorch-sweeps-demo/sweeps/9681wnh0\n" - ] - } - ], - "source": [ - "sweep_id = wandb.sweep(sweep_config, project=\"pytorch-sweeps-demo\")" - ], - "id": "9a01fef6" - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/", - "height": 1000, - "referenced_widgets": [ - "e840ed026b3342718c0aa068f81d93f3", - "d510d413136c4231bc720200145a5d77", - "a6a0d4738d434aa1b734c8407dde4e74", - "9e4d93cf62094092809fee70ba7885f5", - "32a491d3031c476da2d8687861ccbf7d", - "ff00a24840224f8d9cce9ade4e77ac0c", - "d8ec9c75b1f14686a6734b86eea24bb7", - "220d541b7b4347b08a7fc9b8feb09f98" - ] - }, - "id": "e80d1730", - "outputId": "fb105ba8-6c50-4e19-9d02-88a9e8357bc0" - }, - "outputs": [ - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\u001b[34m\u001b[1mwandb\u001b[0m: Agent Starting Run: pw52k3j3 with config:\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tbatch_size: 8\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tbeta_one: 0.9\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tbeta_two: 0.99\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tepochs: 10\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \teps: 1\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tgamma: 0.1\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tlearning_rate: 0.0001\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \toptimizer: sgd\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tstep_size: 3\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: Currently logged in as: \u001b[33me1527193\u001b[0m (\u001b[33mflower-classification\u001b[0m). Use \u001b[1m`wandb login --relogin`\u001b[0m to force relogin\n" - ] - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "Tracking run with wandb version 0.14.0" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "Run data is saved locally in /content/wandb/run-20230404_135456-pw52k3j3" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "Syncing run snowy-sweep-1 to Weights & Biases (docs)
Sweep page: https://wandb.ai/flower-classification/pytorch-sweeps-demo/sweeps/9681wnh0" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - " View project at https://wandb.ai/flower-classification/pytorch-sweeps-demo" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - " View sweep at https://wandb.ai/flower-classification/pytorch-sweeps-demo/sweeps/9681wnh0" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - " View run at https://wandb.ai/flower-classification/pytorch-sweeps-demo/runs/pw52k3j3" - ] - }, - "metadata": {} - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "/usr/local/lib/python3.9/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", - "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, 236MB/s]\n" - ] - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "Waiting for W&B process to finish... (success)." - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "VBox(children=(Label(value='0.001 MB of 0.001 MB uploaded (0.000 MB deduped)\\r'), FloatProgress(value=1.0, max…" - ], - "application/vnd.jupyter.widget-view+json": { - "version_major": 2, - "version_minor": 0, - "model_id": "e840ed026b3342718c0aa068f81d93f3" - } - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "\n", - "

Run history:


epoch▁▂▃▃▄▅▆▆▇█
test/epoch_acc▁▅▆▆██▇▇▇█
test/epoch_loss█▅▂▂▂▂▁▁▂▂
test/f1-score▁▆▇▇███▇▇█
test/precision▁▄▅▅█▇▆▇▅▇
test/recall▁▇▇▇▆▇█▆█▇
train/batch_loss▇▆█▅▅▆▆▆▅▃▄▅▄▄▄▅▃█▄█▃▄▂▁▄▃▁▆▅▁▄▆▂▄▂▂▃▄▆▄
train/epoch_acc▁▆▆▇█▇██▇█
train/epoch_loss█▅▃▂▁▂▁▁▁▁

Run summary:


epoch9
test/epoch_acc0.81111
test/epoch_loss0.60187
test/f1-score0.8172
test/precision0.77551
test/recall0.86364
train/batch_loss0.5635
train/epoch_acc0.77273
train/epoch_loss0.59496

" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - " View run snowy-sweep-1 at: https://wandb.ai/flower-classification/pytorch-sweeps-demo/runs/pw52k3j3
Synced 5 W&B file(s), 0 media file(s), 0 artifact file(s) and 0 other file(s)" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "Find logs at: ./wandb/run-20230404_135456-pw52k3j3/logs" - ] - }, - "metadata": {} - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\u001b[34m\u001b[1mwandb\u001b[0m: Agent Starting Run: ea718wsd with config:\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tbatch_size: 32\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tbeta_one: 0.99\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tbeta_two: 0.99\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tepochs: 10\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \teps: 1e-08\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tgamma: 0.1\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tlearning_rate: 0.1\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \toptimizer: adam\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tstep_size: 2\n" - ] - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "Tracking run with wandb version 0.14.0" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "Run data is saved locally in /content/wandb/run-20230404_140117-ea718wsd" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "Syncing run splendid-sweep-2 to Weights & Biases (docs)
Sweep page: https://wandb.ai/flower-classification/pytorch-sweeps-demo/sweeps/9681wnh0" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - " View project at https://wandb.ai/flower-classification/pytorch-sweeps-demo" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - " View sweep at https://wandb.ai/flower-classification/pytorch-sweeps-demo/sweeps/9681wnh0" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - " View run at https://wandb.ai/flower-classification/pytorch-sweeps-demo/runs/ea718wsd" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "Waiting for W&B process to finish... (failed 1). Press Control-C to abort syncing." - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "\n", - "

Run history:


epoch▁▃▆█
test/epoch_acc▁▁▁
test/epoch_loss█▁▁
test/f1-score▁▁▁
test/precision▁▁▁
test/recall▁▁▁
train/batch_loss▁▁█▁▁▂▁▁▁▁▂▂▁▁▃▁▁▂▁▁▁▁▂▂▁▁▁▂▁▁▂▁▁▁▁▁▁▁▁▁
train/epoch_acc▃▁▇█
train/epoch_loss█▆▃▁

Run summary:


epoch3
test/epoch_acc0.42222
test/epoch_loss109.2288
test/f1-score0.59375
test/precision0.42222
test/recall1.0
train/batch_loss1.26954
train/epoch_acc0.51474
train/epoch_loss3.22592

" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - " View run splendid-sweep-2 at: https://wandb.ai/flower-classification/pytorch-sweeps-demo/runs/ea718wsd
Synced 4 W&B file(s), 0 media file(s), 0 artifact file(s) and 0 other file(s)" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "Find logs at: ./wandb/run-20230404_140117-ea718wsd/logs" - ] - }, - "metadata": {} - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "Run ea718wsd errored: ZeroDivisionError('float division by zero')\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \u001b[32m\u001b[41mERROR\u001b[0m Run ea718wsd errored: ZeroDivisionError('float division by zero')\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: Sweep Agent: Waiting for job.\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: Job received.\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: Agent Starting Run: 2igypsdg with config:\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tbatch_size: 64\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tbeta_one: 0.9\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tbeta_two: 0.5\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tepochs: 10\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \teps: 1\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tgamma: 0.1\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tlearning_rate: 0.0001\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \toptimizer: sgd\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tstep_size: 2\n" - ] - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "Tracking run with wandb version 0.14.0" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "Run data is saved locally in /content/wandb/run-20230404_140346-2igypsdg" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "Syncing run visionary-sweep-3 to Weights & Biases (docs)
Sweep page: https://wandb.ai/flower-classification/pytorch-sweeps-demo/sweeps/9681wnh0" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - " View project at https://wandb.ai/flower-classification/pytorch-sweeps-demo" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - " View sweep at https://wandb.ai/flower-classification/pytorch-sweeps-demo/sweeps/9681wnh0" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - " View run at https://wandb.ai/flower-classification/pytorch-sweeps-demo/runs/2igypsdg" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "Waiting for W&B process to finish... (success)." - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "\n", - "

Run history:


epoch▁▂▃▃▄▅▆▆▇█
test/epoch_acc█▅▁▁▁▁▃▁▃▃
test/epoch_loss▁▆█▄▄▄▆▅▃▅
test/f1-score▁█▅▅▅▅▆▅▆▆
test/precision▂█▁▁▁▁▃▁▃▃
test/recall▁█▇▇▇▇▇▇▇▇
train/batch_loss█▇██▄█▆▆▁▂▂▁▃▅▆▄▅▂▇▃▄▁▆▆▁▆▆▄▄▃▃▆▇▂▇█▅▅▁▄
train/epoch_acc▁▄▇█▇█▇▇▆▇
train/epoch_loss█▅▂▂▂▁▁▂▂▁

Run summary:


epoch9
test/epoch_acc0.34444
test/epoch_loss0.72334
test/f1-score0.47788
test/precision0.35065
test/recall0.75
train/batch_loss0.67509
train/epoch_acc0.56265
train/epoch_loss0.67967

" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - " View run visionary-sweep-3 at: https://wandb.ai/flower-classification/pytorch-sweeps-demo/runs/2igypsdg
Synced 4 W&B file(s), 0 media file(s), 0 artifact file(s) and 0 other file(s)" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "Find logs at: ./wandb/run-20230404_140346-2igypsdg/logs" - ] - }, - "metadata": {} - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\u001b[34m\u001b[1mwandb\u001b[0m: Agent Starting Run: 37tqne1y with config:\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tbatch_size: 64\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tbeta_one: 0.9\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tbeta_two: 0.5\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tepochs: 10\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \teps: 1e-08\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tgamma: 0.1\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tlearning_rate: 0.1\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.14.0" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "Run data is saved locally in /content/wandb/run-20230404_140933-37tqne1y" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "Syncing run proud-sweep-4 to Weights & Biases (docs)
Sweep page: https://wandb.ai/flower-classification/pytorch-sweeps-demo/sweeps/9681wnh0" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - " View project at https://wandb.ai/flower-classification/pytorch-sweeps-demo" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - " View sweep at https://wandb.ai/flower-classification/pytorch-sweeps-demo/sweeps/9681wnh0" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - " View run at https://wandb.ai/flower-classification/pytorch-sweeps-demo/runs/37tqne1y" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "Waiting for W&B process to finish... (success)." - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "\n", - "

Run history:


epoch▁▂▃▃▄▅▆▆▇█
test/epoch_acc▆▅▁▅▃▇▇███
test/epoch_loss▂▁█▁▅▁▁▁▁▁
test/f1-score▅▆▄▄▁▇▇███
test/precision█▅▁█▆▅▅▆▇▇
test/recall▃▆▇▃▁▇█▇▇▇
train/batch_loss█▆▅▄▃▂▁▃▇▃▄▄▂▂▅▃▂▄▂▄▂▄▃▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁
train/epoch_acc▁▆▅▆▆▆████
train/epoch_loss█▄▆▄▄▃▁▁▁▁

Run summary:


epoch9
test/epoch_acc0.84444
test/epoch_loss0.62389
test/f1-score0.84091
test/precision0.84091
test/recall0.84091
train/batch_loss0.00493
train/epoch_acc1.0
train/epoch_loss0.00446

" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - " View run proud-sweep-4 at: https://wandb.ai/flower-classification/pytorch-sweeps-demo/runs/37tqne1y
Synced 4 W&B file(s), 0 media file(s), 0 artifact file(s) and 0 other file(s)" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "Find logs at: ./wandb/run-20230404_140933-37tqne1y/logs" - ] - }, - "metadata": {} - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\u001b[34m\u001b[1mwandb\u001b[0m: Agent Starting Run: 3co2jpxp with config:\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tbatch_size: 8\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tbeta_one: 0.9\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tbeta_two: 0.9\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tepochs: 10\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \teps: 1e-08\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tgamma: 0.1\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tlearning_rate: 0.0003\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \toptimizer: adam\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tstep_size: 7\n" - ] - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "Tracking run with wandb version 0.14.0" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "Run data is saved locally in /content/wandb/run-20230404_141514-3co2jpxp" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "Syncing run restful-sweep-5 to Weights & Biases (docs)
Sweep page: https://wandb.ai/flower-classification/pytorch-sweeps-demo/sweeps/9681wnh0" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - " View project at https://wandb.ai/flower-classification/pytorch-sweeps-demo" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - " View sweep at https://wandb.ai/flower-classification/pytorch-sweeps-demo/sweeps/9681wnh0" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - " View run at https://wandb.ai/flower-classification/pytorch-sweeps-demo/runs/3co2jpxp" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "Waiting for W&B process to finish... (success)." - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "\n", - "

Run history:


epoch▁▂▃▃▄▅▆▆▇█
test/epoch_acc▄█▁▃▃▅▆▇▇█
test/epoch_loss▃▁▆▄█▃▄▂▃▃
test/f1-score▂▇▁▂▃▆▅▆▆█
test/precision▅█▁▃▂▄▆▆▆▇
test/recall▁▂█▄██▂▃▄▄
train/batch_loss▄▂▃▄▂▂▃█▂▁▃▁▂▂▁▁▃▁▁▂▁▁▁▂▁▁▁▃▁▁▁▁▁▁▅▁▁▁▁▁
train/epoch_acc▁▄▅▆▆▆▇███
train/epoch_loss█▆▄▄▃▃▂▂▁▁

Run summary:


epoch9
test/epoch_acc0.87778
test/epoch_loss0.53854
test/f1-score0.86747
test/precision0.85714
test/recall0.87805
train/batch_loss0.00185
train/epoch_acc0.99631
train/epoch_loss0.01069

" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - " View run restful-sweep-5 at: https://wandb.ai/flower-classification/pytorch-sweeps-demo/runs/3co2jpxp
Synced 4 W&B file(s), 0 media file(s), 0 artifact file(s) and 0 other file(s)" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "Find logs at: ./wandb/run-20230404_141514-3co2jpxp/logs" - ] - }, - "metadata": {} - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\u001b[34m\u001b[1mwandb\u001b[0m: Agent Starting Run: ppthue5q with config:\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tbatch_size: 8\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tbeta_one: 0.9\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tbeta_two: 0.999\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tepochs: 10\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \teps: 1e-08\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tgamma: 0.1\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.14.0" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "Run data is saved locally in /content/wandb/run-20230404_142101-ppthue5q" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "Syncing run charmed-sweep-6 to Weights & Biases (docs)
Sweep page: https://wandb.ai/flower-classification/pytorch-sweeps-demo/sweeps/9681wnh0" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - " View project at https://wandb.ai/flower-classification/pytorch-sweeps-demo" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - " View sweep at https://wandb.ai/flower-classification/pytorch-sweeps-demo/sweeps/9681wnh0" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - " View run at https://wandb.ai/flower-classification/pytorch-sweeps-demo/runs/ppthue5q" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "Waiting for W&B process to finish... (success)." - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "\n", - "

Run history:


epoch▁▂▃▃▄▅▆▆▇█
test/epoch_acc▁▄▃▇▆▇███▇
test/epoch_loss█▄▃▅▃▁▁▁▂▂
test/f1-score▁▄▃▆▆▇███▆
test/precision▁▂▂▆▅▅▆▇█▆
test/recall▁█▃▅▃▆▆▅▃▅
train/batch_loss█▃▆▅▇▆▄▃▄▁▄▃▁▁▂▂▁▁▁▁▃▁▁▃▁▁▁▁▁▁▂▁▁▁▂▂▁▃▁▁
train/epoch_acc▁▃▆▆▇▇████
train/epoch_loss█▆▄▄▂▂▁▁▁▁

Run summary:


epoch9
test/epoch_acc0.87778
test/epoch_loss0.24035
test/f1-score0.86076
test/precision0.85
test/recall0.87179
train/batch_loss0.03008
train/epoch_acc0.99386
train/epoch_loss0.02099

" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - " View run charmed-sweep-6 at: https://wandb.ai/flower-classification/pytorch-sweeps-demo/runs/ppthue5q
Synced 4 W&B file(s), 0 media file(s), 0 artifact file(s) and 0 other file(s)" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "Find logs at: ./wandb/run-20230404_142101-ppthue5q/logs" - ] - }, - "metadata": {} - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\u001b[34m\u001b[1mwandb\u001b[0m: Agent Starting Run: eakg0nsy with config:\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tbatch_size: 4\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tbeta_one: 0.9\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tbeta_two: 0.99\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tepochs: 10\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \teps: 0.1\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tgamma: 0.5\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tlearning_rate: 0.003\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \toptimizer: sgd\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tstep_size: 7\n" - ] - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "Tracking run with wandb version 0.14.0" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "Run data is saved locally in /content/wandb/run-20230404_142642-eakg0nsy" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "Syncing run still-sweep-7 to Weights & Biases (docs)
Sweep page: https://wandb.ai/flower-classification/pytorch-sweeps-demo/sweeps/9681wnh0" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - " View project at https://wandb.ai/flower-classification/pytorch-sweeps-demo" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - " View sweep at https://wandb.ai/flower-classification/pytorch-sweeps-demo/sweeps/9681wnh0" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - " View run at https://wandb.ai/flower-classification/pytorch-sweeps-demo/runs/eakg0nsy" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "Waiting for W&B process to finish... (success)." - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "\n", - "

Run history:


epoch▁▂▃▃▄▅▆▆▇█
test/epoch_acc▁▆▅▃█▆▅▆▆▆
test/epoch_loss▆▄▃▆▁▇█▇██
test/f1-score▁▆▅▃█▅▄▆▆▅
test/precision▁▆▁▆▇█▅▇▇▆
test/recall▃▅█▁▆▃▃▄▄▄
train/batch_loss▄▅▃▄▅▆▆█▄▂▂▃▂▁▁▂▁▁▂▁▃▁▁▁▁▁▂▃▁▁▁▁▁▁▁▁▁▁▁▁
train/epoch_acc▁▄▅▆▇▇▇███
train/epoch_loss█▆▅▃▂▂▂▁▁▁

Run summary:


epoch9
test/epoch_acc0.85556
test/epoch_loss0.44089
test/f1-score0.87379
test/precision0.9375
test/recall0.81818
train/batch_loss0.01161
train/epoch_acc0.99386
train/epoch_loss0.02177

" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - " View run still-sweep-7 at: https://wandb.ai/flower-classification/pytorch-sweeps-demo/runs/eakg0nsy
Synced 4 W&B file(s), 0 media file(s), 0 artifact file(s) and 0 other file(s)" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "Find logs at: ./wandb/run-20230404_142642-eakg0nsy/logs" - ] - }, - "metadata": {} - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\u001b[34m\u001b[1mwandb\u001b[0m: Agent Starting Run: jucrzfat with config:\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tbatch_size: 16\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tbeta_one: 0.9\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tbeta_two: 0.99\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tepochs: 10\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \teps: 0.1\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tgamma: 0.1\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tlearning_rate: 0.1\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \toptimizer: sgd\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tstep_size: 3\n" - ] - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "Tracking run with wandb version 0.14.0" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "Run data is saved locally in /content/wandb/run-20230404_143240-jucrzfat" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "Syncing run crimson-sweep-8 to Weights & Biases (docs)
Sweep page: https://wandb.ai/flower-classification/pytorch-sweeps-demo/sweeps/9681wnh0" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - " View project at https://wandb.ai/flower-classification/pytorch-sweeps-demo" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - " View sweep at https://wandb.ai/flower-classification/pytorch-sweeps-demo/sweeps/9681wnh0" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - " View run at https://wandb.ai/flower-classification/pytorch-sweeps-demo/runs/jucrzfat" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "Waiting for W&B process to finish... (success)." - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "\n", - "

Run history:


epoch▁▂▃▃▄▅▆▆▇█
test/epoch_acc▁▆▅▆▇█████
test/epoch_loss█▂▁▁▁▁▁▁▁▁
test/f1-score▁▂▄▅▆▇▇███
test/precision▁▇▅▆▆█████
test/recall█▁▄▅▅▅▅▅▅▅
train/batch_loss▆▅▄▇▄▄▅█▆▄▃▅▄▃▅▂▄▄▄▃▃▃▄▂▄▃▄▅▁▃▃▂▂▂▂▃▃▂▁▃
train/epoch_acc▁▄▅▅▇▇▇▇██
train/epoch_loss█▅▄▃▂▂▂▂▁▁

Run summary:


epoch9
test/epoch_acc0.78889
test/epoch_loss0.46169
test/f1-score0.7957
test/precision0.84091
test/recall0.7551
train/batch_loss0.63008
train/epoch_acc0.77396
train/epoch_loss0.4697

" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - " View run crimson-sweep-8 at: https://wandb.ai/flower-classification/pytorch-sweeps-demo/runs/jucrzfat
Synced 4 W&B file(s), 0 media file(s), 0 artifact file(s) and 0 other file(s)" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "Find logs at: ./wandb/run-20230404_143240-jucrzfat/logs" - ] - }, - "metadata": {} - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\u001b[34m\u001b[1mwandb\u001b[0m: Agent Starting Run: bhks7msu with config:\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tbatch_size: 32\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tbeta_one: 0.99\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tbeta_two: 0.999\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tepochs: 10\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \teps: 1\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tgamma: 0.1\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tlearning_rate: 0.003\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \toptimizer: adam\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tstep_size: 3\n" - ] - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "Tracking run with wandb version 0.14.0" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "Run data is saved locally in /content/wandb/run-20230404_143816-bhks7msu" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "Syncing run lilac-sweep-9 to Weights & Biases (docs)
Sweep page: https://wandb.ai/flower-classification/pytorch-sweeps-demo/sweeps/9681wnh0" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - " View project at https://wandb.ai/flower-classification/pytorch-sweeps-demo" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - " View sweep at https://wandb.ai/flower-classification/pytorch-sweeps-demo/sweeps/9681wnh0" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - " View run at https://wandb.ai/flower-classification/pytorch-sweeps-demo/runs/bhks7msu" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "Waiting for W&B process to finish... (success)." - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "\n", - "

Run history:


epoch▁▂▃▃▄▅▆▆▇█
test/epoch_acc▁▃▃█▁▆▆▃▃█
test/epoch_loss█▅▂▂▁▁▁▁▁▁
test/f1-score▁▄▄█▂▆▆▄▄█
test/precision▂▃▃█▁▆▆▃▃█
test/recall▁█████████
train/batch_loss██▇▅▅▄▄▅▅▂▅▂▃▄▃▅▂▃▃▆▂▃▂▃▃▂▂▅▃▂▁▂▂▅▄▄▃▃▁▅
train/epoch_acc▁▅▇███▇███
train/epoch_loss█▅▃▂▁▁▁▁▁▁

Run summary:


epoch9
test/epoch_acc0.85556
test/epoch_loss0.54705
test/f1-score0.86022
test/precision0.78431
test/recall0.95238
train/batch_loss0.61833
train/epoch_acc0.8059
train/epoch_loss0.558

" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - " View run lilac-sweep-9 at: https://wandb.ai/flower-classification/pytorch-sweeps-demo/runs/bhks7msu
Synced 4 W&B file(s), 0 media file(s), 0 artifact file(s) and 0 other file(s)" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "Find logs at: ./wandb/run-20230404_143816-bhks7msu/logs" - ] - }, - "metadata": {} - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\u001b[34m\u001b[1mwandb\u001b[0m: Agent Starting Run: ezctslju with config:\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tbatch_size: 32\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tbeta_one: 0.9\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tbeta_two: 0.5\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tepochs: 10\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \teps: 1\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tgamma: 0.1\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tlearning_rate: 0.003\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \toptimizer: adam\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.14.0" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "Run data is saved locally in /content/wandb/run-20230404_144350-ezctslju" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "Syncing run different-sweep-10 to Weights & Biases (docs)
Sweep page: https://wandb.ai/flower-classification/pytorch-sweeps-demo/sweeps/9681wnh0" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - " View project at https://wandb.ai/flower-classification/pytorch-sweeps-demo" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - " View sweep at https://wandb.ai/flower-classification/pytorch-sweeps-demo/sweeps/9681wnh0" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - " View run at https://wandb.ai/flower-classification/pytorch-sweeps-demo/runs/ezctslju" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "Waiting for W&B process to finish... (success)." - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "\n", - "

Run history:


epoch▁▂▃▃▄▅▆▆▇█
test/epoch_acc▁▂▇███▇▇▄▇
test/epoch_loss█▆▅▃▂▂▁▁▁▁
test/f1-score▁▅▆███▆▆▁▆
test/precision▂▁██████▇█
test/recall▅█▃▅▅▅▃▃▁▃
train/batch_loss███▇▇▆▆▇▆▆▆▆▅▅▅▅▃▅▃▅▃▃▂▄▃▂▄▂▂▁▂▃▃▃▄▄▃▅▃▄
train/epoch_acc▁▅▇▇▇█▇███
train/epoch_loss█▆▅▄▂▂▁▁▁▁

Run summary:


epoch9
test/epoch_acc0.75556
test/epoch_loss0.53376
test/f1-score0.76596
test/precision0.76596
test/recall0.76596
train/batch_loss0.52814
train/epoch_acc0.86118
train/epoch_loss0.46213

" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - " View run different-sweep-10 at: https://wandb.ai/flower-classification/pytorch-sweeps-demo/runs/ezctslju
Synced 4 W&B file(s), 0 media file(s), 0 artifact file(s) and 0 other file(s)" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "Find logs at: ./wandb/run-20230404_144350-ezctslju/logs" - ] - }, - "metadata": {} - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\u001b[34m\u001b[1mwandb\u001b[0m: Agent Starting Run: gxvcwlwu with config:\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tbatch_size: 64\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tbeta_one: 0.99\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tbeta_two: 0.99\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tepochs: 10\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \teps: 0.1\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tgamma: 0.5\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tlearning_rate: 0.0003\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \toptimizer: adam\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.14.0" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "Run data is saved locally in /content/wandb/run-20230404_144922-gxvcwlwu" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "Syncing run glowing-sweep-11 to Weights & Biases (docs)
Sweep page: https://wandb.ai/flower-classification/pytorch-sweeps-demo/sweeps/9681wnh0" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - " View project at https://wandb.ai/flower-classification/pytorch-sweeps-demo" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - " View sweep at https://wandb.ai/flower-classification/pytorch-sweeps-demo/sweeps/9681wnh0" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - " View run at https://wandb.ai/flower-classification/pytorch-sweeps-demo/runs/gxvcwlwu" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "Waiting for W&B process to finish... (success)." - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "\n", - "

Run history:


epoch▁▂▃▃▄▅▆▆▇█
test/epoch_acc▁▂▅▆▆▆▇███
test/epoch_loss█▇▅▄▄▃▂▂▂▁
test/f1-score▁▂▅▆▇▇▇███
test/precision▁▂▄▅▆▆▇███
test/recall▁▄▇███████
train/batch_loss▇█▆▇▇▆▆▆▆▅▅▆▅▅▃▅▅▄▅▅▃▄▄▂▃▃▃▃▃▃▃▂▁▃▃▃▂▃▁▁
train/epoch_acc▁▄▅▆▇▇▇███
train/epoch_loss█▇▆▄▄▃▂▂▁▁

Run summary:


epoch9
test/epoch_acc0.86667
test/epoch_loss0.53756
test/f1-score0.86364
test/precision0.80851
test/recall0.92683
train/batch_loss0.52993
train/epoch_acc0.80098
train/epoch_loss0.55775

" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - " View run glowing-sweep-11 at: https://wandb.ai/flower-classification/pytorch-sweeps-demo/runs/gxvcwlwu
Synced 4 W&B file(s), 0 media file(s), 0 artifact file(s) and 0 other file(s)" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "Find logs at: ./wandb/run-20230404_144922-gxvcwlwu/logs" - ] - }, - "metadata": {} - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\u001b[34m\u001b[1mwandb\u001b[0m: Agent Starting Run: o4ceynjw with config:\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tbatch_size: 64\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tbeta_one: 0.9\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tbeta_two: 0.999\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tepochs: 10\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \teps: 1e-08\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tgamma: 0.1\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.14.0" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "Run data is saved locally in /content/wandb/run-20230404_145500-o4ceynjw" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "Syncing run chocolate-sweep-12 to Weights & Biases (docs)
Sweep page: https://wandb.ai/flower-classification/pytorch-sweeps-demo/sweeps/9681wnh0" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - " View project at https://wandb.ai/flower-classification/pytorch-sweeps-demo" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - " View sweep at https://wandb.ai/flower-classification/pytorch-sweeps-demo/sweeps/9681wnh0" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - " View run at https://wandb.ai/flower-classification/pytorch-sweeps-demo/runs/o4ceynjw" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "Waiting for W&B process to finish... (success)." - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "\n", - "

Run history:


epoch▁▂▃▃▄▅▆▆▇█
test/epoch_acc▁▆▄▇▇█████
test/epoch_loss█▄▄▁▁▁▁▁▁▁
test/f1-score▁▆▄▇▇█████
test/precision▂▁█▆██████
test/recall▁█▃█▇█████
train/batch_loss██▇▆▅▅▄▄▃▃▂▂▂▂▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁
train/epoch_acc▁▅▇███████
train/epoch_loss█▅▃▁▁▁▁▁▁▁

Run summary:


epoch9
test/epoch_acc0.97778
test/epoch_loss0.13521
test/f1-score0.97826
test/precision1.0
test/recall0.95745
train/batch_loss0.00408
train/epoch_acc1.0
train/epoch_loss0.00712

" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - " View run chocolate-sweep-12 at: https://wandb.ai/flower-classification/pytorch-sweeps-demo/runs/o4ceynjw
Synced 4 W&B file(s), 0 media file(s), 0 artifact file(s) and 0 other file(s)" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "Find logs at: ./wandb/run-20230404_145500-o4ceynjw/logs" - ] - }, - "metadata": {} - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\u001b[34m\u001b[1mwandb\u001b[0m: Agent Starting Run: w0els6yx with config:\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tbatch_size: 4\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tbeta_one: 0.9\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tbeta_two: 0.999\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tepochs: 10\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \teps: 1\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tgamma: 0.5\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tlearning_rate: 0.0001\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \toptimizer: adam\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.14.0" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "Run data is saved locally in /content/wandb/run-20230404_150038-w0els6yx" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "Syncing run glorious-sweep-13 to Weights & Biases (docs)
Sweep page: https://wandb.ai/flower-classification/pytorch-sweeps-demo/sweeps/9681wnh0" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - " View project at https://wandb.ai/flower-classification/pytorch-sweeps-demo" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - " View sweep at https://wandb.ai/flower-classification/pytorch-sweeps-demo/sweeps/9681wnh0" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - " View run at https://wandb.ai/flower-classification/pytorch-sweeps-demo/runs/w0els6yx" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "Waiting for W&B process to finish... (success)." - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "\n", - "

Run history:


epoch▁▂▃▃▄▅▆▆▇█
test/epoch_acc▂▁▄▄▇▆▆▇█▇
test/epoch_loss█▆▅▆▃▂▂▂▂▁
test/f1-score▁▁▅▄▇▇▇███
test/precision▂▁▄▃▆▆▆▆█▇
test/recall▁▂▅▄▆▆▇█▆█
train/batch_loss█▆▆▆▆▆▆▃▇█▄▄▇█▆▅▄▇▇▃▄▄▅▂▃▄▆▆▁▆▂▄▄▅▅▅▄▆▄▄
train/epoch_acc▁▃▄▄▆▆▇▇▇█
train/epoch_loss█▇▆▅▃▃▂▂▂▁

Run summary:


epoch9
test/epoch_acc0.68889
test/epoch_loss0.66123
test/f1-score0.65854
test/precision0.64286
test/recall0.675
train/batch_loss0.60239
train/epoch_acc0.65233
train/epoch_loss0.66732

" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - " View run glorious-sweep-13 at: https://wandb.ai/flower-classification/pytorch-sweeps-demo/runs/w0els6yx
Synced 4 W&B file(s), 0 media file(s), 0 artifact file(s) and 0 other file(s)" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "Find logs at: ./wandb/run-20230404_150038-w0els6yx/logs" - ] - }, - "metadata": {} - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\u001b[34m\u001b[1mwandb\u001b[0m: Agent Starting Run: sn7rpzsv with config:\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tbatch_size: 4\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tbeta_one: 0.9\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tbeta_two: 0.99\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tepochs: 10\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \teps: 1\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tgamma: 0.5\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tlearning_rate: 0.001\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \toptimizer: sgd\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tstep_size: 7\n" - ] - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "Tracking run with wandb version 0.14.0" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "Run data is saved locally in /content/wandb/run-20230404_150639-sn7rpzsv" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "Syncing run stoic-sweep-14 to Weights & Biases (docs)
Sweep page: https://wandb.ai/flower-classification/pytorch-sweeps-demo/sweeps/9681wnh0" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - " View project at https://wandb.ai/flower-classification/pytorch-sweeps-demo" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - " View sweep at https://wandb.ai/flower-classification/pytorch-sweeps-demo/sweeps/9681wnh0" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - " View run at https://wandb.ai/flower-classification/pytorch-sweeps-demo/runs/sn7rpzsv" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "Waiting for W&B process to finish... (success)." - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "\n", - "

Run history:


epoch▁▂▃▃▄▅▆▆▇█
test/epoch_acc▃▁▃▆▆▃▆▆▄█
test/epoch_loss█▆▄▁▃▆▃▃▄▁
test/f1-score▄▁▃▇▆▃▆▆▅█
test/precision▃▆▁▂██▂▁▃▇
test/recall▄▁▄█▄▂▇█▅▇
train/batch_loss█▆▇▆▇█▂▆▂▄▃▁▁▁▄▃▄▂▁▁▁▁▁▃▁▁▁▁▁▁▁▁▁▁▁▂▁▁▁▁
train/epoch_acc▁▄▆▇▇▇▇███
train/epoch_loss█▆▄▃▂▂▂▁▁▁

Run summary:


epoch9
test/epoch_acc0.92222
test/epoch_loss0.22225
test/f1-score0.91358
test/precision0.94872
test/recall0.88095
train/batch_loss0.01037
train/epoch_acc0.98649
train/epoch_loss0.04606

" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - " View run stoic-sweep-14 at: https://wandb.ai/flower-classification/pytorch-sweeps-demo/runs/sn7rpzsv
Synced 4 W&B file(s), 0 media file(s), 0 artifact file(s) and 0 other file(s)" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "Find logs at: ./wandb/run-20230404_150639-sn7rpzsv/logs" - ] - }, - "metadata": {} - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\u001b[34m\u001b[1mwandb\u001b[0m: Sweep Agent: Waiting for job.\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: Job received.\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: Agent Starting Run: m64aehal with config:\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tbatch_size: 4\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tbeta_one: 0.9\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tbeta_two: 0.999\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tepochs: 10\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \teps: 1\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tgamma: 0.1\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tlearning_rate: 0.1\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \toptimizer: adam\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tstep_size: 7\n" - ] - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "Tracking run with wandb version 0.14.0" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "Run data is saved locally in /content/wandb/run-20230404_151243-m64aehal" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "Syncing run rare-sweep-15 to Weights & Biases (docs)
Sweep page: https://wandb.ai/flower-classification/pytorch-sweeps-demo/sweeps/9681wnh0" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - " View project at https://wandb.ai/flower-classification/pytorch-sweeps-demo" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - " View sweep at https://wandb.ai/flower-classification/pytorch-sweeps-demo/sweeps/9681wnh0" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - " View run at https://wandb.ai/flower-classification/pytorch-sweeps-demo/runs/m64aehal" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "Waiting for W&B process to finish... (success)." - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "\n", - "

Run history:


epoch▁▂▃▃▄▅▆▆▇█
test/epoch_acc▁█▃▅█▇▄▇██
test/epoch_loss█▁▆▃▂▄█▄▃▃
test/f1-score▃█▁▃██▃▇██
test/precision▁▅██▆▄▅▆▆▆
test/recall▅█▁▂▇█▃▆▆▇
train/batch_loss▄▅▃▅▂▇▂▄▂▃█▄▂▃▁▃▄▁▂▁▁▁▃▁▂▁▁▂▁▂▁▁▁▁▁▁▁▅▁▂
train/epoch_acc▁▃▄▆▆▇▇▇██
train/epoch_loss█▆▅▄▃▂▂▂▁▁

Run summary:


epoch9
test/epoch_acc0.86667
test/epoch_loss0.52816
test/f1-score0.85
test/precision0.85
test/recall0.85
train/batch_loss0.0016
train/epoch_acc0.99509
train/epoch_loss0.02902

" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - " View run rare-sweep-15 at: https://wandb.ai/flower-classification/pytorch-sweeps-demo/runs/m64aehal
Synced 4 W&B file(s), 0 media file(s), 0 artifact file(s) and 0 other file(s)" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "Find logs at: ./wandb/run-20230404_151243-m64aehal/logs" - ] - }, - "metadata": {} - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\u001b[34m\u001b[1mwandb\u001b[0m: Sweep Agent: Waiting for job.\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: Job received.\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: Agent Starting Run: 71er7icc with config:\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tbatch_size: 32\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tbeta_one: 0.99\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tbeta_two: 0.5\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tepochs: 10\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \teps: 1\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tgamma: 0.5\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tlearning_rate: 0.0001\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.14.0" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "Run data is saved locally in /content/wandb/run-20230404_151846-71er7icc" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "Syncing run winter-sweep-16 to Weights & Biases (docs)
Sweep page: https://wandb.ai/flower-classification/pytorch-sweeps-demo/sweeps/9681wnh0" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - " View project at https://wandb.ai/flower-classification/pytorch-sweeps-demo" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - " View sweep at https://wandb.ai/flower-classification/pytorch-sweeps-demo/sweeps/9681wnh0" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - " View run at https://wandb.ai/flower-classification/pytorch-sweeps-demo/runs/71er7icc" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "Waiting for W&B process to finish... (success)." - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "\n", - "

Run history:


epoch▁▂▃▃▄▅▆▆▇█
test/epoch_acc▁▃▅▆▇▇▇███
test/epoch_loss█▇▅▄▄▃▃▂▂▁
test/f1-score▁▃▆▆▇▇▇███
test/precision▁▃▆▅▆▇▇███
test/recall▁▃▆▇▇▇▇███
train/batch_loss▇█▆▆▆▆▅▇▅▇▅▅▅▅▅▄▄▅▅▄▃▃▄▃▂▃▄▃▂▄▂▃▁▁▃▄▃▂▂▃
train/epoch_acc▁▃▄▆▇▇▇█▇█
train/epoch_loss█▇▆▅▄▃▃▂▂▁

Run summary:


epoch9
test/epoch_acc0.83333
test/epoch_loss0.5844
test/f1-score0.85437
test/precision0.88
test/recall0.83019
train/batch_loss0.60478
train/epoch_acc0.82801
train/epoch_loss0.58084

" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - " View run winter-sweep-16 at: https://wandb.ai/flower-classification/pytorch-sweeps-demo/runs/71er7icc
Synced 4 W&B file(s), 0 media file(s), 0 artifact file(s) and 0 other file(s)" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "Find logs at: ./wandb/run-20230404_151846-71er7icc/logs" - ] - }, - "metadata": {} - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\u001b[34m\u001b[1mwandb\u001b[0m: Agent Starting Run: k0hwgfjk with config:\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tbatch_size: 8\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tbeta_one: 0.9\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tbeta_two: 0.9\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tepochs: 10\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \teps: 1e-08\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tgamma: 0.1\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tlearning_rate: 0.003\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \toptimizer: sgd\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tstep_size: 2\n" - ] - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "Tracking run with wandb version 0.14.0" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "Run data is saved locally in /content/wandb/run-20230404_152419-k0hwgfjk" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "Syncing run sleek-sweep-17 to Weights & Biases (docs)
Sweep page: https://wandb.ai/flower-classification/pytorch-sweeps-demo/sweeps/9681wnh0" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - " View project at https://wandb.ai/flower-classification/pytorch-sweeps-demo" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - " View sweep at https://wandb.ai/flower-classification/pytorch-sweeps-demo/sweeps/9681wnh0" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - " View run at https://wandb.ai/flower-classification/pytorch-sweeps-demo/runs/k0hwgfjk" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "Waiting for W&B process to finish... (success)." - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "\n", - "

Run history:


epoch▁▂▃▃▄▅▆▆▇█
test/epoch_acc▃▁█▆▆▆█▅▅█
test/epoch_loss▅█▂▂▁▁▁▁▁▁
test/f1-score▂▁█▇▇▇█▅▅█
test/precision▇▃█▄▁▁█▁▁█
test/recall▁▁▆▆██▆▆▆▆
train/batch_loss▆█▄▅▃▃▇▁▁▁▁▁▁▁▂▁▂▂▁▁▁▁▁▂▁▄▃▁▁▂▂▁▁▃▁▁▁▁▁▁
train/epoch_acc▁▅██████▇█
train/epoch_loss█▄▁▁▁▁▁▁▁▁

Run summary:


epoch9
test/epoch_acc0.91111
test/epoch_loss0.2015
test/f1-score0.89744
test/precision0.94595
test/recall0.85366
train/batch_loss0.00723
train/epoch_acc0.98157
train/epoch_loss0.07856

" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - " View run sleek-sweep-17 at: https://wandb.ai/flower-classification/pytorch-sweeps-demo/runs/k0hwgfjk
Synced 4 W&B file(s), 0 media file(s), 0 artifact file(s) and 0 other file(s)" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "Find logs at: ./wandb/run-20230404_152419-k0hwgfjk/logs" - ] - }, - "metadata": {} - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\u001b[34m\u001b[1mwandb\u001b[0m: Agent Starting Run: hb00vz7w with config:\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tbatch_size: 4\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tbeta_one: 0.99\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tbeta_two: 0.9\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tepochs: 10\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \teps: 1\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tgamma: 0.5\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tlearning_rate: 0.01\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \toptimizer: adam\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.14.0" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "Run data is saved locally in /content/wandb/run-20230404_152956-hb00vz7w" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "Syncing run smart-sweep-18 to Weights & Biases (docs)
Sweep page: https://wandb.ai/flower-classification/pytorch-sweeps-demo/sweeps/9681wnh0" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - " View project at https://wandb.ai/flower-classification/pytorch-sweeps-demo" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - " View sweep at https://wandb.ai/flower-classification/pytorch-sweeps-demo/sweeps/9681wnh0" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - " View run at https://wandb.ai/flower-classification/pytorch-sweeps-demo/runs/hb00vz7w" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "Waiting for W&B process to finish... (success)." - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "\n", - "

Run history:


epoch▁▂▃▃▄▅▆▆▇█
test/epoch_acc▁▅▆▇▆▇▆▆▆█
test/epoch_loss█▅▅▃▃▁▃▄▂▁
test/f1-score▁▄▆▇▆▇▆▆▆█
test/precision▁█▆▆▂▄▆█▆▄
test/recall▁▂▅▆▇▇▅▄▅█
train/batch_loss▅▅▄▆▅▅▂▂▂▃▂▅▃▂▂▁▂▃▂▁█▁▁▂▁▁▁▁▁▁▁▁▁▂▂▁▁▁▁▁
train/epoch_acc▁▄▅▇▇▇▇▇██
train/epoch_loss█▆▄▃▂▂▂▂▁▁

Run summary:


epoch9
test/epoch_acc0.9
test/epoch_loss0.24883
test/f1-score0.89888
test/precision0.93023
test/recall0.86957
train/batch_loss0.01547
train/epoch_acc0.98771
train/epoch_loss0.04667

" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - " View run smart-sweep-18 at: https://wandb.ai/flower-classification/pytorch-sweeps-demo/runs/hb00vz7w
Synced 4 W&B file(s), 0 media file(s), 0 artifact file(s) and 0 other file(s)" - ] - }, - "metadata": {} - }, - { - "output_type": "display_data", - "data": { - "text/plain": [ - "" - ], - "text/html": [ - "Find logs at: ./wandb/run-20230404_152956-hb00vz7w/logs" - ] - }, - "metadata": {} - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\u001b[34m\u001b[1mwandb\u001b[0m: Agent Starting Run: 0bg49if5 with config:\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tbatch_size: 8\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tbeta_one: 0.9\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tbeta_two: 0.9\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tepochs: 10\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \teps: 1\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tgamma: 0.1\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tlearning_rate: 0.0001\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \toptimizer: adam\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: \tstep_size: 2\n" - ] - } - ], - "source": [ - "wandb.agent(sweep_id, train, count=60)" - ], - "id": "e80d1730" - }, - { - "cell_type": "code", - "source": [], - "metadata": { - "id": "0p3H2-jRjJIG" - }, - "id": "0p3H2-jRjJIG", - "execution_count": null, - "outputs": [] - } - ], - "metadata": { - "accelerator": "GPU", - "colab": { - "provenance": [] - }, - "gpuClass": "standard", - "kernelspec": { - "display_name": "Python 3 (ipykernel)", - "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.15" - }, - "widgets": { - "application/vnd.jupyter.widget-state+json": { - "e840ed026b3342718c0aa068f81d93f3": { - "model_module": "@jupyter-widgets/controls", - "model_name": "VBoxModel", - "model_module_version": "1.5.0", - "state": { - "_dom_classes": [], - "_model_module": "@jupyter-widgets/controls", - "_model_module_version": "1.5.0", - "_model_name": "VBoxModel", - "_view_count": null, - "_view_module": "@jupyter-widgets/controls", - "_view_module_version": "1.5.0", - "_view_name": "VBoxView", - "box_style": "", - "children": [ - "IPY_MODEL_d510d413136c4231bc720200145a5d77", - "IPY_MODEL_a6a0d4738d434aa1b734c8407dde4e74" - ], - "layout": "IPY_MODEL_9e4d93cf62094092809fee70ba7885f5" - } - }, - "d510d413136c4231bc720200145a5d77": { - "model_module": "@jupyter-widgets/controls", - "model_name": "LabelModel", - "model_module_version": "1.5.0", - "state": { - "_dom_classes": [], - "_model_module": "@jupyter-widgets/controls", - "_model_module_version": "1.5.0", - "_model_name": "LabelModel", - "_view_count": null, - "_view_module": "@jupyter-widgets/controls", - "_view_module_version": "1.5.0", - "_view_name": "LabelView", - "description": "", - "description_tooltip": null, - "layout": "IPY_MODEL_32a491d3031c476da2d8687861ccbf7d", - "placeholder": "​", - "style": "IPY_MODEL_ff00a24840224f8d9cce9ade4e77ac0c", - "value": "0.001 MB of 0.001 MB uploaded (0.000 MB deduped)\r" - } - }, - "a6a0d4738d434aa1b734c8407dde4e74": { - "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": "", - "description": "", - "description_tooltip": null, - "layout": "IPY_MODEL_d8ec9c75b1f14686a6734b86eea24bb7", - "max": 1, - "min": 0, - "orientation": "horizontal", - "style": "IPY_MODEL_220d541b7b4347b08a7fc9b8feb09f98", - "value": 1 - } - }, - "9e4d93cf62094092809fee70ba7885f5": { - "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 - } - }, - "32a491d3031c476da2d8687861ccbf7d": { - "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 - } - }, - "ff00a24840224f8d9cce9ade4e77ac0c": { - "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": "" - } - }, - "d8ec9c75b1f14686a6734b86eea24bb7": { - "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 - } - }, - "220d541b7b4347b08a7fc9b8feb09f98": { - "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": "" - } - } - } - } + "cells": [ + { + "cell_type": "markdown", + "id": "2ee2704f-4d86-41b3-b511-c21f4f6cdbb8", + "metadata": {}, + "source": [ + "# Hyperparameter Optimization for Classifier\n", + "\n", + "This notebook is used in Google Colab to run the hyperparameter search for the classifier. The results of each run are uploaded to W&B where the metrics can be aggregated properly." + ] }, - "nbformat": 4, - "nbformat_minor": 5 -} \ No newline at end of file + { + "cell_type": "code", + "execution_count": 1, + "id": "CkZsS-w4atkF", + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "CkZsS-w4atkF", + "outputId": "f3a78987-dbd2-4771-92ca-69cdf97d0571" + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Mounted at /content/drive\n" + ] + } + ], + "source": [ + "from google.colab import drive\n", + "drive.mount('/content/drive')" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "zzWoPgRpd1xn", + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "zzWoPgRpd1xn", + "outputId": "daa8edca-5ddf-4ac8-cb91-b4e77f9cc858" + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/\n", + "Collecting wandb\n", + " Downloading wandb-0.14.0-py3-none-any.whl (2.0 MB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m2.0/2.0 MB\u001b[0m \u001b[31m27.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hCollecting sentry-sdk>=1.0.0\n", + " Downloading sentry_sdk-1.19.0-py2.py3-none-any.whl (199 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m199.2/199.2 KB\u001b[0m \u001b[31m25.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hRequirement already satisfied: setuptools in /usr/local/lib/python3.9/dist-packages (from wandb) (67.6.1)\n", + "Requirement already satisfied: protobuf!=4.21.0,<5,>=3.15.0 in /usr/local/lib/python3.9/dist-packages (from wandb) (3.20.3)\n", + "Requirement already satisfied: psutil>=5.0.0 in /usr/local/lib/python3.9/dist-packages (from wandb) (5.9.4)\n", + "Requirement already satisfied: requests<3,>=2.0.0 in /usr/local/lib/python3.9/dist-packages (from wandb) (2.27.1)\n", + "Collecting GitPython!=3.1.29,>=1.0.0\n", + " Downloading GitPython-3.1.31-py3-none-any.whl (184 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m184.3/184.3 KB\u001b[0m \u001b[31m22.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hRequirement already satisfied: appdirs>=1.4.3 in /usr/local/lib/python3.9/dist-packages (from wandb) (1.4.4)\n", + "Collecting docker-pycreds>=0.4.0\n", + " Downloading docker_pycreds-0.4.0-py2.py3-none-any.whl (9.0 kB)\n", + "Collecting setproctitle\n", + " Downloading setproctitle-1.3.2-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (30 kB)\n", + "Requirement already satisfied: Click!=8.0.0,>=7.0 in /usr/local/lib/python3.9/dist-packages (from wandb) (8.1.3)\n", + "Requirement already satisfied: PyYAML in /usr/local/lib/python3.9/dist-packages (from wandb) (6.0)\n", + "Requirement already satisfied: typing-extensions in /usr/local/lib/python3.9/dist-packages (from wandb) (4.5.0)\n", + "Collecting pathtools\n", + " Downloading pathtools-0.1.2.tar.gz (11 kB)\n", + " Preparing metadata (setup.py) ... \u001b[?25l\u001b[?25hdone\n", + "Requirement already satisfied: six>=1.4.0 in /usr/local/lib/python3.9/dist-packages (from docker-pycreds>=0.4.0->wandb) (1.16.0)\n", + "Collecting gitdb<5,>=4.0.1\n", + " Downloading gitdb-4.0.10-py3-none-any.whl (62 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m62.7/62.7 KB\u001b[0m \u001b[31m8.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hRequirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.9/dist-packages (from requests<3,>=2.0.0->wandb) (3.4)\n", + "Requirement already satisfied: charset-normalizer~=2.0.0 in /usr/local/lib/python3.9/dist-packages (from requests<3,>=2.0.0->wandb) (2.0.12)\n", + "Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.9/dist-packages (from requests<3,>=2.0.0->wandb) (2022.12.7)\n", + "Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/local/lib/python3.9/dist-packages (from requests<3,>=2.0.0->wandb) (1.26.15)\n", + "Collecting smmap<6,>=3.0.1\n", + " Downloading smmap-5.0.0-py3-none-any.whl (24 kB)\n", + "Building wheels for collected packages: pathtools\n", + " Building wheel for pathtools (setup.py) ... \u001b[?25l\u001b[?25hdone\n", + " Created wheel for pathtools: filename=pathtools-0.1.2-py3-none-any.whl size=8807 sha256=e0132d67db355152a3925f1b0367a996c977716084c67122838eac002d321662\n", + " Stored in directory: /root/.cache/pip/wheels/b7/0a/67/ada2a22079218c75a88361c0782855cc72aebc4d18d0289d05\n", + "Successfully built pathtools\n", + "Installing collected packages: pathtools, smmap, setproctitle, sentry-sdk, docker-pycreds, gitdb, GitPython, wandb\n", + "Successfully installed GitPython-3.1.31 docker-pycreds-0.4.0 gitdb-4.0.10 pathtools-0.1.2 sentry-sdk-1.19.0 setproctitle-1.3.2 smmap-5.0.0 wandb-0.14.0\n" + ] + } + ], + "source": [ + "!pip install wandb" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "id": "747ddcf2", + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 121 + }, + "id": "747ddcf2", + "outputId": "ebf3b723-ac7b-41ba-a9a6-e2e82e907879" + }, + "outputs": [ + { + "data": { + "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", + " " + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stderr", + "output_type": "stream", + "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" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\u001b[34m\u001b[1mwandb\u001b[0m: Appending key for api.wandb.ai to your netrc file: /root/.netrc\n" + ] + }, + { + "data": { + "text/plain": [ + "True" + ] + }, + "execution_count": 3, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "import wandb\n", + "\n", + "wandb.login()" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "id": "c37343d6", + "metadata": { + "id": "c37343d6" + }, + "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", + "import numpy as np\n", + "import os\n", + "import time\n", + "import copy\n", + "import random\n", + "from sklearn import metrics\n", + "\n", + "torch.manual_seed(42)\n", + "np.random.seed(42)\n", + "\n", + "device = torch.device(\"cuda\" if torch.cuda.is_available() else \"cpu\")" + ] + }, + { + "cell_type": "markdown", + "id": "d7dd71bd-7d96-46e1-be2a-b384f405e108", + "metadata": {}, + "source": [ + "## Create the Dataset\n", + "\n", + "The dataset (in folder `plantsdata`) is split into 90/10 train/test splits. During each epoch the metrics are reported to W&B where it is easier to see them all in aggregate over time." + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "17b25dc7", + "metadata": { + "id": "17b25dc7" + }, + "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", + "\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 (dataloaders, dataset_sizes)\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, beta_one, beta_two, eps):\n", + " if optimizer == \"sgd\":\n", + " optimizer = optim.SGD(network.parameters(),\n", + " lr=learning_rate, momentum=0.9)\n", + " elif optimizer == \"adam\":\n", + " optimizer = optim.Adam(network.parameters(),\n", + " lr=learning_rate,\n", + " betas=(beta_one, beta_two),\n", + " eps=eps)\n", + " return optimizer\n", + "\n", + "def train_epoch(network, loader, optimizer, criterion, scheduler, dataset_sizes):\n", + " network.train()\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", + " # ⬅ 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", + " epoch_loss = running_loss / dataset_sizes['train']\n", + " epoch_acc = running_corrects.double() / dataset_sizes['train']\n", + " \n", + " return (epoch_loss, epoch_acc)\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", + " 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", + " 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", + " return (epoch_loss, epoch_acc, precision, recall, f)" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "id": "5eff68bf", + "metadata": { + "id": "5eff68bf" + }, + "outputs": [], + "source": [ + "def train(config=None):\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", + " (dataloaders, dataset_sizes) = build_dataset(config.batch_size)\n", + " network = build_network()\n", + " optimizer = build_optimizer(network, config.optimizer, config.learning_rate, config.beta_one,\n", + " config.beta_two, config.eps)\n", + " criterion = nn.CrossEntropyLoss()\n", + " # Decay LR by a factor of 0.1 every 7 epochs\n", + " exp_lr_scheduler = optim.lr_scheduler.StepLR(optimizer, config.step_size, config.gamma)\n", + "\n", + " for epoch in range(config.epochs): \n", + " (epoch_loss, epoch_acc) = train_epoch(network, dataloaders['train'], optimizer,\n", + " criterion, exp_lr_scheduler,\n", + " dataset_sizes)\n", + " wandb.log({\"epoch\": epoch, 'train/epoch_loss': epoch_loss, 'train/epoch_acc': epoch_acc})\n", + " \n", + " (test_loss, test_acc, test_precision, test_recall, test_f) = test(network, dataloaders['test'],\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,\n", + " 'test/f1-score': test_f})" + ] + }, + { + "cell_type": "markdown", + "id": "caf3c858-c57a-4fe1-bc3e-b709223f1652", + "metadata": {}, + "source": [ + "## W&B config\n", + "\n", + "These dictionaries specify the parameters which should be optimized as well as how the optimization should be done (`grid`, `random`,…)." + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "id": "732a83df", + "metadata": { + "id": "732a83df" + }, + "outputs": [], + "source": [ + "sweep_config = {\n", + " 'method': 'random'\n", + "}\n", + "\n", + "metric = {\n", + " 'name': 'test/epoch_acc',\n", + " 'goal': 'maximize' \n", + "}\n", + "\n", + "sweep_config['metric'] = metric\n", + "\n", + "parameters_dict = {\n", + " 'optimizer': {\n", + " 'values': ['adam', 'sgd']\n", + " },\n", + "}\n", + "\n", + "sweep_config['parameters'] = parameters_dict\n", + "\n", + "parameters_dict.update({\n", + " 'epochs': {\n", + " 'value': 10},\n", + " 'batch_size': {\n", + " 'values': [4, 8, 16, 32, 64]},\n", + " 'learning_rate': {\n", + " 'values': [0.1, 0.01, 0.003, 0.001, 0.0003, 0.0001]},\n", + " 'step_size': {\n", + " 'values': [2, 3, 5, 7]},\n", + " 'gamma': {\n", + " 'values': [0.1, 0.5]},\n", + " 'beta_one': {\n", + " 'values': [0.9, 0.99]},\n", + " 'beta_two': {\n", + " 'values': [0.5, 0.9, 0.99, 0.999]},\n", + " 'eps': {\n", + " 'values': [1e-08, 0.1, 1]}\n", + "})" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "id": "9a01fef6", + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "9a01fef6", + "outputId": "dd802f5b-fd67-4e16-c042-f7fdbe65d568" + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Create sweep with ID: 9681wnh0\n", + "Sweep URL: https://wandb.ai/flower-classification/pytorch-sweeps-demo/sweeps/9681wnh0\n" + ] + } + ], + "source": [ + "sweep_id = wandb.sweep(sweep_config, project=\"pytorch-sweeps-demo\")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "e80d1730", + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 1000, + "referenced_widgets": [ + "e840ed026b3342718c0aa068f81d93f3", + "d510d413136c4231bc720200145a5d77", + "a6a0d4738d434aa1b734c8407dde4e74", + "9e4d93cf62094092809fee70ba7885f5", + "32a491d3031c476da2d8687861ccbf7d", + "ff00a24840224f8d9cce9ade4e77ac0c", + "d8ec9c75b1f14686a6734b86eea24bb7", + "220d541b7b4347b08a7fc9b8feb09f98" + ] + }, + "id": "e80d1730", + "outputId": "fb105ba8-6c50-4e19-9d02-88a9e8357bc0" + }, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\u001b[34m\u001b[1mwandb\u001b[0m: Agent Starting Run: pw52k3j3 with config:\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tbatch_size: 8\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tbeta_one: 0.9\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tbeta_two: 0.99\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tepochs: 10\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \teps: 1\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tgamma: 0.1\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tlearning_rate: 0.0001\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \toptimizer: sgd\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tstep_size: 3\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: Currently logged in as: \u001b[33me1527193\u001b[0m (\u001b[33mflower-classification\u001b[0m). Use \u001b[1m`wandb login --relogin`\u001b[0m to force relogin\n" + ] + }, + { + "data": { + "text/html": [ + "Tracking run with wandb version 0.14.0" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "Run data is saved locally in /content/wandb/run-20230404_135456-pw52k3j3" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "Syncing run snowy-sweep-1 to Weights & Biases (docs)
Sweep page: https://wandb.ai/flower-classification/pytorch-sweeps-demo/sweeps/9681wnh0" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + " View project at https://wandb.ai/flower-classification/pytorch-sweeps-demo" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + " View sweep at https://wandb.ai/flower-classification/pytorch-sweeps-demo/sweeps/9681wnh0" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + " View run at https://wandb.ai/flower-classification/pytorch-sweeps-demo/runs/pw52k3j3" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/usr/local/lib/python3.9/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", + "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, 236MB/s]\n" + ] + }, + { + "data": { + "text/html": [ + "Waiting for W&B process to finish... (success)." + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "e840ed026b3342718c0aa068f81d93f3", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "VBox(children=(Label(value='0.001 MB of 0.001 MB uploaded (0.000 MB deduped)\\r'), FloatProgress(value=1.0, max…" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "\n", + "

Run history:


epoch▁▂▃▃▄▅▆▆▇█
test/epoch_acc▁▅▆▆██▇▇▇█
test/epoch_loss█▅▂▂▂▂▁▁▂▂
test/f1-score▁▆▇▇███▇▇█
test/precision▁▄▅▅█▇▆▇▅▇
test/recall▁▇▇▇▆▇█▆█▇
train/batch_loss▇▆█▅▅▆▆▆▅▃▄▅▄▄▄▅▃█▄█▃▄▂▁▄▃▁▆▅▁▄▆▂▄▂▂▃▄▆▄
train/epoch_acc▁▆▆▇█▇██▇█
train/epoch_loss█▅▃▂▁▂▁▁▁▁

Run summary:


epoch9
test/epoch_acc0.81111
test/epoch_loss0.60187
test/f1-score0.8172
test/precision0.77551
test/recall0.86364
train/batch_loss0.5635
train/epoch_acc0.77273
train/epoch_loss0.59496

" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + " View run snowy-sweep-1 at: https://wandb.ai/flower-classification/pytorch-sweeps-demo/runs/pw52k3j3
Synced 5 W&B file(s), 0 media file(s), 0 artifact file(s) and 0 other file(s)" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "Find logs at: ./wandb/run-20230404_135456-pw52k3j3/logs" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\u001b[34m\u001b[1mwandb\u001b[0m: Agent Starting Run: ea718wsd with config:\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tbatch_size: 32\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tbeta_one: 0.99\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tbeta_two: 0.99\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tepochs: 10\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \teps: 1e-08\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tgamma: 0.1\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tlearning_rate: 0.1\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \toptimizer: adam\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tstep_size: 2\n" + ] + }, + { + "data": { + "text/html": [ + "Tracking run with wandb version 0.14.0" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "Run data is saved locally in /content/wandb/run-20230404_140117-ea718wsd" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "Syncing run splendid-sweep-2 to Weights & Biases (docs)
Sweep page: https://wandb.ai/flower-classification/pytorch-sweeps-demo/sweeps/9681wnh0" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + " View project at https://wandb.ai/flower-classification/pytorch-sweeps-demo" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + " View sweep at https://wandb.ai/flower-classification/pytorch-sweeps-demo/sweeps/9681wnh0" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + " View run at https://wandb.ai/flower-classification/pytorch-sweeps-demo/runs/ea718wsd" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "Waiting for W&B process to finish... (failed 1). Press Control-C to abort syncing." + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "\n", + "

Run history:


epoch▁▃▆█
test/epoch_acc▁▁▁
test/epoch_loss█▁▁
test/f1-score▁▁▁
test/precision▁▁▁
test/recall▁▁▁
train/batch_loss▁▁█▁▁▂▁▁▁▁▂▂▁▁▃▁▁▂▁▁▁▁▂▂▁▁▁▂▁▁▂▁▁▁▁▁▁▁▁▁
train/epoch_acc▃▁▇█
train/epoch_loss█▆▃▁

Run summary:


epoch3
test/epoch_acc0.42222
test/epoch_loss109.2288
test/f1-score0.59375
test/precision0.42222
test/recall1.0
train/batch_loss1.26954
train/epoch_acc0.51474
train/epoch_loss3.22592

" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + " View run splendid-sweep-2 at: https://wandb.ai/flower-classification/pytorch-sweeps-demo/runs/ea718wsd
Synced 4 W&B file(s), 0 media file(s), 0 artifact file(s) and 0 other file(s)" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "Find logs at: ./wandb/run-20230404_140117-ea718wsd/logs" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "Run ea718wsd errored: ZeroDivisionError('float division by zero')\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \u001b[32m\u001b[41mERROR\u001b[0m Run ea718wsd errored: ZeroDivisionError('float division by zero')\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: Sweep Agent: Waiting for job.\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: Job received.\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: Agent Starting Run: 2igypsdg with config:\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tbatch_size: 64\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tbeta_one: 0.9\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tbeta_two: 0.5\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tepochs: 10\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \teps: 1\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tgamma: 0.1\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tlearning_rate: 0.0001\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \toptimizer: sgd\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tstep_size: 2\n" + ] + }, + { + "data": { + "text/html": [ + "Tracking run with wandb version 0.14.0" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "Run data is saved locally in /content/wandb/run-20230404_140346-2igypsdg" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "Syncing run visionary-sweep-3 to Weights & Biases (docs)
Sweep page: https://wandb.ai/flower-classification/pytorch-sweeps-demo/sweeps/9681wnh0" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + " View project at https://wandb.ai/flower-classification/pytorch-sweeps-demo" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + " View sweep at https://wandb.ai/flower-classification/pytorch-sweeps-demo/sweeps/9681wnh0" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + " View run at https://wandb.ai/flower-classification/pytorch-sweeps-demo/runs/2igypsdg" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "Waiting for W&B process to finish... (success)." + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "\n", + "

Run history:


epoch▁▂▃▃▄▅▆▆▇█
test/epoch_acc█▅▁▁▁▁▃▁▃▃
test/epoch_loss▁▆█▄▄▄▆▅▃▅
test/f1-score▁█▅▅▅▅▆▅▆▆
test/precision▂█▁▁▁▁▃▁▃▃
test/recall▁█▇▇▇▇▇▇▇▇
train/batch_loss█▇██▄█▆▆▁▂▂▁▃▅▆▄▅▂▇▃▄▁▆▆▁▆▆▄▄▃▃▆▇▂▇█▅▅▁▄
train/epoch_acc▁▄▇█▇█▇▇▆▇
train/epoch_loss█▅▂▂▂▁▁▂▂▁

Run summary:


epoch9
test/epoch_acc0.34444
test/epoch_loss0.72334
test/f1-score0.47788
test/precision0.35065
test/recall0.75
train/batch_loss0.67509
train/epoch_acc0.56265
train/epoch_loss0.67967

" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + " View run visionary-sweep-3 at: https://wandb.ai/flower-classification/pytorch-sweeps-demo/runs/2igypsdg
Synced 4 W&B file(s), 0 media file(s), 0 artifact file(s) and 0 other file(s)" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "Find logs at: ./wandb/run-20230404_140346-2igypsdg/logs" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\u001b[34m\u001b[1mwandb\u001b[0m: Agent Starting Run: 37tqne1y with config:\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tbatch_size: 64\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tbeta_one: 0.9\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tbeta_two: 0.5\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tepochs: 10\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \teps: 1e-08\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tgamma: 0.1\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tlearning_rate: 0.1\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \toptimizer: sgd\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tstep_size: 5\n" + ] + }, + { + "data": { + "text/html": [ + "Tracking run with wandb version 0.14.0" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "Run data is saved locally in /content/wandb/run-20230404_140933-37tqne1y" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "Syncing run proud-sweep-4 to Weights & Biases (docs)
Sweep page: https://wandb.ai/flower-classification/pytorch-sweeps-demo/sweeps/9681wnh0" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + " View project at https://wandb.ai/flower-classification/pytorch-sweeps-demo" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + " View sweep at https://wandb.ai/flower-classification/pytorch-sweeps-demo/sweeps/9681wnh0" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + " View run at https://wandb.ai/flower-classification/pytorch-sweeps-demo/runs/37tqne1y" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "Waiting for W&B process to finish... (success)." + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "\n", + "

Run history:


epoch▁▂▃▃▄▅▆▆▇█
test/epoch_acc▆▅▁▅▃▇▇███
test/epoch_loss▂▁█▁▅▁▁▁▁▁
test/f1-score▅▆▄▄▁▇▇███
test/precision█▅▁█▆▅▅▆▇▇
test/recall▃▆▇▃▁▇█▇▇▇
train/batch_loss█▆▅▄▃▂▁▃▇▃▄▄▂▂▅▃▂▄▂▄▂▄▃▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁
train/epoch_acc▁▆▅▆▆▆████
train/epoch_loss█▄▆▄▄▃▁▁▁▁

Run summary:


epoch9
test/epoch_acc0.84444
test/epoch_loss0.62389
test/f1-score0.84091
test/precision0.84091
test/recall0.84091
train/batch_loss0.00493
train/epoch_acc1.0
train/epoch_loss0.00446

" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + " View run proud-sweep-4 at: https://wandb.ai/flower-classification/pytorch-sweeps-demo/runs/37tqne1y
Synced 4 W&B file(s), 0 media file(s), 0 artifact file(s) and 0 other file(s)" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "Find logs at: ./wandb/run-20230404_140933-37tqne1y/logs" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\u001b[34m\u001b[1mwandb\u001b[0m: Agent Starting Run: 3co2jpxp with config:\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tbatch_size: 8\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tbeta_one: 0.9\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tbeta_two: 0.9\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tepochs: 10\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \teps: 1e-08\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tgamma: 0.1\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tlearning_rate: 0.0003\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \toptimizer: adam\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tstep_size: 7\n" + ] + }, + { + "data": { + "text/html": [ + "Tracking run with wandb version 0.14.0" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "Run data is saved locally in /content/wandb/run-20230404_141514-3co2jpxp" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "Syncing run restful-sweep-5 to Weights & Biases (docs)
Sweep page: https://wandb.ai/flower-classification/pytorch-sweeps-demo/sweeps/9681wnh0" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + " View project at https://wandb.ai/flower-classification/pytorch-sweeps-demo" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + " View sweep at https://wandb.ai/flower-classification/pytorch-sweeps-demo/sweeps/9681wnh0" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + " View run at https://wandb.ai/flower-classification/pytorch-sweeps-demo/runs/3co2jpxp" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "Waiting for W&B process to finish... (success)." + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "\n", + "

Run history:


epoch▁▂▃▃▄▅▆▆▇█
test/epoch_acc▄█▁▃▃▅▆▇▇█
test/epoch_loss▃▁▆▄█▃▄▂▃▃
test/f1-score▂▇▁▂▃▆▅▆▆█
test/precision▅█▁▃▂▄▆▆▆▇
test/recall▁▂█▄██▂▃▄▄
train/batch_loss▄▂▃▄▂▂▃█▂▁▃▁▂▂▁▁▃▁▁▂▁▁▁▂▁▁▁▃▁▁▁▁▁▁▅▁▁▁▁▁
train/epoch_acc▁▄▅▆▆▆▇███
train/epoch_loss█▆▄▄▃▃▂▂▁▁

Run summary:


epoch9
test/epoch_acc0.87778
test/epoch_loss0.53854
test/f1-score0.86747
test/precision0.85714
test/recall0.87805
train/batch_loss0.00185
train/epoch_acc0.99631
train/epoch_loss0.01069

" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + " View run restful-sweep-5 at: https://wandb.ai/flower-classification/pytorch-sweeps-demo/runs/3co2jpxp
Synced 4 W&B file(s), 0 media file(s), 0 artifact file(s) and 0 other file(s)" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "Find logs at: ./wandb/run-20230404_141514-3co2jpxp/logs" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\u001b[34m\u001b[1mwandb\u001b[0m: Agent Starting Run: ppthue5q with config:\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tbatch_size: 8\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tbeta_one: 0.9\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tbeta_two: 0.999\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tepochs: 10\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \teps: 1e-08\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tgamma: 0.1\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" + ] + }, + { + "data": { + "text/html": [ + "Tracking run with wandb version 0.14.0" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "Run data is saved locally in /content/wandb/run-20230404_142101-ppthue5q" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "Syncing run charmed-sweep-6 to Weights & Biases (docs)
Sweep page: https://wandb.ai/flower-classification/pytorch-sweeps-demo/sweeps/9681wnh0" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + " View project at https://wandb.ai/flower-classification/pytorch-sweeps-demo" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + " View sweep at https://wandb.ai/flower-classification/pytorch-sweeps-demo/sweeps/9681wnh0" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + " View run at https://wandb.ai/flower-classification/pytorch-sweeps-demo/runs/ppthue5q" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "Waiting for W&B process to finish... (success)." + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "\n", + "

Run history:


epoch▁▂▃▃▄▅▆▆▇█
test/epoch_acc▁▄▃▇▆▇███▇
test/epoch_loss█▄▃▅▃▁▁▁▂▂
test/f1-score▁▄▃▆▆▇███▆
test/precision▁▂▂▆▅▅▆▇█▆
test/recall▁█▃▅▃▆▆▅▃▅
train/batch_loss█▃▆▅▇▆▄▃▄▁▄▃▁▁▂▂▁▁▁▁▃▁▁▃▁▁▁▁▁▁▂▁▁▁▂▂▁▃▁▁
train/epoch_acc▁▃▆▆▇▇████
train/epoch_loss█▆▄▄▂▂▁▁▁▁

Run summary:


epoch9
test/epoch_acc0.87778
test/epoch_loss0.24035
test/f1-score0.86076
test/precision0.85
test/recall0.87179
train/batch_loss0.03008
train/epoch_acc0.99386
train/epoch_loss0.02099

" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + " View run charmed-sweep-6 at: https://wandb.ai/flower-classification/pytorch-sweeps-demo/runs/ppthue5q
Synced 4 W&B file(s), 0 media file(s), 0 artifact file(s) and 0 other file(s)" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "Find logs at: ./wandb/run-20230404_142101-ppthue5q/logs" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\u001b[34m\u001b[1mwandb\u001b[0m: Agent Starting Run: eakg0nsy with config:\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tbatch_size: 4\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tbeta_one: 0.9\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tbeta_two: 0.99\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tepochs: 10\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \teps: 0.1\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tgamma: 0.5\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tlearning_rate: 0.003\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \toptimizer: sgd\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tstep_size: 7\n" + ] + }, + { + "data": { + "text/html": [ + "Tracking run with wandb version 0.14.0" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "Run data is saved locally in /content/wandb/run-20230404_142642-eakg0nsy" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "Syncing run still-sweep-7 to Weights & Biases (docs)
Sweep page: https://wandb.ai/flower-classification/pytorch-sweeps-demo/sweeps/9681wnh0" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + " View project at https://wandb.ai/flower-classification/pytorch-sweeps-demo" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + " View sweep at https://wandb.ai/flower-classification/pytorch-sweeps-demo/sweeps/9681wnh0" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + " View run at https://wandb.ai/flower-classification/pytorch-sweeps-demo/runs/eakg0nsy" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "Waiting for W&B process to finish... (success)." + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "\n", + "

Run history:


epoch▁▂▃▃▄▅▆▆▇█
test/epoch_acc▁▆▅▃█▆▅▆▆▆
test/epoch_loss▆▄▃▆▁▇█▇██
test/f1-score▁▆▅▃█▅▄▆▆▅
test/precision▁▆▁▆▇█▅▇▇▆
test/recall▃▅█▁▆▃▃▄▄▄
train/batch_loss▄▅▃▄▅▆▆█▄▂▂▃▂▁▁▂▁▁▂▁▃▁▁▁▁▁▂▃▁▁▁▁▁▁▁▁▁▁▁▁
train/epoch_acc▁▄▅▆▇▇▇███
train/epoch_loss█▆▅▃▂▂▂▁▁▁

Run summary:


epoch9
test/epoch_acc0.85556
test/epoch_loss0.44089
test/f1-score0.87379
test/precision0.9375
test/recall0.81818
train/batch_loss0.01161
train/epoch_acc0.99386
train/epoch_loss0.02177

" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + " View run still-sweep-7 at: https://wandb.ai/flower-classification/pytorch-sweeps-demo/runs/eakg0nsy
Synced 4 W&B file(s), 0 media file(s), 0 artifact file(s) and 0 other file(s)" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "Find logs at: ./wandb/run-20230404_142642-eakg0nsy/logs" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\u001b[34m\u001b[1mwandb\u001b[0m: Agent Starting Run: jucrzfat with config:\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tbatch_size: 16\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tbeta_one: 0.9\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tbeta_two: 0.99\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tepochs: 10\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \teps: 0.1\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tgamma: 0.1\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tlearning_rate: 0.1\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \toptimizer: sgd\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tstep_size: 3\n" + ] + }, + { + "data": { + "text/html": [ + "Tracking run with wandb version 0.14.0" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "Run data is saved locally in /content/wandb/run-20230404_143240-jucrzfat" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "Syncing run crimson-sweep-8 to Weights & Biases (docs)
Sweep page: https://wandb.ai/flower-classification/pytorch-sweeps-demo/sweeps/9681wnh0" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + " View project at https://wandb.ai/flower-classification/pytorch-sweeps-demo" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + " View sweep at https://wandb.ai/flower-classification/pytorch-sweeps-demo/sweeps/9681wnh0" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + " View run at https://wandb.ai/flower-classification/pytorch-sweeps-demo/runs/jucrzfat" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "Waiting for W&B process to finish... (success)." + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "\n", + "

Run history:


epoch▁▂▃▃▄▅▆▆▇█
test/epoch_acc▁▆▅▆▇█████
test/epoch_loss█▂▁▁▁▁▁▁▁▁
test/f1-score▁▂▄▅▆▇▇███
test/precision▁▇▅▆▆█████
test/recall█▁▄▅▅▅▅▅▅▅
train/batch_loss▆▅▄▇▄▄▅█▆▄▃▅▄▃▅▂▄▄▄▃▃▃▄▂▄▃▄▅▁▃▃▂▂▂▂▃▃▂▁▃
train/epoch_acc▁▄▅▅▇▇▇▇██
train/epoch_loss█▅▄▃▂▂▂▂▁▁

Run summary:


epoch9
test/epoch_acc0.78889
test/epoch_loss0.46169
test/f1-score0.7957
test/precision0.84091
test/recall0.7551
train/batch_loss0.63008
train/epoch_acc0.77396
train/epoch_loss0.4697

" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + " View run crimson-sweep-8 at: https://wandb.ai/flower-classification/pytorch-sweeps-demo/runs/jucrzfat
Synced 4 W&B file(s), 0 media file(s), 0 artifact file(s) and 0 other file(s)" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "Find logs at: ./wandb/run-20230404_143240-jucrzfat/logs" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\u001b[34m\u001b[1mwandb\u001b[0m: Agent Starting Run: bhks7msu with config:\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tbatch_size: 32\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tbeta_one: 0.99\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tbeta_two: 0.999\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tepochs: 10\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \teps: 1\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tgamma: 0.1\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tlearning_rate: 0.003\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \toptimizer: adam\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tstep_size: 3\n" + ] + }, + { + "data": { + "text/html": [ + "Tracking run with wandb version 0.14.0" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "Run data is saved locally in /content/wandb/run-20230404_143816-bhks7msu" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "Syncing run lilac-sweep-9 to Weights & Biases (docs)
Sweep page: https://wandb.ai/flower-classification/pytorch-sweeps-demo/sweeps/9681wnh0" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + " View project at https://wandb.ai/flower-classification/pytorch-sweeps-demo" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + " View sweep at https://wandb.ai/flower-classification/pytorch-sweeps-demo/sweeps/9681wnh0" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + " View run at https://wandb.ai/flower-classification/pytorch-sweeps-demo/runs/bhks7msu" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "Waiting for W&B process to finish... (success)." + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "\n", + "

Run history:


epoch▁▂▃▃▄▅▆▆▇█
test/epoch_acc▁▃▃█▁▆▆▃▃█
test/epoch_loss█▅▂▂▁▁▁▁▁▁
test/f1-score▁▄▄█▂▆▆▄▄█
test/precision▂▃▃█▁▆▆▃▃█
test/recall▁█████████
train/batch_loss██▇▅▅▄▄▅▅▂▅▂▃▄▃▅▂▃▃▆▂▃▂▃▃▂▂▅▃▂▁▂▂▅▄▄▃▃▁▅
train/epoch_acc▁▅▇███▇███
train/epoch_loss█▅▃▂▁▁▁▁▁▁

Run summary:


epoch9
test/epoch_acc0.85556
test/epoch_loss0.54705
test/f1-score0.86022
test/precision0.78431
test/recall0.95238
train/batch_loss0.61833
train/epoch_acc0.8059
train/epoch_loss0.558

" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + " View run lilac-sweep-9 at: https://wandb.ai/flower-classification/pytorch-sweeps-demo/runs/bhks7msu
Synced 4 W&B file(s), 0 media file(s), 0 artifact file(s) and 0 other file(s)" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "Find logs at: ./wandb/run-20230404_143816-bhks7msu/logs" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\u001b[34m\u001b[1mwandb\u001b[0m: Agent Starting Run: ezctslju with config:\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tbatch_size: 32\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tbeta_one: 0.9\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tbeta_two: 0.5\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tepochs: 10\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \teps: 1\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tgamma: 0.1\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tlearning_rate: 0.003\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \toptimizer: adam\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tstep_size: 5\n" + ] + }, + { + "data": { + "text/html": [ + "Tracking run with wandb version 0.14.0" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "Run data is saved locally in /content/wandb/run-20230404_144350-ezctslju" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "Syncing run different-sweep-10 to Weights & Biases (docs)
Sweep page: https://wandb.ai/flower-classification/pytorch-sweeps-demo/sweeps/9681wnh0" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + " View project at https://wandb.ai/flower-classification/pytorch-sweeps-demo" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + " View sweep at https://wandb.ai/flower-classification/pytorch-sweeps-demo/sweeps/9681wnh0" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + " View run at https://wandb.ai/flower-classification/pytorch-sweeps-demo/runs/ezctslju" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "Waiting for W&B process to finish... (success)." + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "\n", + "

Run history:


epoch▁▂▃▃▄▅▆▆▇█
test/epoch_acc▁▂▇███▇▇▄▇
test/epoch_loss█▆▅▃▂▂▁▁▁▁
test/f1-score▁▅▆███▆▆▁▆
test/precision▂▁██████▇█
test/recall▅█▃▅▅▅▃▃▁▃
train/batch_loss███▇▇▆▆▇▆▆▆▆▅▅▅▅▃▅▃▅▃▃▂▄▃▂▄▂▂▁▂▃▃▃▄▄▃▅▃▄
train/epoch_acc▁▅▇▇▇█▇███
train/epoch_loss█▆▅▄▂▂▁▁▁▁

Run summary:


epoch9
test/epoch_acc0.75556
test/epoch_loss0.53376
test/f1-score0.76596
test/precision0.76596
test/recall0.76596
train/batch_loss0.52814
train/epoch_acc0.86118
train/epoch_loss0.46213

" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + " View run different-sweep-10 at: https://wandb.ai/flower-classification/pytorch-sweeps-demo/runs/ezctslju
Synced 4 W&B file(s), 0 media file(s), 0 artifact file(s) and 0 other file(s)" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "Find logs at: ./wandb/run-20230404_144350-ezctslju/logs" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\u001b[34m\u001b[1mwandb\u001b[0m: Agent Starting Run: gxvcwlwu with config:\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tbatch_size: 64\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tbeta_one: 0.99\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tbeta_two: 0.99\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tepochs: 10\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \teps: 0.1\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tgamma: 0.5\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tlearning_rate: 0.0003\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \toptimizer: adam\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tstep_size: 5\n" + ] + }, + { + "data": { + "text/html": [ + "Tracking run with wandb version 0.14.0" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "Run data is saved locally in /content/wandb/run-20230404_144922-gxvcwlwu" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "Syncing run glowing-sweep-11 to Weights & Biases (docs)
Sweep page: https://wandb.ai/flower-classification/pytorch-sweeps-demo/sweeps/9681wnh0" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + " View project at https://wandb.ai/flower-classification/pytorch-sweeps-demo" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + " View sweep at https://wandb.ai/flower-classification/pytorch-sweeps-demo/sweeps/9681wnh0" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + " View run at https://wandb.ai/flower-classification/pytorch-sweeps-demo/runs/gxvcwlwu" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "Waiting for W&B process to finish... (success)." + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "\n", + "

Run history:


epoch▁▂▃▃▄▅▆▆▇█
test/epoch_acc▁▂▅▆▆▆▇███
test/epoch_loss█▇▅▄▄▃▂▂▂▁
test/f1-score▁▂▅▆▇▇▇███
test/precision▁▂▄▅▆▆▇███
test/recall▁▄▇███████
train/batch_loss▇█▆▇▇▆▆▆▆▅▅▆▅▅▃▅▅▄▅▅▃▄▄▂▃▃▃▃▃▃▃▂▁▃▃▃▂▃▁▁
train/epoch_acc▁▄▅▆▇▇▇███
train/epoch_loss█▇▆▄▄▃▂▂▁▁

Run summary:


epoch9
test/epoch_acc0.86667
test/epoch_loss0.53756
test/f1-score0.86364
test/precision0.80851
test/recall0.92683
train/batch_loss0.52993
train/epoch_acc0.80098
train/epoch_loss0.55775

" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + " View run glowing-sweep-11 at: https://wandb.ai/flower-classification/pytorch-sweeps-demo/runs/gxvcwlwu
Synced 4 W&B file(s), 0 media file(s), 0 artifact file(s) and 0 other file(s)" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "Find logs at: ./wandb/run-20230404_144922-gxvcwlwu/logs" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\u001b[34m\u001b[1mwandb\u001b[0m: Agent Starting Run: o4ceynjw with config:\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tbatch_size: 64\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tbeta_one: 0.9\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tbeta_two: 0.999\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tepochs: 10\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \teps: 1e-08\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tgamma: 0.1\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" + ] + }, + { + "data": { + "text/html": [ + "Tracking run with wandb version 0.14.0" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "Run data is saved locally in /content/wandb/run-20230404_145500-o4ceynjw" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "Syncing run chocolate-sweep-12 to Weights & Biases (docs)
Sweep page: https://wandb.ai/flower-classification/pytorch-sweeps-demo/sweeps/9681wnh0" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + " View project at https://wandb.ai/flower-classification/pytorch-sweeps-demo" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + " View sweep at https://wandb.ai/flower-classification/pytorch-sweeps-demo/sweeps/9681wnh0" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + " View run at https://wandb.ai/flower-classification/pytorch-sweeps-demo/runs/o4ceynjw" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "Waiting for W&B process to finish... (success)." + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "\n", + "

Run history:


epoch▁▂▃▃▄▅▆▆▇█
test/epoch_acc▁▆▄▇▇█████
test/epoch_loss█▄▄▁▁▁▁▁▁▁
test/f1-score▁▆▄▇▇█████
test/precision▂▁█▆██████
test/recall▁█▃█▇█████
train/batch_loss██▇▆▅▅▄▄▃▃▂▂▂▂▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁
train/epoch_acc▁▅▇███████
train/epoch_loss█▅▃▁▁▁▁▁▁▁

Run summary:


epoch9
test/epoch_acc0.97778
test/epoch_loss0.13521
test/f1-score0.97826
test/precision1.0
test/recall0.95745
train/batch_loss0.00408
train/epoch_acc1.0
train/epoch_loss0.00712

" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + " View run chocolate-sweep-12 at: https://wandb.ai/flower-classification/pytorch-sweeps-demo/runs/o4ceynjw
Synced 4 W&B file(s), 0 media file(s), 0 artifact file(s) and 0 other file(s)" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "Find logs at: ./wandb/run-20230404_145500-o4ceynjw/logs" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\u001b[34m\u001b[1mwandb\u001b[0m: Agent Starting Run: w0els6yx with config:\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tbatch_size: 4\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tbeta_one: 0.9\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tbeta_two: 0.999\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tepochs: 10\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \teps: 1\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tgamma: 0.5\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tlearning_rate: 0.0001\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \toptimizer: adam\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tstep_size: 5\n" + ] + }, + { + "data": { + "text/html": [ + "Tracking run with wandb version 0.14.0" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "Run data is saved locally in /content/wandb/run-20230404_150038-w0els6yx" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "Syncing run glorious-sweep-13 to Weights & Biases (docs)
Sweep page: https://wandb.ai/flower-classification/pytorch-sweeps-demo/sweeps/9681wnh0" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + " View project at https://wandb.ai/flower-classification/pytorch-sweeps-demo" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + " View sweep at https://wandb.ai/flower-classification/pytorch-sweeps-demo/sweeps/9681wnh0" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + " View run at https://wandb.ai/flower-classification/pytorch-sweeps-demo/runs/w0els6yx" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "Waiting for W&B process to finish... (success)." + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "\n", + "

Run history:


epoch▁▂▃▃▄▅▆▆▇█
test/epoch_acc▂▁▄▄▇▆▆▇█▇
test/epoch_loss█▆▅▆▃▂▂▂▂▁
test/f1-score▁▁▅▄▇▇▇███
test/precision▂▁▄▃▆▆▆▆█▇
test/recall▁▂▅▄▆▆▇█▆█
train/batch_loss█▆▆▆▆▆▆▃▇█▄▄▇█▆▅▄▇▇▃▄▄▅▂▃▄▆▆▁▆▂▄▄▅▅▅▄▆▄▄
train/epoch_acc▁▃▄▄▆▆▇▇▇█
train/epoch_loss█▇▆▅▃▃▂▂▂▁

Run summary:


epoch9
test/epoch_acc0.68889
test/epoch_loss0.66123
test/f1-score0.65854
test/precision0.64286
test/recall0.675
train/batch_loss0.60239
train/epoch_acc0.65233
train/epoch_loss0.66732

" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + " View run glorious-sweep-13 at: https://wandb.ai/flower-classification/pytorch-sweeps-demo/runs/w0els6yx
Synced 4 W&B file(s), 0 media file(s), 0 artifact file(s) and 0 other file(s)" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "Find logs at: ./wandb/run-20230404_150038-w0els6yx/logs" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\u001b[34m\u001b[1mwandb\u001b[0m: Agent Starting Run: sn7rpzsv with config:\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tbatch_size: 4\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tbeta_one: 0.9\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tbeta_two: 0.99\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tepochs: 10\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \teps: 1\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tgamma: 0.5\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tlearning_rate: 0.001\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \toptimizer: sgd\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tstep_size: 7\n" + ] + }, + { + "data": { + "text/html": [ + "Tracking run with wandb version 0.14.0" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "Run data is saved locally in /content/wandb/run-20230404_150639-sn7rpzsv" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "Syncing run stoic-sweep-14 to Weights & Biases (docs)
Sweep page: https://wandb.ai/flower-classification/pytorch-sweeps-demo/sweeps/9681wnh0" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + " View project at https://wandb.ai/flower-classification/pytorch-sweeps-demo" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + " View sweep at https://wandb.ai/flower-classification/pytorch-sweeps-demo/sweeps/9681wnh0" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + " View run at https://wandb.ai/flower-classification/pytorch-sweeps-demo/runs/sn7rpzsv" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "Waiting for W&B process to finish... (success)." + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "\n", + "

Run history:


epoch▁▂▃▃▄▅▆▆▇█
test/epoch_acc▃▁▃▆▆▃▆▆▄█
test/epoch_loss█▆▄▁▃▆▃▃▄▁
test/f1-score▄▁▃▇▆▃▆▆▅█
test/precision▃▆▁▂██▂▁▃▇
test/recall▄▁▄█▄▂▇█▅▇
train/batch_loss█▆▇▆▇█▂▆▂▄▃▁▁▁▄▃▄▂▁▁▁▁▁▃▁▁▁▁▁▁▁▁▁▁▁▂▁▁▁▁
train/epoch_acc▁▄▆▇▇▇▇███
train/epoch_loss█▆▄▃▂▂▂▁▁▁

Run summary:


epoch9
test/epoch_acc0.92222
test/epoch_loss0.22225
test/f1-score0.91358
test/precision0.94872
test/recall0.88095
train/batch_loss0.01037
train/epoch_acc0.98649
train/epoch_loss0.04606

" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + " View run stoic-sweep-14 at: https://wandb.ai/flower-classification/pytorch-sweeps-demo/runs/sn7rpzsv
Synced 4 W&B file(s), 0 media file(s), 0 artifact file(s) and 0 other file(s)" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "Find logs at: ./wandb/run-20230404_150639-sn7rpzsv/logs" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\u001b[34m\u001b[1mwandb\u001b[0m: Sweep Agent: Waiting for job.\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: Job received.\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: Agent Starting Run: m64aehal with config:\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tbatch_size: 4\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tbeta_one: 0.9\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tbeta_two: 0.999\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tepochs: 10\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \teps: 1\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tgamma: 0.1\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tlearning_rate: 0.1\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \toptimizer: adam\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tstep_size: 7\n" + ] + }, + { + "data": { + "text/html": [ + "Tracking run with wandb version 0.14.0" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "Run data is saved locally in /content/wandb/run-20230404_151243-m64aehal" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "Syncing run rare-sweep-15 to Weights & Biases (docs)
Sweep page: https://wandb.ai/flower-classification/pytorch-sweeps-demo/sweeps/9681wnh0" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + " View project at https://wandb.ai/flower-classification/pytorch-sweeps-demo" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + " View sweep at https://wandb.ai/flower-classification/pytorch-sweeps-demo/sweeps/9681wnh0" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + " View run at https://wandb.ai/flower-classification/pytorch-sweeps-demo/runs/m64aehal" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "Waiting for W&B process to finish... (success)." + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "\n", + "

Run history:


epoch▁▂▃▃▄▅▆▆▇█
test/epoch_acc▁█▃▅█▇▄▇██
test/epoch_loss█▁▆▃▂▄█▄▃▃
test/f1-score▃█▁▃██▃▇██
test/precision▁▅██▆▄▅▆▆▆
test/recall▅█▁▂▇█▃▆▆▇
train/batch_loss▄▅▃▅▂▇▂▄▂▃█▄▂▃▁▃▄▁▂▁▁▁▃▁▂▁▁▂▁▂▁▁▁▁▁▁▁▅▁▂
train/epoch_acc▁▃▄▆▆▇▇▇██
train/epoch_loss█▆▅▄▃▂▂▂▁▁

Run summary:


epoch9
test/epoch_acc0.86667
test/epoch_loss0.52816
test/f1-score0.85
test/precision0.85
test/recall0.85
train/batch_loss0.0016
train/epoch_acc0.99509
train/epoch_loss0.02902

" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + " View run rare-sweep-15 at: https://wandb.ai/flower-classification/pytorch-sweeps-demo/runs/m64aehal
Synced 4 W&B file(s), 0 media file(s), 0 artifact file(s) and 0 other file(s)" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "Find logs at: ./wandb/run-20230404_151243-m64aehal/logs" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\u001b[34m\u001b[1mwandb\u001b[0m: Sweep Agent: Waiting for job.\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: Job received.\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: Agent Starting Run: 71er7icc with config:\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tbatch_size: 32\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tbeta_one: 0.99\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tbeta_two: 0.5\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tepochs: 10\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \teps: 1\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tgamma: 0.5\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tlearning_rate: 0.0001\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \toptimizer: sgd\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tstep_size: 5\n" + ] + }, + { + "data": { + "text/html": [ + "Tracking run with wandb version 0.14.0" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "Run data is saved locally in /content/wandb/run-20230404_151846-71er7icc" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "Syncing run winter-sweep-16 to Weights & Biases (docs)
Sweep page: https://wandb.ai/flower-classification/pytorch-sweeps-demo/sweeps/9681wnh0" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + " View project at https://wandb.ai/flower-classification/pytorch-sweeps-demo" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + " View sweep at https://wandb.ai/flower-classification/pytorch-sweeps-demo/sweeps/9681wnh0" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + " View run at https://wandb.ai/flower-classification/pytorch-sweeps-demo/runs/71er7icc" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "Waiting for W&B process to finish... (success)." + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "\n", + "

Run history:


epoch▁▂▃▃▄▅▆▆▇█
test/epoch_acc▁▃▅▆▇▇▇███
test/epoch_loss█▇▅▄▄▃▃▂▂▁
test/f1-score▁▃▆▆▇▇▇███
test/precision▁▃▆▅▆▇▇███
test/recall▁▃▆▇▇▇▇███
train/batch_loss▇█▆▆▆▆▅▇▅▇▅▅▅▅▅▄▄▅▅▄▃▃▄▃▂▃▄▃▂▄▂▃▁▁▃▄▃▂▂▃
train/epoch_acc▁▃▄▆▇▇▇█▇█
train/epoch_loss█▇▆▅▄▃▃▂▂▁

Run summary:


epoch9
test/epoch_acc0.83333
test/epoch_loss0.5844
test/f1-score0.85437
test/precision0.88
test/recall0.83019
train/batch_loss0.60478
train/epoch_acc0.82801
train/epoch_loss0.58084

" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + " View run winter-sweep-16 at: https://wandb.ai/flower-classification/pytorch-sweeps-demo/runs/71er7icc
Synced 4 W&B file(s), 0 media file(s), 0 artifact file(s) and 0 other file(s)" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "Find logs at: ./wandb/run-20230404_151846-71er7icc/logs" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\u001b[34m\u001b[1mwandb\u001b[0m: Agent Starting Run: k0hwgfjk with config:\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tbatch_size: 8\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tbeta_one: 0.9\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tbeta_two: 0.9\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tepochs: 10\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \teps: 1e-08\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tgamma: 0.1\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tlearning_rate: 0.003\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \toptimizer: sgd\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tstep_size: 2\n" + ] + }, + { + "data": { + "text/html": [ + "Tracking run with wandb version 0.14.0" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "Run data is saved locally in /content/wandb/run-20230404_152419-k0hwgfjk" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "Syncing run sleek-sweep-17 to Weights & Biases (docs)
Sweep page: https://wandb.ai/flower-classification/pytorch-sweeps-demo/sweeps/9681wnh0" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + " View project at https://wandb.ai/flower-classification/pytorch-sweeps-demo" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + " View sweep at https://wandb.ai/flower-classification/pytorch-sweeps-demo/sweeps/9681wnh0" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + " View run at https://wandb.ai/flower-classification/pytorch-sweeps-demo/runs/k0hwgfjk" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "Waiting for W&B process to finish... (success)." + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "\n", + "

Run history:


epoch▁▂▃▃▄▅▆▆▇█
test/epoch_acc▃▁█▆▆▆█▅▅█
test/epoch_loss▅█▂▂▁▁▁▁▁▁
test/f1-score▂▁█▇▇▇█▅▅█
test/precision▇▃█▄▁▁█▁▁█
test/recall▁▁▆▆██▆▆▆▆
train/batch_loss▆█▄▅▃▃▇▁▁▁▁▁▁▁▂▁▂▂▁▁▁▁▁▂▁▄▃▁▁▂▂▁▁▃▁▁▁▁▁▁
train/epoch_acc▁▅██████▇█
train/epoch_loss█▄▁▁▁▁▁▁▁▁

Run summary:


epoch9
test/epoch_acc0.91111
test/epoch_loss0.2015
test/f1-score0.89744
test/precision0.94595
test/recall0.85366
train/batch_loss0.00723
train/epoch_acc0.98157
train/epoch_loss0.07856

" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + " View run sleek-sweep-17 at: https://wandb.ai/flower-classification/pytorch-sweeps-demo/runs/k0hwgfjk
Synced 4 W&B file(s), 0 media file(s), 0 artifact file(s) and 0 other file(s)" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "Find logs at: ./wandb/run-20230404_152419-k0hwgfjk/logs" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\u001b[34m\u001b[1mwandb\u001b[0m: Agent Starting Run: hb00vz7w with config:\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tbatch_size: 4\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tbeta_one: 0.99\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tbeta_two: 0.9\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tepochs: 10\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \teps: 1\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tgamma: 0.5\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tlearning_rate: 0.01\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \toptimizer: adam\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tstep_size: 5\n" + ] + }, + { + "data": { + "text/html": [ + "Tracking run with wandb version 0.14.0" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "Run data is saved locally in /content/wandb/run-20230404_152956-hb00vz7w" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "Syncing run smart-sweep-18 to Weights & Biases (docs)
Sweep page: https://wandb.ai/flower-classification/pytorch-sweeps-demo/sweeps/9681wnh0" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + " View project at https://wandb.ai/flower-classification/pytorch-sweeps-demo" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + " View sweep at https://wandb.ai/flower-classification/pytorch-sweeps-demo/sweeps/9681wnh0" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + " View run at https://wandb.ai/flower-classification/pytorch-sweeps-demo/runs/hb00vz7w" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "Waiting for W&B process to finish... (success)." + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "\n", + "

Run history:


epoch▁▂▃▃▄▅▆▆▇█
test/epoch_acc▁▅▆▇▆▇▆▆▆█
test/epoch_loss█▅▅▃▃▁▃▄▂▁
test/f1-score▁▄▆▇▆▇▆▆▆█
test/precision▁█▆▆▂▄▆█▆▄
test/recall▁▂▅▆▇▇▅▄▅█
train/batch_loss▅▅▄▆▅▅▂▂▂▃▂▅▃▂▂▁▂▃▂▁█▁▁▂▁▁▁▁▁▁▁▁▁▂▂▁▁▁▁▁
train/epoch_acc▁▄▅▇▇▇▇▇██
train/epoch_loss█▆▄▃▂▂▂▂▁▁

Run summary:


epoch9
test/epoch_acc0.9
test/epoch_loss0.24883
test/f1-score0.89888
test/precision0.93023
test/recall0.86957
train/batch_loss0.01547
train/epoch_acc0.98771
train/epoch_loss0.04667

" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + " View run smart-sweep-18 at: https://wandb.ai/flower-classification/pytorch-sweeps-demo/runs/hb00vz7w
Synced 4 W&B file(s), 0 media file(s), 0 artifact file(s) and 0 other file(s)" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "Find logs at: ./wandb/run-20230404_152956-hb00vz7w/logs" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\u001b[34m\u001b[1mwandb\u001b[0m: Agent Starting Run: 0bg49if5 with config:\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tbatch_size: 8\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tbeta_one: 0.9\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tbeta_two: 0.9\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tepochs: 10\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \teps: 1\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tgamma: 0.1\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tlearning_rate: 0.0001\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \toptimizer: adam\n", + "\u001b[34m\u001b[1mwandb\u001b[0m: \tstep_size: 2\n" + ] + } + ], + "source": [ + "wandb.agent(sweep_id, train, count=60)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "0p3H2-jRjJIG", + "metadata": { + "id": "0p3H2-jRjJIG" + }, + "outputs": [], + "source": [] + } + ], + "metadata": { + "accelerator": "GPU", + "colab": { + "provenance": [] + }, + "gpuClass": "standard", + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "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.10.13" + }, + "widgets": { + "application/vnd.jupyter.widget-state+json": { + "220d541b7b4347b08a7fc9b8feb09f98": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "ProgressStyleModel", + "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": "" + } + }, + "32a491d3031c476da2d8687861ccbf7d": { + "model_module": "@jupyter-widgets/base", + "model_module_version": "1.2.0", + "model_name": "LayoutModel", + "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 + } + }, + "9e4d93cf62094092809fee70ba7885f5": { + "model_module": "@jupyter-widgets/base", + "model_module_version": "1.2.0", + "model_name": "LayoutModel", + "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 + } + }, + "a6a0d4738d434aa1b734c8407dde4e74": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "FloatProgressModel", + "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": "", + "description": "", + "description_tooltip": null, + "layout": "IPY_MODEL_d8ec9c75b1f14686a6734b86eea24bb7", + "max": 1, + "min": 0, + "orientation": "horizontal", + "style": "IPY_MODEL_220d541b7b4347b08a7fc9b8feb09f98", + "value": 1 + } + }, + "d510d413136c4231bc720200145a5d77": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "LabelModel", + "state": { + "_dom_classes": [], + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "LabelModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/controls", + "_view_module_version": "1.5.0", + "_view_name": "LabelView", + "description": "", + "description_tooltip": null, + "layout": "IPY_MODEL_32a491d3031c476da2d8687861ccbf7d", + "placeholder": "​", + "style": "IPY_MODEL_ff00a24840224f8d9cce9ade4e77ac0c", + "value": "0.001 MB of 0.001 MB uploaded (0.000 MB deduped)\r" + } + }, + "d8ec9c75b1f14686a6734b86eea24bb7": { + "model_module": "@jupyter-widgets/base", + "model_module_version": "1.2.0", + "model_name": "LayoutModel", + "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 + } + }, + "e840ed026b3342718c0aa068f81d93f3": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "VBoxModel", + "state": { + "_dom_classes": [], + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "VBoxModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/controls", + "_view_module_version": "1.5.0", + "_view_name": "VBoxView", + "box_style": "", + "children": [ + "IPY_MODEL_d510d413136c4231bc720200145a5d77", + "IPY_MODEL_a6a0d4738d434aa1b734c8407dde4e74" + ], + "layout": "IPY_MODEL_9e4d93cf62094092809fee70ba7885f5" + } + }, + "ff00a24840224f8d9cce9ade4e77ac0c": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "DescriptionStyleModel", + "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": "" + } + } + } + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/classification/classifier/hyp-metrics.ipynb b/classification/classifier/hyp-metrics.ipynb index 6579501..bc4c7e3 100644 --- a/classification/classifier/hyp-metrics.ipynb +++ b/classification/classifier/hyp-metrics.ipynb @@ -34,6 +34,14 @@ "np.random.seed(42)" ] }, + { + "cell_type": "markdown", + "id": "4d29e56f-ee81-4f43-96ff-99bb22c52f6a", + "metadata": {}, + "source": [ + "# Download Metrics from WandB" + ] + }, { "cell_type": "code", "execution_count": 2, @@ -70,6 +78,16 @@ "runs_df.to_csv(\"hyp-metrics.csv\")" ] }, + { + "cell_type": "markdown", + "id": "821aeb7d-784b-4e38-b4f8-c49245ee25ce", + "metadata": {}, + "source": [ + "# Transform Metrics\n", + "\n", + "The column `summary` contains most of the metrics we are interested in (`test/precision`,…) but all of the metrics are in a dictionary in this column." + ] + }, { "cell_type": "code", "execution_count": 3, @@ -970,7 +988,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.7.15" + "version": "3.10.13" } }, "nbformat": 4, diff --git a/classification/classifier/hyp.ipynb b/classification/classifier/hyp.ipynb index 246b7d2..69367f6 100644 --- a/classification/classifier/hyp.ipynb +++ b/classification/classifier/hyp.ipynb @@ -1,5 +1,15 @@ { "cells": [ + { + "cell_type": "markdown", + "id": "5eca6897-e43c-4358-9281-ab6b1ece871a", + "metadata": {}, + "source": [ + "# Local Hyperparameter Optimization\n", + "\n", + "This notebook is similar to the `classifier_hyp` notebook, but it runs the hyperparameter optimization locally instead of on Google Colab. The definitive version is the Google Colab one because we run many more iterations and parameter combinations there due to GPU availability." + ] + }, { "cell_type": "code", "execution_count": 1, @@ -4636,7 +4646,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.7.15" + "version": "3.10.13" } }, "nbformat": 4, diff --git a/classification/classifier/k-fold-train.ipynb b/classification/classifier/k-fold-train.ipynb index 71098fe..3866abc 100644 --- a/classification/classifier/k-fold-train.ipynb +++ b/classification/classifier/k-fold-train.ipynb @@ -1 +1,5206 @@ -{"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 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" + ] + } + ], + "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" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "747ddcf2", + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 121 + }, + "executionInfo": { + "elapsed": 20584, + "status": "ok", + "timestamp": 1682933991673, + "user": { + "displayName": "Kranklything", + "userId": "02979056772560081296" + }, + "user_tz": 0 + }, + "id": "747ddcf2", + "outputId": "e0fd939b-acea-4244-d17f-e9440ebd876a" + }, + "outputs": [ + { + "data": { + "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", + " " + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stderr", + "output_type": "stream", + "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" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\u001b[34m\u001b[1mwandb\u001b[0m: Appending key for api.wandb.ai to your netrc file: /root/.netrc\n" + ] + }, + { + "data": { + "text/plain": [ + "True" + ] + }, + "execution_count": 2, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "import wandb\n", + "\n", + "wandb.login()" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "id": "c37343d6", + "metadata": { + "executionInfo": { + "elapsed": 6233, + "status": "ok", + "timestamp": 1682933997906, + "user": { + "displayName": "Kranklything", + "userId": "02979056772560081296" + }, + "user_tz": 0 + }, + "id": "c37343d6" + }, + "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", + "execution_count": 4, + "id": "3jcZsJkvCFYN", + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "executionInfo": { + "elapsed": 24067, + "status": "ok", + "timestamp": 1682934021957, + "user": { + "displayName": "Kranklything", + "userId": "02979056772560081296" + }, + "user_tz": 0 + }, + "id": "3jcZsJkvCFYN", + "outputId": "584e7472-5547-4dbe-e15a-61200c504bf3" + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Mounted at /content/drive\n" + ] + } + ], + "source": [ + "from google.colab import drive\n", + "drive.mount('/content/drive')" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "9kAalkZjkZss", + "metadata": { + "executionInfo": { + "elapsed": 17, + "status": "ok", + "timestamp": 1682934021957, + "user": { + "displayName": "Kranklything", + "userId": "02979056772560081296" + }, + "user_tz": 0 + }, + "id": "9kAalkZjkZss" + }, + "outputs": [], + "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" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "id": "hHslzk9d4dnq", + "metadata": { + "executionInfo": { + "elapsed": 17, + "status": "ok", + "timestamp": 1682934021957, + "user": { + "displayName": "Kranklything", + "userId": "02979056772560081296" + }, + "user_tz": 0 + }, + "id": "hHslzk9d4dnq" + }, + "outputs": [], + "source": [ + "plt.rcParams['mathtext.fontset'] = 'cm'\n", + "plt.rcParams['font.family'] = 'STIXGeneral'" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "id": "17b25dc7", + "metadata": { + "executionInfo": { + "elapsed": 17, + "status": "ok", + "timestamp": 1682934021957, + "user": { + "displayName": "Kranklything", + "userId": "02979056772560081296" + }, + "user_tz": 0 + }, + "id": "17b25dc7" + }, + "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": { + "executionInfo": { + "elapsed": 17, + "status": "ok", + "timestamp": 1682934021957, + "user": { + "displayName": "Kranklything", + "userId": "02979056772560081296" + }, + "user_tz": 0 + }, + "id": "5eff68bf" + }, + "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": { + "executionInfo": { + "elapsed": 0, + "status": "ok", + "timestamp": 1682934128109, + "user": { + "displayName": "Kranklything", + "userId": "02979056772560081296" + }, + "user_tz": 0 + }, + "id": "732a83df" + }, + "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/" + }, + "executionInfo": { + "elapsed": 1834, + "status": "ok", + "timestamp": 1682934130376, + "user": { + "displayName": "Kranklything", + "userId": "02979056772560081296" + }, + "user_tz": 0 + }, + "id": "9a01fef6", + "outputId": "d227e860-eb90-4d23-d299-99863f931d46" + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "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": { + "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", + "scrolled": true + }, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "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" + ] + }, + { + "data": { + "text/html": [ + "Tracking run with wandb version 0.15.0" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "Run data is saved locally in /content/wandb/run-20230501_094215-qxhbaz0l" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "Syncing run good-sweep-1 to Weights & Biases (docs)
Sweep page: https://wandb.ai/flower-classification/classifier-optimized/sweeps/bq0rvyfn" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + " View project at https://wandb.ai/flower-classification/classifier-optimized" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + " View sweep at https://wandb.ai/flower-classification/classifier-optimized/sweeps/bq0rvyfn" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + " View run at https://wandb.ai/flower-classification/classifier-optimized/runs/qxhbaz0l" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stderr", + "output_type": "stream", + "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" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "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" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "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" + ] + }, + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "e5784a8d425b45418ab8558ec841c9a3", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + " 0%| | 0/25 [00:00\n", - "\n", - "This notebook loads the test dataset in YOLOv5 format from disk and evaluates the model's performance." - ] - }, - { - "cell_type": "code", - "execution_count": 1, - "id": "ff25695e", - "metadata": {}, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "/home/zenon/.local/share/miniconda3/lib/python3.7/site-packages/requests/__init__.py:104: RequestsDependencyWarning: urllib3 (1.26.13) or chardet (5.1.0)/charset_normalizer (2.0.4) doesn't match a supported version!\n", - " RequestsDependencyWarning)\n" - ] - } - ], - "source": [ - "import fiftyone as fo\n", - "from PIL import Image\n", - "from detection import detect\n", - "from detection import detect_yolo_only" - ] - }, - { - "cell_type": "markdown", - "id": "86a5e832", - "metadata": {}, - "source": [ - "## Aggregate Model Evaluation \n", - "\n", - "First, load the dataset from the directory containing the images and the labels in YOLOv5 format.\n", - "\n", - "### Loading the dataset " - ] - }, { "cell_type": "code", "execution_count": null, @@ -237,76 +178,6 @@ "The code for the LaTeX table of the classification report can be printed by first converting the results to a pandas DataFrame and then calling the `to_latex()` method of the DataFrame. This code can then be inserted into the LaTeX document." ] }, - { - "cell_type": "code", - "execution_count": 20, - "id": "f7ad63b0", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\\begin{tabular}{lrrrr}\n", - "\\toprule\n", - "{} & precision & recall & f1-score & support \\\\\n", - "\\midrule\n", - "Healthy & 0.679 & 0.525 & 0.592 & 766.0 \\\\\n", - "Stressed & 0.646 & 0.447 & 0.529 & 494.0 \\\\\n", - "micro avg & 0.667 & 0.494 & 0.568 & 1260.0 \\\\\n", - "macro avg & 0.663 & 0.486 & 0.560 & 1260.0 \\\\\n", - "weighted avg & 0.666 & 0.494 & 0.567 & 1260.0 \\\\\n", - "\\bottomrule\n", - "\\end{tabular}\n", - "\n", - "0.3374377395168513\n" - ] - } - ], - "source": [ - "results_df = pd.DataFrame(results.report()).transpose().round(3)\n", - "\n", - "# Export DataFrame to LaTeX tabular environment\n", - "print(results_df.to_latex())\n", - "# YOLO second hyp with Resnet optimized and relabeled dataset\n", - "print(results.mAP())" - ] - }, - { - "cell_type": "code", - "execution_count": 17, - "id": "d73cca50", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\\begin{tabular}{lrrrr}\n", - "\\toprule\n", - "{} & precision & recall & f1-score & support \\\\\n", - "\\midrule\n", - "Healthy & 0.653 & 0.604 & 0.628 & 766.0 \\\\\n", - "Stressed & 0.566 & 0.492 & 0.527 & 494.0 \\\\\n", - "micro avg & 0.620 & 0.560 & 0.589 & 1260.0 \\\\\n", - "macro avg & 0.610 & 0.548 & 0.577 & 1260.0 \\\\\n", - "weighted avg & 0.619 & 0.560 & 0.588 & 1260.0 \\\\\n", - "\\bottomrule\n", - "\\end{tabular}\n", - "\n", - "0.36171308664990176\n" - ] - } - ], - "source": [ - "results_df = pd.DataFrame(results.report()).transpose().round(3)\n", - "\n", - "# Export DataFrame to LaTeX tabular environment\n", - "print(results_df.to_latex())\n", - "# YOLO original with Resnet optimized and relabeled dataset\n", - "print(results.mAP())" - ] - }, { "cell_type": "code", "execution_count": 14, @@ -338,7 +209,7 @@ "\n", "# Export DataFrame to LaTeX tabular environment\n", "print(results_df.to_latex())\n", - "# YOLO optimized with Resnet optimized and relabeled dataset\n", + "# YOLO original with Resnet original and relabeled dataset\n", "print(results.mAP())" ] }, @@ -373,154 +244,10 @@ "\n", "# Export DataFrame to LaTeX tabular environment\n", "print(results_df.to_latex())\n", - "# YOLO original with Resnet original and relabeled dataset\n", + "# YOLO optimized with Resnet optimized and relabeled dataset\n", "print(results.mAP())" ] }, - { - "cell_type": "code", - "execution_count": 10, - "id": "b14d2b25", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\\begin{tabular}{lrrrr}\n", - "\\toprule\n", - "{} & precision & recall & f1-score & support \\\\\n", - "\\midrule\n", - "Healthy & 0.841 & 0.759 & 0.798 & 663.0 \\\\\n", - "Stressed & 0.726 & 0.810 & 0.766 & 484.0 \\\\\n", - "micro avg & 0.786 & 0.780 & 0.783 & 1147.0 \\\\\n", - "macro avg & 0.784 & 0.784 & 0.782 & 1147.0 \\\\\n", - "weighted avg & 0.793 & 0.780 & 0.784 & 1147.0 \\\\\n", - "\\bottomrule\n", - "\\end{tabular}\n", - "\n" - ] - } - ], - "source": [ - "results_df = pd.DataFrame(results.report()).transpose().round(3)\n", - "\n", - "# Export DataFrame to LaTeX tabular environment\n", - "print(results_df.to_latex())\n", - "# YOLO original with Resnet original and new dataset" - ] - }, - { - "cell_type": "code", - "execution_count": 8, - "id": "900e9014", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\\begin{tabular}{lrrrr}\n", - "\\toprule\n", - "{} & precision & recall & f1-score & support \\\\\n", - "\\midrule\n", - "Healthy & 0.674 & 0.721 & 0.696 & 662.0 \\\\\n", - "Stressed & 0.616 & 0.543 & 0.577 & 488.0 \\\\\n", - "micro avg & 0.652 & 0.645 & 0.649 & 1150.0 \\\\\n", - "macro avg & 0.645 & 0.632 & 0.637 & 1150.0 \\\\\n", - "weighted avg & 0.649 & 0.645 & 0.646 & 1150.0 \\\\\n", - "\\bottomrule\n", - "\\end{tabular}\n", - "\n", - "0.49320073714096757\n" - ] - } - ], - "source": [ - "results_df = pd.DataFrame(results.report()).transpose().round(3)\n", - "\n", - "# Export DataFrame to LaTeX tabular environment\n", - "print(results_df.to_latex())\n", - "print(results.mAP())\n", - "# YOLO original and Resnet final with old dataset" - ] - }, - { - "cell_type": "code", - "execution_count": 51, - "id": "24df35b4", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - " precision recall f1-score support\n", - "\n", - " Healthy 0.82 0.74 0.78 662\n", - " Stressed 0.71 0.78 0.74 488\n", - "\n", - " micro avg 0.77 0.76 0.76 1150\n", - " macro avg 0.77 0.76 0.76 1150\n", - "weighted avg 0.77 0.76 0.77 1150\n", - "\n", - "0.6225848121901868\n" - ] - } - ], - "source": [ - "# Print a classification report for all classes\n", - "results.print_report()\n", - "\n", - "print(results.mAP())\n", - "# YOLO original and Resnet original with old dataset" - ] - }, - { - "cell_type": "code", - "execution_count": 8, - "id": "a6bb272a", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - " precision recall f1-score support\n", - "\n", - " Healthy 0.66 0.64 0.65 662\n", - " Stressed 0.68 0.54 0.60 488\n", - "\n", - " micro avg 0.67 0.60 0.63 1150\n", - " macro avg 0.67 0.59 0.63 1150\n", - "weighted avg 0.67 0.60 0.63 1150\n", - "\n", - "0.44258882390400406\n", - "\\begin{tabular}{lrrrr}\n", - "\\toprule\n", - "{} & precision & recall & f1-score & support \\\\\n", - "\\midrule\n", - "Healthy & 0.664 & 0.640 & 0.652 & 662.0 \\\\\n", - "Stressed & 0.680 & 0.539 & 0.601 & 488.0 \\\\\n", - "micro avg & 0.670 & 0.597 & 0.631 & 1150.0 \\\\\n", - "macro avg & 0.672 & 0.590 & 0.626 & 1150.0 \\\\\n", - "weighted avg & 0.670 & 0.597 & 0.630 & 1150.0 \\\\\n", - "\\bottomrule\n", - "\\end{tabular}\n", - "\n" - ] - } - ], - "source": [ - "# Print a classification report for all classes\n", - "results.print_report()\n", - "results_df = pd.DataFrame(results.report()).transpose().round(3)\n", - "\n", - "print(results.mAP())\n", - "print(results_df.to_latex())\n", - "# YOLO final and Resnet final with old dataset" - ] - }, { "cell_type": "code", "execution_count": 35, @@ -676,7 +403,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.7.15" + "version": "3.10.13" } }, "nbformat": 4, diff --git a/classification/evaluation/eval-test-yolo.ipynb b/classification/evaluation/eval-test-yolo.ipynb index 47cc0ef..15b4ca6 100644 --- a/classification/evaluation/eval-test-yolo.ipynb +++ b/classification/evaluation/eval-test-yolo.ipynb @@ -569,7 +569,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.7.15" + "version": "3.10.13" } }, "nbformat": 4, diff --git a/classification/jetson-deployment/image-capture/capture.cc b/classification/jetson-deployment/image-capture/capture.cc index 325922b..27de862 100644 --- a/classification/jetson-deployment/image-capture/capture.cc +++ b/classification/jetson-deployment/image-capture/capture.cc @@ -21,6 +21,8 @@ string video_pipeline(int capture_width, int capture_height, int framerate, "appsink"; } +// Calls nvarguscamerasrc to take a 1s video at maximum resolution, +// flips the video and then captures one image and writes it to disk. int main() { int capture_width = 3264; int capture_height = 2464; diff --git a/classification/jetson-deployment/server.py b/classification/jetson-deployment/server.py index 419d847..d279da1 100644 --- a/classification/jetson-deployment/server.py +++ b/classification/jetson-deployment/server.py @@ -25,6 +25,16 @@ pred = manager.dict() def get_pred(): + """Calls the detection and classification models on current.jpg + and stores the predictions in the global variable `pred` in the + following format: + { + 'image': base64 encoded image, + '0': [state, timestamp, time since state < 3], + '1': [state, timestamp, time since state < 3], + ⋮ + } + """ tmp = deepcopy(pred) take_image() logging.debug('Starting image classification') @@ -41,15 +51,6 @@ def get_pred(): 'Finished drawing bounding boxes. Saving to current_bbox.jpg ...') cv2.imwrite('current_bbox.jpg', bbox_img) - # Clear superfluous bboxes if less detected - # if len(preds) < len(pred): - # logging.debug( - # 'Current round contains less bboxes than previous round: old: %s\nnew: %s', - # json.dumps(preds.copy()), json.dumps(pred.copy())) - # for key in pred: - # if key not in preds: - # pred.pop(key) - pred.clear() for idx, row in preds.iterrows(): new = [] diff --git a/classification/utils/conversions.py b/classification/utils/conversions.py index 02039e2..cc09ac8 100644 --- a/classification/utils/conversions.py +++ b/classification/utils/conversions.py @@ -1,4 +1,12 @@ def convert_to_yolo(bbox, width, height): + """Transform bounding boxes in xmin, ymin, xmax, ymax format to + YOLO format. + + :param bbox: bounding box in xmin, ymin, xmax, ymax format + :param width: width of the image + :param height: height of the image + :returns List[int]: bounding box in YOLO format + """ modified = bbox.copy() modified['xmin%'] = round(bbox['xmin'] / width * 100, 2) modified['ymin%'] = round(bbox['ymin'] / height * 100, 2) diff --git a/classification/utils/manipulations.py b/classification/utils/manipulations.py index 2b5302c..9b5351f 100644 --- a/classification/utils/manipulations.py +++ b/classification/utils/manipulations.py @@ -2,6 +2,14 @@ import cv2 def draw_boxes(image, bboxes): + """Draw bounding boxes in xmin, ymin, xmax, ymax format onto + image. + + :param image: opencv2 image object in BGR + :param List bboxes: bounding boxes in xmin, ymin, xmax, ymax + format + :returns: img with bounding boxes drawn + """ img = image.copy() for idx, bbox in enumerate(bboxes): xmin, ymin, xmax, ymax = bbox