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