import{S as Es,i as js,s as Cs,e as o,k as f,w,t as r,M as Is,c as s,d as a,m,a as n,x as y,h as l,b as c,N as Ns,G as t,g as h,y as $,q as M,o as V,B as T,v as As,L as Fo}from"../../chunks/vendor-hf-doc-builder.js";import{T as Ts}from"../../chunks/Tip-hf-doc-builder.js";import{D as yt}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Jo}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as ot}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as ko}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";import{P as ks}from"../../chunks/PipelineTag-hf-doc-builder.js";function Fs(C){let p,b,v,u,_;return u=new Jo({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`}}),{c(){p=o("p"),b=r("Example:"),v=f(),w(u.$$.fragment)},l(i){p=s(i,"P",{});var g=n(p);b=l(g,"Example:"),g.forEach(a),v=m(i),y(u.$$.fragment,i)},m(i,g){h(i,p,g),t(p,b),h(i,v,g),$(u,i,g),_=!0},p:Fo,i(i){_||(M(u.$$.fragment,i),_=!0)},o(i){V(u.$$.fragment,i),_=!1},d(i){i&&a(p),i&&a(v),T(u,i)}}}function Js(C){let p,b,v,u,_;return{c(){p=o("p"),b=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),v=o("code"),u=r("Module"),_=r(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(i){p=s(i,"P",{});var g=n(p);b=l(g,"Although the recipe for forward pass needs to be defined within this function, one should call the "),v=s(g,"CODE",{});var A=n(v);u=l(A,"Module"),A.forEach(a),_=l(g,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),g.forEach(a)},m(i,g){h(i,p,g),t(p,b),t(p,v),t(v,u),t(p,_)},d(i){i&&a(p)}}}function Zs(C){let p,b,v,u,_;return u=new Jo({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>]`}}),{c(){p=o("p"),b=r("Example:"),v=f(),w(u.$$.fragment)},l(i){p=s(i,"P",{});var g=n(p);b=l(g,"Example:"),g.forEach(a),v=m(i),y(u.$$.fragment,i)},m(i,g){h(i,p,g),t(p,b),h(i,v,g),$(u,i,g),_=!0},p:Fo,i(i){_||(M(u.$$.fragment,i),_=!0)},o(i){V(u.$$.fragment,i),_=!1},d(i){i&&a(p),i&&a(v),T(u,i)}}}function Ws(C){let p,b,v,u,_;return{c(){p=o("p"),b=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),v=o("code"),u=r("Module"),_=r(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(i){p=s(i,"P",{});var g=n(p);b=l(g,"Although the recipe for forward pass needs to be defined within this function, one should call the "),v=s(g,"CODE",{});var A=n(v);u=l(A,"Module"),A.forEach(a),_=l(g,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),g.forEach(a)},m(i,g){h(i,p,g),t(p,b),t(p,v),t(v,u),t(p,_)},d(i){i&&a(p)}}}function xs(C){let p,b,v,u,_;return u=new Jo({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`}}),{c(){p=o("p"),b=r("Example:"),v=f(),w(u.$$.fragment)},l(i){p=s(i,"P",{});var g=n(p);b=l(g,"Example:"),g.forEach(a),v=m(i),y(u.$$.fragment,i)},m(i,g){h(i,p,g),t(p,b),h(i,v,g),$(u,i,g),_=!0},p:Fo,i(i){_||(M(u.$$.fragment,i),_=!0)},o(i){V(u.$$.fragment,i),_=!1},d(i){i&&a(p),i&&a(v),T(u,i)}}}function Us(C){let p,b,v,u,_,i,g,A,ta,$t,Z,S,st,le,aa,nt,oa,Mt,X,sa,ie,na,ra,Vt,We,la,Tt,xe,ia,Et,Ue,ce,ca,de,da,ha,jt,Pe,pa,Ct,ze,he,fa,rt,ma,ua,It,q,ga,pe,va,_a,Nt,fe,Zo,At,F,ba,me,wa,ya,ue,$a,Ma,kt,W,L,lt,ge,Va,it,Ta,Ft,Ge,Ea,Jt,ve,Zt,Y,J,Be,ja,Ca,_e,Ia,Na,be,Aa,ka,Fa,Re,Ja,Se,Za,Wt,Xe,Wa,xt,x,Q,ct,we,xa,dt,Ua,Ut,E,ye,Pa,U,za,qe,Ga,Ba,$e,Ra,Sa,Xa,P,qa,Le,La,Ya,Ye,Qa,Ha,Da,H,Pt,z,D,ht,Me,Oa,pt,Ka,zt,k,Ve,eo,Te,to,Ee,ao,oo,so,I,je,no,G,ro,Qe,lo,io,ft,co,ho,po,O,fo,K,Gt,B,ee,mt,Ce,mo,ut,uo,Bt,j,Ie,go,gt,vo,_o,Ne,bo,Ae,wo,yo,$o,N,ke,Mo,R,Vo,He,To,Eo,vt,jo,Co,Io,te,No,ae,Rt;return i=new ot({}),le=new ot({}),ge=new ot({}),ve=new ks({props:{pipeline:"image-classification"}}),we=new ot({}),ye=new yt({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-12) &#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 1e-2) &#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.30.0/src/transformers/models/van/configuration_van.py#L30"}}),H=new ko({props:{anchor:"transformers.VanConfig.example",$$slots:{default:[Fs]},$$scope:{ctx:C}}}),Me=new ot({}),Ve=new yt({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.30.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.30.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.30.0/src/transformers/models/van/modeling_van.py#L425"}}),je=new yt({props:{name:"forward",anchor:"transformers.VanModel.forward",parameters:[{name:"pixel_values",val:": typing.Optional[torch.FloatTensor]"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = 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.30.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.30.0/en/model_doc/layoutlmv2#transformers.LayoutLMv2FeatureExtractor.__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.30.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.30.0/src/transformers/models/van/modeling_van.py#L435",returnDescription:`
<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.30.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>) \u2014 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>) \u2014 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>) \u2014 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:`
<p><code>transformers.modeling_outputs.BaseModelOutputWithPoolingAndNoAttention</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),O=new Ts({props:{$$slots:{default:[Js]},$$scope:{ctx:C}}}),K=new ko({props:{anchor:"transformers.VanModel.forward.example",$$slots:{default:[Zs]},$$scope:{ctx:C}}}),Ce=new ot({}),Ie=new yt({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.30.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.30.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.30.0/src/transformers/models/van/modeling_van.py#L480"}}),ke=new yt({props:{name:"forward",anchor:"transformers.VanForImageClassification.forward",parameters:[{name:"pixel_values",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = 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.30.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.30.0/en/model_doc/layoutlmv2#transformers.LayoutLMv2FeatureExtractor.__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.30.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.30.0/src/transformers/models/van/modeling_van.py#L492",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.30.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.30.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) \u2014 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>) \u2014 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>) \u2014 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:`
<p><a
  href="/docs/transformers/v4.30.0/en/main_classes/output#transformers.modeling_outputs.ImageClassifierOutputWithNoAttention"
>transformers.modeling_outputs.ImageClassifierOutputWithNoAttention</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),te=new Ts({props:{$$slots:{default:[Ws]},$$scope:{ctx:C}}}),ae=new ko({props:{anchor:"transformers.VanForImageClassification.forward.example",$$slots:{default:[xs]},$$scope:{ctx:C}}}),{c(){p=o("meta"),b=f(),v=o("h1"),u=o("a"),_=o("span"),w(i.$$.fragment),g=f(),A=o("span"),ta=r("VAN"),$t=f(),Z=o("h2"),S=o("a"),st=o("span"),w(le.$$.fragment),aa=f(),nt=o("span"),oa=r("Overview"),Mt=f(),X=o("p"),sa=r("The VAN model was proposed in "),ie=o("a"),na=r("Visual Attention Network"),ra=r(" by Meng-Hao Guo, Cheng-Ze Lu, Zheng-Ning Liu, Ming-Ming Cheng, Shi-Min Hu."),Vt=f(),We=o("p"),la=r("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."),Tt=f(),xe=o("p"),ia=r("The abstract from the paper is the following:"),Et=f(),Ue=o("p"),ce=o("em"),ca=r("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 "),de=o("a"),da=r("this https URL"),ha=r("."),jt=f(),Pe=o("p"),pa=r("Tips:"),Ct=f(),ze=o("ul"),he=o("li"),fa=r("VAN does not have an embedding layer, thus the "),rt=o("code"),ma=r("hidden_states"),ua=r(" will have a length equal to the number of stages."),It=f(),q=o("p"),ga=r("The figure below illustrates the architecture of a Visual Aattention Layer. Taken from the "),pe=o("a"),va=r("original paper"),_a=r("."),Nt=f(),fe=o("img"),At=f(),F=o("p"),ba=r("This model was contributed by "),me=o("a"),wa=r("Francesco"),ya=r(". The original code can be found "),ue=o("a"),$a=r("here"),Ma=r("."),kt=f(),W=o("h2"),L=o("a"),lt=o("span"),w(ge.$$.fragment),Va=f(),it=o("span"),Ta=r("Resources"),Ft=f(),Ge=o("p"),Ea=r("A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with VAN."),Jt=f(),w(ve.$$.fragment),Zt=f(),Y=o("ul"),J=o("li"),Be=o("a"),ja=r("VanForImageClassification"),Ca=r(" is supported by this "),_e=o("a"),Ia=r("example script"),Na=r(" and "),be=o("a"),Aa=r("notebook"),ka=r("."),Fa=f(),Re=o("li"),Ja=r("See also: "),Se=o("a"),Za=r("Image classification task guide"),Wt=f(),Xe=o("p"),Wa=r("If you\u2019re interested in submitting a resource to be included here, please feel free to open a Pull Request and we\u2019ll review it! The resource should ideally demonstrate something new instead of duplicating an existing resource."),xt=f(),x=o("h2"),Q=o("a"),ct=o("span"),w(we.$$.fragment),xa=f(),dt=o("span"),Ua=r("VanConfig"),Ut=f(),E=o("div"),w(ye.$$.fragment),Pa=f(),U=o("p"),za=r("This is the configuration class to store the configuration of a "),qe=o("a"),Ga=r("VanModel"),Ba=r(`. 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
`),$e=o("a"),Ra=r("Visual-Attention-Network/van-base"),Sa=r(" architecture."),Xa=f(),P=o("p"),qa=r("Configuration objects inherit from "),Le=o("a"),La=r("PretrainedConfig"),Ya=r(` and can be used to control the model outputs. Read the
documentation from `),Ye=o("a"),Qa=r("PretrainedConfig"),Ha=r(" for more information."),Da=f(),w(H.$$.fragment),Pt=f(),z=o("h2"),D=o("a"),ht=o("span"),w(Me.$$.fragment),Oa=f(),pt=o("span"),Ka=r("VanModel"),zt=f(),k=o("div"),w(Ve.$$.fragment),eo=f(),Te=o("p"),to=r(`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 `),Ee=o("a"),ao=r("torch.nn.Module"),oo=r(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),so=f(),I=o("div"),w(je.$$.fragment),no=f(),G=o("p"),ro=r("The "),Qe=o("a"),lo=r("VanModel"),io=r(" forward method, overrides the "),ft=o("code"),co=r("__call__"),ho=r(" special method."),po=f(),w(O.$$.fragment),fo=f(),w(K.$$.fragment),Gt=f(),B=o("h2"),ee=o("a"),mt=o("span"),w(Ce.$$.fragment),mo=f(),ut=o("span"),uo=r("VanForImageClassification"),Bt=f(),j=o("div"),w(Ie.$$.fragment),go=f(),gt=o("p"),vo=r(`VAN Model with an image classification head on top (a linear layer on top of the pooled features), e.g. for
ImageNet.`),_o=f(),Ne=o("p"),bo=r("This model is a PyTorch "),Ae=o("a"),wo=r("torch.nn.Module"),yo=r(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),$o=f(),N=o("div"),w(ke.$$.fragment),Mo=f(),R=o("p"),Vo=r("The "),He=o("a"),To=r("VanForImageClassification"),Eo=r(" forward method, overrides the "),vt=o("code"),jo=r("__call__"),Co=r(" special method."),Io=f(),w(te.$$.fragment),No=f(),w(ae.$$.fragment),this.h()},l(e){const d=Is('[data-svelte="svelte-1phssyn"]',document.head);p=s(d,"META",{name:!0,content:!0}),d.forEach(a),b=m(e),v=s(e,"H1",{class:!0});var Fe=n(v);u=s(Fe,"A",{id:!0,class:!0,href:!0});var _t=n(u);_=s(_t,"SPAN",{});var bt=n(_);y(i.$$.fragment,bt),bt.forEach(a),_t.forEach(a),g=m(Fe),A=s(Fe,"SPAN",{});var wt=n(A);ta=l(wt,"VAN"),wt.forEach(a),Fe.forEach(a),$t=m(e),Z=s(e,"H2",{class:!0});var Je=n(Z);S=s(Je,"A",{id:!0,class:!0,href:!0});var Wo=n(S);st=s(Wo,"SPAN",{});var xo=n(st);y(le.$$.fragment,xo),xo.forEach(a),Wo.forEach(a),aa=m(Je),nt=s(Je,"SPAN",{});var Uo=n(nt);oa=l(Uo,"Overview"),Uo.forEach(a),Je.forEach(a),Mt=m(e),X=s(e,"P",{});var St=n(X);sa=l(St,"The VAN model was proposed in "),ie=s(St,"A",{href:!0,rel:!0});var Po=n(ie);na=l(Po,"Visual Attention Network"),Po.forEach(a),ra=l(St," by Meng-Hao Guo, Cheng-Ze Lu, Zheng-Ning Liu, Ming-Ming Cheng, Shi-Min Hu."),St.forEach(a),Vt=m(e),We=s(e,"P",{});var zo=n(We);la=l(zo,"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."),zo.forEach(a),Tt=m(e),xe=s(e,"P",{});var Go=n(xe);ia=l(Go,"The abstract from the paper is the following:"),Go.forEach(a),Et=m(e),Ue=s(e,"P",{});var Bo=n(Ue);ce=s(Bo,"EM",{});var Xt=n(ce);ca=l(Xt,"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 "),de=s(Xt,"A",{href:!0,rel:!0});var Ro=n(de);da=l(Ro,"this https URL"),Ro.forEach(a),ha=l(Xt,"."),Xt.forEach(a),Bo.forEach(a),jt=m(e),Pe=s(e,"P",{});var So=n(Pe);pa=l(So,"Tips:"),So.forEach(a),Ct=m(e),ze=s(e,"UL",{});var Xo=n(ze);he=s(Xo,"LI",{});var qt=n(he);fa=l(qt,"VAN does not have an embedding layer, thus the "),rt=s(qt,"CODE",{});var qo=n(rt);ma=l(qo,"hidden_states"),qo.forEach(a),ua=l(qt," will have a length equal to the number of stages."),qt.forEach(a),Xo.forEach(a),It=m(e),q=s(e,"P",{});var Lt=n(q);ga=l(Lt,"The figure below illustrates the architecture of a Visual Aattention Layer. Taken from the "),pe=s(Lt,"A",{href:!0,rel:!0});var Lo=n(pe);va=l(Lo,"original paper"),Lo.forEach(a),_a=l(Lt,"."),Lt.forEach(a),Nt=m(e),fe=s(e,"IMG",{width:!0,src:!0}),At=m(e),F=s(e,"P",{});var De=n(F);ba=l(De,"This model was contributed by "),me=s(De,"A",{href:!0,rel:!0});var Yo=n(me);wa=l(Yo,"Francesco"),Yo.forEach(a),ya=l(De,". The original code can be found "),ue=s(De,"A",{href:!0,rel:!0});var Qo=n(ue);$a=l(Qo,"here"),Qo.forEach(a),Ma=l(De,"."),De.forEach(a),kt=m(e),W=s(e,"H2",{class:!0});var Yt=n(W);L=s(Yt,"A",{id:!0,class:!0,href:!0});var Ho=n(L);lt=s(Ho,"SPAN",{});var Do=n(lt);y(ge.$$.fragment,Do),Do.forEach(a),Ho.forEach(a),Va=m(Yt),it=s(Yt,"SPAN",{});var Oo=n(it);Ta=l(Oo,"Resources"),Oo.forEach(a),Yt.forEach(a),Ft=m(e),Ge=s(e,"P",{});var Ko=n(Ge);Ea=l(Ko,"A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with VAN."),Ko.forEach(a),Jt=m(e),y(ve.$$.fragment,e),Zt=m(e),Y=s(e,"UL",{});var Qt=n(Y);J=s(Qt,"LI",{});var Ze=n(J);Be=s(Ze,"A",{href:!0});var es=n(Be);ja=l(es,"VanForImageClassification"),es.forEach(a),Ca=l(Ze," is supported by this "),_e=s(Ze,"A",{href:!0,rel:!0});var ts=n(_e);Ia=l(ts,"example script"),ts.forEach(a),Na=l(Ze," and "),be=s(Ze,"A",{href:!0,rel:!0});var as=n(be);Aa=l(as,"notebook"),as.forEach(a),ka=l(Ze,"."),Ze.forEach(a),Fa=m(Qt),Re=s(Qt,"LI",{});var Ao=n(Re);Ja=l(Ao,"See also: "),Se=s(Ao,"A",{href:!0});var os=n(Se);Za=l(os,"Image classification task guide"),os.forEach(a),Ao.forEach(a),Qt.forEach(a),Wt=m(e),Xe=s(e,"P",{});var ss=n(Xe);Wa=l(ss,"If you\u2019re interested in submitting a resource to be included here, please feel free to open a Pull Request and we\u2019ll review it! The resource should ideally demonstrate something new instead of duplicating an existing resource."),ss.forEach(a),xt=m(e),x=s(e,"H2",{class:!0});var Ht=n(x);Q=s(Ht,"A",{id:!0,class:!0,href:!0});var ns=n(Q);ct=s(ns,"SPAN",{});var rs=n(ct);y(we.$$.fragment,rs),rs.forEach(a),ns.forEach(a),xa=m(Ht),dt=s(Ht,"SPAN",{});var ls=n(dt);Ua=l(ls,"VanConfig"),ls.forEach(a),Ht.forEach(a),Ut=m(e),E=s(e,"DIV",{class:!0});var oe=n(E);y(ye.$$.fragment,oe),Pa=m(oe),U=s(oe,"P",{});var Oe=n(U);za=l(Oe,"This is the configuration class to store the configuration of a "),qe=s(Oe,"A",{href:!0});var is=n(qe);Ga=l(is,"VanModel"),is.forEach(a),Ba=l(Oe,`. 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
`),$e=s(Oe,"A",{href:!0,rel:!0});var cs=n($e);Ra=l(cs,"Visual-Attention-Network/van-base"),cs.forEach(a),Sa=l(Oe," architecture."),Oe.forEach(a),Xa=m(oe),P=s(oe,"P",{});var Ke=n(P);qa=l(Ke,"Configuration objects inherit from "),Le=s(Ke,"A",{href:!0});var ds=n(Le);La=l(ds,"PretrainedConfig"),ds.forEach(a),Ya=l(Ke,` and can be used to control the model outputs. Read the
documentation from `),Ye=s(Ke,"A",{href:!0});var hs=n(Ye);Qa=l(hs,"PretrainedConfig"),hs.forEach(a),Ha=l(Ke," for more information."),Ke.forEach(a),Da=m(oe),y(H.$$.fragment,oe),oe.forEach(a),Pt=m(e),z=s(e,"H2",{class:!0});var Dt=n(z);D=s(Dt,"A",{id:!0,class:!0,href:!0});var ps=n(D);ht=s(ps,"SPAN",{});var fs=n(ht);y(Me.$$.fragment,fs),fs.forEach(a),ps.forEach(a),Oa=m(Dt),pt=s(Dt,"SPAN",{});var ms=n(pt);Ka=l(ms,"VanModel"),ms.forEach(a),Dt.forEach(a),zt=m(e),k=s(e,"DIV",{class:!0});var et=n(k);y(Ve.$$.fragment,et),eo=m(et),Te=s(et,"P",{});var Ot=n(Te);to=l(Ot,`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 `),Ee=s(Ot,"A",{href:!0,rel:!0});var us=n(Ee);ao=l(us,"torch.nn.Module"),us.forEach(a),oo=l(Ot,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Ot.forEach(a),so=m(et),I=s(et,"DIV",{class:!0});var se=n(I);y(je.$$.fragment,se),no=m(se),G=s(se,"P",{});var tt=n(G);ro=l(tt,"The "),Qe=s(tt,"A",{href:!0});var gs=n(Qe);lo=l(gs,"VanModel"),gs.forEach(a),io=l(tt," forward method, overrides the "),ft=s(tt,"CODE",{});var vs=n(ft);co=l(vs,"__call__"),vs.forEach(a),ho=l(tt," special method."),tt.forEach(a),po=m(se),y(O.$$.fragment,se),fo=m(se),y(K.$$.fragment,se),se.forEach(a),et.forEach(a),Gt=m(e),B=s(e,"H2",{class:!0});var Kt=n(B);ee=s(Kt,"A",{id:!0,class:!0,href:!0});var _s=n(ee);mt=s(_s,"SPAN",{});var bs=n(mt);y(Ce.$$.fragment,bs),bs.forEach(a),_s.forEach(a),mo=m(Kt),ut=s(Kt,"SPAN",{});var ws=n(ut);uo=l(ws,"VanForImageClassification"),ws.forEach(a),Kt.forEach(a),Bt=m(e),j=s(e,"DIV",{class:!0});var ne=n(j);y(Ie.$$.fragment,ne),go=m(ne),gt=s(ne,"P",{});var ys=n(gt);vo=l(ys,`VAN Model with an image classification head on top (a linear layer on top of the pooled features), e.g. for
ImageNet.`),ys.forEach(a),_o=m(ne),Ne=s(ne,"P",{});var ea=n(Ne);bo=l(ea,"This model is a PyTorch "),Ae=s(ea,"A",{href:!0,rel:!0});var $s=n(Ae);wo=l($s,"torch.nn.Module"),$s.forEach(a),yo=l(ea,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),ea.forEach(a),$o=m(ne),N=s(ne,"DIV",{class:!0});var re=n(N);y(ke.$$.fragment,re),Mo=m(re),R=s(re,"P",{});var at=n(R);Vo=l(at,"The "),He=s(at,"A",{href:!0});var Ms=n(He);To=l(Ms,"VanForImageClassification"),Ms.forEach(a),Eo=l(at," forward method, overrides the "),vt=s(at,"CODE",{});var Vs=n(vt);jo=l(Vs,"__call__"),Vs.forEach(a),Co=l(at," special method."),at.forEach(a),Io=m(re),y(te.$$.fragment,re),No=m(re),y(ae.$$.fragment,re),re.forEach(a),ne.forEach(a),this.h()},h(){c(p,"name","hf:doc:metadata"),c(p,"content",JSON.stringify(Ps)),c(u,"id","van"),c(u,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(u,"href","#van"),c(v,"class","relative group"),c(S,"id","overview"),c(S,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(S,"href","#overview"),c(Z,"class","relative group"),c(ie,"href","https://arxiv.org/abs/2202.09741"),c(ie,"rel","nofollow"),c(de,"href","https://github.com/Visual-Attention-Network/VAN-Classification"),c(de,"rel","nofollow"),c(pe,"href","https://arxiv.org/abs/2202.09741"),c(pe,"rel","nofollow"),c(fe,"width","600"),Ns(fe.src,Zo="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/van_architecture.png")||c(fe,"src",Zo),c(me,"href","https://huggingface.co/Francesco"),c(me,"rel","nofollow"),c(ue,"href","https://github.com/Visual-Attention-Network/VAN-Classification"),c(ue,"rel","nofollow"),c(L,"id","resources"),c(L,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(L,"href","#resources"),c(W,"class","relative group"),c(Be,"href","/docs/transformers/v4.30.0/en/model_doc/van#transformers.VanForImageClassification"),c(_e,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/image-classification"),c(_e,"rel","nofollow"),c(be,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/image_classification.ipynb"),c(be,"rel","nofollow"),c(Se,"href","../tasks/image_classification"),c(Q,"id","transformers.VanConfig"),c(Q,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(Q,"href","#transformers.VanConfig"),c(x,"class","relative group"),c(qe,"href","/docs/transformers/v4.30.0/en/model_doc/van#transformers.VanModel"),c($e,"href","https://huggingface.co/Visual-Attention-Network/van-base"),c($e,"rel","nofollow"),c(Le,"href","/docs/transformers/v4.30.0/en/main_classes/configuration#transformers.PretrainedConfig"),c(Ye,"href","/docs/transformers/v4.30.0/en/main_classes/configuration#transformers.PretrainedConfig"),c(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(D,"id","transformers.VanModel"),c(D,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(D,"href","#transformers.VanModel"),c(z,"class","relative group"),c(Ee,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(Ee,"rel","nofollow"),c(Qe,"href","/docs/transformers/v4.30.0/en/model_doc/van#transformers.VanModel"),c(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(ee,"id","transformers.VanForImageClassification"),c(ee,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(ee,"href","#transformers.VanForImageClassification"),c(B,"class","relative group"),c(Ae,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(Ae,"rel","nofollow"),c(He,"href","/docs/transformers/v4.30.0/en/model_doc/van#transformers.VanForImageClassification"),c(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(j,"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,d){t(document.head,p),h(e,b,d),h(e,v,d),t(v,u),t(u,_),$(i,_,null),t(v,g),t(v,A),t(A,ta),h(e,$t,d),h(e,Z,d),t(Z,S),t(S,st),$(le,st,null),t(Z,aa),t(Z,nt),t(nt,oa),h(e,Mt,d),h(e,X,d),t(X,sa),t(X,ie),t(ie,na),t(X,ra),h(e,Vt,d),h(e,We,d),t(We,la),h(e,Tt,d),h(e,xe,d),t(xe,ia),h(e,Et,d),h(e,Ue,d),t(Ue,ce),t(ce,ca),t(ce,de),t(de,da),t(ce,ha),h(e,jt,d),h(e,Pe,d),t(Pe,pa),h(e,Ct,d),h(e,ze,d),t(ze,he),t(he,fa),t(he,rt),t(rt,ma),t(he,ua),h(e,It,d),h(e,q,d),t(q,ga),t(q,pe),t(pe,va),t(q,_a),h(e,Nt,d),h(e,fe,d),h(e,At,d),h(e,F,d),t(F,ba),t(F,me),t(me,wa),t(F,ya),t(F,ue),t(ue,$a),t(F,Ma),h(e,kt,d),h(e,W,d),t(W,L),t(L,lt),$(ge,lt,null),t(W,Va),t(W,it),t(it,Ta),h(e,Ft,d),h(e,Ge,d),t(Ge,Ea),h(e,Jt,d),$(ve,e,d),h(e,Zt,d),h(e,Y,d),t(Y,J),t(J,Be),t(Be,ja),t(J,Ca),t(J,_e),t(_e,Ia),t(J,Na),t(J,be),t(be,Aa),t(J,ka),t(Y,Fa),t(Y,Re),t(Re,Ja),t(Re,Se),t(Se,Za),h(e,Wt,d),h(e,Xe,d),t(Xe,Wa),h(e,xt,d),h(e,x,d),t(x,Q),t(Q,ct),$(we,ct,null),t(x,xa),t(x,dt),t(dt,Ua),h(e,Ut,d),h(e,E,d),$(ye,E,null),t(E,Pa),t(E,U),t(U,za),t(U,qe),t(qe,Ga),t(U,Ba),t(U,$e),t($e,Ra),t(U,Sa),t(E,Xa),t(E,P),t(P,qa),t(P,Le),t(Le,La),t(P,Ya),t(P,Ye),t(Ye,Qa),t(P,Ha),t(E,Da),$(H,E,null),h(e,Pt,d),h(e,z,d),t(z,D),t(D,ht),$(Me,ht,null),t(z,Oa),t(z,pt),t(pt,Ka),h(e,zt,d),h(e,k,d),$(Ve,k,null),t(k,eo),t(k,Te),t(Te,to),t(Te,Ee),t(Ee,ao),t(Te,oo),t(k,so),t(k,I),$(je,I,null),t(I,no),t(I,G),t(G,ro),t(G,Qe),t(Qe,lo),t(G,io),t(G,ft),t(ft,co),t(G,ho),t(I,po),$(O,I,null),t(I,fo),$(K,I,null),h(e,Gt,d),h(e,B,d),t(B,ee),t(ee,mt),$(Ce,mt,null),t(B,mo),t(B,ut),t(ut,uo),h(e,Bt,d),h(e,j,d),$(Ie,j,null),t(j,go),t(j,gt),t(gt,vo),t(j,_o),t(j,Ne),t(Ne,bo),t(Ne,Ae),t(Ae,wo),t(Ne,yo),t(j,$o),t(j,N),$(ke,N,null),t(N,Mo),t(N,R),t(R,Vo),t(R,He),t(He,To),t(R,Eo),t(R,vt),t(vt,jo),t(R,Co),t(N,Io),$(te,N,null),t(N,No),$(ae,N,null),Rt=!0},p(e,[d]){const Fe={};d&2&&(Fe.$$scope={dirty:d,ctx:e}),H.$set(Fe);const _t={};d&2&&(_t.$$scope={dirty:d,ctx:e}),O.$set(_t);const bt={};d&2&&(bt.$$scope={dirty:d,ctx:e}),K.$set(bt);const wt={};d&2&&(wt.$$scope={dirty:d,ctx:e}),te.$set(wt);const Je={};d&2&&(Je.$$scope={dirty:d,ctx:e}),ae.$set(Je)},i(e){Rt||(M(i.$$.fragment,e),M(le.$$.fragment,e),M(ge.$$.fragment,e),M(ve.$$.fragment,e),M(we.$$.fragment,e),M(ye.$$.fragment,e),M(H.$$.fragment,e),M(Me.$$.fragment,e),M(Ve.$$.fragment,e),M(je.$$.fragment,e),M(O.$$.fragment,e),M(K.$$.fragment,e),M(Ce.$$.fragment,e),M(Ie.$$.fragment,e),M(ke.$$.fragment,e),M(te.$$.fragment,e),M(ae.$$.fragment,e),Rt=!0)},o(e){V(i.$$.fragment,e),V(le.$$.fragment,e),V(ge.$$.fragment,e),V(ve.$$.fragment,e),V(we.$$.fragment,e),V(ye.$$.fragment,e),V(H.$$.fragment,e),V(Me.$$.fragment,e),V(Ve.$$.fragment,e),V(je.$$.fragment,e),V(O.$$.fragment,e),V(K.$$.fragment,e),V(Ce.$$.fragment,e),V(Ie.$$.fragment,e),V(ke.$$.fragment,e),V(te.$$.fragment,e),V(ae.$$.fragment,e),Rt=!1},d(e){a(p),e&&a(b),e&&a(v),T(i),e&&a($t),e&&a(Z),T(le),e&&a(Mt),e&&a(X),e&&a(Vt),e&&a(We),e&&a(Tt),e&&a(xe),e&&a(Et),e&&a(Ue),e&&a(jt),e&&a(Pe),e&&a(Ct),e&&a(ze),e&&a(It),e&&a(q),e&&a(Nt),e&&a(fe),e&&a(At),e&&a(F),e&&a(kt),e&&a(W),T(ge),e&&a(Ft),e&&a(Ge),e&&a(Jt),T(ve,e),e&&a(Zt),e&&a(Y),e&&a(Wt),e&&a(Xe),e&&a(xt),e&&a(x),T(we),e&&a(Ut),e&&a(E),T(ye),T(H),e&&a(Pt),e&&a(z),T(Me),e&&a(zt),e&&a(k),T(Ve),T(je),T(O),T(K),e&&a(Gt),e&&a(B),T(Ce),e&&a(Bt),e&&a(j),T(Ie),T(ke),T(te),T(ae)}}}const Ps={local:"van",sections:[{local:"overview",title:"Overview"},{local:"resources",title:"Resources"},{local:"transformers.VanConfig",title:"VanConfig"},{local:"transformers.VanModel",title:"VanModel"},{local:"transformers.VanForImageClassification",title:"VanForImageClassification"}],title:"VAN"};function zs(C){return As(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ys extends Es{constructor(p){super();js(this,p,zs,Us,Cs,{})}}export{Ys as default,Ps as metadata};
