import{s as Jt,f as It,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 h,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.e257edda.js";import{C as it}from"../chunks/CodeBlock.e6cd0d95.js";import{E as lt}from"../chunks/ExampleCodeBlock.20db4b6e.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,g="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=g,d=r(),i=c("p"),i.innerHTML=p},l(a){s=m(a,"P",{"data-svelte-h":!0}),f(s)!=="svelte-1dwyvn5"&&(s.textContent=g),d=l(a),i=m(a,"P",{"data-svelte-h":!0}),f(i)!=="svelte-4042uy"&&(i.innerHTML=p)},m(a,u){o(a,s,u),o(a,d,u),o(a,i,u)},p:ve,d(a){a&&(n(s),n(d),n(i))}}}function Ht(M){let s,g="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=g,d=r(),_(i.$$.fragment)},l(a){s=m(a,"P",{"data-svelte-h":!0}),f(s)!=="svelte-11lpom8"&&(s.textContent=g),d=l(a),b(i.$$.fragment,a)},m(a,u){o(a,s,u),o(a,d,u),v(i,a,u),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 Gt(M){let s,g=`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=g},l(d){s=m(d,"P",{"data-svelte-h":!0}),f(s)!=="svelte-fincs2"&&(s.innerHTML=g)},m(d,i){o(d,s,i)},p:ve,d(d){d&&n(s)}}}function Rt(M){let s,g="Example:",d,i,p;return i=new it({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMFZhbk1vZGVsJTBBaW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGF0YXNldHMlMjBpbXBvcnQlMjBsb2FkX2RhdGFzZXQlMEElMEFkYXRhc2V0JTIwJTNEJTIwbG9hZF9kYXRhc2V0KCUyMmh1Z2dpbmdmYWNlJTJGY2F0cy1pbWFnZSUyMiUyQyUyMHRydXN0X3JlbW90ZV9jb2RlJTNEVHJ1ZSklMEFpbWFnZSUyMCUzRCUyMGRhdGFzZXQlNUIlMjJ0ZXN0JTIyJTVEJTVCJTIyaW1hZ2UlMjIlNUQlNUIwJTVEJTBBJTBBaW1hZ2VfcHJvY2Vzc29yJTIwJTNEJTIwQXV0b0ltYWdlUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJWaXN1YWwtQXR0ZW50aW9uLU5ldHdvcmslMkZ2YW4tYmFzZSUyMiklMEFtb2RlbCUyMCUzRCUyMFZhbk1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJWaXN1YWwtQXR0ZW50aW9uLU5ldHdvcmslMkZ2YW4tYmFzZSUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjBpbWFnZV9wcm9jZXNzb3IoaW1hZ2UlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQXdpdGglMjB0b3JjaC5ub19ncmFkKCklM0ElMEElMjAlMjAlMjAlMjBvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBJTBBbGFzdF9oaWRkZW5fc3RhdGVzJTIwJTNEJTIwb3V0cHV0cy5sYXN0X2hpZGRlbl9zdGF0ZSUwQWxpc3QobGFzdF9oaWRkZW5fc3RhdGVzLnNoYXBlKQ==",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>, trust_remote_code=<span class="hljs-literal">True</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=g,d=r(),_(i.$$.fragment)},l(a){s=m(a,"P",{"data-svelte-h":!0}),f(s)!=="svelte-11lpom8"&&(s.textContent=g),d=l(a),b(i.$$.fragment,a)},m(a,u){o(a,s,u),o(a,d,u),v(i,a,u),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,g=`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=g},l(d){s=m(d,"P",{"data-svelte-h":!0}),f(s)!=="svelte-fincs2"&&(s.innerHTML=g)},m(d,i){o(d,s,i)},p:ve,d(d){d&&n(s)}}}function Bt(M){let s,g="Example:",d,i,p;return i=new it({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMFZhbkZvckltYWdlQ2xhc3NpZmljYXRpb24lMEFpbXBvcnQlMjB0b3JjaCUwQWZyb20lMjBkYXRhc2V0cyUyMGltcG9ydCUyMGxvYWRfZGF0YXNldCUwQSUwQWRhdGFzZXQlMjAlM0QlMjBsb2FkX2RhdGFzZXQoJTIyaHVnZ2luZ2ZhY2UlMkZjYXRzLWltYWdlJTIyJTJDJTIwdHJ1c3RfcmVtb3RlX2NvZGUlM0RUcnVlKSUwQWltYWdlJTIwJTNEJTIwZGF0YXNldCU1QiUyMnRlc3QlMjIlNUQlNUIlMjJpbWFnZSUyMiU1RCU1QjAlNUQlMEElMEFpbWFnZV9wcm9jZXNzb3IlMjAlM0QlMjBBdXRvSW1hZ2VQcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMlZpc3VhbC1BdHRlbnRpb24tTmV0d29yayUyRnZhbi1iYXNlJTIyKSUwQW1vZGVsJTIwJTNEJTIwVmFuRm9ySW1hZ2VDbGFzc2lmaWNhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIyVmlzdWFsLUF0dGVudGlvbi1OZXR3b3JrJTJGdmFuLWJhc2UlMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwaW1hZ2VfcHJvY2Vzc29yKGltYWdlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEElMEF3aXRoJTIwdG9yY2gubm9fZ3JhZCgpJTNBJTBBJTIwJTIwJTIwJTIwbG9naXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpLmxvZ2l0cyUwQSUwQSUyMyUyMG1vZGVsJTIwcHJlZGljdHMlMjBvbmUlMjBvZiUyMHRoZSUyMDEwMDAlMjBJbWFnZU5ldCUyMGNsYXNzZXMlMEFwcmVkaWN0ZWRfbGFiZWwlMjAlM0QlMjBsb2dpdHMuYXJnbWF4KC0xKS5pdGVtKCklMEFwcmludChtb2RlbC5jb25maWcuaWQybGFiZWwlNUJwcmVkaWN0ZWRfbGFiZWwlNUQp",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>, trust_remote_code=<span class="hljs-literal">True</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=g,d=r(),_(i.$$.fragment)},l(a){s=m(a,"P",{"data-svelte-h":!0}),f(s)!=="svelte-11lpom8"&&(s.textContent=g),d=l(a),b(i.$$.fragment,a)},m(a,u){o(a,s,u),o(a,d,u),v(i,a,u),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 Pt(M){let s,g,d,i,p,a,u,ye,R,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.",Ve,P,mt="The abstract from the paper is the following:",Ce,L,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,ut="<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,ht='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,Ze,S,_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,q,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/pr_29693/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,He,T,ne,Xe,me,wt=`This is the configuration class to store the configuration of a <a href="/docs/transformers/pr_29693/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/pr_29693/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/pr_29693/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,Qe,N,Ge,ae,Re,j,se,Se,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.`,qe,C,oe,De,ue,Tt='The <a href="/docs/transformers/pr_29693/en/model_doc/van#transformers.VanModel">VanModel</a> forward method, overrides the <code>__call__</code> special method.',Oe,k,Ke,z,Ae,re,Be,V,le,et,he,Vt=`VAN Model with an image classification head on top (a linear layer on top of the pooled features), e.g. for
ImageNet.`,tt,ge,Ct=`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/pr_29693/en/model_doc/van#transformers.VanForImageClassification">VanForImageClassification</a> forward method, overrides the <code>__call__</code> special method.',st,H,ot,G,Pe,de,Le,$e,Ee;return p=new be({props:{title:"VAN",local:"van",headingTag:"h1"}}),u=new rt({props:{warning:!0,$$slots:{default:[zt]},$$scope:{ctx:M}}}),R=new be({props:{title:"Overview",local:"overview",headingTag:"h2"}}),q=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/vr_29693/src/transformers/models/deprecated/van/configuration_van.py#L24"}}),N=new lt({props:{anchor:"transformers.VanConfig.example",$$slots:{default:[Ht]},$$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/pr_29693/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/pr_29693/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/vr_29693/src/transformers/models/deprecated/van/modeling_van.py#L409"}}),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/pr_29693/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/pr_29693/en/model_doc/vit#transformers.ViTFeatureExtractor.__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/pr_29693/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/vr_29693/src/transformers/models/deprecated/van/modeling_van.py#L424",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/pr_29693/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:[Gt]},$$scope:{ctx:M}}}),z=new lt({props:{anchor:"transformers.VanModel.forward.example",$$slots:{default:[Rt]},$$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/pr_29693/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/pr_29693/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/vr_29693/src/transformers/models/deprecated/van/modeling_van.py#L462"}}),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/pr_29693/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/pr_29693/en/model_doc/vit#transformers.ViTFeatureExtractor.__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/pr_29693/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/vr_29693/src/transformers/models/deprecated/van/modeling_van.py#L481",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/pr_29693/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/pr_29693/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/pr_29693/en/main_classes/output#transformers.modeling_outputs.ImageClassifierOutputWithNoAttention"
>transformers.modeling_outputs.ImageClassifierOutputWithNoAttention</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),H=new rt({props:{$$slots:{default:[At]},$$scope:{ctx:M}}}),G=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"),g=r(),d=c("p"),i=r(),_(p.$$.fragment),a=r(),_(u.$$.fragment),ye=r(),_(R.$$.fragment),Me=r(),A=c("p"),A.innerHTML=dt,Te=r(),B=c("p"),B.textContent=ct,Ve=r(),P=c("p"),P.textContent=mt,Ce=r(),L=c("p"),L.innerHTML=pt,xe=r(),E=c("p"),E.textContent=ft,je=r(),X=c("ul"),X.innerHTML=ut,Je=r(),Y=c("p"),Y.innerHTML=ht,Ie=r(),Q=c("img"),Ze=r(),S=c("p"),S.innerHTML=_t,Fe=r(),_(q.$$.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),He=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),Ge=r(),_(ae.$$.fragment),Re=r(),j=c("div"),_(se.$$.fragment),Se=r(),fe=c("p"),fe.innerHTML=Mt,qe=r(),C=c("div"),_(oe.$$.fragment),De=r(),ue=c("p"),ue.innerHTML=Tt,Oe=r(),_(k.$$.fragment),Ke=r(),_(z.$$.fragment),Ae=r(),_(re.$$.fragment),Be=r(),V=c("div"),_(le.$$.fragment),et=r(),he=c("p"),he.textContent=Vt,tt=r(),ge=c("p"),ge.innerHTML=Ct,nt=r(),x=c("div"),_(ie.$$.fragment),at=r(),_e=c("p"),_e.innerHTML=xt,st=r(),_(H.$$.fragment),ot=r(),_(G.$$.fragment),Pe=r(),_(de.$$.fragment),Le=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),g=l(e),d=m(e,"P",{}),ce(d).forEach(n),i=l(e),b(p.$$.fragment,e),a=l(e),b(u.$$.fragment,e),ye=l(e),b(R.$$.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),Ve=l(e),P=m(e,"P",{"data-svelte-h":!0}),f(P)!=="svelte-vfdo9a"&&(P.textContent=mt),Ce=l(e),L=m(e,"P",{"data-svelte-h":!0}),f(L)!=="svelte-eh9hlc"&&(L.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=ut),Je=l(e),Y=m(e,"P",{"data-svelte-h":!0}),f(Y)!=="svelte-zo4dsx"&&(Y.innerHTML=ht),Ie=l(e),Q=m(e,"IMG",{width:!0,src:!0}),Ze=l(e),S=m(e,"P",{"data-svelte-h":!0}),f(S)!=="svelte-10esb2x"&&(S.innerHTML=_t),Fe=l(e),b(q.$$.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-ve9h99"&&(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),He=l(e),T=m(e,"DIV",{class:!0});var J=ce(T);b(ne.$$.fragment,J),Xe=l(J),me=m(J,"P",{"data-svelte-h":!0}),f(me)!=="svelte-o3t6bj"&&(me.innerHTML=wt),Ye=l(J),pe=m(J,"P",{"data-svelte-h":!0}),f(pe)!=="svelte-jtolpf"&&(pe.innerHTML=yt),Qe=l(J),b(N.$$.fragment,J),J.forEach(n),Ge=l(e),b(ae.$$.fragment,e),Re=l(e),j=m(e,"DIV",{class:!0});var W=ce(j);b(se.$$.fragment,W),Se=l(W),fe=m(W,"P",{"data-svelte-h":!0}),f(fe)!=="svelte-16mr62j"&&(fe.innerHTML=Mt),qe=l(W),C=m(W,"DIV",{class:!0});var I=ce(C);b(oe.$$.fragment,I),De=l(I),ue=m(I,"P",{"data-svelte-h":!0}),f(ue)!=="svelte-1xob87h"&&(ue.innerHTML=Tt),Oe=l(I),b(k.$$.fragment,I),Ke=l(I),b(z.$$.fragment,I),I.forEach(n),W.forEach(n),Ae=l(e),b(re.$$.fragment,e),Be=l(e),V=m(e,"DIV",{class:!0});var Z=ce(V);b(le.$$.fragment,Z),et=l(Z),he=m(Z,"P",{"data-svelte-h":!0}),f(he)!=="svelte-lxjyb1"&&(he.textContent=Vt),tt=l(Z),ge=m(Z,"P",{"data-svelte-h":!0}),f(ge)!=="svelte-1gjh92c"&&(ge.innerHTML=Ct),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-1yv8mn9"&&(_e.innerHTML=xt),st=l(F),b(H.$$.fragment,F),ot=l(F),b(G.$$.fragment,F),F.forEach(n),Z.forEach(n),Pe=l(e),b(de.$$.fragment,e),Le=l(e),$e=m(e,"P",{}),ce($e).forEach(n),this.h()},h(){U(s,"name","hf:doc:metadata"),U(s,"content",Lt),U(Q,"width","600"),It(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(C,"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(V,"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,g,t),o(e,d,t),o(e,i,t),v(p,e,t),o(e,a,t),v(u,e,t),o(e,ye,t),v(R,e,t),o(e,Me,t),o(e,A,t),o(e,Te,t),o(e,B,t),o(e,Ve,t),o(e,P,t),o(e,Ce,t),o(e,L,t),o(e,xe,t),o(e,E,t),o(e,je,t),o(e,X,t),o(e,Je,t),o(e,Y,t),o(e,Ie,t),o(e,Q,t),o(e,Ze,t),o(e,S,t),o(e,Fe,t),v(q,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,He,t),o(e,T,t),v(ne,T,null),h(T,Xe),h(T,me),h(T,Ye),h(T,pe),h(T,Qe),v(N,T,null),o(e,Ge,t),v(ae,e,t),o(e,Re,t),o(e,j,t),v(se,j,null),h(j,Se),h(j,fe),h(j,qe),h(j,C),v(oe,C,null),h(C,De),h(C,ue),h(C,Oe),v(k,C,null),h(C,Ke),v(z,C,null),o(e,Ae,t),v(re,e,t),o(e,Be,t),o(e,V,t),v(le,V,null),h(V,et),h(V,he),h(V,tt),h(V,ge),h(V,nt),h(V,x),v(ie,x,null),h(x,at),h(x,_e),h(x,st),v(H,x,null),h(x,ot),v(G,x,null),o(e,Pe,t),v(de,e,t),o(e,Le,t),o(e,$e,t),Ee=!0},p(e,[t]){const J={};t&2&&(J.$$scope={dirty:t,ctx:e}),u.$set(J);const W={};t&2&&(W.$$scope={dirty:t,ctx:e}),N.$set(W);const I={};t&2&&(I.$$scope={dirty:t,ctx:e}),k.$set(I);const Z={};t&2&&(Z.$$scope={dirty:t,ctx:e}),z.$set(Z);const F={};t&2&&(F.$$scope={dirty:t,ctx:e}),H.$set(F);const jt={};t&2&&(jt.$$scope={dirty:t,ctx:e}),G.$set(jt)},i(e){Ee||($(p.$$.fragment,e),$(u.$$.fragment,e),$(R.$$.fragment,e),$(q.$$.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),$(H.$$.fragment,e),$(G.$$.fragment,e),$(de.$$.fragment,e),Ee=!0)},o(e){w(p.$$.fragment,e),w(u.$$.fragment,e),w(R.$$.fragment,e),w(q.$$.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(H.$$.fragment,e),w(G.$$.fragment,e),w(de.$$.fragment,e),Ee=!1},d(e){e&&(n(g),n(d),n(i),n(a),n(ye),n(Me),n(A),n(Te),n(B),n(Ve),n(P),n(Ce),n(L),n(xe),n(E),n(je),n(X),n(Je),n(Y),n(Ie),n(Q),n(Ze),n(S),n(Fe),n(We),n(D),n(Ue),n(Ne),n(K),n(ke),n(ee),n(ze),n(He),n(T),n(Ge),n(Re),n(j),n(Ae),n(Be),n(V),n(Pe),n(Le),n($e)),n(s),y(p,e),y(u,e),y(R,e),y(q,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(H),y(G),y(de,e)}}}const Lt='{"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,Pt,Jt,{})}}export{en as component};
