diff --git a/guides/kerascv-kinetics-400-evaluation-in-pytorch.ipynb b/guides/benchmark/kerascv-kinetics-400-evaluation-in-pytorch.ipynb similarity index 100% rename from guides/kerascv-kinetics-400-evaluation-in-pytorch.ipynb rename to guides/benchmark/kerascv-kinetics-400-evaluation-in-pytorch.ipynb diff --git a/guides/jax_videoswin_video_classification.ipynb b/guides/fine_tune/jax_videoswin_video_classification.ipynb similarity index 100% rename from guides/jax_videoswin_video_classification.ipynb rename to guides/fine_tune/jax_videoswin_video_classification.ipynb diff --git a/guides/tf_videoswin_video_classification.ipynb b/guides/fine_tune/tf_videoswin_video_classification.ipynb similarity index 100% rename from guides/tf_videoswin_video_classification.ipynb rename to guides/fine_tune/tf_videoswin_video_classification.ipynb diff --git a/guides/torch_lightning_videoswin_video_classification.ipynb b/guides/fine_tune/torch_lightning_videoswin_video_classification.ipynb similarity index 100% rename from guides/torch_lightning_videoswin_video_classification.ipynb rename to guides/fine_tune/torch_lightning_videoswin_video_classification.ipynb diff --git a/guides/torch_videoswin_video_classification.ipynb b/guides/fine_tune/torch_videoswin_video_classification.ipynb similarity index 100% rename from guides/torch_videoswin_video_classification.ipynb rename to guides/fine_tune/torch_videoswin_video_classification.ipynb diff --git a/guides/video-swin-transformer-keras-and-torchvision.ipynb b/guides/video-swin-transformer-keras-and-torchvision.ipynb deleted file mode 100644 index b849aec..0000000 --- a/guides/video-swin-transformer-keras-and-torchvision.ipynb +++ /dev/null @@ -1,830 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": 1, - "id": "3a7c18dd", - "metadata": { - "_cell_guid": "b1076dfc-b9ad-4769-8c92-a6c4dae69d19", - "_uuid": "8f2839f25d086af736a60e9eeb907d3b93b6e0e5", - "execution": { - "iopub.execute_input": "2024-03-24T08:21:57.386689Z", - "iopub.status.busy": "2024-03-24T08:21:57.386195Z", - "iopub.status.idle": "2024-03-24T08:21:58.586122Z", - "shell.execute_reply": "2024-03-24T08:21:58.583977Z" - }, - "papermill": { - "duration": 1.213863, - "end_time": "2024-03-24T08:21:58.590060", - "exception": false, - "start_time": "2024-03-24T08:21:57.376197", - "status": "completed" - }, - "tags": [] - }, - "outputs": [], - "source": [ - "import numpy as np \n", - "import pandas as pd\n", - "import os\n", - "import warnings\n", - "\n", - "os.environ[\"KERAS_BACKEND\"] = \"torch\"\n", - "warnings.simplefilter(action=\"ignore\")\n", - "os.environ[\"TF_CPP_MIN_LOG_LEVEL\"] = \"3\"" - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "id": "59b23fed", - "metadata": { - "execution": { - "iopub.execute_input": "2024-03-24T08:21:58.609538Z", - "iopub.status.busy": "2024-03-24T08:21:58.608585Z", - "iopub.status.idle": "2024-03-24T08:22:22.423962Z", - "shell.execute_reply": "2024-03-24T08:22:22.422772Z" - }, - "papermill": { - "duration": 23.827524, - "end_time": "2024-03-24T08:22:22.426861", - "exception": false, - "start_time": "2024-03-24T08:21:58.599337", - "status": "completed" - }, - "tags": [] - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Cloning into 'VideoSwin'...\r\n", - "remote: Enumerating objects: 729, done.\u001b[K\r\n", - "remote: Counting objects: 100% (195/195), done.\u001b[K\r\n", - "remote: Compressing objects: 100% (76/76), done.\u001b[K\r\n", - "remote: Total 729 (delta 151), reused 150 (delta 119), pack-reused 534\u001b[K\r\n", - "Receiving objects: 100% (729/729), 3.53 MiB | 28.72 MiB/s, done.\r\n", - "Resolving deltas: 100% (433/433), done.\r\n", - "/kaggle/working/VideoSwin\n" - ] - } - ], - "source": [ - "!git clone https://github.com/innat/VideoSwin.git\n", - "%cd VideoSwin\n", - "!pip install -q -e . " - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "id": "ce7b27ad", - "metadata": { - "execution": { - "iopub.execute_input": "2024-03-24T08:22:22.445376Z", - "iopub.status.busy": "2024-03-24T08:22:22.444957Z", - "iopub.status.idle": "2024-03-24T08:22:31.350978Z", - "shell.execute_reply": "2024-03-24T08:22:31.349674Z" - }, - "papermill": { - "duration": 8.918879, - "end_time": "2024-03-24T08:22:31.353947", - "exception": false, - "start_time": "2024-03-24T08:22:22.435068", - "status": "completed" - }, - "tags": [] - }, - "outputs": [ - { - "data": { - "text/plain": [ - "('3.0.5', '2.1.2+cpu')" - ] - }, - "execution_count": 3, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "import torch\n", - "import keras\n", - "from keras import ops\n", - "\n", - "keras.__version__, torch.__version__" - ] - }, - { - "cell_type": "markdown", - "id": "099af522", - "metadata": { - "papermill": { - "duration": 0.008521, - "end_time": "2024-03-24T08:22:31.371328", - "exception": false, - "start_time": "2024-03-24T08:22:31.362807", - "status": "completed" - }, - "tags": [] - }, - "source": [ - "# Utility" - ] - }, - { - "cell_type": "code", - "execution_count": 4, - "id": "57016c03", - "metadata": { - "execution": { - "iopub.execute_input": "2024-03-24T08:22:31.391698Z", - "iopub.status.busy": "2024-03-24T08:22:31.390822Z", - "iopub.status.idle": "2024-03-24T08:22:31.401270Z", - "shell.execute_reply": "2024-03-24T08:22:31.400035Z" - }, - "papermill": { - "duration": 0.024085, - "end_time": "2024-03-24T08:22:31.404251", - "exception": false, - "start_time": "2024-03-24T08:22:31.380166", - "status": "completed" - }, - "tags": [] - }, - "outputs": [], - "source": [ - "def logit_checking(models, inputs, name):\n", - " keras_model, torch_model = models\n", - " keras_input, torch_input = inputs\n", - "\n", - " # forward pass\n", - " keras_predict = keras_model(keras_input)\n", - " torch_predict = torch_model(torch_input)\n", - " \n", - " print('Model: ', name)\n", - " print('Output shape: ', keras_predict.shape, torch_predict.shape)\n", - " print('keras logits: ', keras_predict[0, :5])\n", - " print('torch logits: ', torch_predict[0, :5], end='\\n')\n", - " \n", - " np.testing.assert_allclose(\n", - " keras_predict.detach().numpy(),\n", - " torch_predict.detach().numpy(),\n", - " 1e-5, 1e-5\n", - " )\n", - "\n", - " np.testing.assert_allclose(\n", - " keras_predict.detach().numpy(),\n", - " torch_predict.detach().numpy(),\n", - " 1e-6, 1e-6\n", - " )" - ] - }, - { - "cell_type": "code", - "execution_count": 5, - "id": "0e3a8e9a", - "metadata": { - "execution": { - "iopub.execute_input": "2024-03-24T08:22:31.424660Z", - "iopub.status.busy": "2024-03-24T08:22:31.424195Z", - "iopub.status.idle": "2024-03-24T08:22:31.631412Z", - "shell.execute_reply": "2024-03-24T08:22:31.629852Z" - }, - "papermill": { - "duration": 0.221479, - "end_time": "2024-03-24T08:22:31.634707", - "exception": false, - "start_time": "2024-03-24T08:22:31.413228", - "status": "completed" - }, - "tags": [] - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "torch.Size([1, 32, 224, 224, 3]) torch.Size([1, 3, 32, 224, 224])\n" - ] - } - ], - "source": [ - "common_input = np.random.normal(0, 1, (1, 32, 224, 224, 3)).astype('float32')\n", - "keras_input = ops.array(common_input)\n", - "torch_input = torch.from_numpy(common_input.transpose(0, 4, 1, 2, 3))\n", - "print(keras_input.shape, torch_input.shape)" - ] - }, - { - "cell_type": "markdown", - "id": "744c6bdb", - "metadata": { - "papermill": { - "duration": 0.009575, - "end_time": "2024-03-24T08:22:31.653258", - "exception": false, - "start_time": "2024-03-24T08:22:31.643683", - "status": "completed" - }, - "tags": [] - }, - "source": [ - "# Keras: Video Swin Tiny" - ] - }, - { - "cell_type": "code", - "execution_count": 6, - "id": "b59546b2", - "metadata": { - "execution": { - "iopub.execute_input": "2024-03-24T08:22:31.673046Z", - "iopub.status.busy": "2024-03-24T08:22:31.672666Z", - "iopub.status.idle": "2024-03-24T08:22:35.518952Z", - "shell.execute_reply": "2024-03-24T08:22:35.517104Z" - }, - "papermill": { - "duration": 3.86022, - "end_time": "2024-03-24T08:22:35.522549", - "exception": false, - "start_time": "2024-03-24T08:22:31.662329", - "status": "completed" - }, - "tags": [] - }, - "outputs": [], - "source": [ - "!wget https://github.com/innat/VideoSwin/releases/download/v2.0/videoswin_tiny_kinetics400_classifier.weights.h5 -q" - ] - }, - { - "cell_type": "code", - "execution_count": 7, - "id": "790469f4", - "metadata": { - "execution": { - "iopub.execute_input": "2024-03-24T08:22:35.543417Z", - "iopub.status.busy": "2024-03-24T08:22:35.542956Z", - "iopub.status.idle": "2024-03-24T08:22:37.635190Z", - "shell.execute_reply": "2024-03-24T08:22:37.633663Z" - }, - "papermill": { - "duration": 2.106728, - "end_time": "2024-03-24T08:22:37.638646", - "exception": false, - "start_time": "2024-03-24T08:22:35.531918", - "status": "completed" - }, - "tags": [] - }, - "outputs": [], - "source": [ - "from videoswin.model import VideoSwinT\n", - "\n", - "keras_model = VideoSwinT(\n", - " input_shape=(32, 224, 224, 3),\n", - " include_rescaling=False,\n", - " num_classes=400,\n", - " activation=None\n", - ")\n", - "\n", - "keras_model.load_weights(\n", - " 'videoswin_tiny_kinetics400_classifier.weights.h5'\n", - ")" - ] - }, - { - "cell_type": "markdown", - "id": "6fdbcbb9", - "metadata": { - "papermill": { - "duration": 0.00852, - "end_time": "2024-03-24T08:22:37.656932", - "exception": false, - "start_time": "2024-03-24T08:22:37.648412", - "status": "completed" - }, - "tags": [] - }, - "source": [ - "# TorchVision: Video Swin Tiny" - ] - }, - { - "cell_type": "code", - "execution_count": 8, - "id": "46983e55", - "metadata": { - "execution": { - "iopub.execute_input": "2024-03-24T08:22:37.678769Z", - "iopub.status.busy": "2024-03-24T08:22:37.677443Z", - "iopub.status.idle": "2024-03-24T08:22:43.089473Z", - "shell.execute_reply": "2024-03-24T08:22:43.087914Z" - }, - "papermill": { - "duration": 5.426674, - "end_time": "2024-03-24T08:22:43.092543", - "exception": false, - "start_time": "2024-03-24T08:22:37.665869", - "status": "completed" - }, - "tags": [] - }, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "Downloading: \"https://download.pytorch.org/models/swin3d_t-7615ae03.pth\" to /root/.cache/torch/hub/checkpoints/swin3d_t-7615ae03.pth\n", - "100%|██████████| 122M/122M [00:03<00:00, 36.0MB/s]\n" - ] - } - ], - "source": [ - "import torchvision\n", - "from torchvision.models.video import Swin3D_T_Weights\n", - "\n", - "torch_model = torchvision.models.video.swin3d_t(\n", - " weights=Swin3D_T_Weights.KINETICS400_V1\n", - ").eval()" - ] - }, - { - "cell_type": "code", - "execution_count": 9, - "id": "6ce3f031", - "metadata": { - "execution": { - "iopub.execute_input": "2024-03-24T08:22:43.119644Z", - "iopub.status.busy": "2024-03-24T08:22:43.119143Z", - "iopub.status.idle": "2024-03-24T08:22:59.913430Z", - "shell.execute_reply": "2024-03-24T08:22:59.911880Z" - }, - "papermill": { - "duration": 16.812869, - "end_time": "2024-03-24T08:22:59.918094", - "exception": false, - "start_time": "2024-03-24T08:22:43.105225", - "status": "completed" - }, - "tags": [] - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Model: VideoSwinTiny\n", - "Output shape: torch.Size([1, 400]) torch.Size([1, 400])\n", - "keras logits: tensor([-0.1836, 1.2517, 1.0862, -0.3655, -1.4410], grad_fn=)\n", - "torch logits: tensor([-0.1836, 1.2517, 1.0862, -0.3655, -1.4410], grad_fn=)\n" - ] - } - ], - "source": [ - "logit_checking(\n", - " [keras_model, torch_model], [keras_input, torch_input], name='VideoSwinTiny'\n", - ")" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "f0ed548a", - "metadata": { - "papermill": { - "duration": 0.014387, - "end_time": "2024-03-24T08:22:59.945716", - "exception": false, - "start_time": "2024-03-24T08:22:59.931329", - "status": "completed" - }, - "tags": [] - }, - "outputs": [], - "source": [] - }, - { - "cell_type": "markdown", - "id": "2c7320a4", - "metadata": { - "papermill": { - "duration": 0.01181, - "end_time": "2024-03-24T08:22:59.970055", - "exception": false, - "start_time": "2024-03-24T08:22:59.958245", - "status": "completed" - }, - "tags": [] - }, - "source": [ - "# Keras: Video Swin Small" - ] - }, - { - "cell_type": "code", - "execution_count": 10, - "id": "5c919a67", - "metadata": { - "execution": { - "iopub.execute_input": "2024-03-24T08:22:59.996493Z", - "iopub.status.busy": "2024-03-24T08:22:59.996070Z", - "iopub.status.idle": "2024-03-24T08:23:05.880465Z", - "shell.execute_reply": "2024-03-24T08:23:05.877982Z" - }, - "papermill": { - "duration": 5.901338, - "end_time": "2024-03-24T08:23:05.883630", - "exception": false, - "start_time": "2024-03-24T08:22:59.982292", - "status": "completed" - }, - "tags": [] - }, - "outputs": [], - "source": [ - "!wget https://github.com/innat/VideoSwin/releases/download/v2.0/videoswin_small_kinetics400_classifier.weights.h5 -q" - ] - }, - { - "cell_type": "code", - "execution_count": 11, - "id": "f3635268", - "metadata": { - "execution": { - "iopub.execute_input": "2024-03-24T08:23:05.910725Z", - "iopub.status.busy": "2024-03-24T08:23:05.910270Z", - "iopub.status.idle": "2024-03-24T08:23:08.102558Z", - "shell.execute_reply": "2024-03-24T08:23:08.101370Z" - }, - "papermill": { - "duration": 2.209671, - "end_time": "2024-03-24T08:23:08.105636", - "exception": false, - "start_time": "2024-03-24T08:23:05.895965", - "status": "completed" - }, - "tags": [] - }, - "outputs": [], - "source": [ - "from videoswin.model import VideoSwinS\n", - "\n", - "keras_model = VideoSwinS(\n", - " input_shape=(32, 224, 224, 3),\n", - " include_rescaling=False,\n", - " num_classes=400,\n", - " activation=None\n", - ")\n", - "\n", - "keras_model.load_weights(\n", - " 'videoswin_small_kinetics400_classifier.weights.h5'\n", - ")" - ] - }, - { - "cell_type": "markdown", - "id": "d19d7697", - "metadata": { - "papermill": { - "duration": 0.011814, - "end_time": "2024-03-24T08:23:08.130358", - "exception": false, - "start_time": "2024-03-24T08:23:08.118544", - "status": "completed" - }, - "tags": [] - }, - "source": [ - "# TorchVision: Video Swin Small" - ] - }, - { - "cell_type": "code", - "execution_count": 12, - "id": "96a41eab", - "metadata": { - "execution": { - "iopub.execute_input": "2024-03-24T08:23:08.158478Z", - "iopub.status.busy": "2024-03-24T08:23:08.157628Z", - "iopub.status.idle": "2024-03-24T08:23:16.306490Z", - "shell.execute_reply": "2024-03-24T08:23:16.304794Z" - }, - "papermill": { - "duration": 8.166763, - "end_time": "2024-03-24T08:23:16.309486", - "exception": false, - "start_time": "2024-03-24T08:23:08.142723", - "status": "completed" - }, - "tags": [] - }, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "Downloading: \"https://download.pytorch.org/models/swin3d_s-da41c237.pth\" to /root/.cache/torch/hub/checkpoints/swin3d_s-da41c237.pth\n", - "100%|██████████| 218M/218M [00:05<00:00, 38.5MB/s]\n" - ] - } - ], - "source": [ - "import torchvision\n", - "from torchvision.models.video import Swin3D_S_Weights\n", - "\n", - "torch_model = torchvision.models.video.swin3d_s(\n", - " weights=Swin3D_S_Weights.KINETICS400_V1\n", - ").eval()" - ] - }, - { - "cell_type": "code", - "execution_count": 13, - "id": "31b50049", - "metadata": { - "execution": { - "iopub.execute_input": "2024-03-24T08:23:16.348975Z", - "iopub.status.busy": "2024-03-24T08:23:16.348506Z", - "iopub.status.idle": "2024-03-24T08:23:44.789445Z", - "shell.execute_reply": "2024-03-24T08:23:44.788109Z" - }, - "papermill": { - "duration": 28.464442, - "end_time": "2024-03-24T08:23:44.793273", - "exception": false, - "start_time": "2024-03-24T08:23:16.328831", - "status": "completed" - }, - "tags": [] - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Model: VideoSwinSmall\n", - "Output shape: torch.Size([1, 400]) torch.Size([1, 400])\n", - "keras logits: tensor([ 0.6722, 1.1854, 0.9514, -0.4893, -1.8892], grad_fn=)\n", - "torch logits: tensor([ 0.6722, 1.1854, 0.9514, -0.4893, -1.8892], grad_fn=)\n" - ] - } - ], - "source": [ - "logit_checking(\n", - " [keras_model, torch_model], [keras_input, torch_input], name='VideoSwinSmall'\n", - ")" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "2fb26470", - "metadata": { - "papermill": { - "duration": 0.017237, - "end_time": "2024-03-24T08:23:44.828645", - "exception": false, - "start_time": "2024-03-24T08:23:44.811408", - "status": "completed" - }, - "tags": [] - }, - "outputs": [], - "source": [] - }, - { - "cell_type": "markdown", - "id": "a9b57a9b", - "metadata": { - "papermill": { - "duration": 0.017032, - "end_time": "2024-03-24T08:23:44.863273", - "exception": false, - "start_time": "2024-03-24T08:23:44.846241", - "status": "completed" - }, - "tags": [] - }, - "source": [ - "# Keras: Video Swin Base [ImageNet 22K]" - ] - }, - { - "cell_type": "code", - "execution_count": 14, - "id": "f1bbebdb", - "metadata": { - "execution": { - "iopub.execute_input": "2024-03-24T08:23:44.901543Z", - "iopub.status.busy": "2024-03-24T08:23:44.900307Z", - "iopub.status.idle": "2024-03-24T08:23:53.748986Z", - "shell.execute_reply": "2024-03-24T08:23:53.746009Z" - }, - "papermill": { - "duration": 8.873847, - "end_time": "2024-03-24T08:23:53.755069", - "exception": false, - "start_time": "2024-03-24T08:23:44.881222", - "status": "completed" - }, - "tags": [] - }, - "outputs": [], - "source": [ - "!wget https://github.com/innat/VideoSwin/releases/download/v2.0/videoswin_base_kinetics400_imagenet22k_classifier.weights.h5 -q" - ] - }, - { - "cell_type": "code", - "execution_count": 15, - "id": "219836a0", - "metadata": { - "execution": { - "iopub.execute_input": "2024-03-24T08:23:53.797238Z", - "iopub.status.busy": "2024-03-24T08:23:53.795435Z", - "iopub.status.idle": "2024-03-24T08:23:57.403133Z", - "shell.execute_reply": "2024-03-24T08:23:57.401370Z" - }, - "papermill": { - "duration": 3.632772, - "end_time": "2024-03-24T08:23:57.406600", - "exception": false, - "start_time": "2024-03-24T08:23:53.773828", - "status": "completed" - }, - "tags": [] - }, - "outputs": [], - "source": [ - "from videoswin.model import VideoSwinB\n", - "\n", - "keras_model = VideoSwinB(\n", - " input_shape=(32, 224, 224, 3),\n", - " include_rescaling=False,\n", - " num_classes=400,\n", - " activation=None\n", - ")\n", - "\n", - "keras_model.load_weights(\n", - " 'videoswin_base_kinetics400_imagenet22k_classifier.weights.h5'\n", - ")" - ] - }, - { - "cell_type": "markdown", - "id": "2bd561da", - "metadata": { - "papermill": { - "duration": 0.018191, - "end_time": "2024-03-24T08:23:57.443325", - "exception": false, - "start_time": "2024-03-24T08:23:57.425134", - "status": "completed" - }, - "tags": [] - }, - "source": [ - "# TorchVision: Video Swin Base [ImageNet 22K]" - ] - }, - { - "cell_type": "code", - "execution_count": 16, - "id": "cc4076c5", - "metadata": { - "execution": { - "iopub.execute_input": "2024-03-24T08:23:57.482989Z", - "iopub.status.busy": "2024-03-24T08:23:57.482510Z", - "iopub.status.idle": "2024-03-24T08:24:15.864584Z", - "shell.execute_reply": "2024-03-24T08:24:15.863207Z" - }, - "papermill": { - "duration": 18.405582, - "end_time": "2024-03-24T08:24:15.867692", - "exception": false, - "start_time": "2024-03-24T08:23:57.462110", - "status": "completed" - }, - "tags": [] - }, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "Downloading: \"https://download.pytorch.org/models/swin3d_b_22k-7c6ae6fa.pth\" to /root/.cache/torch/hub/checkpoints/swin3d_b_22k-7c6ae6fa.pth\n", - "100%|██████████| 364M/364M [00:14<00:00, 25.5MB/s]\n" - ] - } - ], - "source": [ - "import torchvision\n", - "from torchvision.models.video import Swin3D_B_Weights\n", - "\n", - "torch_model = torchvision.models.video.swin3d_b(\n", - " weights=Swin3D_B_Weights.KINETICS400_IMAGENET22K_V1\n", - ").eval()" - ] - }, - { - "cell_type": "code", - "execution_count": 17, - "id": "a4cab99b", - "metadata": { - "execution": { - "iopub.execute_input": "2024-03-24T08:24:15.933731Z", - "iopub.status.busy": "2024-03-24T08:24:15.933133Z", - "iopub.status.idle": "2024-03-24T08:24:58.240105Z", - "shell.execute_reply": "2024-03-24T08:24:58.238492Z" - }, - "papermill": { - "duration": 42.343163, - "end_time": "2024-03-24T08:24:58.243147", - "exception": false, - "start_time": "2024-03-24T08:24:15.899984", - "status": "completed" - }, - "tags": [] - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Model: VideoSwinBaseImageNet22K\n", - "Output shape: torch.Size([1, 400]) torch.Size([1, 400])\n", - "keras logits: tensor([ 0.3086, 0.7657, 1.4416, -1.0855, -1.4904], grad_fn=)\n", - "torch logits: tensor([ 0.3086, 0.7657, 1.4416, -1.0855, -1.4904], grad_fn=)\n" - ] - } - ], - "source": [ - "logit_checking(\n", - " [keras_model, torch_model], [keras_input, torch_input], name='VideoSwinBaseImageNet22K'\n", - ")" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "5f8f9aa6", - "metadata": { - "papermill": { - "duration": 0.030943, - "end_time": "2024-03-24T08:24:58.304808", - "exception": false, - "start_time": "2024-03-24T08:24:58.273865", - "status": "completed" - }, - "tags": [] - }, - "outputs": [], - "source": [] - } - ], - "metadata": { - "kaggle": { - "accelerator": "none", - "dataSources": [], - "dockerImageVersionId": 30673, - "isGpuEnabled": false, - "isInternetEnabled": true, - "language": "python", - "sourceType": "notebook" - }, - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.10.13" - }, - "papermill": { - "default_parameters": {}, - "duration": 187.411886, - "end_time": "2024-03-24T08:25:01.323707", - "environment_variables": {}, - "exception": null, - "input_path": "__notebook__.ipynb", - "output_path": "__notebook__.ipynb", - "parameters": {}, - "start_time": "2024-03-24T08:21:53.911821", - "version": "2.5.0" - } - }, - "nbformat": 4, - "nbformat_minor": 5 -}