import{s as xt,f as jt,o as It,n as be}from"../chunks/scheduler.9bc65507.js";import{S as Jt,i as Zt,g as c,s as r,r as _,A as Ft,h as m,f as n,c as l,j as de,u as b,x as f,k as U,y as h,a as o,v,d as w,t as $,w as y}from"../chunks/index.707bf1b6.js";import{T as st}from"../chunks/Tip.c2ecdbf4.js";import{D as we}from"../chunks/Docstring.17db21ae.js";import{C as rt}from"../chunks/CodeBlock.54a9f38d.js";import{E as ot}from"../chunks/ExampleCodeBlock.4f515aa9.js";import{P as Wt}from"../chunks/PipelineTag.44585822.js";import{H as _e}from"../chunks/Heading.342b1fa6.js";function Ut(M){let s,u="This model is in maintenance mode only, we don’t accept any new PRs changing its code.",d,i,p=`If you run into any issues running this model, please reinstall the last version that supported this model: v4.30.0.
You can do so by running the following command: <code>pip install -U transformers==4.30.0</code>.`;return{c(){s=c("p"),s.textContent=u,d=r(),i=c("p"),i.innerHTML=p},l(a){s=m(a,"P",{"data-svelte-h":!0}),f(s)!=="svelte-1dwyvn5"&&(s.textContent=u),d=l(a),i=m(a,"P",{"data-svelte-h":!0}),f(i)!=="svelte-4042uy"&&(i.innerHTML=p)},m(a,g){o(a,s,g),o(a,d,g),o(a,i,g)},p:be,d(a){a&&(n(s),n(d),n(i))}}}function Nt(M){let s,u="Example:",d,i,p;return i=new rt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFZhbk1vZGVsJTJDJTIwVmFuQ29uZmlnJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMFZBTiUyMHZhbi1iYXNlJTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMFZhbkNvbmZpZygpJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMG1vZGVsJTIwZnJvbSUyMHRoZSUyMHZhbi1iYXNlJTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBbW9kZWwlMjAlM0QlMjBWYW5Nb2RlbChjb25maWd1cmF0aW9uKSUwQSUyMyUyMEFjY2Vzc2luZyUyMHRoZSUyMG1vZGVsJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBtb2RlbC5jb25maWc=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> VanModel, VanConfig

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a VAN van-base style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = VanConfig()
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model from the van-base style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = VanModel(configuration)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Accessing the model configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = model.config`,wrap:!1}}),{c(){s=c("p"),s.textContent=u,d=r(),_(i.$$.fragment)},l(a){s=m(a,"P",{"data-svelte-h":!0}),f(s)!=="svelte-11lpom8"&&(s.textContent=u),d=l(a),b(i.$$.fragment,a)},m(a,g){o(a,s,g),o(a,d,g),v(i,a,g),p=!0},p:be,i(a){p||(w(i.$$.fragment,a),p=!0)},o(a){$(i.$$.fragment,a),p=!1},d(a){a&&(n(s),n(d)),y(i,a)}}}function kt(M){let s,u=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){s=c("p"),s.innerHTML=u},l(d){s=m(d,"P",{"data-svelte-h":!0}),f(s)!=="svelte-fincs2"&&(s.innerHTML=u)},m(d,i){o(d,s,i)},p:be,d(d){d&&n(s)}}}function zt(M){let s,u="Example:",d,i,p;return i=new rt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMFZhbk1vZGVsJTBBaW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGF0YXNldHMlMjBpbXBvcnQlMjBsb2FkX2RhdGFzZXQlMEElMEFkYXRhc2V0JTIwJTNEJTIwbG9hZF9kYXRhc2V0KCUyMmh1Z2dpbmdmYWNlJTJGY2F0cy1pbWFnZSUyMiklMEFpbWFnZSUyMCUzRCUyMGRhdGFzZXQlNUIlMjJ0ZXN0JTIyJTVEJTVCJTIyaW1hZ2UlMjIlNUQlNUIwJTVEJTBBJTBBaW1hZ2VfcHJvY2Vzc29yJTIwJTNEJTIwQXV0b0ltYWdlUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJWaXN1YWwtQXR0ZW50aW9uLU5ldHdvcmslMkZ2YW4tYmFzZSUyMiklMEFtb2RlbCUyMCUzRCUyMFZhbk1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJWaXN1YWwtQXR0ZW50aW9uLU5ldHdvcmslMkZ2YW4tYmFzZSUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjBpbWFnZV9wcm9jZXNzb3IoaW1hZ2UlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQXdpdGglMjB0b3JjaC5ub19ncmFkKCklM0ElMEElMjAlMjAlMjAlMjBvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBJTBBbGFzdF9oaWRkZW5fc3RhdGVzJTIwJTNEJTIwb3V0cHV0cy5sYXN0X2hpZGRlbl9zdGF0ZSUwQWxpc3QobGFzdF9oaWRkZW5fc3RhdGVzLnNoYXBlKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, VanModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset

<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = load_dataset(<span class="hljs-string">&quot;huggingface/cats-image&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>image = dataset[<span class="hljs-string">&quot;test&quot;</span>][<span class="hljs-string">&quot;image&quot;</span>][<span class="hljs-number">0</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span>image_processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">&quot;Visual-Attention-Network/van-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = VanModel.from_pretrained(<span class="hljs-string">&quot;Visual-Attention-Network/van-base&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = image_processor(image, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    outputs = model(**inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(last_hidden_states.shape)
[<span class="hljs-number">1</span>, <span class="hljs-number">512</span>, <span class="hljs-number">7</span>, <span class="hljs-number">7</span>]`,wrap:!1}}),{c(){s=c("p"),s.textContent=u,d=r(),_(i.$$.fragment)},l(a){s=m(a,"P",{"data-svelte-h":!0}),f(s)!=="svelte-11lpom8"&&(s.textContent=u),d=l(a),b(i.$$.fragment,a)},m(a,g){o(a,s,g),o(a,d,g),v(i,a,g),p=!0},p:be,i(a){p||(w(i.$$.fragment,a),p=!0)},o(a){$(i.$$.fragment,a),p=!1},d(a){a&&(n(s),n(d)),y(i,a)}}}function Gt(M){let s,u=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){s=c("p"),s.innerHTML=u},l(d){s=m(d,"P",{"data-svelte-h":!0}),f(s)!=="svelte-fincs2"&&(s.innerHTML=u)},m(d,i){o(d,s,i)},p:be,d(d){d&&n(s)}}}function Ht(M){let s,u="Example:",d,i,p;return i=new rt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMFZhbkZvckltYWdlQ2xhc3NpZmljYXRpb24lMEFpbXBvcnQlMjB0b3JjaCUwQWZyb20lMjBkYXRhc2V0cyUyMGltcG9ydCUyMGxvYWRfZGF0YXNldCUwQSUwQWRhdGFzZXQlMjAlM0QlMjBsb2FkX2RhdGFzZXQoJTIyaHVnZ2luZ2ZhY2UlMkZjYXRzLWltYWdlJTIyKSUwQWltYWdlJTIwJTNEJTIwZGF0YXNldCU1QiUyMnRlc3QlMjIlNUQlNUIlMjJpbWFnZSUyMiU1RCU1QjAlNUQlMEElMEFpbWFnZV9wcm9jZXNzb3IlMjAlM0QlMjBBdXRvSW1hZ2VQcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMlZpc3VhbC1BdHRlbnRpb24tTmV0d29yayUyRnZhbi1iYXNlJTIyKSUwQW1vZGVsJTIwJTNEJTIwVmFuRm9ySW1hZ2VDbGFzc2lmaWNhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIyVmlzdWFsLUF0dGVudGlvbi1OZXR3b3JrJTJGdmFuLWJhc2UlMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwaW1hZ2VfcHJvY2Vzc29yKGltYWdlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEElMEF3aXRoJTIwdG9yY2gubm9fZ3JhZCgpJTNBJTBBJTIwJTIwJTIwJTIwbG9naXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpLmxvZ2l0cyUwQSUwQSUyMyUyMG1vZGVsJTIwcHJlZGljdHMlMjBvbmUlMjBvZiUyMHRoZSUyMDEwMDAlMjBJbWFnZU5ldCUyMGNsYXNzZXMlMEFwcmVkaWN0ZWRfbGFiZWwlMjAlM0QlMjBsb2dpdHMuYXJnbWF4KC0xKS5pdGVtKCklMEFwcmludChtb2RlbC5jb25maWcuaWQybGFiZWwlNUJwcmVkaWN0ZWRfbGFiZWwlNUQp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, VanForImageClassification
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset

<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = load_dataset(<span class="hljs-string">&quot;huggingface/cats-image&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>image = dataset[<span class="hljs-string">&quot;test&quot;</span>][<span class="hljs-string">&quot;image&quot;</span>][<span class="hljs-number">0</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span>image_processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">&quot;Visual-Attention-Network/van-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = VanForImageClassification.from_pretrained(<span class="hljs-string">&quot;Visual-Attention-Network/van-base&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = image_processor(image, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    logits = model(**inputs).logits

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># model predicts one of the 1000 ImageNet classes</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_label = logits.argmax(-<span class="hljs-number">1</span>).item()
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(model.config.id2label[predicted_label])
tabby, tabby cat`,wrap:!1}}),{c(){s=c("p"),s.textContent=u,d=r(),_(i.$$.fragment)},l(a){s=m(a,"P",{"data-svelte-h":!0}),f(s)!=="svelte-11lpom8"&&(s.textContent=u),d=l(a),b(i.$$.fragment,a)},m(a,g){o(a,s,g),o(a,d,g),v(i,a,g),p=!0},p:be,i(a){p||(w(i.$$.fragment,a),p=!0)},o(a){$(i.$$.fragment,a),p=!1},d(a){a&&(n(s),n(d)),y(i,a)}}}function Pt(M){let s,u,d,i,p,a,g,$e,P,ye,A,lt='The VAN model was proposed in <a href="https://arxiv.org/abs/2202.09741" rel="nofollow">Visual Attention Network</a> by Meng-Hao Guo, Cheng-Ze Lu, Zheng-Ning Liu, Ming-Ming Cheng, Shi-Min Hu.',Me,B,it="This paper introduces a new attention layer based on convolution operations able to capture both local and distant relationships. This is done by combining normal and large kernel convolution layers. The latter uses a dilated convolution to capture distant correlations.",Te,L,dt="The abstract from the paper is the following:",Ce,R,ct='<em>While originally designed for natural language processing tasks, the self-attention mechanism has recently taken various computer vision areas by storm. However, the 2D nature of images brings three challenges for applying self-attention in computer vision. (1) Treating images as 1D sequences neglects their 2D structures. (2) The quadratic complexity is too expensive for high-resolution images. (3) It only captures spatial adaptability but ignores channel adaptability. In this paper, we propose a novel large kernel attention (LKA) module to enable self-adaptive and long-range correlations in self-attention while avoiding the above issues. We further introduce a novel neural network based on LKA, namely Visual Attention Network (VAN). While extremely simple, VAN outperforms the state-of-the-art vision transformers and convolutional neural networks with a large margin in extensive experiments, including image classification, object detection, semantic segmentation, instance segmentation, etc. Code is available at <a href="https://github.com/Visual-Attention-Network/VAN-Classification" rel="nofollow">this https URL</a>.</em>',Ve,E,mt="Tips:",xe,X,pt="<li>VAN does not have an embedding layer, thus the <code>hidden_states</code> will have a length equal to the number of stages.</li>",je,Y,ft='The figure below illustrates the architecture of a Visual Attention Layer. Taken from the <a href="https://arxiv.org/abs/2202.09741" rel="nofollow">original paper</a>.',Ie,Q,gt,Je,q,ht='This model was contributed by <a href="https://huggingface.co/Francesco" rel="nofollow">Francesco</a>. The original code can be found <a href="https://github.com/Visual-Attention-Network/VAN-Classification" rel="nofollow">here</a>.',Ze,S,Fe,D,ut="A list of official Hugging Face and community (indicated by 🌎) resources to help you get started with VAN.",We,O,Ue,K,_t='<li><a href="/docs/transformers/main/en/model_doc/van#transformers.VanForImageClassification">VanForImageClassification</a> is supported by this <a href="https://github.com/huggingface/transformers/tree/main/examples/pytorch/image-classification" rel="nofollow">example script</a> and <a href="https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/image_classification.ipynb" rel="nofollow">notebook</a>.</li> <li>See also: <a href="../tasks/image_classification">Image classification task guide</a></li>',Ne,ee,bt="If you’re interested in submitting a resource to be included here, please feel free to open a Pull Request and we’ll review it! The resource should ideally demonstrate something new instead of duplicating an existing resource.",ke,te,ze,T,ne,Re,ce,vt=`This is the configuration class to store the configuration of a <a href="/docs/transformers/main/en/model_doc/van#transformers.VanModel">VanModel</a>. It is used to instantiate a VAN model
according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the VAN
<a href="https://huggingface.co/Visual-Attention-Network/van-base" rel="nofollow">Visual-Attention-Network/van-base</a> architecture.`,Ee,me,wt=`Configuration objects inherit from <a href="/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> and can be used to control the model outputs. Read the
documentation from <a href="/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,Xe,N,Ge,ae,He,j,se,Ye,pe,$t=`The bare VAN model outputting raw features without any specific head on top. Note, VAN does not have an embedding layer.
This model is a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`,Qe,V,oe,qe,fe,yt='The <a href="/docs/transformers/main/en/model_doc/van#transformers.VanModel">VanModel</a> forward method, overrides the <code>__call__</code> special method.',Se,k,De,z,Pe,re,Ae,C,le,Oe,ge,Mt=`VAN Model with an image classification head on top (a linear layer on top of the pooled features), e.g. for
ImageNet.`,Ke,he,Tt=`This model is a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`,et,x,ie,tt,ue,Ct='The <a href="/docs/transformers/main/en/model_doc/van#transformers.VanForImageClassification">VanForImageClassification</a> forward method, overrides the <code>__call__</code> special method.',nt,G,at,H,Be,ve,Le;return p=new _e({props:{title:"VAN",local:"van",headingTag:"h1"}}),g=new st({props:{warning:!0,$$slots:{default:[Ut]},$$scope:{ctx:M}}}),P=new _e({props:{title:"Overview",local:"overview",headingTag:"h2"}}),S=new _e({props:{title:"Resources",local:"resources",headingTag:"h2"}}),O=new Wt({props:{pipeline:"image-classification"}}),te=new _e({props:{title:"VanConfig",local:"transformers.VanConfig",headingTag:"h2"}}),ne=new we({props:{name:"class transformers.VanConfig",anchor:"transformers.VanConfig",parameters:[{name:"image_size",val:" = 224"},{name:"num_channels",val:" = 3"},{name:"patch_sizes",val:" = [7, 3, 3, 3]"},{name:"strides",val:" = [4, 2, 2, 2]"},{name:"hidden_sizes",val:" = [64, 128, 320, 512]"},{name:"depths",val:" = [3, 3, 12, 3]"},{name:"mlp_ratios",val:" = [8, 8, 4, 4]"},{name:"hidden_act",val:" = 'gelu'"},{name:"initializer_range",val:" = 0.02"},{name:"layer_norm_eps",val:" = 1e-06"},{name:"layer_scale_init_value",val:" = 0.01"},{name:"drop_path_rate",val:" = 0.0"},{name:"dropout_rate",val:" = 0.0"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.VanConfig.image_size",description:`<strong>image_size</strong> (<code>int</code>, <em>optional</em>, defaults to 224) &#x2014;
The size (resolution) of each image.`,name:"image_size"},{anchor:"transformers.VanConfig.num_channels",description:`<strong>num_channels</strong> (<code>int</code>, <em>optional</em>, defaults to 3) &#x2014;
The number of input channels.`,name:"num_channels"},{anchor:"transformers.VanConfig.patch_sizes",description:`<strong>patch_sizes</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[7, 3, 3, 3]</code>) &#x2014;
Patch size to use in each stage&#x2019;s embedding layer.`,name:"patch_sizes"},{anchor:"transformers.VanConfig.strides",description:`<strong>strides</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[4, 2, 2, 2]</code>) &#x2014;
Stride size to use in each stage&#x2019;s embedding layer to downsample the input.`,name:"strides"},{anchor:"transformers.VanConfig.hidden_sizes",description:`<strong>hidden_sizes</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[64, 128, 320, 512]</code>) &#x2014;
Dimensionality (hidden size) at each stage.`,name:"hidden_sizes"},{anchor:"transformers.VanConfig.depths",description:`<strong>depths</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[3, 3, 12, 3]</code>) &#x2014;
Depth (number of layers) for each stage.`,name:"depths"},{anchor:"transformers.VanConfig.mlp_ratios",description:`<strong>mlp_ratios</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[8, 8, 4, 4]</code>) &#x2014;
The expansion ratio for mlp layer at each stage.`,name:"mlp_ratios"},{anchor:"transformers.VanConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;gelu&quot;</code>) &#x2014;
The non-linear activation function (function or string) in each layer. If string, <code>&quot;gelu&quot;</code>, <code>&quot;relu&quot;</code>,
<code>&quot;selu&quot;</code> and <code>&quot;gelu_new&quot;</code> are supported.`,name:"hidden_act"},{anchor:"transformers.VanConfig.initializer_range",description:`<strong>initializer_range</strong> (<code>float</code>, <em>optional</em>, defaults to 0.02) &#x2014;
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.`,name:"initializer_range"},{anchor:"transformers.VanConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-06) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.VanConfig.layer_scale_init_value",description:`<strong>layer_scale_init_value</strong> (<code>float</code>, <em>optional</em>, defaults to 0.01) &#x2014;
The initial value for layer scaling.`,name:"layer_scale_init_value"},{anchor:"transformers.VanConfig.drop_path_rate",description:`<strong>drop_path_rate</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout probability for stochastic depth.`,name:"drop_path_rate"},{anchor:"transformers.VanConfig.dropout_rate",description:`<strong>dropout_rate</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout probability for dropout.`,name:"dropout_rate"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/deprecated/van/configuration_van.py#L30"}}),N=new ot({props:{anchor:"transformers.VanConfig.example",$$slots:{default:[Nt]},$$scope:{ctx:M}}}),ae=new _e({props:{title:"VanModel",local:"transformers.VanModel",headingTag:"h2"}}),se=new we({props:{name:"class transformers.VanModel",anchor:"transformers.VanModel",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.VanModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/van#transformers.VanConfig">VanConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/deprecated/van/modeling_van.py#L416"}}),oe=new we({props:{name:"forward",anchor:"transformers.VanModel.forward",parameters:[{name:"pixel_values",val:": Optional"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.VanModel.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/main/en/model_doc/imagegpt#transformers.ImageGPTFeatureExtractor.__call__">ConvNextImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.VanModel.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all stages. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.VanModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/deprecated/van/modeling_van.py#L431",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <code>transformers.modeling_outputs.BaseModelOutputWithPoolingAndNoAttention</code> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/van#transformers.VanConfig"
>VanConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) — Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>pooler_output</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, hidden_size)</code>) — Last layer hidden-state after a pooling operation on the spatial dimensions.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, num_channels, height, width)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>transformers.modeling_outputs.BaseModelOutputWithPoolingAndNoAttention</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),k=new st({props:{$$slots:{default:[kt]},$$scope:{ctx:M}}}),z=new ot({props:{anchor:"transformers.VanModel.forward.example",$$slots:{default:[zt]},$$scope:{ctx:M}}}),re=new _e({props:{title:"VanForImageClassification",local:"transformers.VanForImageClassification",headingTag:"h2"}}),le=new we({props:{name:"class transformers.VanForImageClassification",anchor:"transformers.VanForImageClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.VanForImageClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/van#transformers.VanConfig">VanConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/deprecated/van/modeling_van.py#L469"}}),ie=new we({props:{name:"forward",anchor:"transformers.VanForImageClassification.forward",parameters:[{name:"pixel_values",val:": Optional = None"},{name:"labels",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.VanForImageClassification.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/main/en/model_doc/imagegpt#transformers.ImageGPTFeatureExtractor.__call__">ConvNextImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.VanForImageClassification.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all stages. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.VanForImageClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.VanForImageClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the image classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss), If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/deprecated/van/modeling_van.py#L488",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.ImageClassifierOutputWithNoAttention"
>transformers.modeling_outputs.ImageClassifierOutputWithNoAttention</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/van#transformers.VanConfig"
>VanConfig</a>) and inputs.</p>
<ul>
<li><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) — Classification (or regression if config.num_labels==1) loss.</li>
<li><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels)</code>) — Classification (or regression if config.num_labels==1) scores (before SoftMax).</li>
<li><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each stage) of shape <code>(batch_size, num_channels, height, width)</code>. Hidden-states (also
called feature maps) of the model at the output of each stage.</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.ImageClassifierOutputWithNoAttention"
>transformers.modeling_outputs.ImageClassifierOutputWithNoAttention</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),G=new st({props:{$$slots:{default:[Gt]},$$scope:{ctx:M}}}),H=new ot({props:{anchor:"transformers.VanForImageClassification.forward.example",$$slots:{default:[Ht]},$$scope:{ctx:M}}}),{c(){s=c("meta"),u=r(),d=c("p"),i=r(),_(p.$$.fragment),a=r(),_(g.$$.fragment),$e=r(),_(P.$$.fragment),ye=r(),A=c("p"),A.innerHTML=lt,Me=r(),B=c("p"),B.textContent=it,Te=r(),L=c("p"),L.textContent=dt,Ce=r(),R=c("p"),R.innerHTML=ct,Ve=r(),E=c("p"),E.textContent=mt,xe=r(),X=c("ul"),X.innerHTML=pt,je=r(),Y=c("p"),Y.innerHTML=ft,Ie=r(),Q=c("img"),Je=r(),q=c("p"),q.innerHTML=ht,Ze=r(),_(S.$$.fragment),Fe=r(),D=c("p"),D.textContent=ut,We=r(),_(O.$$.fragment),Ue=r(),K=c("ul"),K.innerHTML=_t,Ne=r(),ee=c("p"),ee.textContent=bt,ke=r(),_(te.$$.fragment),ze=r(),T=c("div"),_(ne.$$.fragment),Re=r(),ce=c("p"),ce.innerHTML=vt,Ee=r(),me=c("p"),me.innerHTML=wt,Xe=r(),_(N.$$.fragment),Ge=r(),_(ae.$$.fragment),He=r(),j=c("div"),_(se.$$.fragment),Ye=r(),pe=c("p"),pe.innerHTML=$t,Qe=r(),V=c("div"),_(oe.$$.fragment),qe=r(),fe=c("p"),fe.innerHTML=yt,Se=r(),_(k.$$.fragment),De=r(),_(z.$$.fragment),Pe=r(),_(re.$$.fragment),Ae=r(),C=c("div"),_(le.$$.fragment),Oe=r(),ge=c("p"),ge.textContent=Mt,Ke=r(),he=c("p"),he.innerHTML=Tt,et=r(),x=c("div"),_(ie.$$.fragment),tt=r(),ue=c("p"),ue.innerHTML=Ct,nt=r(),_(G.$$.fragment),at=r(),_(H.$$.fragment),Be=r(),ve=c("p"),this.h()},l(e){const t=Ft("svelte-u9bgzb",document.head);s=m(t,"META",{name:!0,content:!0}),t.forEach(n),u=l(e),d=m(e,"P",{}),de(d).forEach(n),i=l(e),b(p.$$.fragment,e),a=l(e),b(g.$$.fragment,e),$e=l(e),b(P.$$.fragment,e),ye=l(e),A=m(e,"P",{"data-svelte-h":!0}),f(A)!=="svelte-19tgy2r"&&(A.innerHTML=lt),Me=l(e),B=m(e,"P",{"data-svelte-h":!0}),f(B)!=="svelte-1k14mfv"&&(B.textContent=it),Te=l(e),L=m(e,"P",{"data-svelte-h":!0}),f(L)!=="svelte-vfdo9a"&&(L.textContent=dt),Ce=l(e),R=m(e,"P",{"data-svelte-h":!0}),f(R)!=="svelte-eh9hlc"&&(R.innerHTML=ct),Ve=l(e),E=m(e,"P",{"data-svelte-h":!0}),f(E)!=="svelte-axv494"&&(E.textContent=mt),xe=l(e),X=m(e,"UL",{"data-svelte-h":!0}),f(X)!=="svelte-159tyma"&&(X.innerHTML=pt),je=l(e),Y=m(e,"P",{"data-svelte-h":!0}),f(Y)!=="svelte-zo4dsx"&&(Y.innerHTML=ft),Ie=l(e),Q=m(e,"IMG",{width:!0,src:!0}),Je=l(e),q=m(e,"P",{"data-svelte-h":!0}),f(q)!=="svelte-10esb2x"&&(q.innerHTML=ht),Ze=l(e),b(S.$$.fragment,e),Fe=l(e),D=m(e,"P",{"data-svelte-h":!0}),f(D)!=="svelte-1gzppm8"&&(D.textContent=ut),We=l(e),b(O.$$.fragment,e),Ue=l(e),K=m(e,"UL",{"data-svelte-h":!0}),f(K)!=="svelte-11iwm6a"&&(K.innerHTML=_t),Ne=l(e),ee=m(e,"P",{"data-svelte-h":!0}),f(ee)!=="svelte-1xesile"&&(ee.textContent=bt),ke=l(e),b(te.$$.fragment,e),ze=l(e),T=m(e,"DIV",{class:!0});var I=de(T);b(ne.$$.fragment,I),Re=l(I),ce=m(I,"P",{"data-svelte-h":!0}),f(ce)!=="svelte-1nc1yro"&&(ce.innerHTML=vt),Ee=l(I),me=m(I,"P",{"data-svelte-h":!0}),f(me)!=="svelte-o55m63"&&(me.innerHTML=wt),Xe=l(I),b(N.$$.fragment,I),I.forEach(n),Ge=l(e),b(ae.$$.fragment,e),He=l(e),j=m(e,"DIV",{class:!0});var W=de(j);b(se.$$.fragment,W),Ye=l(W),pe=m(W,"P",{"data-svelte-h":!0}),f(pe)!=="svelte-16mr62j"&&(pe.innerHTML=$t),Qe=l(W),V=m(W,"DIV",{class:!0});var J=de(V);b(oe.$$.fragment,J),qe=l(J),fe=m(J,"P",{"data-svelte-h":!0}),f(fe)!=="svelte-1rzddh6"&&(fe.innerHTML=yt),Se=l(J),b(k.$$.fragment,J),De=l(J),b(z.$$.fragment,J),J.forEach(n),W.forEach(n),Pe=l(e),b(re.$$.fragment,e),Ae=l(e),C=m(e,"DIV",{class:!0});var Z=de(C);b(le.$$.fragment,Z),Oe=l(Z),ge=m(Z,"P",{"data-svelte-h":!0}),f(ge)!=="svelte-lxjyb1"&&(ge.textContent=Mt),Ke=l(Z),he=m(Z,"P",{"data-svelte-h":!0}),f(he)!=="svelte-1gjh92c"&&(he.innerHTML=Tt),et=l(Z),x=m(Z,"DIV",{class:!0});var F=de(x);b(ie.$$.fragment,F),tt=l(F),ue=m(F,"P",{"data-svelte-h":!0}),f(ue)!=="svelte-14chz9u"&&(ue.innerHTML=Ct),nt=l(F),b(G.$$.fragment,F),at=l(F),b(H.$$.fragment,F),F.forEach(n),Z.forEach(n),Be=l(e),ve=m(e,"P",{}),de(ve).forEach(n),this.h()},h(){U(s,"name","hf:doc:metadata"),U(s,"content",At),U(Q,"width","600"),jt(Q.src,gt="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/van_architecture.png")||U(Q,"src",gt),U(T,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),U(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),U(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),U(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),U(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,t){h(document.head,s),o(e,u,t),o(e,d,t),o(e,i,t),v(p,e,t),o(e,a,t),v(g,e,t),o(e,$e,t),v(P,e,t),o(e,ye,t),o(e,A,t),o(e,Me,t),o(e,B,t),o(e,Te,t),o(e,L,t),o(e,Ce,t),o(e,R,t),o(e,Ve,t),o(e,E,t),o(e,xe,t),o(e,X,t),o(e,je,t),o(e,Y,t),o(e,Ie,t),o(e,Q,t),o(e,Je,t),o(e,q,t),o(e,Ze,t),v(S,e,t),o(e,Fe,t),o(e,D,t),o(e,We,t),v(O,e,t),o(e,Ue,t),o(e,K,t),o(e,Ne,t),o(e,ee,t),o(e,ke,t),v(te,e,t),o(e,ze,t),o(e,T,t),v(ne,T,null),h(T,Re),h(T,ce),h(T,Ee),h(T,me),h(T,Xe),v(N,T,null),o(e,Ge,t),v(ae,e,t),o(e,He,t),o(e,j,t),v(se,j,null),h(j,Ye),h(j,pe),h(j,Qe),h(j,V),v(oe,V,null),h(V,qe),h(V,fe),h(V,Se),v(k,V,null),h(V,De),v(z,V,null),o(e,Pe,t),v(re,e,t),o(e,Ae,t),o(e,C,t),v(le,C,null),h(C,Oe),h(C,ge),h(C,Ke),h(C,he),h(C,et),h(C,x),v(ie,x,null),h(x,tt),h(x,ue),h(x,nt),v(G,x,null),h(x,at),v(H,x,null),o(e,Be,t),o(e,ve,t),Le=!0},p(e,[t]){const I={};t&2&&(I.$$scope={dirty:t,ctx:e}),g.$set(I);const W={};t&2&&(W.$$scope={dirty:t,ctx:e}),N.$set(W);const J={};t&2&&(J.$$scope={dirty:t,ctx:e}),k.$set(J);const Z={};t&2&&(Z.$$scope={dirty:t,ctx:e}),z.$set(Z);const F={};t&2&&(F.$$scope={dirty:t,ctx:e}),G.$set(F);const Vt={};t&2&&(Vt.$$scope={dirty:t,ctx:e}),H.$set(Vt)},i(e){Le||(w(p.$$.fragment,e),w(g.$$.fragment,e),w(P.$$.fragment,e),w(S.$$.fragment,e),w(O.$$.fragment,e),w(te.$$.fragment,e),w(ne.$$.fragment,e),w(N.$$.fragment,e),w(ae.$$.fragment,e),w(se.$$.fragment,e),w(oe.$$.fragment,e),w(k.$$.fragment,e),w(z.$$.fragment,e),w(re.$$.fragment,e),w(le.$$.fragment,e),w(ie.$$.fragment,e),w(G.$$.fragment,e),w(H.$$.fragment,e),Le=!0)},o(e){$(p.$$.fragment,e),$(g.$$.fragment,e),$(P.$$.fragment,e),$(S.$$.fragment,e),$(O.$$.fragment,e),$(te.$$.fragment,e),$(ne.$$.fragment,e),$(N.$$.fragment,e),$(ae.$$.fragment,e),$(se.$$.fragment,e),$(oe.$$.fragment,e),$(k.$$.fragment,e),$(z.$$.fragment,e),$(re.$$.fragment,e),$(le.$$.fragment,e),$(ie.$$.fragment,e),$(G.$$.fragment,e),$(H.$$.fragment,e),Le=!1},d(e){e&&(n(u),n(d),n(i),n(a),n($e),n(ye),n(A),n(Me),n(B),n(Te),n(L),n(Ce),n(R),n(Ve),n(E),n(xe),n(X),n(je),n(Y),n(Ie),n(Q),n(Je),n(q),n(Ze),n(Fe),n(D),n(We),n(Ue),n(K),n(Ne),n(ee),n(ke),n(ze),n(T),n(Ge),n(He),n(j),n(Pe),n(Ae),n(C),n(Be),n(ve)),n(s),y(p,e),y(g,e),y(P,e),y(S,e),y(O,e),y(te,e),y(ne),y(N),y(ae,e),y(se),y(oe),y(k),y(z),y(re,e),y(le),y(ie),y(G),y(H)}}}const At='{"title":"VAN","local":"van","sections":[{"title":"Overview","local":"overview","sections":[],"depth":2},{"title":"Resources","local":"resources","sections":[],"depth":2},{"title":"VanConfig","local":"transformers.VanConfig","sections":[],"depth":2},{"title":"VanModel","local":"transformers.VanModel","sections":[],"depth":2},{"title":"VanForImageClassification","local":"transformers.VanForImageClassification","sections":[],"depth":2}],"depth":1}';function Bt(M){return It(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Dt extends Jt{constructor(s){super(),Zt(this,s,Bt,Pt,xt,{})}}export{Dt as component};
