import{s as It,f as Jt,o as Zt,n as ve}from"../chunks/scheduler.25b97de1.js";import{S as Ft,i as Wt,g as c,s as r,r as _,A as Ut,h as m,f as n,c as l,j as ce,u as b,x as f,k as U,y as u,a as o,v,d as $,t as w,w as y}from"../chunks/index.d9030fc9.js";import{T as rt}from"../chunks/Tip.baa67368.js";import{D as we}from"../chunks/Docstring.ffac8efa.js";import{C as it}from"../chunks/CodeBlock.e6cd0d95.js";import{E as lt}from"../chunks/ExampleCodeBlock.22dfe688.js";import{P as Nt}from"../chunks/PipelineTag.5f100392.js";import{H as be,E as kt}from"../chunks/EditOnGithub.91d95064.js";function zt(M){let s,h="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=h,d=r(),i=c("p"),i.innerHTML=p},l(a){s=m(a,"P",{"data-svelte-h":!0}),f(s)!=="svelte-1dwyvn5"&&(s.textContent=h),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:ve,d(a){a&&(n(s),n(d),n(i))}}}function Gt(M){let s,h="Example:",d,i,p;return i=new it({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=h,d=r(),_(i.$$.fragment)},l(a){s=m(a,"P",{"data-svelte-h":!0}),f(s)!=="svelte-11lpom8"&&(s.textContent=h),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:ve,i(a){p||($(i.$$.fragment,a),p=!0)},o(a){w(i.$$.fragment,a),p=!1},d(a){a&&(n(s),n(d)),y(i,a)}}}function Ht(M){let s,h=`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=h},l(d){s=m(d,"P",{"data-svelte-h":!0}),f(s)!=="svelte-fincs2"&&(s.innerHTML=h)},m(d,i){o(d,s,i)},p:ve,d(d){d&&n(s)}}}function Pt(M){let s,h="Example:",d,i,p;return i=new it({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=h,d=r(),_(i.$$.fragment)},l(a){s=m(a,"P",{"data-svelte-h":!0}),f(s)!=="svelte-11lpom8"&&(s.textContent=h),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:ve,i(a){p||($(i.$$.fragment,a),p=!0)},o(a){w(i.$$.fragment,a),p=!1},d(a){a&&(n(s),n(d)),y(i,a)}}}function At(M){let s,h=`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=h},l(d){s=m(d,"P",{"data-svelte-h":!0}),f(s)!=="svelte-fincs2"&&(s.innerHTML=h)},m(d,i){o(d,s,i)},p:ve,d(d){d&&n(s)}}}function Bt(M){let s,h="Example:",d,i,p;return i=new it({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=h,d=r(),_(i.$$.fragment)},l(a){s=m(a,"P",{"data-svelte-h":!0}),f(s)!=="svelte-11lpom8"&&(s.textContent=h),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:ve,i(a){p||($(i.$$.fragment,a),p=!0)},o(a){w(i.$$.fragment,a),p=!1},d(a){a&&(n(s),n(d)),y(i,a)}}}function Lt(M){let s,h,d,i,p,a,g,ye,P,Me,A,dt='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.',Te,B,ct="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.",Ce,L,mt="The abstract from the paper is the following:",Ve,R,pt='<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>',xe,E,ft="Tips:",je,X,gt="<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>",Ie,Y,ut='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>.',Je,Q,ht,Ze,q,_t='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>.',Fe,S,We,D,bt="A list of official Hugging Face and community (indicated by 🌎) resources to help you get started with VAN.",Ue,O,Ne,K,vt='<li><a href="/docs/transformers/v4.41.0/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>',ke,ee,$t="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.",ze,te,Ge,T,ne,Xe,me,wt=`This is the configuration class to store the configuration of a <a href="/docs/transformers/v4.41.0/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.`,Ye,pe,yt=`Configuration objects inherit from <a href="/docs/transformers/v4.41.0/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/v4.41.0/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,Qe,N,He,ae,Pe,j,se,qe,fe,Mt=`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.`,Se,V,oe,De,ge,Tt='The <a href="/docs/transformers/v4.41.0/en/model_doc/van#transformers.VanModel">VanModel</a> forward method, overrides the <code>__call__</code> special method.',Oe,k,Ke,z,Ae,re,Be,C,le,et,ue,Ct=`VAN Model with an image classification head on top (a linear layer on top of the pooled features), e.g. for
ImageNet.`,tt,he,Vt=`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.`,nt,x,ie,at,_e,xt='The <a href="/docs/transformers/v4.41.0/en/model_doc/van#transformers.VanForImageClassification">VanForImageClassification</a> forward method, overrides the <code>__call__</code> special method.',st,G,ot,H,Le,de,Re,$e,Ee;return p=new be({props:{title:"VAN",local:"van",headingTag:"h1"}}),g=new rt({props:{warning:!0,$$slots:{default:[zt]},$$scope:{ctx:M}}}),P=new be({props:{title:"Overview",local:"overview",headingTag:"h2"}}),S=new be({props:{title:"Resources",local:"resources",headingTag:"h2"}}),O=new Nt({props:{pipeline:"image-classification"}}),te=new be({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/v4.41.0/src/transformers/models/deprecated/van/configuration_van.py#L24"}}),N=new lt({props:{anchor:"transformers.VanConfig.example",$$slots:{default:[Gt]},$$scope:{ctx:M}}}),ae=new be({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/v4.41.0/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/v4.41.0/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/v4.41.0/src/transformers/models/deprecated/van/modeling_van.py#L411"}}),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/v4.41.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.41.0/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/v4.41.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.41.0/src/transformers/models/deprecated/van/modeling_van.py#L426",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/v4.41.0/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 rt({props:{$$slots:{default:[Ht]},$$scope:{ctx:M}}}),z=new lt({props:{anchor:"transformers.VanModel.forward.example",$$slots:{default:[Pt]},$$scope:{ctx:M}}}),re=new be({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/v4.41.0/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/v4.41.0/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/v4.41.0/src/transformers/models/deprecated/van/modeling_van.py#L464"}}),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/v4.41.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.41.0/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/v4.41.0/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/v4.41.0/src/transformers/models/deprecated/van/modeling_van.py#L483",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


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