{
 "cells": [
  {
   "cell_type": "raw",
   "metadata": {},
   "source": [
    "---\n",
    "execute:\n",
    "  enabled: false\n",
    "---"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<!-- d2l:prose id=convnext-md-1 fw=all -->\n",
    "\n",
    "# ConvNeXt: A ConvNet for the 2020s\n",
    "\n",
    "By 2021, vision transformers [@Dosovitskiy.Beyer.Kolesnikov.ea.2021] had taken over the top of the ImageNet leaderboard, and hierarchical variants such as the Swin transformer [@liu2021swin] were displacing convnets as the default backbone for detection and segmentation. It was tempting to conclude that attention had made convolution obsolete. But a transformer differs from a 2015 ResNet in many ways besides attention: its training recipe, its stem, its activation function, its normalization layers, the shape and depth of its stages. Which of these differences actually carried the improvement?\n",
    "\n",
    "@liu2022convnet answered by experiment. Starting from a ResNet-50, they applied one transformer-inspired design change at a time, measured ImageNet accuracy after each, kept what helped, and never added attention. The end point, named ConvNeXt, reaches 82.0% top-1 accuracy where the Swin-T transformer of the same computational cost reaches 81.3%. The exercise is the best guided tour of modern architecture design we know of, because every step uses a concept this book has already taught: training recipes (that section), depthwise convolutions (that section), the inverted bottleneck (that section), receptive fields (the equation), and normalization layers (that section). In this section we walk the roadmap, implement the result, and train a scaled-down ConvNeXt with the modern recipe of that section."
   ]
  },
  {
   "cell_type": "code",
   "metadata": {
    "id": "convnext-imports"
   },
   "source": [
    "from d2l import jax as d2l\n",
    "from flax import nnx\n",
    "import jax\n",
    "from jax import numpy as jnp\n",
    "import optax"
   ],
   "execution_count": 1,
   "outputs": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<!-- d2l:prose id=convnext-md-2 fw=all -->\n",
    "\n",
    "## The Modernization Roadmap\n",
    "\n",
    "the table shows the full sequence. Each row keeps every change above it, so the accuracies are cumulative; the computational cost is held near that of Swin-T (about 4.5 GFLOPs) throughout.\n",
    "\n",
    "<!-- tbl-caption:The ConvNeXt modernization roadmap [@liu2022convnet]. ImageNet-1K top-1 accuracy of a ResNet-50 as design changes accumulate; each row includes all rows above it, at roughly constant cost. Swin-T, the transformer of the same cost, reaches 81.3%. -->\n",
    "\n",
    "| Change | What it means | Top-1 |\n",
    "|:--|:--|:--|\n",
    "| (starting point) | ResNet-50 with its 2015 recipe | 76.1% |\n",
    "| Modern training recipe | 300 epochs, AdamW, Mixup, label smoothing, stochastic depth (that section) | 78.8% |\n",
    "| Stage ratio | blocks per stage $(3, 4, 6, 3) \\to (3, 3, 9, 3)$ | 79.4% |\n",
    "| Patchify stem | $7 \\times 7$ stride-2 convolution plus pooling $\\to$ one $4 \\times 4$ stride-4 convolution | 79.5% |\n",
    "| Depthwise convolutions | the $3 \\times 3$ convolution becomes depthwise; width grows from 64 to 96 channels | 80.5% |\n",
    "| Inverted bottleneck | expand $4\\times$ inside the block instead of compressing | 80.6% |\n",
    "| Large kernels | depthwise convolution moved to the front and enlarged to $7 \\times 7$ | 80.6% |\n",
    "| ReLU $\\to$ GELU | a smooth activation, as in transformers | 80.6% |\n",
    "| Fewer activations | one activation per block instead of three | 81.3% |\n",
    "| Fewer normalizations | one normalization per block instead of three | 81.4% |\n",
    "| BN $\\to$ LN | layer normalization over channels at each position | 81.5% |\n",
    "| Separate downsampling | an LN plus $2 \\times 2$ stride-2 convolution between stages | 82.0% |\n",
    "\n",
    "The first row is the largest single jump, and it is not an architecture change at all. The 2.7 points it contributes are the recipe effect of that section (the \"ResNet strikes back\" study pushed the same network to 80.4% with a still longer 600-epoch procedure [@wightman2021resnet]). Keep this split in mind for everything below: of the 5.9 points separating the 2015 ResNet-50 from ConvNeXt, 2.7 are training and 3.2 are architecture. Papers that compared a well-tuned transformer against a 2015-recipe ResNet were, in large part, comparing recipes.\n",
    "\n",
    "### Macro design\n",
    "\n",
    "The next two rows change the network's silhouette. Swin-T distributes its blocks across the four stages in the ratio $1{:}1{:}3{:}1$, spending most of its depth where the feature maps are small and each block is cheap; adopting the same ratio, $(3, 3, 9, 3)$ blocks instead of ResNet-50's $(3, 4, 6, 3)$, adds 0.6 points. The stem changes more. ResNet begins with a $7 \\times 7$ stride-2 convolution followed by max-pooling, a fourfold reduction computed with overlapping windows. Vision transformers instead slice the image into non-overlapping patches, which is just a strided convolution whose kernel size equals its stride (that section): a $4 \\times 4$ convolution with stride 4. This *patchify* stem replaces the ResNet stem with no loss (79.5%), and its output, one feature vector per $4 \\times 4$ patch, is the same object a transformer calls a patch embedding.\n",
    "\n",
    "### Depthwise convolutions and the inverted bottleneck\n",
    "\n",
    "The attention core of a transformer mixes information *across positions* using\n",
    "one weight pattern per head. Its query, key, value, and output projections also\n",
    "mix channels. The MLP that follows mixes channels independently at each\n",
    "position. MobileNet factorizes a convolution in a related way: a depthwise\n",
    "convolution mixes positions within each channel, then $1 \\times 1$ convolutions\n",
    "mix channels (that section). Making the ResNet\n",
    "bottleneck's $3 \\times 3$ convolution depthwise, and spending the savings on\n",
    "width (64 to 96 channels, matching Swin-T), brings 80.5%. Inverting the\n",
    "bottleneck so that the block expands its thin residual stream by $4\\times$ and\n",
    "projects back adds a little more (80.6%). We saw in\n",
    "that section why this shape is economical once the spatial\n",
    "convolution is depthwise. The transformer's MLP uses the same factor-four\n",
    "pointwise expand--activate--project substructure; ConvNeXt adds the depthwise\n",
    "spatial mixer before it.\n",
    "\n",
    "With the expensive dense convolution gone, kernel size stops being a luxury. Moving the depthwise convolution to the front of the block (so the cheap operation sees the unexpanded stream; this alone temporarily costs 0.7 points) and enlarging it from $3 \\times 3$ to $7 \\times 7$ recovers the loss at lower cost. By the equation, a $7 \\times 7$ kernel grows the receptive field as fast as three stacked $3 \\times 3$ layers, the trade VGG once resolved in favor of depth (that section) when kernels were dense and their cost quadratic. Depthwise, a $7 \\times 7$ kernel costs only $49/9 \\approx 5\\times$ a $3 \\times 3$ one on the depthwise term alone, a small fraction of the block. The authors report that accuracy saturates at $7 \\times 7$: kernels of $9 \\times 9$ and $11 \\times 11$ buy nothing further at this scale.\n",
    "\n",
    "### Micro design\n",
    "\n",
    "The remaining rows are small and, cumulatively, decisive. Replacing ReLU by GELU, the smooth activation used in transformers and in essentially every large language model, changes nothing by itself (80.6%). What matters is *how many* activations and normalizations the block contains. A ResNet bottleneck interleaves a normalization and an activation after every convolution: three of each. A transformer block applies one activation, inside its MLP, and one or two normalizations. Deleting all but one GELU (between the two $1 \\times 1$ convolutions) adds 0.7 points, more than any other micro-design change; deleting all but one normalization adds a little more, and swapping that survivor from batch normalization to layer normalization, applied over the channels at each spatial position, another tenth (81.5%). The lesson of that section reappears: normalization is scaffolding for optimization, and less of it, placed well, can be better. the figure shows the before and after.\n",
    "\n",
    "![The ResNet-50 bottleneck block and the ConvNeXt block that the roadmap turns it into. Three normalizations and three activations become one of each; the compress-process-expand bottleneck becomes an inverted bottleneck led by a $7 \\times 7$ depthwise convolution.](../img/arch-resnet-vs-convnext-block.svg)\n",
    "\n",
    "Finally, ResNet downsamples inside the first block of each stage, by giving its $3 \\times 3$ convolution a stride of 2. Swin instead uses a separate patch-merging layer between stages. Adopting the same separation, a layer normalization followed by a $2 \\times 2$ stride-2 convolution between stages (plus a normalization after the stem and one before the classifier head, which the authors found necessary for stable training), completes the roadmap at 82.0%. the figure shows the assembled ConvNeXt-T: a patchify stem, four stages of $(3, 3, 9, 3)$ blocks at widths $(96, 192, 384, 768)$, downsampling layers between them, and a global-average-pooling head, the stem-body-head layout this chapter has used since that section.\n",
    "\n",
    "![ConvNeXt-T. A patchify stem replaces convolution-plus-pooling; stages of 3, 3, 9, and 3 blocks are joined by separate LN plus $2 \\times 2$ stride-2 downsampling layers; there is no pooling anywhere in the body.](../img/arch-convnext.svg)\n",
    "\n",
    "Where does this leave the convnet-versus-transformer question? At this scale, even: a pure convnet, given the transformer's recipe and design sensibilities, matches or slightly beats the transformer, and the paper shows the result persists for larger variants and transfers to COCO detection and ADE20K segmentation, the benchmarks that that section argued still discriminate. What the roadmap does not show is a convnet *advantage*: the two families, tuned by the same hands, land in the same place. We return to what that means in that section.\n",
    "\n",
    "## Implementation\n",
    "\n",
    "ConvNeXt is easy to build precisely because the roadmap removed things. A block is six operations; the network is the familiar arch-tuple loop.\n",
    "\n",
    "### The ConvNeXt block\n",
    "\n",
    "The block applies, in order: a $7 \\times 7$ depthwise convolution, layer normalization, a $1 \\times 1$ convolution expanding the channels $4\\times$, a GELU, and a $1 \\times 1$ convolution projecting back, with the result added to the input. Two refinements from the paper's training setup come along. *Layer scale* multiplies the branch by a learnable per-channel vector $\\gamma$ initialized to $10^{-6}$, so every block starts as a near-identity and the network begins training as a shallow function that gradually deepens; the technique was introduced for very deep vision transformers [@touvron2021cait] and helps stability here too. *Stochastic depth*, the equation of that section, randomly drops the whole branch per sample during training.\n",
    "\n",
    "One implementation detail deserves attention, because it is the\n",
    "layer-normalization placement that the roadmap's LN row depends on. ConvNeXt\n",
    "normalizes over the *channels at each spatial position*, the same normalization\n",
    "a transformer applies to each token. In a channels-last layout (samples,\n",
    "height, width, channels) this is the library default, and a $1 \\times 1$\n",
    "convolution is a linear layer applied to the last axis. Our PyTorch\n",
    "implementation therefore permutes to channels-last inside the block, while\n",
    "TensorFlow and JAX are channels-last natively. MXNet stays channels-first and\n",
    "normalizes `axis=1`."
   ]
  },
  {
   "cell_type": "code",
   "metadata": {
    "id": "convnext-block"
   },
   "source": [
    "class ConvNeXtBlock(nnx.Module):\n",
    "    \"\"\"Depthwise 7x7, LN, 1x1 expand, GELU, 1x1 project, scaled residual.\"\"\"\n",
    "    deterministic: bool\n",
    "\n",
    "    def __init__(self, dim, drop_prob=0.0, layer_scale=1e-6, rngs=None):\n",
    "        rngs = (nnx.Rngs(params=d2l.get_key(), dropout=d2l.get_key())\n",
    "                if rngs is None else rngs)\n",
    "        self.dim, self.drop_prob = dim, drop_prob\n",
    "        self.deterministic = False\n",
    "        self.rngs = rngs\n",
    "        self.dwconv = nnx.Conv(dim, dim, kernel_size=(7, 7), padding='same',\n",
    "                               feature_group_count=dim, rngs=rngs)\n",
    "        self.norm = nnx.LayerNorm(dim, epsilon=1e-6, rngs=rngs)\n",
    "        self.pwconv1 = nnx.Linear(dim, 4 * dim, rngs=rngs)\n",
    "        self.pwconv2 = nnx.Linear(4 * dim, dim, rngs=rngs)\n",
    "        self.gamma = nnx.Param(layer_scale * jnp.ones(dim))\n",
    "\n",
    "    def set_view(self, *, deterministic):\n",
    "        self.deterministic = deterministic\n",
    "\n",
    "    def __call__(self, X):\n",
    "        Y = self.norm(self.dwconv(X))\n",
    "        Y = self.pwconv2(nnx.gelu(self.pwconv1(Y)))\n",
    "        Y = self.gamma * Y\n",
    "        if not self.deterministic and self.drop_prob > 0:\n",
    "            keep = jax.random.bernoulli(\n",
    "                self.rngs.dropout(), 1 - self.drop_prob,\n",
    "                (X.shape[0], 1, 1, 1))\n",
    "            Y = Y * keep / (1 - self.drop_prob)\n",
    "        return X + Y"
   ],
   "execution_count": 2,
   "outputs": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<!-- d2l:prose id=convnext-md-3 fw=all -->\n",
    "\n",
    "### The full network\n",
    "\n",
    "The network is the arch-tuple pattern of that section one more time: a tuple of (depth, channels) pairs, a stem, a loop, a head. The stem is the patchify convolution plus a normalization. Between stages sits the separate downsampling layer, a normalization followed by a $2 \\times 2$ stride-2 convolution; there is no pooling anywhere in the body. Following the paper, the per-block stochastic-depth probability ramps linearly from zero at the first block to its maximum at the last. Our dimensions are a scaled-down ConvNeXt sized for Fashion-MNIST, near the \"atto\" end of the family: widths $(40, 80, 160, 320)$ and depths $(2, 2, 6, 2)$, with the third stage deepest as in the full model."
   ]
  },
  {
   "cell_type": "code",
   "metadata": {
    "id": "convnext-model"
   },
   "source": [
    "class ConvNeXt(d2l.Classifier):\n",
    "    def __init__(self, arch=((2, 40), (2, 80), (6, 160), (2, 320)),\n",
    "                 lr=2e-3, num_classes=10, drop_path_max=0.1, rngs=None):\n",
    "        super().__init__()\n",
    "        self.save_hyperparameters(ignore=['rngs'])\n",
    "        rngs = (nnx.Rngs(params=d2l.get_key(), dropout=d2l.get_key(),\n",
    "                         mixup=d2l.get_key()) if rngs is None else rngs)\n",
    "        self.rngs = rngs\n",
    "        layers = [nnx.Conv(1, arch[0][1], kernel_size=(4, 4),\n",
    "                           strides=(4, 4), rngs=rngs),\n",
    "                  nnx.LayerNorm(arch[0][1], epsilon=1e-6, rngs=rngs)]\n",
    "        total = sum(d for d, _ in arch)\n",
    "        rates = [drop_path_max * i / max(total - 1, 1)\n",
    "                 for i in range(total)]\n",
    "        b, c_prev = 0, arch[0][1]\n",
    "        for i, (depth, c) in enumerate(arch):\n",
    "            if i > 0:  # separate downsampling layer between stages\n",
    "                layers += [nnx.LayerNorm(c_prev, epsilon=1e-6, rngs=rngs),\n",
    "                           nnx.Conv(c_prev, c, kernel_size=(2, 2),\n",
    "                                    strides=(2, 2), rngs=rngs)]\n",
    "            for _ in range(depth):\n",
    "                layers.append(ConvNeXtBlock(c, drop_prob=rates[b], rngs=rngs))\n",
    "                b += 1\n",
    "            c_prev = c\n",
    "        layers += [lambda x: x.mean(axis=(1, 2)),  # global average pooling\n",
    "                   nnx.LayerNorm(c_prev, epsilon=1e-6, rngs=rngs),\n",
    "                   nnx.Linear(c_prev, num_classes, rngs=rngs)]\n",
    "        self.net = nnx.Sequential(*layers)"
   ],
   "execution_count": 3,
   "outputs": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<!-- d2l:prose id=convnext-md-4 fw=jax -->\n",
    "\n",
    "Unlike every network since that section, this model carries no\n",
    "batch statistics: layer normalization is a pure function of its input. The\n",
    "`deterministic` mode controls stochastic depth rather than normalization,\n",
    "and the module needs no mutable running statistics. Each block owns a\n",
    "`dropout` RNG stream that advances when it samples per-example residual masks."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<!-- d2l:prose id=convnext-md-5 fw=all -->\n",
    "\n",
    "A $96 \\times 96$ input leaves the stem as a $24 \\times 24$ map, and the three downsampling layers reduce it to $12 \\times 12$, $6 \\times 6$, and finally $3 \\times 3$ before the head pools it away. We check the output shape and count parameters: 3,376,450, about a third of the 11.2 million in the ResNet-18 we trained in that section. The exact count is a stringent correctness check for any reimplementation, ours included, since a single wrongly sized layer changes it."
   ]
  },
  {
   "cell_type": "code",
   "metadata": {
    "id": "convnext-params"
   },
   "source": [
    "model = ConvNeXt()\n",
    "X = jnp.zeros((1, 96, 96, 1))\n",
    "assert nnx.view(model, deterministic=True)(X).shape == (1, 10)\n",
    "sum(p.size for _, p in nnx.state(model, nnx.Param).flat_state())"
   ],
   "execution_count": 4,
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": "3376450"
     },
     "metadata": {},
     "execution_count": 4
    }
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<!-- d2l:prose id=convnext-md-6 fw=all -->\n",
    "\n",
    "### Training with the modern recipe\n",
    "\n",
    "We train ConvNeXt with the compact modern recipe used in\n",
    "that section: AdamW, cosine decay with warmup, label\n",
    "smoothing, and Mixup. For a controlled local comparison, we train a ResNet-18\n",
    "whose base width is reduced from 64 to 35 channels, giving it nearly the same\n",
    "parameter count as our ConvNeXt. The two models share the data, recipe, epoch\n",
    "budget, and the same seed."
   ]
  },
  {
   "cell_type": "code",
   "metadata": {
    "id": "convnext-recipe"
   },
   "source": [
    "def mixup(key, X, y, alpha):\n",
    "    key_lam, key_perm = jax.random.split(key)\n",
    "    lam = jax.random.beta(key_lam, alpha, alpha)\n",
    "    perm = jax.random.permutation(key_perm, X.shape[0])\n",
    "    return lam * X + (1 - lam) * X[perm], y, y[perm], lam\n",
    "\n",
    "class ModernConvNeXt(ConvNeXt):\n",
    "    def __init__(self, lr=2e-3, num_classes=10, drop_path_max=0.0,\n",
    "                 max_epochs=30, steps_per_epoch=468, rngs=None):\n",
    "        super().__init__(lr=lr, num_classes=num_classes,\n",
    "                         drop_path_max=drop_path_max, rngs=rngs)\n",
    "        self.max_epochs, self.steps_per_epoch = max_epochs, steps_per_epoch\n",
    "\n",
    "    def configure_optimizers(self):\n",
    "        total = self.max_epochs * self.steps_per_epoch\n",
    "        schedule = optax.warmup_cosine_decay_schedule(\n",
    "            0.0, self.lr, 3 * self.steps_per_epoch, total)\n",
    "        return optax.adamw(schedule, weight_decay=0.05)\n",
    "\n",
    "    def training_step(self, batch):\n",
    "        X, y = batch\n",
    "        X, y_a, y_b, lam = mixup(self.rngs.mixup(), X, y, 0.2)\n",
    "        logp = jax.nn.log_softmax(self(X))\n",
    "        eye = jnp.eye(self.num_classes)\n",
    "        ta = 0.9 * eye[y_a] + 0.1 / self.num_classes\n",
    "        tb = 0.9 * eye[y_b] + 0.1 / self.num_classes\n",
    "        return (lam * -(ta * logp).sum(axis=1).mean()\n",
    "                + (1 - lam) * -(tb * logp).sum(axis=1).mean())\n",
    "\n",
    "class CompactResNet18(d2l.Classifier):\n",
    "    def __init__(self, lr=2e-3, num_classes=10, base=35, max_epochs=30,\n",
    "                 steps_per_epoch=468, rngs=None):\n",
    "        super().__init__()\n",
    "        self.save_hyperparameters(ignore=['rngs'])\n",
    "        rngs = (nnx.Rngs(params=d2l.get_key(), dropout=d2l.get_key(),\n",
    "                         mixup=d2l.get_key()) if rngs is None else rngs)\n",
    "        self.rngs = rngs\n",
    "        channels = (base, 2 * base, 4 * base, 8 * base)\n",
    "        layers = [nnx.Conv(1, base, (7, 7), strides=(2, 2),\n",
    "                           padding='same', rngs=rngs),\n",
    "                  nnx.BatchNorm(base, rngs=rngs), nnx.relu,\n",
    "                  lambda x: nnx.max_pool(x, (3, 3), (2, 2), padding='SAME')]\n",
    "        in_channels = base\n",
    "        for i, c in enumerate(channels):\n",
    "            for j in range(2):\n",
    "                down = i > 0 and j == 0\n",
    "                layers.append(d2l.Residual(\n",
    "                    c, use_1x1conv=down,\n",
    "                    strides=(2, 2) if down else (1, 1),\n",
    "                    in_channels=in_channels, rngs=rngs))\n",
    "                in_channels = c\n",
    "        layers += [lambda x: x.mean(axis=(1, 2)),\n",
    "                   nnx.Linear(channels[-1], num_classes, rngs=rngs)]\n",
    "        self.net = nnx.Sequential(*layers)\n",
    "\n",
    "    configure_optimizers = ModernConvNeXt.configure_optimizers\n",
    "    training_step = ModernConvNeXt.training_step"
   ],
   "execution_count": 5,
   "outputs": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<!-- d2l:prose id=convnext-md-7 fw=all -->\n",
    "\n",
    "We train for 30 epochs on the full Fashion-MNIST training set at $96 \\times\n",
    "96$, matching the modern-recipe ResNet-18 run of\n",
    "that section epoch for epoch. We set ConvNeXt's stochastic\n",
    "depth rate to zero in this comparison because the compact ResNet control does\n",
    "not use it; the block implementation above still exercises the complete\n",
    "stochastic-depth path."
   ]
  },
  {
   "cell_type": "code",
   "metadata": {
    "id": "convnext-train"
   },
   "source": [
    "data = d2l.FashionMNIST(batch_size=128, resize=(96, 96))\n",
    "jax_scores = {}\n",
    "for name, model in (\n",
    "        ('ConvNeXt', ModernConvNeXt(\n",
    "            steps_per_epoch=len(data.train_dataloader()))),\n",
    "        ('compact ResNet-18', CompactResNet18(\n",
    "            steps_per_epoch=len(data.train_dataloader())))):\n",
    "    d2l.tf.random.set_seed(1)  # Match the tf.data order between models\n",
    "    trainer = d2l.Trainer(max_epochs=30, num_gpus=1)\n",
    "    trainer.fit(model, data)\n",
    "    correct, n = 0.0, 0\n",
    "    for X, y in data.val_dataloader():\n",
    "        values = model.accuracy(trainer.val_model(X), y, averaged=False)\n",
    "        correct += float(values.sum())\n",
    "        n += len(y)\n",
    "    jax_scores[name] = correct / n"
   ],
   "execution_count": 6,
   "outputs": [
    {
     "output_type": "display_data",
     "data": {
      "image/svg+xml": "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n  \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n<svg xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"238.965625pt\" height=\"184.099166pt\" viewBox=\"0 0 238.965625 184.099166\" xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\">\n <metadata>\n  <rdf:RDF xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:cc=\"http://creativecommons.org/ns#\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n   <cc:Work>\n    <dc:type rdf:resource=\"http://purl.org/dc/dcmitype/StillImage\"/>\n    <dc:date>2026-07-19T15:02:28.677087</dc:date>\n    <dc:format>image/svg+xml</dc:format>\n    <dc:creator>\n     <cc:Agent>\n      <dc:title>Matplotlib v3.10.8, https://matplotlib.org/</dc:title>\n     </cc:Agent>\n    </dc:creator>\n   </cc:Work>\n  </rdf:RDF>\n </metadata>\n <defs>\n  <style type=\"text/css\">*{stroke-linejoin: round; stroke-linecap: butt}</style>\n </defs>\n <g id=\"figure_1\">\n  <g id=\"patch_1\">\n   <path d=\"M 0 184.099166 \nL 238.965625 184.099166 \nL 238.965625 0 \nL 0 0 \nz\n\" style=\"fill: #ffffff\"/>\n  </g>\n  <g id=\"axes_1\">\n   <g id=\"patch_2\">\n    <path d=\"M 30.103125 146.542916 \nL 225.403125 146.542916 \nL 225.403125 7.942916 \nL 30.103125 7.942916 \nz\n\" style=\"fill: #ffffff\"/>\n   </g>\n   <g id=\"matplotlib.axis_1\">\n    <g id=\"xtick_1\">\n     <g id=\"line2d_1\">\n      <defs>\n       <path id=\"m06b58a9cfd\" d=\"M 0 0 \nL 0 3.5 \n\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </defs>\n      <g>\n       <use xlink:href=\"#m06b58a9cfd\" x=\"30.103125\" y=\"146.542916\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_1\">\n      <!-- 0 -->\n      <g transform=\"translate(26.921875 161.141354) scale(0.1 -0.1)\">\n       <defs>\n        <path id=\"DejaVuSans-30\" d=\"M 2034 4250 \nQ 1547 4250 1301 3770 \nQ 1056 3291 1056 2328 \nQ 1056 1369 1301 889 \nQ 1547 409 2034 409 \nQ 2525 409 2770 889 \nQ 3016 1369 3016 2328 \nQ 3016 3291 2770 3770 \nQ 2525 4250 2034 4250 \nz\nM 2034 4750 \nQ 2819 4750 3233 4129 \nQ 3647 3509 3647 2328 \nQ 3647 1150 3233 529 \nQ 2819 -91 2034 -91 \nQ 1250 -91 836 529 \nQ 422 1150 422 2328 \nQ 422 3509 836 4129 \nQ 1250 4750 2034 4750 \nz\n\" transform=\"scale(0.015625)\"/>\n       </defs>\n       <use xlink:href=\"#DejaVuSans-30\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_2\">\n     <g id=\"line2d_2\">\n      <g>\n       <use xlink:href=\"#m06b58a9cfd\" x=\"62.653125\" y=\"146.542916\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_2\">\n      <!-- 5 -->\n      <g transform=\"translate(59.471875 161.141354) scale(0.1 -0.1)\">\n       <defs>\n        <path id=\"DejaVuSans-35\" d=\"M 691 4666 \nL 3169 4666 \nL 3169 4134 \nL 1269 4134 \nL 1269 2991 \nQ 1406 3038 1543 3061 \nQ 1681 3084 1819 3084 \nQ 2600 3084 3056 2656 \nQ 3513 2228 3513 1497 \nQ 3513 744 3044 326 \nQ 2575 -91 1722 -91 \nQ 1428 -91 1123 -41 \nQ 819 9 494 109 \nL 494 744 \nQ 775 591 1075 516 \nQ 1375 441 1709 441 \nQ 2250 441 2565 725 \nQ 2881 1009 2881 1497 \nQ 2881 1984 2565 2268 \nQ 2250 2553 1709 2553 \nQ 1456 2553 1204 2497 \nQ 953 2441 691 2322 \nL 691 4666 \nz\n\" transform=\"scale(0.015625)\"/>\n       </defs>\n       <use xlink:href=\"#DejaVuSans-35\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_3\">\n     <g id=\"line2d_3\">\n      <g>\n       <use xlink:href=\"#m06b58a9cfd\" x=\"95.203125\" y=\"146.542916\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_3\">\n      <!-- 10 -->\n      <g transform=\"translate(88.840625 161.141354) scale(0.1 -0.1)\">\n       <defs>\n        <path id=\"DejaVuSans-31\" d=\"M 794 531 \nL 1825 531 \nL 1825 4091 \nL 703 3866 \nL 703 4441 \nL 1819 4666 \nL 2450 4666 \nL 2450 531 \nL 3481 531 \nL 3481 0 \nL 794 0 \nL 794 531 \nz\n\" transform=\"scale(0.015625)\"/>\n       </defs>\n       <use xlink:href=\"#DejaVuSans-31\"/>\n       <use xlink:href=\"#DejaVuSans-30\" transform=\"translate(63.623047 0)\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_4\">\n     <g id=\"line2d_4\">\n      <g>\n       <use xlink:href=\"#m06b58a9cfd\" x=\"127.753125\" y=\"146.542916\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_4\">\n      <!-- 15 -->\n      <g transform=\"translate(121.390625 161.141354) scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-31\"/>\n       <use xlink:href=\"#DejaVuSans-35\" transform=\"translate(63.623047 0)\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_5\">\n     <g id=\"line2d_5\">\n      <g>\n       <use xlink:href=\"#m06b58a9cfd\" x=\"160.303125\" y=\"146.542916\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_5\">\n      <!-- 20 -->\n      <g transform=\"translate(153.940625 161.141354) scale(0.1 -0.1)\">\n       <defs>\n        <path id=\"DejaVuSans-32\" d=\"M 1228 531 \nL 3431 531 \nL 3431 0 \nL 469 0 \nL 469 531 \nQ 828 903 1448 1529 \nQ 2069 2156 2228 2338 \nQ 2531 2678 2651 2914 \nQ 2772 3150 2772 3378 \nQ 2772 3750 2511 3984 \nQ 2250 4219 1831 4219 \nQ 1534 4219 1204 4116 \nQ 875 4013 500 3803 \nL 500 4441 \nQ 881 4594 1212 4672 \nQ 1544 4750 1819 4750 \nQ 2544 4750 2975 4387 \nQ 3406 4025 3406 3419 \nQ 3406 3131 3298 2873 \nQ 3191 2616 2906 2266 \nQ 2828 2175 2409 1742 \nQ 1991 1309 1228 531 \nz\n\" transform=\"scale(0.015625)\"/>\n       </defs>\n       <use xlink:href=\"#DejaVuSans-32\"/>\n       <use xlink:href=\"#DejaVuSans-30\" transform=\"translate(63.623047 0)\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_6\">\n     <g id=\"line2d_6\">\n      <g>\n       <use xlink:href=\"#m06b58a9cfd\" x=\"192.853125\" y=\"146.542916\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_6\">\n      <!-- 25 -->\n      <g transform=\"translate(186.490625 161.141354) scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-32\"/>\n       <use xlink:href=\"#DejaVuSans-35\" transform=\"translate(63.623047 0)\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_7\">\n     <g id=\"line2d_7\">\n      <g>\n       <use xlink:href=\"#m06b58a9cfd\" x=\"225.403125\" y=\"146.542916\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_7\">\n      <!-- 30 -->\n      <g transform=\"translate(219.040625 161.141354) scale(0.1 -0.1)\">\n       <defs>\n        <path id=\"DejaVuSans-33\" d=\"M 2597 2516 \nQ 3050 2419 3304 2112 \nQ 3559 1806 3559 1356 \nQ 3559 666 3084 287 \nQ 2609 -91 1734 -91 \nQ 1441 -91 1130 -33 \nQ 819 25 488 141 \nL 488 750 \nQ 750 597 1062 519 \nQ 1375 441 1716 441 \nQ 2309 441 2620 675 \nQ 2931 909 2931 1356 \nQ 2931 1769 2642 2001 \nQ 2353 2234 1838 2234 \nL 1294 2234 \nL 1294 2753 \nL 1863 2753 \nQ 2328 2753 2575 2939 \nQ 2822 3125 2822 3475 \nQ 2822 3834 2567 4026 \nQ 2313 4219 1838 4219 \nQ 1578 4219 1281 4162 \nQ 984 4106 628 3988 \nL 628 4550 \nQ 988 4650 1302 4700 \nQ 1616 4750 1894 4750 \nQ 2613 4750 3031 4423 \nQ 3450 4097 3450 3541 \nQ 3450 3153 3228 2886 \nQ 3006 2619 2597 2516 \nz\n\" transform=\"scale(0.015625)\"/>\n       </defs>\n       <use xlink:href=\"#DejaVuSans-33\"/>\n       <use xlink:href=\"#DejaVuSans-30\" transform=\"translate(63.623047 0)\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"text_8\">\n     <!-- epoch -->\n     <g transform=\"translate(112.525 174.819479) scale(0.1 -0.1)\">\n      <defs>\n       <path id=\"DejaVuSans-65\" d=\"M 3597 1894 \nL 3597 1613 \nL 953 1613 \nQ 991 1019 1311 708 \nQ 1631 397 2203 397 \nQ 2534 397 2845 478 \nQ 3156 559 3463 722 \nL 3463 178 \nQ 3153 47 2828 -22 \nQ 2503 -91 2169 -91 \nQ 1331 -91 842 396 \nQ 353 884 353 1716 \nQ 353 2575 817 3079 \nQ 1281 3584 2069 3584 \nQ 2775 3584 3186 3129 \nQ 3597 2675 3597 1894 \nz\nM 3022 2063 \nQ 3016 2534 2758 2815 \nQ 2500 3097 2075 3097 \nQ 1594 3097 1305 2825 \nQ 1016 2553 972 2059 \nL 3022 2063 \nz\n\" transform=\"scale(0.015625)\"/>\n       <path id=\"DejaVuSans-70\" d=\"M 1159 525 \nL 1159 -1331 \nL 581 -1331 \nL 581 3500 \nL 1159 3500 \nL 1159 2969 \nQ 1341 3281 1617 3432 \nQ 1894 3584 2278 3584 \nQ 2916 3584 3314 3078 \nQ 3713 2572 3713 1747 \nQ 3713 922 3314 415 \nQ 2916 -91 2278 -91 \nQ 1894 -91 1617 61 \nQ 1341 213 1159 525 \nz\nM 3116 1747 \nQ 3116 2381 2855 2742 \nQ 2594 3103 2138 3103 \nQ 1681 3103 1420 2742 \nQ 1159 2381 1159 1747 \nQ 1159 1113 1420 752 \nQ 1681 391 2138 391 \nQ 2594 391 2855 752 \nQ 3116 1113 3116 1747 \nz\n\" transform=\"scale(0.015625)\"/>\n       <path id=\"DejaVuSans-6f\" d=\"M 1959 3097 \nQ 1497 3097 1228 2736 \nQ 959 2375 959 1747 \nQ 959 1119 1226 758 \nQ 1494 397 1959 397 \nQ 2419 397 2687 759 \nQ 2956 1122 2956 1747 \nQ 2956 2369 2687 2733 \nQ 2419 3097 1959 3097 \nz\nM 1959 3584 \nQ 2709 3584 3137 3096 \nQ 3566 2609 3566 1747 \nQ 3566 888 3137 398 \nQ 2709 -91 1959 -91 \nQ 1206 -91 779 398 \nQ 353 888 353 1747 \nQ 353 2609 779 3096 \nQ 1206 3584 1959 3584 \nz\n\" transform=\"scale(0.015625)\"/>\n       <path id=\"DejaVuSans-63\" d=\"M 3122 3366 \nL 3122 2828 \nQ 2878 2963 2633 3030 \nQ 2388 3097 2138 3097 \nQ 1578 3097 1268 2742 \nQ 959 2388 959 1747 \nQ 959 1106 1268 751 \nQ 1578 397 2138 397 \nQ 2388 397 2633 464 \nQ 2878 531 3122 666 \nL 3122 134 \nQ 2881 22 2623 -34 \nQ 2366 -91 2075 -91 \nQ 1284 -91 818 406 \nQ 353 903 353 1747 \nQ 353 2603 823 3093 \nQ 1294 3584 2113 3584 \nQ 2378 3584 2631 3529 \nQ 2884 3475 3122 3366 \nz\n\" transform=\"scale(0.015625)\"/>\n       <path id=\"DejaVuSans-68\" d=\"M 3513 2113 \nL 3513 0 \nL 2938 0 \nL 2938 2094 \nQ 2938 2591 2744 2837 \nQ 2550 3084 2163 3084 \nQ 1697 3084 1428 2787 \nQ 1159 2491 1159 1978 \nL 1159 0 \nL 581 0 \nL 581 4863 \nL 1159 4863 \nL 1159 2956 \nQ 1366 3272 1645 3428 \nQ 1925 3584 2291 3584 \nQ 2894 3584 3203 3211 \nQ 3513 2838 3513 2113 \nz\n\" transform=\"scale(0.015625)\"/>\n      </defs>\n      <use xlink:href=\"#DejaVuSans-65\"/>\n      <use xlink:href=\"#DejaVuSans-70\" transform=\"translate(61.523438 0)\"/>\n      <use xlink:href=\"#DejaVuSans-6f\" transform=\"translate(125 0)\"/>\n      <use xlink:href=\"#DejaVuSans-63\" transform=\"translate(186.181641 0)\"/>\n      <use xlink:href=\"#DejaVuSans-68\" transform=\"translate(241.162109 0)\"/>\n     </g>\n    </g>\n   </g>\n   <g id=\"matplotlib.axis_2\">\n    <g id=\"ytick_1\">\n     <g id=\"line2d_8\">\n      <defs>\n       <path id=\"ma53ca495a5\" d=\"M 0 0 \nL -3.5 0 \n\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </defs>\n      <g>\n       <use xlink:href=\"#ma53ca495a5\" x=\"30.103125\" y=\"127.914582\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_9\">\n      <!-- 0.5 -->\n      <g transform=\"translate(7.2 131.713801) scale(0.1 -0.1)\">\n       <defs>\n        <path id=\"DejaVuSans-2e\" d=\"M 684 794 \nL 1344 794 \nL 1344 0 \nL 684 0 \nL 684 794 \nz\n\" transform=\"scale(0.015625)\"/>\n       </defs>\n       <use xlink:href=\"#DejaVuSans-30\"/>\n       <use xlink:href=\"#DejaVuSans-2e\" transform=\"translate(63.623047 0)\"/>\n       <use xlink:href=\"#DejaVuSans-35\" transform=\"translate(95.410156 0)\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_2\">\n     <g id=\"line2d_9\">\n      <g>\n       <use xlink:href=\"#ma53ca495a5\" x=\"30.103125\" y=\"88.942794\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_10\">\n      <!-- 1.0 -->\n      <g transform=\"translate(7.2 92.742013) scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-31\"/>\n       <use xlink:href=\"#DejaVuSans-2e\" transform=\"translate(63.623047 0)\"/>\n       <use xlink:href=\"#DejaVuSans-30\" transform=\"translate(95.410156 0)\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_3\">\n     <g id=\"line2d_10\">\n      <g>\n       <use xlink:href=\"#ma53ca495a5\" x=\"30.103125\" y=\"49.971007\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_11\">\n      <!-- 1.5 -->\n      <g transform=\"translate(7.2 53.770225) scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-31\"/>\n       <use xlink:href=\"#DejaVuSans-2e\" transform=\"translate(63.623047 0)\"/>\n       <use xlink:href=\"#DejaVuSans-35\" transform=\"translate(95.410156 0)\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_4\">\n     <g id=\"line2d_11\">\n      <g>\n       <use xlink:href=\"#ma53ca495a5\" x=\"30.103125\" y=\"10.999219\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_12\">\n      <!-- 2.0 -->\n      <g transform=\"translate(7.2 14.798438) scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-32\"/>\n       <use xlink:href=\"#DejaVuSans-2e\" transform=\"translate(63.623047 0)\"/>\n       <use xlink:href=\"#DejaVuSans-30\" transform=\"translate(95.410156 0)\"/>\n      </g>\n     </g>\n    </g>\n   </g>\n   <g id=\"line2d_12\">\n    <path d=\"M 31.72367 14.242916 \nL 34.97867 69.430754 \nL 38.23367 82.875639 \nL 41.48867 86.044609 \nL 44.74367 89.720761 \nL 47.99867 90.931739 \nL 51.25367 92.12831 \nL 54.50867 91.847096 \nL 57.76367 94.689811 \nL 61.01867 94.382073 \nL 64.27367 99.311481 \nL 67.52867 97.013254 \nL 70.78367 99.109539 \nL 74.03867 99.90669 \nL 77.29367 100.220674 \nL 80.54867 97.874934 \nL 83.80367 103.466411 \nL 87.05867 101.670485 \nL 90.31367 105.964 \nL 93.56867 103.510081 \nL 96.82367 105.921441 \nL 100.07867 102.89427 \nL 103.33367 105.062439 \nL 106.58867 104.462565 \nL 109.84367 107.284182 \nL 113.09867 105.584596 \nL 116.35367 107.106584 \nL 119.60867 107.750484 \nL 122.86367 106.926079 \nL 126.11867 108.827752 \nL 129.37367 109.621626 \nL 132.62867 108.133771 \nL 135.88367 108.609485 \nL 139.13867 107.668019 \nL 142.39367 109.858592 \nL 145.64867 110.314008 \nL 148.90367 108.301376 \nL 152.15867 110.564343 \nL 155.41367 108.868371 \nL 158.66867 111.039384 \nL 161.92367 110.318896 \nL 165.17867 113.010723 \nL 168.43367 111.725406 \nL 171.68867 113.889654 \nL 174.94367 112.589119 \nL 178.19867 110.538476 \nL 181.45367 111.400657 \nL 184.70867 111.605848 \nL 187.96367 112.275787 \nL 191.21867 113.698649 \nL 194.47367 110.95156 \nL 197.72867 110.658351 \nL 200.98367 112.931904 \nL 204.23867 113.02162 \nL 207.49367 110.353395 \nL 210.74867 110.753275 \nL 214.00367 111.746159 \nL 217.25867 114.316608 \nL 220.51367 110.998167 \nL 223.76867 110.920307 \n\" clip-path=\"url(#p2f6ca2141f)\" style=\"fill: none; stroke: #1f77b4; stroke-width: 1.5; stroke-linecap: square\"/>\n   </g>\n   <g id=\"line2d_13\">\n    <path d=\"M 36.613125 102.932865 \nL 43.123125 99.649245 \nL 49.633125 98.184719 \nL 56.143125 98.076807 \nL 62.653125 97.737654 \nL 69.163125 97.498705 \nL 75.673125 96.897479 \nL 82.183125 96.635406 \nL 88.693125 96.396457 \nL 95.203125 96.311669 \nL 101.713125 96.635406 \nL 108.223125 96.535202 \nL 114.733125 95.987932 \nL 121.243125 96.265421 \nL 127.753125 96.473537 \nL 134.263125 95.918559 \nL 140.773125 95.987932 \nL 147.283125 96.373333 \nL 153.793125 95.872311 \nL 160.303125 95.702735 \nL 166.813125 95.440662 \nL 173.323125 95.44837 \nL 179.833125 95.44837 \nL 186.343125 95.371289 \nL 192.853125 95.394413 \nL 199.363125 95.294209 \nL 205.873125 95.371289 \nL 212.383125 95.194005 \nL 218.893125 95.255669 \nL 225.403125 95.240253 \n\" clip-path=\"url(#p2f6ca2141f)\" style=\"fill: none; stroke-dasharray: 5.55,2.4; stroke-dashoffset: 0; stroke: #ff7f0e; stroke-width: 1.5\"/>\n   </g>\n   <g id=\"line2d_14\">\n    <path d=\"M 36.613125 121.442886 \nL 43.123125 131.179314 \nL 49.633125 133.820402 \nL 56.143125 136.556777 \nL 62.653125 136.771616 \nL 69.163125 135.171963 \nL 75.673125 139.083572 \nL 82.183125 137.665395 \nL 88.693125 138.256567 \nL 95.203125 139.360581 \nL 101.713125 137.942409 \nL 108.223125 137.427218 \nL 114.733125 139.063144 \nL 121.243125 137.898947 \nL 127.753125 137.355054 \nL 134.263125 138.220972 \nL 140.773125 137.55205 \nL 147.283125 135.888965 \nL 153.793125 137.893206 \nL 160.303125 138.580307 \nL 166.813125 139.02051 \nL 173.323125 139.360821 \nL 179.833125 138.968468 \nL 186.343125 139.503135 \nL 192.853125 139.746215 \nL 199.363125 139.950145 \nL 205.873125 140.242916 \nL 212.383125 140.153073 \nL 218.893125 140.178962 \nL 225.403125 140.156555 \n\" clip-path=\"url(#p2f6ca2141f)\" style=\"fill: none; stroke-dasharray: 9.6,2.4,1.5,2.4; stroke-dashoffset: 0; stroke: #2ca02c; stroke-width: 1.5\"/>\n   </g>\n   <g id=\"patch_3\">\n    <path d=\"M 30.103125 146.542916 \nL 30.103125 7.942916 \n\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n   </g>\n   <g id=\"patch_4\">\n    <path d=\"M 225.403125 146.542916 \nL 225.403125 7.942916 \n\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n   </g>\n   <g id=\"patch_5\">\n    <path d=\"M 30.103125 146.542916 \nL 225.403125 146.542916 \n\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n   </g>\n   <g id=\"patch_6\">\n    <path d=\"M 30.103125 7.942916 \nL 225.403125 7.942916 \n\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n   </g>\n   <g id=\"legend_1\">\n    <g id=\"patch_7\">\n     <path d=\"M 138.8125 60.811666 \nL 218.403125 60.811666 \nQ 220.403125 60.811666 220.403125 58.811666 \nL 220.403125 14.942916 \nQ 220.403125 12.942916 218.403125 12.942916 \nL 138.8125 12.942916 \nQ 136.8125 12.942916 136.8125 14.942916 \nL 136.8125 58.811666 \nQ 136.8125 60.811666 138.8125 60.811666 \nz\n\" style=\"fill: #ffffff; opacity: 0.8; stroke: #cccccc; stroke-linejoin: miter\"/>\n    </g>\n    <g id=\"line2d_15\">\n     <path d=\"M 140.8125 21.041354 \nL 150.8125 21.041354 \nL 160.8125 21.041354 \n\" style=\"fill: none; stroke: #1f77b4; stroke-width: 1.5; stroke-linecap: square\"/>\n    </g>\n    <g id=\"text_13\">\n     <!-- train_loss -->\n     <g transform=\"translate(168.8125 24.541354) scale(0.1 -0.1)\">\n      <defs>\n       <path id=\"DejaVuSans-74\" d=\"M 1172 4494 \nL 1172 3500 \nL 2356 3500 \nL 2356 3053 \nL 1172 3053 \nL 1172 1153 \nQ 1172 725 1289 603 \nQ 1406 481 1766 481 \nL 2356 481 \nL 2356 0 \nL 1766 0 \nQ 1100 0 847 248 \nQ 594 497 594 1153 \nL 594 3053 \nL 172 3053 \nL 172 3500 \nL 594 3500 \nL 594 4494 \nL 1172 4494 \nz\n\" transform=\"scale(0.015625)\"/>\n       <path id=\"DejaVuSans-72\" d=\"M 2631 2963 \nQ 2534 3019 2420 3045 \nQ 2306 3072 2169 3072 \nQ 1681 3072 1420 2755 \nQ 1159 2438 1159 1844 \nL 1159 0 \nL 581 0 \nL 581 3500 \nL 1159 3500 \nL 1159 2956 \nQ 1341 3275 1631 3429 \nQ 1922 3584 2338 3584 \nQ 2397 3584 2469 3576 \nQ 2541 3569 2628 3553 \nL 2631 2963 \nz\n\" transform=\"scale(0.015625)\"/>\n       <path id=\"DejaVuSans-61\" d=\"M 2194 1759 \nQ 1497 1759 1228 1600 \nQ 959 1441 959 1056 \nQ 959 750 1161 570 \nQ 1363 391 1709 391 \nQ 2188 391 2477 730 \nQ 2766 1069 2766 1631 \nL 2766 1759 \nL 2194 1759 \nz\nM 3341 1997 \nL 3341 0 \nL 2766 0 \nL 2766 531 \nQ 2569 213 2275 61 \nQ 1981 -91 1556 -91 \nQ 1019 -91 701 211 \nQ 384 513 384 1019 \nQ 384 1609 779 1909 \nQ 1175 2209 1959 2209 \nL 2766 2209 \nL 2766 2266 \nQ 2766 2663 2505 2880 \nQ 2244 3097 1772 3097 \nQ 1472 3097 1187 3025 \nQ 903 2953 641 2809 \nL 641 3341 \nQ 956 3463 1253 3523 \nQ 1550 3584 1831 3584 \nQ 2591 3584 2966 3190 \nQ 3341 2797 3341 1997 \nz\n\" transform=\"scale(0.015625)\"/>\n       <path id=\"DejaVuSans-69\" d=\"M 603 3500 \nL 1178 3500 \nL 1178 0 \nL 603 0 \nL 603 3500 \nz\nM 603 4863 \nL 1178 4863 \nL 1178 4134 \nL 603 4134 \nL 603 4863 \nz\n\" transform=\"scale(0.015625)\"/>\n       <path id=\"DejaVuSans-6e\" d=\"M 3513 2113 \nL 3513 0 \nL 2938 0 \nL 2938 2094 \nQ 2938 2591 2744 2837 \nQ 2550 3084 2163 3084 \nQ 1697 3084 1428 2787 \nQ 1159 2491 1159 1978 \nL 1159 0 \nL 581 0 \nL 581 3500 \nL 1159 3500 \nL 1159 2956 \nQ 1366 3272 1645 3428 \nQ 1925 3584 2291 3584 \nQ 2894 3584 3203 3211 \nQ 3513 2838 3513 2113 \nz\n\" transform=\"scale(0.015625)\"/>\n       <path id=\"DejaVuSans-5f\" d=\"M 3263 -1063 \nL 3263 -1509 \nL -63 -1509 \nL -63 -1063 \nL 3263 -1063 \nz\n\" transform=\"scale(0.015625)\"/>\n       <path id=\"DejaVuSans-6c\" d=\"M 603 4863 \nL 1178 4863 \nL 1178 0 \nL 603 0 \nL 603 4863 \nz\n\" transform=\"scale(0.015625)\"/>\n       <path id=\"DejaVuSans-73\" d=\"M 2834 3397 \nL 2834 2853 \nQ 2591 2978 2328 3040 \nQ 2066 3103 1784 3103 \nQ 1356 3103 1142 2972 \nQ 928 2841 928 2578 \nQ 928 2378 1081 2264 \nQ 1234 2150 1697 2047 \nL 1894 2003 \nQ 2506 1872 2764 1633 \nQ 3022 1394 3022 966 \nQ 3022 478 2636 193 \nQ 2250 -91 1575 -91 \nQ 1294 -91 989 -36 \nQ 684 19 347 128 \nL 347 722 \nQ 666 556 975 473 \nQ 1284 391 1588 391 \nQ 1994 391 2212 530 \nQ 2431 669 2431 922 \nQ 2431 1156 2273 1281 \nQ 2116 1406 1581 1522 \nL 1381 1569 \nQ 847 1681 609 1914 \nQ 372 2147 372 2553 \nQ 372 3047 722 3315 \nQ 1072 3584 1716 3584 \nQ 2034 3584 2315 3537 \nQ 2597 3491 2834 3397 \nz\n\" transform=\"scale(0.015625)\"/>\n      </defs>\n      <use xlink:href=\"#DejaVuSans-74\"/>\n      <use xlink:href=\"#DejaVuSans-72\" transform=\"translate(39.208984 0)\"/>\n      <use xlink:href=\"#DejaVuSans-61\" transform=\"translate(80.322266 0)\"/>\n      <use xlink:href=\"#DejaVuSans-69\" transform=\"translate(141.601562 0)\"/>\n      <use xlink:href=\"#DejaVuSans-6e\" transform=\"translate(169.384766 0)\"/>\n      <use xlink:href=\"#DejaVuSans-5f\" transform=\"translate(232.763672 0)\"/>\n      <use xlink:href=\"#DejaVuSans-6c\" transform=\"translate(282.763672 0)\"/>\n      <use xlink:href=\"#DejaVuSans-6f\" transform=\"translate(310.546875 0)\"/>\n      <use xlink:href=\"#DejaVuSans-73\" transform=\"translate(371.728516 0)\"/>\n      <use xlink:href=\"#DejaVuSans-73\" transform=\"translate(423.828125 0)\"/>\n     </g>\n    </g>\n    <g id=\"line2d_16\">\n     <path d=\"M 140.8125 35.997604 \nL 150.8125 35.997604 \nL 160.8125 35.997604 \n\" style=\"fill: none; stroke-dasharray: 5.55,2.4; stroke-dashoffset: 0; stroke: #ff7f0e; stroke-width: 1.5\"/>\n    </g>\n    <g id=\"text_14\">\n     <!-- val_acc -->\n     <g transform=\"translate(168.8125 39.497604) scale(0.1 -0.1)\">\n      <defs>\n       <path id=\"DejaVuSans-76\" d=\"M 191 3500 \nL 800 3500 \nL 1894 563 \nL 2988 3500 \nL 3597 3500 \nL 2284 0 \nL 1503 0 \nL 191 3500 \nz\n\" transform=\"scale(0.015625)\"/>\n      </defs>\n      <use xlink:href=\"#DejaVuSans-76\"/>\n      <use xlink:href=\"#DejaVuSans-61\" transform=\"translate(59.179688 0)\"/>\n      <use xlink:href=\"#DejaVuSans-6c\" transform=\"translate(120.458984 0)\"/>\n      <use xlink:href=\"#DejaVuSans-5f\" transform=\"translate(148.242188 0)\"/>\n      <use xlink:href=\"#DejaVuSans-61\" transform=\"translate(198.242188 0)\"/>\n      <use xlink:href=\"#DejaVuSans-63\" transform=\"translate(259.521484 0)\"/>\n      <use xlink:href=\"#DejaVuSans-63\" transform=\"translate(314.501953 0)\"/>\n     </g>\n    </g>\n    <g id=\"line2d_17\">\n     <path d=\"M 140.8125 50.953854 \nL 150.8125 50.953854 \nL 160.8125 50.953854 \n\" style=\"fill: none; stroke-dasharray: 9.6,2.4,1.5,2.4; stroke-dashoffset: 0; stroke: #2ca02c; stroke-width: 1.5\"/>\n    </g>\n    <g id=\"text_15\">\n     <!-- val_loss -->\n     <g transform=\"translate(168.8125 54.453854) scale(0.1 -0.1)\">\n      <use xlink:href=\"#DejaVuSans-76\"/>\n      <use xlink:href=\"#DejaVuSans-61\" transform=\"translate(59.179688 0)\"/>\n      <use xlink:href=\"#DejaVuSans-6c\" transform=\"translate(120.458984 0)\"/>\n      <use xlink:href=\"#DejaVuSans-5f\" transform=\"translate(148.242188 0)\"/>\n      <use xlink:href=\"#DejaVuSans-6c\" transform=\"translate(198.242188 0)\"/>\n      <use xlink:href=\"#DejaVuSans-6f\" transform=\"translate(226.025391 0)\"/>\n      <use xlink:href=\"#DejaVuSans-73\" transform=\"translate(287.207031 0)\"/>\n      <use xlink:href=\"#DejaVuSans-73\" transform=\"translate(339.306641 0)\"/>\n     </g>\n    </g>\n   </g>\n  </g>\n </g>\n <defs>\n  <clipPath id=\"p2f6ca2141f\">\n   <rect x=\"30.103125\" y=\"7.942916\" width=\"195.3\" height=\"138.6\"/>\n  </clipPath>\n </defs>\n</svg>\n"
     },
     "metadata": {}
    },
    {
     "output_type": "display_data",
     "data": {
      "image/svg+xml": "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n  \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n<svg xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"238.965625pt\" height=\"183.35625pt\" viewBox=\"0 0 238.965625 183.35625\" xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\">\n <metadata>\n  <rdf:RDF xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:cc=\"http://creativecommons.org/ns#\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n   <cc:Work>\n    <dc:type rdf:resource=\"http://purl.org/dc/dcmitype/StillImage\"/>\n    <dc:date>2026-07-19T15:02:28.733577</dc:date>\n    <dc:format>image/svg+xml</dc:format>\n    <dc:creator>\n     <cc:Agent>\n      <dc:title>Matplotlib v3.10.8, https://matplotlib.org/</dc:title>\n     </cc:Agent>\n    </dc:creator>\n   </cc:Work>\n  </rdf:RDF>\n </metadata>\n <defs>\n  <style type=\"text/css\">*{stroke-linejoin: round; stroke-linecap: butt}</style>\n </defs>\n <g id=\"figure_1\">\n  <g id=\"patch_1\">\n   <path d=\"M 0 183.35625 \nL 238.965625 183.35625 \nL 238.965625 0 \nL 0 0 \nz\n\" style=\"fill: #ffffff\"/>\n  </g>\n  <g id=\"axes_1\">\n   <g id=\"patch_2\">\n    <path d=\"M 30.103125 145.8 \nL 225.403125 145.8 \nL 225.403125 7.2 \nL 30.103125 7.2 \nz\n\" style=\"fill: #ffffff\"/>\n   </g>\n   <g id=\"matplotlib.axis_1\">\n    <g id=\"xtick_1\">\n     <g id=\"line2d_1\">\n      <defs>\n       <path id=\"m577af0d656\" d=\"M 0 0 \nL 0 3.5 \n\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </defs>\n      <g>\n       <use xlink:href=\"#m577af0d656\" x=\"30.103125\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_1\">\n      <!-- 0 -->\n      <g transform=\"translate(26.921875 160.398438) scale(0.1 -0.1)\">\n       <defs>\n        <path id=\"DejaVuSans-30\" d=\"M 2034 4250 \nQ 1547 4250 1301 3770 \nQ 1056 3291 1056 2328 \nQ 1056 1369 1301 889 \nQ 1547 409 2034 409 \nQ 2525 409 2770 889 \nQ 3016 1369 3016 2328 \nQ 3016 3291 2770 3770 \nQ 2525 4250 2034 4250 \nz\nM 2034 4750 \nQ 2819 4750 3233 4129 \nQ 3647 3509 3647 2328 \nQ 3647 1150 3233 529 \nQ 2819 -91 2034 -91 \nQ 1250 -91 836 529 \nQ 422 1150 422 2328 \nQ 422 3509 836 4129 \nQ 1250 4750 2034 4750 \nz\n\" transform=\"scale(0.015625)\"/>\n       </defs>\n       <use xlink:href=\"#DejaVuSans-30\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_2\">\n     <g id=\"line2d_2\">\n      <g>\n       <use xlink:href=\"#m577af0d656\" x=\"62.653125\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_2\">\n      <!-- 5 -->\n      <g transform=\"translate(59.471875 160.398438) scale(0.1 -0.1)\">\n       <defs>\n        <path id=\"DejaVuSans-35\" d=\"M 691 4666 \nL 3169 4666 \nL 3169 4134 \nL 1269 4134 \nL 1269 2991 \nQ 1406 3038 1543 3061 \nQ 1681 3084 1819 3084 \nQ 2600 3084 3056 2656 \nQ 3513 2228 3513 1497 \nQ 3513 744 3044 326 \nQ 2575 -91 1722 -91 \nQ 1428 -91 1123 -41 \nQ 819 9 494 109 \nL 494 744 \nQ 775 591 1075 516 \nQ 1375 441 1709 441 \nQ 2250 441 2565 725 \nQ 2881 1009 2881 1497 \nQ 2881 1984 2565 2268 \nQ 2250 2553 1709 2553 \nQ 1456 2553 1204 2497 \nQ 953 2441 691 2322 \nL 691 4666 \nz\n\" transform=\"scale(0.015625)\"/>\n       </defs>\n       <use xlink:href=\"#DejaVuSans-35\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_3\">\n     <g id=\"line2d_3\">\n      <g>\n       <use xlink:href=\"#m577af0d656\" x=\"95.203125\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_3\">\n      <!-- 10 -->\n      <g transform=\"translate(88.840625 160.398438) scale(0.1 -0.1)\">\n       <defs>\n        <path id=\"DejaVuSans-31\" d=\"M 794 531 \nL 1825 531 \nL 1825 4091 \nL 703 3866 \nL 703 4441 \nL 1819 4666 \nL 2450 4666 \nL 2450 531 \nL 3481 531 \nL 3481 0 \nL 794 0 \nL 794 531 \nz\n\" transform=\"scale(0.015625)\"/>\n       </defs>\n       <use xlink:href=\"#DejaVuSans-31\"/>\n       <use xlink:href=\"#DejaVuSans-30\" transform=\"translate(63.623047 0)\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_4\">\n     <g id=\"line2d_4\">\n      <g>\n       <use xlink:href=\"#m577af0d656\" x=\"127.753125\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_4\">\n      <!-- 15 -->\n      <g transform=\"translate(121.390625 160.398438) scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-31\"/>\n       <use xlink:href=\"#DejaVuSans-35\" transform=\"translate(63.623047 0)\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_5\">\n     <g id=\"line2d_5\">\n      <g>\n       <use xlink:href=\"#m577af0d656\" x=\"160.303125\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_5\">\n      <!-- 20 -->\n      <g transform=\"translate(153.940625 160.398438) scale(0.1 -0.1)\">\n       <defs>\n        <path id=\"DejaVuSans-32\" d=\"M 1228 531 \nL 3431 531 \nL 3431 0 \nL 469 0 \nL 469 531 \nQ 828 903 1448 1529 \nQ 2069 2156 2228 2338 \nQ 2531 2678 2651 2914 \nQ 2772 3150 2772 3378 \nQ 2772 3750 2511 3984 \nQ 2250 4219 1831 4219 \nQ 1534 4219 1204 4116 \nQ 875 4013 500 3803 \nL 500 4441 \nQ 881 4594 1212 4672 \nQ 1544 4750 1819 4750 \nQ 2544 4750 2975 4387 \nQ 3406 4025 3406 3419 \nQ 3406 3131 3298 2873 \nQ 3191 2616 2906 2266 \nQ 2828 2175 2409 1742 \nQ 1991 1309 1228 531 \nz\n\" transform=\"scale(0.015625)\"/>\n       </defs>\n       <use xlink:href=\"#DejaVuSans-32\"/>\n       <use xlink:href=\"#DejaVuSans-30\" transform=\"translate(63.623047 0)\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_6\">\n     <g id=\"line2d_6\">\n      <g>\n       <use xlink:href=\"#m577af0d656\" x=\"192.853125\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_6\">\n      <!-- 25 -->\n      <g transform=\"translate(186.490625 160.398438) scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-32\"/>\n       <use xlink:href=\"#DejaVuSans-35\" transform=\"translate(63.623047 0)\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_7\">\n     <g id=\"line2d_7\">\n      <g>\n       <use xlink:href=\"#m577af0d656\" x=\"225.403125\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_7\">\n      <!-- 30 -->\n      <g transform=\"translate(219.040625 160.398438) scale(0.1 -0.1)\">\n       <defs>\n        <path id=\"DejaVuSans-33\" d=\"M 2597 2516 \nQ 3050 2419 3304 2112 \nQ 3559 1806 3559 1356 \nQ 3559 666 3084 287 \nQ 2609 -91 1734 -91 \nQ 1441 -91 1130 -33 \nQ 819 25 488 141 \nL 488 750 \nQ 750 597 1062 519 \nQ 1375 441 1716 441 \nQ 2309 441 2620 675 \nQ 2931 909 2931 1356 \nQ 2931 1769 2642 2001 \nQ 2353 2234 1838 2234 \nL 1294 2234 \nL 1294 2753 \nL 1863 2753 \nQ 2328 2753 2575 2939 \nQ 2822 3125 2822 3475 \nQ 2822 3834 2567 4026 \nQ 2313 4219 1838 4219 \nQ 1578 4219 1281 4162 \nQ 984 4106 628 3988 \nL 628 4550 \nQ 988 4650 1302 4700 \nQ 1616 4750 1894 4750 \nQ 2613 4750 3031 4423 \nQ 3450 4097 3450 3541 \nQ 3450 3153 3228 2886 \nQ 3006 2619 2597 2516 \nz\n\" transform=\"scale(0.015625)\"/>\n       </defs>\n       <use xlink:href=\"#DejaVuSans-33\"/>\n       <use xlink:href=\"#DejaVuSans-30\" transform=\"translate(63.623047 0)\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"text_8\">\n     <!-- epoch -->\n     <g transform=\"translate(112.525 174.076563) scale(0.1 -0.1)\">\n      <defs>\n       <path id=\"DejaVuSans-65\" d=\"M 3597 1894 \nL 3597 1613 \nL 953 1613 \nQ 991 1019 1311 708 \nQ 1631 397 2203 397 \nQ 2534 397 2845 478 \nQ 3156 559 3463 722 \nL 3463 178 \nQ 3153 47 2828 -22 \nQ 2503 -91 2169 -91 \nQ 1331 -91 842 396 \nQ 353 884 353 1716 \nQ 353 2575 817 3079 \nQ 1281 3584 2069 3584 \nQ 2775 3584 3186 3129 \nQ 3597 2675 3597 1894 \nz\nM 3022 2063 \nQ 3016 2534 2758 2815 \nQ 2500 3097 2075 3097 \nQ 1594 3097 1305 2825 \nQ 1016 2553 972 2059 \nL 3022 2063 \nz\n\" transform=\"scale(0.015625)\"/>\n       <path id=\"DejaVuSans-70\" d=\"M 1159 525 \nL 1159 -1331 \nL 581 -1331 \nL 581 3500 \nL 1159 3500 \nL 1159 2969 \nQ 1341 3281 1617 3432 \nQ 1894 3584 2278 3584 \nQ 2916 3584 3314 3078 \nQ 3713 2572 3713 1747 \nQ 3713 922 3314 415 \nQ 2916 -91 2278 -91 \nQ 1894 -91 1617 61 \nQ 1341 213 1159 525 \nz\nM 3116 1747 \nQ 3116 2381 2855 2742 \nQ 2594 3103 2138 3103 \nQ 1681 3103 1420 2742 \nQ 1159 2381 1159 1747 \nQ 1159 1113 1420 752 \nQ 1681 391 2138 391 \nQ 2594 391 2855 752 \nQ 3116 1113 3116 1747 \nz\n\" transform=\"scale(0.015625)\"/>\n       <path id=\"DejaVuSans-6f\" d=\"M 1959 3097 \nQ 1497 3097 1228 2736 \nQ 959 2375 959 1747 \nQ 959 1119 1226 758 \nQ 1494 397 1959 397 \nQ 2419 397 2687 759 \nQ 2956 1122 2956 1747 \nQ 2956 2369 2687 2733 \nQ 2419 3097 1959 3097 \nz\nM 1959 3584 \nQ 2709 3584 3137 3096 \nQ 3566 2609 3566 1747 \nQ 3566 888 3137 398 \nQ 2709 -91 1959 -91 \nQ 1206 -91 779 398 \nQ 353 888 353 1747 \nQ 353 2609 779 3096 \nQ 1206 3584 1959 3584 \nz\n\" transform=\"scale(0.015625)\"/>\n       <path id=\"DejaVuSans-63\" d=\"M 3122 3366 \nL 3122 2828 \nQ 2878 2963 2633 3030 \nQ 2388 3097 2138 3097 \nQ 1578 3097 1268 2742 \nQ 959 2388 959 1747 \nQ 959 1106 1268 751 \nQ 1578 397 2138 397 \nQ 2388 397 2633 464 \nQ 2878 531 3122 666 \nL 3122 134 \nQ 2881 22 2623 -34 \nQ 2366 -91 2075 -91 \nQ 1284 -91 818 406 \nQ 353 903 353 1747 \nQ 353 2603 823 3093 \nQ 1294 3584 2113 3584 \nQ 2378 3584 2631 3529 \nQ 2884 3475 3122 3366 \nz\n\" transform=\"scale(0.015625)\"/>\n       <path id=\"DejaVuSans-68\" d=\"M 3513 2113 \nL 3513 0 \nL 2938 0 \nL 2938 2094 \nQ 2938 2591 2744 2837 \nQ 2550 3084 2163 3084 \nQ 1697 3084 1428 2787 \nQ 1159 2491 1159 1978 \nL 1159 0 \nL 581 0 \nL 581 4863 \nL 1159 4863 \nL 1159 2956 \nQ 1366 3272 1645 3428 \nQ 1925 3584 2291 3584 \nQ 2894 3584 3203 3211 \nQ 3513 2838 3513 2113 \nz\n\" transform=\"scale(0.015625)\"/>\n      </defs>\n      <use xlink:href=\"#DejaVuSans-65\"/>\n      <use xlink:href=\"#DejaVuSans-70\" transform=\"translate(61.523438 0)\"/>\n      <use xlink:href=\"#DejaVuSans-6f\" transform=\"translate(125 0)\"/>\n      <use xlink:href=\"#DejaVuSans-63\" transform=\"translate(186.181641 0)\"/>\n      <use xlink:href=\"#DejaVuSans-68\" transform=\"translate(241.162109 0)\"/>\n     </g>\n    </g>\n   </g>\n   <g id=\"matplotlib.axis_2\">\n    <g id=\"ytick_1\">\n     <g id=\"line2d_8\">\n      <defs>\n       <path id=\"m3c220f122b\" d=\"M 0 0 \nL -3.5 0 \n\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </defs>\n      <g>\n       <use xlink:href=\"#m3c220f122b\" x=\"30.103125\" y=\"125.643174\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_9\">\n      <!-- 0.4 -->\n      <g transform=\"translate(7.2 129.442392) scale(0.1 -0.1)\">\n       <defs>\n        <path id=\"DejaVuSans-2e\" d=\"M 684 794 \nL 1344 794 \nL 1344 0 \nL 684 0 \nL 684 794 \nz\n\" transform=\"scale(0.015625)\"/>\n        <path id=\"DejaVuSans-34\" d=\"M 2419 4116 \nL 825 1625 \nL 2419 1625 \nL 2419 4116 \nz\nM 2253 4666 \nL 3047 4666 \nL 3047 1625 \nL 3713 1625 \nL 3713 1100 \nL 3047 1100 \nL 3047 0 \nL 2419 0 \nL 2419 1100 \nL 313 1100 \nL 313 1709 \nL 2253 4666 \nz\n\" transform=\"scale(0.015625)\"/>\n       </defs>\n       <use xlink:href=\"#DejaVuSans-30\"/>\n       <use xlink:href=\"#DejaVuSans-2e\" transform=\"translate(63.623047 0)\"/>\n       <use xlink:href=\"#DejaVuSans-34\" transform=\"translate(95.410156 0)\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_2\">\n     <g id=\"line2d_9\">\n      <g>\n       <use xlink:href=\"#m3c220f122b\" x=\"30.103125\" y=\"100.688213\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_10\">\n      <!-- 0.6 -->\n      <g transform=\"translate(7.2 104.487431) scale(0.1 -0.1)\">\n       <defs>\n        <path id=\"DejaVuSans-36\" d=\"M 2113 2584 \nQ 1688 2584 1439 2293 \nQ 1191 2003 1191 1497 \nQ 1191 994 1439 701 \nQ 1688 409 2113 409 \nQ 2538 409 2786 701 \nQ 3034 994 3034 1497 \nQ 3034 2003 2786 2293 \nQ 2538 2584 2113 2584 \nz\nM 3366 4563 \nL 3366 3988 \nQ 3128 4100 2886 4159 \nQ 2644 4219 2406 4219 \nQ 1781 4219 1451 3797 \nQ 1122 3375 1075 2522 \nQ 1259 2794 1537 2939 \nQ 1816 3084 2150 3084 \nQ 2853 3084 3261 2657 \nQ 3669 2231 3669 1497 \nQ 3669 778 3244 343 \nQ 2819 -91 2113 -91 \nQ 1303 -91 875 529 \nQ 447 1150 447 2328 \nQ 447 3434 972 4092 \nQ 1497 4750 2381 4750 \nQ 2619 4750 2861 4703 \nQ 3103 4656 3366 4563 \nz\n\" transform=\"scale(0.015625)\"/>\n       </defs>\n       <use xlink:href=\"#DejaVuSans-30\"/>\n       <use xlink:href=\"#DejaVuSans-2e\" transform=\"translate(63.623047 0)\"/>\n       <use xlink:href=\"#DejaVuSans-36\" transform=\"translate(95.410156 0)\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_3\">\n     <g id=\"line2d_10\">\n      <g>\n       <use xlink:href=\"#m3c220f122b\" x=\"30.103125\" y=\"75.733252\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_11\">\n      <!-- 0.8 -->\n      <g transform=\"translate(7.2 79.532471) scale(0.1 -0.1)\">\n       <defs>\n        <path id=\"DejaVuSans-38\" d=\"M 2034 2216 \nQ 1584 2216 1326 1975 \nQ 1069 1734 1069 1313 \nQ 1069 891 1326 650 \nQ 1584 409 2034 409 \nQ 2484 409 2743 651 \nQ 3003 894 3003 1313 \nQ 3003 1734 2745 1975 \nQ 2488 2216 2034 2216 \nz\nM 1403 2484 \nQ 997 2584 770 2862 \nQ 544 3141 544 3541 \nQ 544 4100 942 4425 \nQ 1341 4750 2034 4750 \nQ 2731 4750 3128 4425 \nQ 3525 4100 3525 3541 \nQ 3525 3141 3298 2862 \nQ 3072 2584 2669 2484 \nQ 3125 2378 3379 2068 \nQ 3634 1759 3634 1313 \nQ 3634 634 3220 271 \nQ 2806 -91 2034 -91 \nQ 1263 -91 848 271 \nQ 434 634 434 1313 \nQ 434 1759 690 2068 \nQ 947 2378 1403 2484 \nz\nM 1172 3481 \nQ 1172 3119 1398 2916 \nQ 1625 2713 2034 2713 \nQ 2441 2713 2670 2916 \nQ 2900 3119 2900 3481 \nQ 2900 3844 2670 4047 \nQ 2441 4250 2034 4250 \nQ 1625 4250 1398 4047 \nQ 1172 3844 1172 3481 \nz\n\" transform=\"scale(0.015625)\"/>\n       </defs>\n       <use xlink:href=\"#DejaVuSans-30\"/>\n       <use xlink:href=\"#DejaVuSans-2e\" transform=\"translate(63.623047 0)\"/>\n       <use xlink:href=\"#DejaVuSans-38\" transform=\"translate(95.410156 0)\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_4\">\n     <g id=\"line2d_11\">\n      <g>\n       <use xlink:href=\"#m3c220f122b\" x=\"30.103125\" y=\"50.778291\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_12\">\n      <!-- 1.0 -->\n      <g transform=\"translate(7.2 54.57751) scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-31\"/>\n       <use xlink:href=\"#DejaVuSans-2e\" transform=\"translate(63.623047 0)\"/>\n       <use xlink:href=\"#DejaVuSans-30\" transform=\"translate(95.410156 0)\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_5\">\n     <g id=\"line2d_12\">\n      <g>\n       <use xlink:href=\"#m3c220f122b\" x=\"30.103125\" y=\"25.82333\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_13\">\n      <!-- 1.2 -->\n      <g transform=\"translate(7.2 29.622549) scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-31\"/>\n       <use xlink:href=\"#DejaVuSans-2e\" transform=\"translate(63.623047 0)\"/>\n       <use xlink:href=\"#DejaVuSans-32\" transform=\"translate(95.410156 0)\"/>\n      </g>\n     </g>\n    </g>\n   </g>\n   <g id=\"line2d_13\">\n    <path d=\"M 31.72367 13.5 \nL 34.97867 50.674746 \nL 38.23367 56.851422 \nL 41.48867 58.886783 \nL 44.74367 63.912362 \nL 47.99867 62.532088 \nL 51.25367 64.162399 \nL 54.50867 64.161891 \nL 57.76367 67.596891 \nL 61.01867 66.424598 \nL 64.27367 70.207621 \nL 67.52867 67.149309 \nL 70.78367 70.330438 \nL 74.03867 69.642156 \nL 77.29367 74.765498 \nL 80.54867 71.455762 \nL 83.80367 74.548515 \nL 87.05867 72.403536 \nL 90.31367 76.17047 \nL 93.56867 73.594564 \nL 96.82367 73.567238 \nL 100.07867 72.973468 \nL 103.33367 80.234769 \nL 106.58867 78.650932 \nL 109.84367 82.433247 \nL 113.09867 77.587237 \nL 116.35367 80.781403 \nL 119.60867 82.057838 \nL 122.86367 80.857476 \nL 126.11867 81.082914 \nL 129.37367 80.190647 \nL 132.62867 83.723725 \nL 135.88367 81.628857 \nL 139.13867 81.649448 \nL 142.39367 81.664539 \nL 145.64867 83.728533 \nL 148.90367 85.140876 \nL 152.15867 83.085448 \nL 155.41367 83.21089 \nL 158.66867 84.847874 \nL 161.92367 88.325062 \nL 165.17867 86.849032 \nL 168.43367 83.852042 \nL 171.68867 82.281936 \nL 174.94367 85.875812 \nL 178.19867 85.990322 \nL 181.45367 87.979824 \nL 184.70867 84.350007 \nL 187.96367 86.539083 \nL 191.21867 89.126017 \nL 194.47367 88.563807 \nL 197.72867 89.16214 \nL 200.98367 87.326387 \nL 204.23867 85.279235 \nL 207.49367 89.36581 \nL 210.74867 87.530287 \nL 214.00367 88.061107 \nL 217.25867 89.929777 \nL 220.51367 88.717487 \nL 223.76867 85.721275 \n\" clip-path=\"url(#pa3d6b5bf07)\" style=\"fill: none; stroke: #1f77b4; stroke-width: 1.5; stroke-linecap: square\"/>\n   </g>\n   <g id=\"line2d_14\">\n    <path d=\"M 36.613125 70.595176 \nL 43.123125 66.177713 \nL 49.633125 63.759214 \nL 56.143125 62.80909 \nL 62.653125 62.883125 \nL 69.163125 61.501126 \nL 75.673125 61.192644 \nL 82.183125 61.575162 \nL 88.693125 60.291876 \nL 95.203125 60.526323 \nL 101.713125 61.155626 \nL 108.223125 62.735054 \nL 114.733125 59.625555 \nL 121.243125 59.613216 \nL 127.753125 60.625037 \nL 134.263125 58.835841 \nL 140.773125 59.526841 \nL 147.283125 59.662573 \nL 153.793125 58.601395 \nL 160.303125 58.613734 \nL 166.813125 58.403966 \nL 173.323125 58.132502 \nL 179.833125 58.070806 \nL 186.343125 58.194199 \nL 192.853125 58.144842 \nL 199.363125 57.885717 \nL 205.873125 57.861038 \nL 212.383125 57.873377 \nL 218.893125 57.922735 \nL 225.403125 57.984431 \n\" clip-path=\"url(#pa3d6b5bf07)\" style=\"fill: none; stroke-dasharray: 5.55,2.4; stroke-dashoffset: 0; stroke: #ff7f0e; stroke-width: 1.5\"/>\n   </g>\n   <g id=\"line2d_15\">\n    <path d=\"M 36.613125 102.382813 \nL 43.123125 113.994135 \nL 49.633125 124.0193 \nL 56.143125 124.011005 \nL 62.653125 125.733335 \nL 69.163125 132.487003 \nL 75.673125 132.88591 \nL 82.183125 132.632867 \nL 88.693125 134.52068 \nL 95.203125 135.563772 \nL 101.713125 133.943928 \nL 108.223125 130.694393 \nL 114.733125 136.994529 \nL 121.243125 135.566388 \nL 127.753125 133.916846 \nL 134.263125 138.811554 \nL 140.773125 136.555907 \nL 147.283125 135.692724 \nL 153.793125 137.334667 \nL 160.303125 137.668309 \nL 166.813125 137.922651 \nL 173.323125 138.47224 \nL 179.833125 138.497871 \nL 186.343125 138.510875 \nL 192.853125 138.535399 \nL 199.363125 139.275445 \nL 205.873125 139.335042 \nL 212.383125 139.41475 \nL 218.893125 139.5 \nL 225.403125 139.088968 \n\" clip-path=\"url(#pa3d6b5bf07)\" style=\"fill: none; stroke-dasharray: 9.6,2.4,1.5,2.4; stroke-dashoffset: 0; stroke: #2ca02c; stroke-width: 1.5\"/>\n   </g>\n   <g id=\"patch_3\">\n    <path d=\"M 30.103125 145.8 \nL 30.103125 7.2 \n\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n   </g>\n   <g id=\"patch_4\">\n    <path d=\"M 225.403125 145.8 \nL 225.403125 7.2 \n\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n   </g>\n   <g id=\"patch_5\">\n    <path d=\"M 30.103125 145.8 \nL 225.403125 145.8 \n\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n   </g>\n   <g id=\"patch_6\">\n    <path d=\"M 30.103125 7.2 \nL 225.403125 7.2 \n\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n   </g>\n   <g id=\"legend_1\">\n    <g id=\"patch_7\">\n     <path d=\"M 37.103125 60.06875 \nL 116.69375 60.06875 \nQ 118.69375 60.06875 118.69375 58.06875 \nL 118.69375 14.2 \nQ 118.69375 12.2 116.69375 12.2 \nL 37.103125 12.2 \nQ 35.103125 12.2 35.103125 14.2 \nL 35.103125 58.06875 \nQ 35.103125 60.06875 37.103125 60.06875 \nz\n\" style=\"fill: #ffffff; opacity: 0.8; stroke: #cccccc; stroke-linejoin: miter\"/>\n    </g>\n    <g id=\"line2d_16\">\n     <path d=\"M 39.103125 20.298438 \nL 49.103125 20.298438 \nL 59.103125 20.298438 \n\" style=\"fill: none; stroke: #1f77b4; stroke-width: 1.5; stroke-linecap: square\"/>\n    </g>\n    <g id=\"text_14\">\n     <!-- train_loss -->\n     <g transform=\"translate(67.103125 23.798438) scale(0.1 -0.1)\">\n      <defs>\n       <path id=\"DejaVuSans-74\" d=\"M 1172 4494 \nL 1172 3500 \nL 2356 3500 \nL 2356 3053 \nL 1172 3053 \nL 1172 1153 \nQ 1172 725 1289 603 \nQ 1406 481 1766 481 \nL 2356 481 \nL 2356 0 \nL 1766 0 \nQ 1100 0 847 248 \nQ 594 497 594 1153 \nL 594 3053 \nL 172 3053 \nL 172 3500 \nL 594 3500 \nL 594 4494 \nL 1172 4494 \nz\n\" transform=\"scale(0.015625)\"/>\n       <path id=\"DejaVuSans-72\" d=\"M 2631 2963 \nQ 2534 3019 2420 3045 \nQ 2306 3072 2169 3072 \nQ 1681 3072 1420 2755 \nQ 1159 2438 1159 1844 \nL 1159 0 \nL 581 0 \nL 581 3500 \nL 1159 3500 \nL 1159 2956 \nQ 1341 3275 1631 3429 \nQ 1922 3584 2338 3584 \nQ 2397 3584 2469 3576 \nQ 2541 3569 2628 3553 \nL 2631 2963 \nz\n\" transform=\"scale(0.015625)\"/>\n       <path id=\"DejaVuSans-61\" d=\"M 2194 1759 \nQ 1497 1759 1228 1600 \nQ 959 1441 959 1056 \nQ 959 750 1161 570 \nQ 1363 391 1709 391 \nQ 2188 391 2477 730 \nQ 2766 1069 2766 1631 \nL 2766 1759 \nL 2194 1759 \nz\nM 3341 1997 \nL 3341 0 \nL 2766 0 \nL 2766 531 \nQ 2569 213 2275 61 \nQ 1981 -91 1556 -91 \nQ 1019 -91 701 211 \nQ 384 513 384 1019 \nQ 384 1609 779 1909 \nQ 1175 2209 1959 2209 \nL 2766 2209 \nL 2766 2266 \nQ 2766 2663 2505 2880 \nQ 2244 3097 1772 3097 \nQ 1472 3097 1187 3025 \nQ 903 2953 641 2809 \nL 641 3341 \nQ 956 3463 1253 3523 \nQ 1550 3584 1831 3584 \nQ 2591 3584 2966 3190 \nQ 3341 2797 3341 1997 \nz\n\" transform=\"scale(0.015625)\"/>\n       <path id=\"DejaVuSans-69\" d=\"M 603 3500 \nL 1178 3500 \nL 1178 0 \nL 603 0 \nL 603 3500 \nz\nM 603 4863 \nL 1178 4863 \nL 1178 4134 \nL 603 4134 \nL 603 4863 \nz\n\" transform=\"scale(0.015625)\"/>\n       <path id=\"DejaVuSans-6e\" d=\"M 3513 2113 \nL 3513 0 \nL 2938 0 \nL 2938 2094 \nQ 2938 2591 2744 2837 \nQ 2550 3084 2163 3084 \nQ 1697 3084 1428 2787 \nQ 1159 2491 1159 1978 \nL 1159 0 \nL 581 0 \nL 581 3500 \nL 1159 3500 \nL 1159 2956 \nQ 1366 3272 1645 3428 \nQ 1925 3584 2291 3584 \nQ 2894 3584 3203 3211 \nQ 3513 2838 3513 2113 \nz\n\" transform=\"scale(0.015625)\"/>\n       <path id=\"DejaVuSans-5f\" d=\"M 3263 -1063 \nL 3263 -1509 \nL -63 -1509 \nL -63 -1063 \nL 3263 -1063 \nz\n\" transform=\"scale(0.015625)\"/>\n       <path id=\"DejaVuSans-6c\" d=\"M 603 4863 \nL 1178 4863 \nL 1178 0 \nL 603 0 \nL 603 4863 \nz\n\" transform=\"scale(0.015625)\"/>\n       <path id=\"DejaVuSans-73\" d=\"M 2834 3397 \nL 2834 2853 \nQ 2591 2978 2328 3040 \nQ 2066 3103 1784 3103 \nQ 1356 3103 1142 2972 \nQ 928 2841 928 2578 \nQ 928 2378 1081 2264 \nQ 1234 2150 1697 2047 \nL 1894 2003 \nQ 2506 1872 2764 1633 \nQ 3022 1394 3022 966 \nQ 3022 478 2636 193 \nQ 2250 -91 1575 -91 \nQ 1294 -91 989 -36 \nQ 684 19 347 128 \nL 347 722 \nQ 666 556 975 473 \nQ 1284 391 1588 391 \nQ 1994 391 2212 530 \nQ 2431 669 2431 922 \nQ 2431 1156 2273 1281 \nQ 2116 1406 1581 1522 \nL 1381 1569 \nQ 847 1681 609 1914 \nQ 372 2147 372 2553 \nQ 372 3047 722 3315 \nQ 1072 3584 1716 3584 \nQ 2034 3584 2315 3537 \nQ 2597 3491 2834 3397 \nz\n\" transform=\"scale(0.015625)\"/>\n      </defs>\n      <use xlink:href=\"#DejaVuSans-74\"/>\n      <use xlink:href=\"#DejaVuSans-72\" transform=\"translate(39.208984 0)\"/>\n      <use xlink:href=\"#DejaVuSans-61\" transform=\"translate(80.322266 0)\"/>\n      <use xlink:href=\"#DejaVuSans-69\" transform=\"translate(141.601562 0)\"/>\n      <use xlink:href=\"#DejaVuSans-6e\" transform=\"translate(169.384766 0)\"/>\n      <use xlink:href=\"#DejaVuSans-5f\" transform=\"translate(232.763672 0)\"/>\n      <use xlink:href=\"#DejaVuSans-6c\" transform=\"translate(282.763672 0)\"/>\n      <use xlink:href=\"#DejaVuSans-6f\" transform=\"translate(310.546875 0)\"/>\n      <use xlink:href=\"#DejaVuSans-73\" transform=\"translate(371.728516 0)\"/>\n      <use xlink:href=\"#DejaVuSans-73\" transform=\"translate(423.828125 0)\"/>\n     </g>\n    </g>\n    <g id=\"line2d_17\">\n     <path d=\"M 39.103125 35.254688 \nL 49.103125 35.254688 \nL 59.103125 35.254688 \n\" style=\"fill: none; stroke-dasharray: 5.55,2.4; stroke-dashoffset: 0; stroke: #ff7f0e; stroke-width: 1.5\"/>\n    </g>\n    <g id=\"text_15\">\n     <!-- val_acc -->\n     <g transform=\"translate(67.103125 38.754688) scale(0.1 -0.1)\">\n      <defs>\n       <path id=\"DejaVuSans-76\" d=\"M 191 3500 \nL 800 3500 \nL 1894 563 \nL 2988 3500 \nL 3597 3500 \nL 2284 0 \nL 1503 0 \nL 191 3500 \nz\n\" transform=\"scale(0.015625)\"/>\n      </defs>\n      <use xlink:href=\"#DejaVuSans-76\"/>\n      <use xlink:href=\"#DejaVuSans-61\" transform=\"translate(59.179688 0)\"/>\n      <use xlink:href=\"#DejaVuSans-6c\" transform=\"translate(120.458984 0)\"/>\n      <use xlink:href=\"#DejaVuSans-5f\" transform=\"translate(148.242188 0)\"/>\n      <use xlink:href=\"#DejaVuSans-61\" transform=\"translate(198.242188 0)\"/>\n      <use xlink:href=\"#DejaVuSans-63\" transform=\"translate(259.521484 0)\"/>\n      <use xlink:href=\"#DejaVuSans-63\" transform=\"translate(314.501953 0)\"/>\n     </g>\n    </g>\n    <g id=\"line2d_18\">\n     <path d=\"M 39.103125 50.210938 \nL 49.103125 50.210938 \nL 59.103125 50.210938 \n\" style=\"fill: none; stroke-dasharray: 9.6,2.4,1.5,2.4; stroke-dashoffset: 0; stroke: #2ca02c; stroke-width: 1.5\"/>\n    </g>\n    <g id=\"text_16\">\n     <!-- val_loss -->\n     <g transform=\"translate(67.103125 53.710938) scale(0.1 -0.1)\">\n      <use xlink:href=\"#DejaVuSans-76\"/>\n      <use xlink:href=\"#DejaVuSans-61\" transform=\"translate(59.179688 0)\"/>\n      <use xlink:href=\"#DejaVuSans-6c\" transform=\"translate(120.458984 0)\"/>\n      <use xlink:href=\"#DejaVuSans-5f\" transform=\"translate(148.242188 0)\"/>\n      <use xlink:href=\"#DejaVuSans-6c\" transform=\"translate(198.242188 0)\"/>\n      <use xlink:href=\"#DejaVuSans-6f\" transform=\"translate(226.025391 0)\"/>\n      <use xlink:href=\"#DejaVuSans-73\" transform=\"translate(287.207031 0)\"/>\n      <use xlink:href=\"#DejaVuSans-73\" transform=\"translate(339.306641 0)\"/>\n     </g>\n    </g>\n   </g>\n  </g>\n </g>\n <defs>\n  <clipPath id=\"pa3d6b5bf07\">\n   <rect x=\"30.103125\" y=\"7.2\" width=\"195.3\" height=\"138.6\"/>\n  </clipPath>\n </defs>\n</svg>\n"
     },
     "metadata": {}
    }
   ]
  },