SimCLR/feature_eval/mini_batch_logistic_regression_evaluator.ipynb
2021-01-17 20:08:58 -03:00

842 lines
35 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"kernelspec": {
"display_name": "pytorch",
"language": "python",
"name": "pytorch"
},
"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.6.6"
},
"colab": {
"name": "Copy of mini-batch-logistic-regression-evaluator.ipynb",
"provenance": []
},
"accelerator": "GPU",
"widgets": {
"application/vnd.jupyter.widget-state+json": {
"bcf2585d31644e0f86569e604b2e635b": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HBoxModel",
"state": {
"_view_name": "HBoxView",
"_dom_classes": [],
"_model_name": "HBoxModel",
"_view_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_view_count": null,
"_view_module_version": "1.5.0",
"box_style": "",
"layout": "IPY_MODEL_2612abdc916d47418dda7287807a00ce",
"_model_module": "@jupyter-widgets/controls",
"children": [
"IPY_MODEL_027c3ca8839846fcae9d6bb23fb10399",
"IPY_MODEL_1d09572d2433498caa268567c838e640"
]
}
},
"2612abdc916d47418dda7287807a00ce": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"state": {
"_view_name": "LayoutView",
"grid_template_rows": null,
"right": null,
"justify_content": null,
"_view_module": "@jupyter-widgets/base",
"overflow": null,
"_model_module_version": "1.2.0",
"_view_count": null,
"flex_flow": null,
"width": null,
"min_width": null,
"border": null,
"align_items": null,
"bottom": null,
"_model_module": "@jupyter-widgets/base",
"top": null,
"grid_column": null,
"overflow_y": null,
"overflow_x": null,
"grid_auto_flow": null,
"grid_area": null,
"grid_template_columns": null,
"flex": null,
"_model_name": "LayoutModel",
"justify_items": null,
"grid_row": null,
"max_height": null,
"align_content": null,
"visibility": null,
"align_self": null,
"height": null,
"min_height": null,
"padding": null,
"grid_auto_rows": null,
"grid_gap": null,
"max_width": null,
"order": null,
"_view_module_version": "1.2.0",
"grid_template_areas": null,
"object_position": null,
"object_fit": null,
"grid_auto_columns": null,
"margin": null,
"display": null,
"left": null
}
},
"027c3ca8839846fcae9d6bb23fb10399": {
"model_module": "@jupyter-widgets/controls",
"model_name": "FloatProgressModel",
"state": {
"_view_name": "ProgressView",
"style": "IPY_MODEL_08cddf6f231a4e89ab8e1e026cf11796",
"_dom_classes": [],
"description": "",
"_model_name": "FloatProgressModel",
"bar_style": "info",
"max": 1,
"_view_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"value": 1,
"_view_count": null,
"_view_module_version": "1.5.0",
"orientation": "horizontal",
"min": 0,
"description_tooltip": null,
"_model_module": "@jupyter-widgets/controls",
"layout": "IPY_MODEL_75267826defa4565be4bed232272434e"
}
},
"1d09572d2433498caa268567c838e640": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HTMLModel",
"state": {
"_view_name": "HTMLView",
"style": "IPY_MODEL_8c189a0cd687479dba885a9c2d47fb64",
"_dom_classes": [],
"description": "",
"_model_name": "HTMLModel",
"placeholder": "",
"_view_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"value": " 2640404480/? [01:10<00:00, 98486594.59it/s]",
"_view_count": null,
"_view_module_version": "1.5.0",
"description_tooltip": null,
"_model_module": "@jupyter-widgets/controls",
"layout": "IPY_MODEL_b6528931de654b3c85b94bec14f4891b"
}
},
"08cddf6f231a4e89ab8e1e026cf11796": {
"model_module": "@jupyter-widgets/controls",
"model_name": "ProgressStyleModel",
"state": {
"_view_name": "StyleView",
"_model_name": "ProgressStyleModel",
"description_width": "initial",
"_view_module": "@jupyter-widgets/base",
"_model_module_version": "1.5.0",
"_view_count": null,
"_view_module_version": "1.2.0",
"bar_color": null,
"_model_module": "@jupyter-widgets/controls"
}
},
"75267826defa4565be4bed232272434e": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"state": {
"_view_name": "LayoutView",
"grid_template_rows": null,
"right": null,
"justify_content": null,
"_view_module": "@jupyter-widgets/base",
"overflow": null,
"_model_module_version": "1.2.0",
"_view_count": null,
"flex_flow": null,
"width": null,
"min_width": null,
"border": null,
"align_items": null,
"bottom": null,
"_model_module": "@jupyter-widgets/base",
"top": null,
"grid_column": null,
"overflow_y": null,
"overflow_x": null,
"grid_auto_flow": null,
"grid_area": null,
"grid_template_columns": null,
"flex": null,
"_model_name": "LayoutModel",
"justify_items": null,
"grid_row": null,
"max_height": null,
"align_content": null,
"visibility": null,
"align_self": null,
"height": null,
"min_height": null,
"padding": null,
"grid_auto_rows": null,
"grid_gap": null,
"max_width": null,
"order": null,
"_view_module_version": "1.2.0",
"grid_template_areas": null,
"object_position": null,
"object_fit": null,
"grid_auto_columns": null,
"margin": null,
"display": null,
"left": null
}
},
"8c189a0cd687479dba885a9c2d47fb64": {
"model_module": "@jupyter-widgets/controls",
"model_name": "DescriptionStyleModel",
"state": {
"_view_name": "StyleView",
"_model_name": "DescriptionStyleModel",
"description_width": "",
"_view_module": "@jupyter-widgets/base",
"_model_module_version": "1.5.0",
"_view_count": null,
"_view_module_version": "1.2.0",
"_model_module": "@jupyter-widgets/controls"
}
},
"b6528931de654b3c85b94bec14f4891b": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"state": {
"_view_name": "LayoutView",
"grid_template_rows": null,
"right": null,
"justify_content": null,
"_view_module": "@jupyter-widgets/base",
"overflow": null,
"_model_module_version": "1.2.0",
"_view_count": null,
"flex_flow": null,
"width": null,
"min_width": null,
"border": null,
"align_items": null,
"bottom": null,
"_model_module": "@jupyter-widgets/base",
"top": null,
"grid_column": null,
"overflow_y": null,
"overflow_x": null,
"grid_auto_flow": null,
"grid_area": null,
"grid_template_columns": null,
"flex": null,
"_model_name": "LayoutModel",
"justify_items": null,
"grid_row": null,
"max_height": null,
"align_content": null,
"visibility": null,
"align_self": null,
"height": null,
"min_height": null,
"padding": null,
"grid_auto_rows": null,
"grid_gap": null,
"max_width": null,
"order": null,
"_view_module_version": "1.2.0",
"grid_template_areas": null,
"object_position": null,
"object_fit": null,
"grid_auto_columns": null,
"margin": null,
"display": null,
"left": null
}
}
}
}
},
"cells": [
{
"cell_type": "code",
"metadata": {
"id": "YUemQib7ZE4D"
},
"source": [
"import torch\n",
"import sys\n",
"import numpy as np\n",
"import os\n",
"from sklearn.neighbors import KNeighborsClassifier\n",
"import yaml\n",
"import matplotlib.pyplot as plt\n",
"from sklearn.decomposition import PCA\n",
"from sklearn.linear_model import LogisticRegression\n",
"from sklearn import preprocessing\n",
"import importlib.util\n",
"import torchvision"
],
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"metadata": {
"id": "WSgRE1CcLqdS",
"colab": {
"base_uri": "https://localhost:8080/"
},
"outputId": "e44ac358-6480-4a5f-a358-6eb6ace26c8b"
},
"source": [
"!pip install gdown"
],
"execution_count": null,
"outputs": [
{
"output_type": "stream",
"text": [
"Requirement already satisfied: gdown in /usr/local/lib/python3.6/dist-packages (3.6.4)\n",
"Requirement already satisfied: six in /usr/local/lib/python3.6/dist-packages (from gdown) (1.15.0)\n",
"Requirement already satisfied: requests in /usr/local/lib/python3.6/dist-packages (from gdown) (2.23.0)\n",
"Requirement already satisfied: tqdm in /usr/local/lib/python3.6/dist-packages (from gdown) (4.41.1)\n",
"Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /usr/local/lib/python3.6/dist-packages (from requests->gdown) (1.24.3)\n",
"Requirement already satisfied: chardet<4,>=3.0.2 in /usr/local/lib/python3.6/dist-packages (from requests->gdown) (3.0.4)\n",
"Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.6/dist-packages (from requests->gdown) (2020.12.5)\n",
"Requirement already satisfied: idna<3,>=2.5 in /usr/local/lib/python3.6/dist-packages (from requests->gdown) (2.10)\n"
],
"name": "stdout"
}
]
},
{
"cell_type": "code",
"metadata": {
"id": "NOIJEui1ZziV"
},
"source": [
"def get_file_id_by_model(folder_name):\n",
" file_id = {'resnet18_100-epochs_stl10': '14_nH2FkyKbt61cieQDiSbBVNP8-gtwgF',\n",
" 'resnet18_100-epochs_cifar10': '1lc2aoVtrAetGn0PnTkOyFzPCIucOJq7C'}\n",
" return file_id.get(folder_name, \"Model not found.\")"
],
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"metadata": {
"id": "G7YMxsvEZMrX",
"colab": {
"base_uri": "https://localhost:8080/"
},
"outputId": "36932a7d-c7e5-492a-f37d-8be6b18f787a"
},
"source": [
"folder_name = 'resnet18_100-epochs_stl10'\n",
"file_id = get_file_id_by_model(folder_name)\n",
"print(folder_name, file_id)"
],
"execution_count": null,
"outputs": [
{
"output_type": "stream",
"text": [
"resnet18_100-epochs_stl10 14_nH2FkyKbt61cieQDiSbBVNP8-gtwgF\n"
],
"name": "stdout"
}
]
},
{
"cell_type": "code",
"metadata": {
"id": "PWZ8fet_YoJm",
"colab": {
"base_uri": "https://localhost:8080/"
},
"outputId": "8d52756d-707b-4a3f-9e8c-0d191408deab"
},
"source": [
"# download and extract model files\n",
"os.system('gdown https://drive.google.com/uc?id={}'.format(file_id))\n",
"os.system('unzip {}'.format(folder_name))\n",
"!ls"
],
"execution_count": null,
"outputs": [
{
"output_type": "stream",
"text": [
"checkpoint_0100.pth.tar\n",
"config.yml\n",
"events.out.tfevents.1610901470.4cb2c837708d.2683858.0\n",
"resnet18_100-epochs_stl10.zip\n",
"sample_data\n",
"training.log\n"
],
"name": "stdout"
}
]
},
{
"cell_type": "code",
"metadata": {
"id": "ooyhd8piZ1w1",
"colab": {
"base_uri": "https://localhost:8080/"
},
"outputId": "6ffb73aa-35c5-4df2-bd1f-6de6a235a9e5"
},
"source": [
"!unzip resnet18_100-epochs_stl10"
],
"execution_count": null,
"outputs": [
{
"output_type": "stream",
"text": [
"Archive: resnet18_100-epochs_stl10.zip\n",
"replace checkpoint_0100.pth.tar? [y]es, [n]o, [A]ll, [N]one, [r]ename: A\n",
" inflating: checkpoint_0100.pth.tar \n",
" inflating: config.yml \n",
" inflating: events.out.tfevents.1610901470.4cb2c837708d.2683858.0 \n",
" inflating: training.log \n"
],
"name": "stdout"
}
]
},
{
"cell_type": "code",
"metadata": {
"id": "3_nypQVEv-hn"
},
"source": [
"from torch.utils.data import DataLoader\n",
"import torchvision.transforms as transforms\n",
"from torchvision import datasets"
],
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"metadata": {
"id": "lDfbL3w_Z0Od",
"colab": {
"base_uri": "https://localhost:8080/"
},
"outputId": "5f58bd9b-4428-4b8c-e271-b47ca6694f34"
},
"source": [
"device = 'cuda' if torch.cuda.is_available() else 'cpu'\n",
"print(\"Using device:\", device)"
],
"execution_count": null,
"outputs": [
{
"output_type": "stream",
"text": [
"Using device: cuda\n"
],
"name": "stdout"
}
]
},
{
"cell_type": "code",
"metadata": {
"id": "BfIPl0G6_RrT"
},
"source": [
"def get_stl10_data_loaders(download, shuffle=False, batch_size=128):\n",
" train_dataset = datasets.STL10('./data', split='train', download=download,\n",
" transform=transforms.ToTensor())\n",
"\n",
" train_loader = DataLoader(train_dataset, batch_size=batch_size,\n",
" num_workers=0, drop_last=False, shuffle=shuffle)\n",
" \n",
" test_dataset = datasets.STL10('./data', split='test', download=download,\n",
" transform=transforms.ToTensor())\n",
"\n",
" test_loader = DataLoader(test_dataset, batch_size=2*batch_size,\n",
" num_workers=10, drop_last=False, shuffle=shuffle)\n",
" return train_loader, test_loader\n",
"\n",
"def get_cifar10_data_loaders(download, shuffle=False, batch_size=128):\n",
" train_dataset = datasets.CIFAR10('./data', train=True, download=download,\n",
" transform=transforms.ToTensor())\n",
"\n",
" train_loader = DataLoader(train_dataset, batch_size=batch_size,\n",
" num_workers=0, drop_last=False, shuffle=shuffle)\n",
" \n",
" test_dataset = datasets.CIFAR10('./data', train=False, download=download,\n",
" transform=transforms.ToTensor())\n",
"\n",
" test_loader = DataLoader(test_dataset, batch_size=2*batch_size,\n",
" num_workers=10, drop_last=False, shuffle=shuffle)\n",
" return train_loader, test_loader"
],
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"metadata": {
"id": "6N8lYkbmDTaK"
},
"source": [
"with open(os.path.join('./config.yml')) as file:\n",
" config = yaml.load(file)"
],
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"metadata": {
"id": "a18lPD-tIle6"
},
"source": [
"if config.arch == 'resnet18':\n",
" model = torchvision.models.resnet18(pretrained=False, num_classes=10).to(device)\n",
"elif config.arch == 'resnet50':\n",
" model = torchvision.models.resnet50(pretrained=False, num_classes=10).to(device)"
],
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"metadata": {
"id": "4AIfgq41GuTT"
},
"source": [
"checkpoint = torch.load('checkpoint_0100.pth.tar', map_location=device)\n",
"state_dict = checkpoint['state_dict']\n",
"\n",
"for k in list(state_dict.keys()):\n",
"\n",
" if k.startswith('backbone.'):\n",
" if k.startswith('backbone') and not k.startswith('backbone.fc'):\n",
" # remove prefix\n",
" state_dict[k[len(\"backbone.\"):]] = state_dict[k]\n",
" del state_dict[k]"
],
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"metadata": {
"id": "VVjA83PPJYWl"
},
"source": [
"log = model.load_state_dict(state_dict, strict=False)\n",
"assert log.missing_keys == ['fc.weight', 'fc.bias']"
],
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"metadata": {
"id": "_GC0a14uWRr6",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 117,
"referenced_widgets": [
"bcf2585d31644e0f86569e604b2e635b",
"2612abdc916d47418dda7287807a00ce",
"027c3ca8839846fcae9d6bb23fb10399",
"1d09572d2433498caa268567c838e640",
"08cddf6f231a4e89ab8e1e026cf11796",
"75267826defa4565be4bed232272434e",
"8c189a0cd687479dba885a9c2d47fb64",
"b6528931de654b3c85b94bec14f4891b"
]
},
"outputId": "56db3fac-10cc-4985-932d-878375ccd18f"
},
"source": [
"if config.dataset_name == 'cifar10':\n",
" train_loader, test_loader = get_cifar10_data_loaders(download=True)\n",
"elif config.dataset_name == 'stl10':\n",
" train_loader, test_loader = get_stl10_data_loaders(download=True)\n",
"print(\"Dataset:\", config.dataset_name)"
],
"execution_count": null,
"outputs": [
{
"output_type": "stream",
"text": [
"Downloading http://ai.stanford.edu/~acoates/stl10/stl10_binary.tar.gz to ./data/stl10_binary.tar.gz\n"
],
"name": "stdout"
},
{
"output_type": "display_data",
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "bcf2585d31644e0f86569e604b2e635b",
"version_minor": 0,
"version_major": 2
},
"text/plain": [
"HBox(children=(FloatProgress(value=1.0, bar_style='info', max=1.0), HTML(value='')))"
]
},
"metadata": {
"tags": []
}
},
{
"output_type": "stream",
"text": [
"Extracting ./data/stl10_binary.tar.gz to ./data\n",
"Files already downloaded and verified\n",
"Dataset: stl10\n"
],
"name": "stdout"
}
]
},
{
"cell_type": "code",
"metadata": {
"id": "pYT_KsM0Mnnr"
},
"source": [
"# freeze all layers but the last fc\n",
"for name, param in model.named_parameters():\n",
" if name not in ['fc.weight', 'fc.bias']:\n",
" param.requires_grad = False\n",
"\n",
"parameters = list(filter(lambda p: p.requires_grad, model.parameters()))\n",
"assert len(parameters) == 2 # fc.weight, fc.bias"
],
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"metadata": {
"id": "aPVh1S_eMRDU"
},
"source": [
"optimizer = torch.optim.Adam(model.parameters(), lr=3e-4, weight_decay=0.0008)\n",
"criterion = torch.nn.CrossEntropyLoss().to(device)"
],
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"metadata": {
"id": "edr6RhP2PdVq"
},
"source": [
"def accuracy(output, target, topk=(1,)):\n",
" \"\"\"Computes the accuracy over the k top predictions for the specified values of k\"\"\"\n",
" with torch.no_grad():\n",
" maxk = max(topk)\n",
" batch_size = target.size(0)\n",
"\n",
" _, pred = output.topk(maxk, 1, True, True)\n",
" pred = pred.t()\n",
" correct = pred.eq(target.view(1, -1).expand_as(pred))\n",
"\n",
" res = []\n",
" for k in topk:\n",
" correct_k = correct[:k].reshape(-1).float().sum(0, keepdim=True)\n",
" res.append(correct_k.mul_(100.0 / batch_size))\n",
" return res"
],
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"metadata": {
"id": "qOder0dAMI7X",
"colab": {
"base_uri": "https://localhost:8080/"
},
"outputId": "95b285c8-2b26-4d2c-ccc3-bb9111871c8d"
},
"source": [
"epochs = 100\n",
"for epoch in range(epochs):\n",
" top1_train_accuracy = 0\n",
" for counter, (x_batch, y_batch) in enumerate(train_loader):\n",
" x_batch = x_batch.to(device)\n",
" y_batch = y_batch.to(device)\n",
"\n",
" logits = model(x_batch)\n",
" loss = criterion(logits, y_batch)\n",
" top1 = accuracy(logits, y_batch, topk=(1,))\n",
" top1_train_accuracy += top1[0]\n",
"\n",
" optimizer.zero_grad()\n",
" loss.backward()\n",
" optimizer.step()\n",
"\n",
" top1_train_accuracy /= (counter + 1)\n",
" top1_accuracy = 0\n",
" top5_accuracy = 0\n",
" for counter, (x_batch, y_batch) in enumerate(test_loader):\n",
" x_batch = x_batch.to(device)\n",
" y_batch = y_batch.to(device)\n",
"\n",
" logits = model(x_batch)\n",
" \n",
" top1, top5 = accuracy(logits, y_batch, topk=(1,5))\n",
" top1_accuracy += top1[0]\n",
" top5_accuracy += top5[0]\n",
" \n",
" top1_accuracy /= (counter + 1)\n",
" top5_accuracy /= (counter + 1)\n",
" print(f\"Epoch {epoch}\\tTop1 Train accuracy {top1_train_accuracy.item()}\\tTop1 Test accuracy: {top1_accuracy.item()}\\tTop5 test acc: {top5_accuracy.item()}\")"
],
"execution_count": null,
"outputs": [
{
"output_type": "stream",
"text": [
"Top1 Train accuracy 29.47265625\tTop1 Test accuracy: 42.4560546875\tTop5 test acc: 92.41943359375\n",
"Top1 Train accuracy 49.47265625\tTop1 Test accuracy: 53.662109375\tTop5 test acc: 96.15478515625\n",
"Top1 Train accuracy 56.85546875\tTop1 Test accuracy: 57.92236328125\tTop5 test acc: 96.74072265625\n",
"Top1 Train accuracy 59.3359375\tTop1 Test accuracy: 59.9365234375\tTop5 test acc: 97.021484375\n",
"Top1 Train accuracy 60.8984375\tTop1 Test accuracy: 61.1572265625\tTop5 test acc: 97.15576171875\n",
"Top1 Train accuracy 61.89453125\tTop1 Test accuracy: 61.8408203125\tTop5 test acc: 97.2900390625\n",
"Top1 Train accuracy 62.48046875\tTop1 Test accuracy: 62.5244140625\tTop5 test acc: 97.3388671875\n",
"Top1 Train accuracy 63.125\tTop1 Test accuracy: 63.037109375\tTop5 test acc: 97.44873046875\n",
"Top1 Train accuracy 64.4140625\tTop1 Test accuracy: 63.39111328125\tTop5 test acc: 97.54638671875\n",
"Top1 Train accuracy 64.86328125\tTop1 Test accuracy: 63.85498046875\tTop5 test acc: 97.5830078125\n",
"Top1 Train accuracy 65.15625\tTop1 Test accuracy: 64.0869140625\tTop5 test acc: 97.65625\n",
"Top1 Train accuracy 65.56640625\tTop1 Test accuracy: 64.34326171875\tTop5 test acc: 97.69287109375\n",
"Top1 Train accuracy 65.859375\tTop1 Test accuracy: 64.48974609375\tTop5 test acc: 97.7294921875\n",
"Top1 Train accuracy 66.03515625\tTop1 Test accuracy: 64.83154296875\tTop5 test acc: 97.75390625\n",
"Top1 Train accuracy 66.171875\tTop1 Test accuracy: 65.02685546875\tTop5 test acc: 97.79052734375\n",
"Top1 Train accuracy 66.484375\tTop1 Test accuracy: 65.46630859375\tTop5 test acc: 97.7783203125\n",
"Top1 Train accuracy 66.953125\tTop1 Test accuracy: 65.66162109375\tTop5 test acc: 97.8515625\n",
"Top1 Train accuracy 67.2265625\tTop1 Test accuracy: 65.91796875\tTop5 test acc: 97.93701171875\n",
"Top1 Train accuracy 67.48046875\tTop1 Test accuracy: 65.97900390625\tTop5 test acc: 97.91259765625\n",
"Top1 Train accuracy 67.8125\tTop1 Test accuracy: 66.11328125\tTop5 test acc: 97.93701171875\n",
"Top1 Train accuracy 68.046875\tTop1 Test accuracy: 66.3330078125\tTop5 test acc: 97.9736328125\n",
"Top1 Train accuracy 68.45703125\tTop1 Test accuracy: 66.5283203125\tTop5 test acc: 97.94921875\n",
"Top1 Train accuracy 68.59375\tTop1 Test accuracy: 66.63818359375\tTop5 test acc: 97.94921875\n",
"Top1 Train accuracy 68.7890625\tTop1 Test accuracy: 66.748046875\tTop5 test acc: 97.93701171875\n",
"Top1 Train accuracy 69.00390625\tTop1 Test accuracy: 66.90673828125\tTop5 test acc: 97.9248046875\n",
"Top1 Train accuracy 69.21875\tTop1 Test accuracy: 67.0654296875\tTop5 test acc: 97.9736328125\n",
"Top1 Train accuracy 69.35546875\tTop1 Test accuracy: 67.0654296875\tTop5 test acc: 97.9736328125\n",
"Top1 Train accuracy 69.66796875\tTop1 Test accuracy: 67.2119140625\tTop5 test acc: 97.93701171875\n",
"Top1 Train accuracy 69.765625\tTop1 Test accuracy: 67.24853515625\tTop5 test acc: 97.9736328125\n",
"Top1 Train accuracy 69.82421875\tTop1 Test accuracy: 67.4072265625\tTop5 test acc: 97.98583984375\n",
"Top1 Train accuracy 69.9609375\tTop1 Test accuracy: 67.431640625\tTop5 test acc: 97.98583984375\n",
"Top1 Train accuracy 70.09765625\tTop1 Test accuracy: 67.4560546875\tTop5 test acc: 97.998046875\n",
"Top1 Train accuracy 70.15625\tTop1 Test accuracy: 67.44384765625\tTop5 test acc: 98.01025390625\n",
"Top1 Train accuracy 70.29296875\tTop1 Test accuracy: 67.54150390625\tTop5 test acc: 98.0224609375\n",
"Top1 Train accuracy 70.41015625\tTop1 Test accuracy: 67.61474609375\tTop5 test acc: 98.05908203125\n",
"Top1 Train accuracy 70.5078125\tTop1 Test accuracy: 67.67578125\tTop5 test acc: 98.0712890625\n",
"Top1 Train accuracy 70.64453125\tTop1 Test accuracy: 67.73681640625\tTop5 test acc: 98.08349609375\n",
"Top1 Train accuracy 70.859375\tTop1 Test accuracy: 67.76123046875\tTop5 test acc: 98.0712890625\n",
"Top1 Train accuracy 70.8984375\tTop1 Test accuracy: 67.88330078125\tTop5 test acc: 98.08349609375\n",
"Top1 Train accuracy 71.07421875\tTop1 Test accuracy: 67.95654296875\tTop5 test acc: 98.095703125\n",
"Top1 Train accuracy 71.11328125\tTop1 Test accuracy: 67.93212890625\tTop5 test acc: 98.1201171875\n",
"Top1 Train accuracy 71.2890625\tTop1 Test accuracy: 68.0419921875\tTop5 test acc: 98.10791015625\n",
"Top1 Train accuracy 71.3671875\tTop1 Test accuracy: 68.10302734375\tTop5 test acc: 98.13232421875\n",
"Top1 Train accuracy 71.42578125\tTop1 Test accuracy: 68.1396484375\tTop5 test acc: 98.13232421875\n",
"Top1 Train accuracy 71.4453125\tTop1 Test accuracy: 68.1396484375\tTop5 test acc: 98.13232421875\n",
"Top1 Train accuracy 71.50390625\tTop1 Test accuracy: 68.1640625\tTop5 test acc: 98.1201171875\n",
"Top1 Train accuracy 71.484375\tTop1 Test accuracy: 68.2373046875\tTop5 test acc: 98.14453125\n",
"Top1 Train accuracy 71.6015625\tTop1 Test accuracy: 68.34716796875\tTop5 test acc: 98.15673828125\n",
"Top1 Train accuracy 71.7578125\tTop1 Test accuracy: 68.39599609375\tTop5 test acc: 98.15673828125\n",
"Top1 Train accuracy 71.89453125\tTop1 Test accuracy: 68.37158203125\tTop5 test acc: 98.20556640625\n",
"Top1 Train accuracy 72.01171875\tTop1 Test accuracy: 68.4326171875\tTop5 test acc: 98.20556640625\n",
"Top1 Train accuracy 72.1484375\tTop1 Test accuracy: 68.44482421875\tTop5 test acc: 98.2177734375\n",
"Top1 Train accuracy 72.1875\tTop1 Test accuracy: 68.51806640625\tTop5 test acc: 98.25439453125\n",
"Top1 Train accuracy 72.28515625\tTop1 Test accuracy: 68.603515625\tTop5 test acc: 98.2421875\n",
"Top1 Train accuracy 72.36328125\tTop1 Test accuracy: 68.5791015625\tTop5 test acc: 98.2666015625\n",
"Top1 Train accuracy 72.5390625\tTop1 Test accuracy: 68.61572265625\tTop5 test acc: 98.2666015625\n",
"Top1 Train accuracy 72.59765625\tTop1 Test accuracy: 68.64013671875\tTop5 test acc: 98.2666015625\n",
"Top1 Train accuracy 73.02734375\tTop1 Test accuracy: 68.7255859375\tTop5 test acc: 98.25439453125\n",
"Top1 Train accuracy 73.18359375\tTop1 Test accuracy: 68.76220703125\tTop5 test acc: 98.2666015625\n",
"Top1 Train accuracy 73.26171875\tTop1 Test accuracy: 68.8232421875\tTop5 test acc: 98.291015625\n",
"Top1 Train accuracy 73.359375\tTop1 Test accuracy: 68.85986328125\tTop5 test acc: 98.27880859375\n",
"Top1 Train accuracy 73.45703125\tTop1 Test accuracy: 68.8720703125\tTop5 test acc: 98.32763671875\n",
"Top1 Train accuracy 73.49609375\tTop1 Test accuracy: 68.9208984375\tTop5 test acc: 98.33984375\n",
"Top1 Train accuracy 73.53515625\tTop1 Test accuracy: 68.8720703125\tTop5 test acc: 98.33984375\n",
"Top1 Train accuracy 73.53515625\tTop1 Test accuracy: 68.9208984375\tTop5 test acc: 98.3642578125\n",
"Top1 Train accuracy 73.65234375\tTop1 Test accuracy: 69.00634765625\tTop5 test acc: 98.33984375\n",
"Top1 Train accuracy 73.76953125\tTop1 Test accuracy: 69.0185546875\tTop5 test acc: 98.33984375\n",
"Top1 Train accuracy 73.9453125\tTop1 Test accuracy: 69.0673828125\tTop5 test acc: 98.35205078125\n",
"Top1 Train accuracy 74.00390625\tTop1 Test accuracy: 69.1162109375\tTop5 test acc: 98.35205078125\n",
"Top1 Train accuracy 74.0625\tTop1 Test accuracy: 69.140625\tTop5 test acc: 98.3642578125\n",
"Top1 Train accuracy 74.12109375\tTop1 Test accuracy: 69.17724609375\tTop5 test acc: 98.3642578125\n",
"Top1 Train accuracy 74.21875\tTop1 Test accuracy: 69.20166015625\tTop5 test acc: 98.35205078125\n",
"Top1 Train accuracy 74.21875\tTop1 Test accuracy: 69.2626953125\tTop5 test acc: 98.33984375\n",
"Top1 Train accuracy 74.23828125\tTop1 Test accuracy: 69.3359375\tTop5 test acc: 98.33984375\n",
"Top1 Train accuracy 74.23828125\tTop1 Test accuracy: 69.37255859375\tTop5 test acc: 98.3154296875\n",
"Top1 Train accuracy 74.2578125\tTop1 Test accuracy: 69.42138671875\tTop5 test acc: 98.3154296875\n",
"Top1 Train accuracy 74.27734375\tTop1 Test accuracy: 69.482421875\tTop5 test acc: 98.3154296875\n",
"Top1 Train accuracy 74.375\tTop1 Test accuracy: 69.51904296875\tTop5 test acc: 98.30322265625\n",
"Top1 Train accuracy 74.39453125\tTop1 Test accuracy: 69.6044921875\tTop5 test acc: 98.30322265625\n",
"Top1 Train accuracy 74.43359375\tTop1 Test accuracy: 69.6044921875\tTop5 test acc: 98.30322265625\n",
"Top1 Train accuracy 74.43359375\tTop1 Test accuracy: 69.6044921875\tTop5 test acc: 98.30322265625\n",
"Top1 Train accuracy 74.4921875\tTop1 Test accuracy: 69.64111328125\tTop5 test acc: 98.3154296875\n",
"Top1 Train accuracy 74.5703125\tTop1 Test accuracy: 69.7021484375\tTop5 test acc: 98.3154296875\n",
"Top1 Train accuracy 74.66796875\tTop1 Test accuracy: 69.775390625\tTop5 test acc: 98.3154296875\n",
"Top1 Train accuracy 74.6875\tTop1 Test accuracy: 69.775390625\tTop5 test acc: 98.3154296875\n",
"Top1 Train accuracy 74.74609375\tTop1 Test accuracy: 69.76318359375\tTop5 test acc: 98.30322265625\n",
"Top1 Train accuracy 74.74609375\tTop1 Test accuracy: 69.78759765625\tTop5 test acc: 98.30322265625\n",
"Top1 Train accuracy 74.84375\tTop1 Test accuracy: 69.81201171875\tTop5 test acc: 98.3154296875\n",
"Top1 Train accuracy 74.94140625\tTop1 Test accuracy: 69.88525390625\tTop5 test acc: 98.32763671875\n",
"Top1 Train accuracy 75.0390625\tTop1 Test accuracy: 69.8974609375\tTop5 test acc: 98.32763671875\n",
"Top1 Train accuracy 75.05859375\tTop1 Test accuracy: 69.921875\tTop5 test acc: 98.3154296875\n",
"Top1 Train accuracy 75.078125\tTop1 Test accuracy: 69.95849609375\tTop5 test acc: 98.30322265625\n",
"Top1 Train accuracy 75.15625\tTop1 Test accuracy: 69.921875\tTop5 test acc: 98.30322265625\n",
"Top1 Train accuracy 75.21484375\tTop1 Test accuracy: 69.9462890625\tTop5 test acc: 98.30322265625\n",
"Top1 Train accuracy 75.17578125\tTop1 Test accuracy: 69.93408203125\tTop5 test acc: 98.30322265625\n",
"Top1 Train accuracy 75.17578125\tTop1 Test accuracy: 69.98291015625\tTop5 test acc: 98.291015625\n",
"Top1 Train accuracy 75.234375\tTop1 Test accuracy: 69.95849609375\tTop5 test acc: 98.3154296875\n",
"Top1 Train accuracy 75.234375\tTop1 Test accuracy: 69.98291015625\tTop5 test acc: 98.3154296875\n",
"Top1 Train accuracy 75.2734375\tTop1 Test accuracy: 70.00732421875\tTop5 test acc: 98.3154296875\n",
"Top1 Train accuracy 75.37109375\tTop1 Test accuracy: 70.01953125\tTop5 test acc: 98.3154296875\n"
],
"name": "stdout"
}
]
},
{
"cell_type": "code",
"metadata": {
"id": "dtYqHZirMNZk"
},
"source": [
""
],
"execution_count": null,
"outputs": []
}
]
}