
  {
   "cell_type": "code",
   "metadata": {
    "id": "convnext-eval"
   },
   "source": [
    "jax_scores"
   ],
   "execution_count": 7,
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": "{'ConvNeXt': 0.9183, 'compact ResNet-18': 0.9423}"
     },
     "metadata": {},
     "execution_count": 7
    }
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<!-- d2l:prose id=convnext-md-8 fw=all -->\n",
    "\n",
    "| Model | Parameters | PyTorch accuracy | JAX accuracy |\n",
    "|---|---:|---:|---:|\n",
    "| ConvNeXt | 3,376,450 | ≈92% | ≈92% |\n",
    "| Compact ResNet-18 | 3,348,320 | ≈94% | ≈94.5% |\n",
    "\n",
    "This comparison asks a narrower question than the earlier run against the\n",
    "11.2-million-parameter ResNet-18: at roughly 3.4 million parameters, does the\n",
    "ConvNeXt block and stem help on upsampled Fashion-MNIST? Each entry is one\n",
    "seeded run, rounded to the half point; the independent JAX run checks that\n",
    "the result is not tied to one implementation. Here the compact\n",
    "ResNet is ahead by about two points in both implementations. Even this control\n",
    "is task-specific: it matches parameters, not latency or multiply-adds, and\n",
    "every step in the published roadmap was selected on ImageNet at\n",
    "$224\\times224$. The local result therefore says that ConvNeXt's ImageNet\n",
    "design choices do not automatically transfer to this small grayscale task; it\n",
    "is not a general ranking of the architecture families.\n",
    "\n",
    "## Beyond ConvNeXt\n",
    "\n",
    "### ConvNeXt V2: pretraining and GRN\n",
    "\n",
    "ConvNeXt closed the supervised gap, but by 2023 the frontier had moved to self-supervised pretraining, where transformers held an advantage: masked autoencoders [@he2022masked] drop most input patches and train the network to reconstruct them, which is natural for a patch-sequence model and awkward for a convolution that slides across the holes. ConvNeXt V2 [@woo2023convnextv2] adapted the idea with sparse convolutions that skip masked regions during pretraining. Doing so exposed a failure the authors traced to feature *collapse*: with the V1 block, many channels of the pretrained network go dead or redundant. Their fix, *Global Response Normalization* (GRN), is a three-line layer inserted after the block's GELU that computes each channel's global response norm, divides by the mean over channels, and uses the ratio to recalibrate the features, sharpening the contrast between channels and preventing collapse; it also replaces layer scale. The combination of the masked-autoencoder pretraining and GRN lifted the largest model to 88.9% ImageNet top-1 accuracy, at the time the best result trained on public data. Implementing GRN is one of the exercises, and it fits in about five lines.\n",
    "\n",
    "### Large Kernels and Other Spatial Mixers\n",
    "\n",
    "The roadmap's $7 \\times 7$ kernel invited an obvious question: why stop there? RepLKNet [@ding2022replknet] pushed depthwise kernels to $31 \\times 31$, using the re-parameterization trick of that section to train a parallel small kernel that folds away at inference, and showed the effective receptive field widening dramatically, with the gains showing up mostly in detection and segmentation rather than classification. SLaK [@liu2022slak] reached $51 \\times 51$ by factorizing the kernel into two thin rectangular stripes plus dynamic sparsity. InternImage [@wang2023internimage] took the opposite route to the same goal, a large *adaptive* receptive field, by building its blocks from deformable convolutions (DCNv3) whose sampling locations are input-dependent, and scaled to 3 billion parameters and state-of-the-art COCO detection. UniRepLKNet [@ding2024unireplknet] carried large-kernel design across modalities, to audio, point clouds, and time series.\n",
    "\n",
    "The durable result is narrower than a verdict on one winning operator. Modern\n",
    "backbones need access to wide context, and ConvNeXt showed that a moderately\n",
    "large depthwise kernel is one practical way to obtain it. Fixed kernels of\n",
    "$31 \\times 31$ and beyond have remained specialized: their reported gains are\n",
    "strongest in dense prediction, and efficient training or inference often needs\n",
    "re-parameterization, sparsity, or specialized kernels. Deformable operators\n",
    "and attention provide alternative, input-dependent routes to wide context.\n",
    "\n",
    "### ConvNeXt in 2026\n",
    "\n",
    "ConvNeXt has aged into infrastructure. It is a standard strong-CNN backbone\n",
    "in detection and segmentation toolkits, a common encoder choice where a\n",
    "transformer's quadratic attention cost is unwelcome at high resolution, and\n",
    "the convolutional tower in several widely used OpenCLIP image-text models\n",
    "[@radford2021learning], where ConvNeXt encoders trained on\n",
    "billion-scale image-text corpora remain among the strongest public\n",
    "convolutional models. When a practitioner in 2026 says \"just use a CNN\",\n",
    "the CNN they reach for is more often than not a ConvNeXt or something\n",
    "shaped like one.\n",
    "\n",
    "## Summary and Discussion\n",
    "\n",
    "ConvNeXt is a controlled experiment wearing an architecture's name. One change\n",
    "at a time, it turned a 2015 ResNet-50 into a network that matches Swin at equal\n",
    "cost: a modern recipe, a Swin-like stage ratio, a patchify stem, depthwise\n",
    "convolutions in an inverted bottleneck led by a $7 \\times 7$ kernel, GELU, and\n",
    "fewer normalization and activation layers. At the scales tested in the paper,\n",
    "well-tuned convnets and transformers are competitive; the experiment does not\n",
    "establish that either family dominates in every data and compute regime. Our\n",
    "parameter-matched Fashion-MNIST comparison applies the same control discipline\n",
    "to the smaller setting used in this book.\n",
    "\n",
    "The block itself is a piece of convergent evolution. Depthwise convolution mixing space but not channels, a pointwise MLP expanding by four mixing channels but not space, one normalization, one activation, a residual connection: strip the names and the ConvNeXt block and the transformer block are the same design with different spatial mixers. That reading, which that section develops, is more durable than any single leaderboard number, including the ones in this section.\n",
    "\n",
    "## Exercises\n",
    "\n",
    "1. Implement Global Response Normalization. For a channels-last feature map $X$, compute per-channel global norms $g_c = \\lVert X_{:,:,c} \\rVert_2$, normalize them as $n_c = g_c / \\bar{g}$ where $\\bar{g}$ is the mean over channels, and return $\\gamma \\odot (X \\cdot n) + \\beta + X$ with learnable per-channel $\\gamma, \\beta$ initialized to zero. Insert it after the GELU in `ConvNeXtBlock` (ConvNeXt V2 also removes layer scale when doing so), retrain, and compare.\n",
    "1. Swap the depthwise kernel size: train the model with $3 \\times 3$ and with $11 \\times 11$ depthwise convolutions (adjust the padding) and compare accuracy, parameter count, and time per epoch against the $7 \\times 7$ baseline. Do you see the saturation that @liu2022convnet report?\n",
    "1. Count where the parameters live: for our ConvNeXt, compute the fraction of parameters in depthwise convolutions, in the $1 \\times 1$ expansions and projections, and in the downsampling layers, and compare with the ResNet-18 of that section. Which design decision explains why ConvNeXt is three times smaller at the same depth-times-width feel?\n",
    "1. Ablate layer scale: train with $\\gamma$ initialized to $10^{-6}$ (the default), to $1$, and with the parameter removed entirely. Relate what you observe to stochastic depth, which also shrinks the effective contribution of each residual branch early in training.\n",
    "1. Our run gives the modern recipe to a modern architecture. Complete the other half of the ablation square: train this ConvNeXt with the 2015 recipe of that section (SGD with momentum, step decay, no Mixup or smoothing). How much of the network's quality survives the recipe downgrade?"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "name": "d2l-jax",
   "display_name": "d2l (JAX)",
   "language": "python"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
