import{S as Ss,i as ks,s as Vs,e as a,k as h,w,t as n,M as Is,c as s,d as o,m as f,a as r,x as T,h as i,b as c,N as Es,G as t,g as m,y as M,q as $,o as y,B as N,v as Cs,L as Ca}from"../../chunks/vendor-hf-doc-builder.js";import{T as Ns}from"../../chunks/Tip-hf-doc-builder.js";import{D as $t}from"../../chunks/Docstring-hf-doc-builder.js";import{C as xa}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as at}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Ea}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";import{P as xs}from"../../chunks/PipelineTag-hf-doc-builder.js";function Ps(V){let p,b,_,u,v;return u=new xa({props:{code:`from transformers import ViTMSNModel, ViTMSNConfig

# Initializing a ViT MSN vit-msn-base style configuration
configuration = ViTConfig()

# Initializing a model from the vit-msn-base style configuration
model = ViTMSNModel(configuration)

# Accessing the model configuration
configuration = model.config`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> ViTMSNModel, ViTMSNConfig

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a ViT MSN vit-msn-base style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = ViTConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model from the vit-msn-base style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ViTMSNModel(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=a("p"),b=n("Example:"),_=h(),w(u.$$.fragment)},l(l){p=s(l,"P",{});var g=r(p);b=i(g,"Example:"),g.forEach(o),_=f(l),T(u.$$.fragment,l)},m(l,g){m(l,p,g),t(p,b),m(l,_,g),M(u,l,g),v=!0},p:Ca,i(l){v||($(u.$$.fragment,l),v=!0)},o(l){y(u.$$.fragment,l),v=!1},d(l){l&&o(p),l&&o(_),N(u,l)}}}function js(V){let p,b,_,u,v;return{c(){p=a("p"),b=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a("code"),u=n("Module"),v=n(`
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(l){p=s(l,"P",{});var g=r(p);b=i(g,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=s(g,"CODE",{});var C=r(_);u=i(C,"Module"),C.forEach(o),v=i(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(o)},m(l,g){m(l,p,g),t(p,b),t(p,_),t(_,u),t(p,v)},d(l){l&&o(p)}}}function As(V){let p,b,_,u,v;return u=new xa({props:{code:`from transformers import AutoImageProcessor, ViTMSNModel
import torch
from PIL import Image
import requests

url = "http://images.cocodataset.org/val2017/000000039769.jpg"
image = Image.open(requests.get(url, stream=True).raw)

image_processor = AutoImageProcessor.from_pretrained("facebook/vit-msn-small")
model = ViTMSNModel.from_pretrained("facebook/vit-msn-small")
inputs = image_processor(images=image, return_tensors="pt")
with torch.no_grad():
    outputs = model(**inputs)
last_hidden_states = outputs.last_hidden_state`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, ViTMSNModel
<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> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests

<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;http://images.cocodataset.org/val2017/000000039769.jpg&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw)

<span class="hljs-meta">&gt;&gt;&gt; </span>image_processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">&quot;facebook/vit-msn-small&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ViTMSNModel.from_pretrained(<span class="hljs-string">&quot;facebook/vit-msn-small&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = image_processor(images=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`}}),{c(){p=a("p"),b=n("Examples:"),_=h(),w(u.$$.fragment)},l(l){p=s(l,"P",{});var g=r(p);b=i(g,"Examples:"),g.forEach(o),_=f(l),T(u.$$.fragment,l)},m(l,g){m(l,p,g),t(p,b),m(l,_,g),M(u,l,g),v=!0},p:Ca,i(l){v||($(u.$$.fragment,l),v=!0)},o(l){y(u.$$.fragment,l),v=!1},d(l){l&&o(p),l&&o(_),N(u,l)}}}function Fs(V){let p,b,_,u,v;return{c(){p=a("p"),b=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a("code"),u=n("Module"),v=n(`
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(l){p=s(l,"P",{});var g=r(p);b=i(g,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=s(g,"CODE",{});var C=r(_);u=i(C,"Module"),C.forEach(o),v=i(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(o)},m(l,g){m(l,p,g),t(p,b),t(p,_),t(_,u),t(p,v)},d(l){l&&o(p)}}}function qs(V){let p,b,_,u,v;return u=new xa({props:{code:`from transformers import AutoImageProcessor, ViTMSNForImageClassification
import torch
from PIL import Image
import requests

torch.manual_seed(2)
url = "http://images.cocodataset.org/val2017/000000039769.jpg"
image = Image.open(requests.get(url, stream=True).raw)

image_processor = AutoImageProcessor.from_pretrained("facebook/vit-msn-small")
model = ViTMSNForImageClassification.from_pretrained("facebook/vit-msn-small")

inputs = image_processor(images=image, return_tensors="pt")
with torch.no_grad():
    logits = model(**inputs).logits
# model predicts one of the 1000 ImageNet classes
predicted_label = logits.argmax(-1).item()
print(model.config.id2label[predicted_label])`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, ViTMSNForImageClassification
<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> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests

<span class="hljs-meta">&gt;&gt;&gt; </span>torch.manual_seed(<span class="hljs-number">2</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;http://images.cocodataset.org/val2017/000000039769.jpg&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw)

<span class="hljs-meta">&gt;&gt;&gt; </span>image_processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">&quot;facebook/vit-msn-small&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ViTMSNForImageClassification.from_pretrained(<span class="hljs-string">&quot;facebook/vit-msn-small&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = image_processor(images=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])
Kerry blue terrier`}}),{c(){p=a("p"),b=n("Examples:"),_=h(),w(u.$$.fragment)},l(l){p=s(l,"P",{});var g=r(p);b=i(g,"Examples:"),g.forEach(o),_=f(l),T(u.$$.fragment,l)},m(l,g){m(l,p,g),t(p,b),m(l,_,g),M(u,l,g),v=!0},p:Ca,i(l){v||($(u.$$.fragment,l),v=!0)},o(l){y(u.$$.fragment,l),v=!1},d(l){l&&o(p),l&&o(_),N(u,l)}}}function zs(V){let p,b,_,u,v,l,g,C,Yt,yt,q,K,st,ce,Zt,rt,eo,Nt,U,to,de,oo,ao,St,Ae,so,kt,Fe,nt,ro,Vt,qe,no,It,j,it,io,lo,x,co,ze,mo,po,Oe,ho,fo,me,uo,go,_o,lt,vo,Et,J,Pa,Ct,pe,bo,Le,wo,xt,A,To,he,Mo,$o,fe,yo,No,Pt,z,G,ct,ue,So,dt,ko,jt,De,Vo,At,ge,Ft,Be,F,We,Io,Eo,_e,Co,xo,ve,Po,jo,qt,He,Ao,zt,O,Q,mt,be,Fo,pt,qo,Ot,S,we,zo,L,Oo,Re,Lo,Do,Te,Bo,Wo,Ho,D,Ro,Ke,Ko,Uo,Ue,Jo,Go,Qo,X,Lt,B,Y,ht,Me,Xo,ft,Yo,Dt,P,$e,Zo,ye,ea,Ne,ta,oa,aa,I,Se,sa,W,ra,Je,na,ia,ut,la,ca,da,Z,ma,ee,Bt,H,te,gt,ke,pa,_t,ha,Wt,k,Ve,fa,vt,ua,ga,Ie,_a,Ee,va,ba,wa,E,Ce,Ta,R,Ma,Ge,$a,ya,bt,Na,Sa,ka,oe,Va,ae,Ht;return l=new at({}),ce=new at({}),ue=new at({}),ge=new xs({props:{pipeline:"image-classification"}}),be=new at({}),we=new $t({props:{name:"class transformers.ViTMSNConfig",anchor:"transformers.ViTMSNConfig",parameters:[{name:"hidden_size",val:" = 768"},{name:"num_hidden_layers",val:" = 12"},{name:"num_attention_heads",val:" = 12"},{name:"intermediate_size",val:" = 3072"},{name:"hidden_act",val:" = 'gelu'"},{name:"hidden_dropout_prob",val:" = 0.0"},{name:"attention_probs_dropout_prob",val:" = 0.0"},{name:"initializer_range",val:" = 0.02"},{name:"layer_norm_eps",val:" = 1e-06"},{name:"image_size",val:" = 224"},{name:"patch_size",val:" = 16"},{name:"num_channels",val:" = 3"},{name:"qkv_bias",val:" = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.ViTMSNConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 768) &#x2014;
Dimensionality of the encoder layers and the pooler layer.`,name:"hidden_size"},{anchor:"transformers.ViTMSNConfig.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"num_hidden_layers"},{anchor:"transformers.ViTMSNConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"num_attention_heads"},{anchor:"transformers.ViTMSNConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 3072) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (i.e., feed-forward) layer in the Transformer encoder.`,name:"intermediate_size"},{anchor:"transformers.ViTMSNConfig.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 the encoder and pooler. 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.ViTMSNConfig.hidden_dropout_prob",description:`<strong>hidden_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout probability for all fully connected layers in the embeddings, encoder, and pooler.`,name:"hidden_dropout_prob"},{anchor:"transformers.ViTMSNConfig.attention_probs_dropout_prob",description:`<strong>attention_probs_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout ratio for the attention probabilities.`,name:"attention_probs_dropout_prob"},{anchor:"transformers.ViTMSNConfig.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.ViTMSNConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-06) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.ViTMSNConfig.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.ViTMSNConfig.patch_size",description:`<strong>patch_size</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014;
The size (resolution) of each patch.`,name:"patch_size"},{anchor:"transformers.ViTMSNConfig.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.ViTMSNConfig.qkv_bias",description:`<strong>qkv_bias</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to add a bias to the queries, keys and values.`,name:"qkv_bias"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/vit_msn/configuration_vit_msn.py#L30"}}),X=new Ea({props:{anchor:"transformers.ViTMSNConfig.example",$$slots:{default:[Ps]},$$scope:{ctx:V}}}),Me=new at({}),$e=new $t({props:{name:"class transformers.ViTMSNModel",anchor:"transformers.ViTMSNModel",parameters:[{name:"config",val:": ViTMSNConfig"},{name:"use_mask_token",val:": bool = False"}],parametersDescription:[{anchor:"transformers.ViTMSNModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/vit_msn#transformers.ViTMSNConfig">ViTMSNConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/vit_msn/modeling_vit_msn.py#L493"}}),Se=new $t({props:{name:"forward",anchor:"transformers.ViTMSNModel.forward",parameters:[{name:"pixel_values",val:": typing.Optional[torch.Tensor] = None"},{name:"bool_masked_pos",val:": typing.Optional[torch.BoolTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"interpolate_pos_encoding",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.ViTMSNModel.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/main/en/model_doc/poolformer#transformers.PoolFormerFeatureExtractor.__call__">ViTImageProcessor.<strong>call</strong>()</a>
for details.`,name:"pixel_values"},{anchor:"transformers.ViTMSNModel.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.ViTMSNModel.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.ViTMSNModel.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 layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.ViTMSNModel.forward.interpolate_pos_encoding",description:`<strong>interpolate_pos_encoding</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether to interpolate the pre-trained position encodings.`,name:"interpolate_pos_encoding"},{anchor:"transformers.ViTMSNModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/vit_msn/modeling_vit_msn.py#L517",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.BaseModelOutput"
>transformers.modeling_outputs.BaseModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/vit_msn#transformers.ViTMSNConfig"
>ViTMSNConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</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, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.BaseModelOutput"
>transformers.modeling_outputs.BaseModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Z=new Ns({props:{$$slots:{default:[js]},$$scope:{ctx:V}}}),ee=new Ea({props:{anchor:"transformers.ViTMSNModel.forward.example",$$slots:{default:[As]},$$scope:{ctx:V}}}),ke=new at({}),Ve=new $t({props:{name:"class transformers.ViTMSNForImageClassification",anchor:"transformers.ViTMSNForImageClassification",parameters:[{name:"config",val:": ViTMSNConfig"}],parametersDescription:[{anchor:"transformers.ViTMSNForImageClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/vit_msn#transformers.ViTMSNConfig">ViTMSNConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/vit_msn/modeling_vit_msn.py#L599"}}),Ce=new $t({props:{name:"forward",anchor:"transformers.ViTMSNForImageClassification.forward",parameters:[{name:"pixel_values",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"interpolate_pos_encoding",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.ViTMSNForImageClassification.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/main/en/model_doc/poolformer#transformers.PoolFormerFeatureExtractor.__call__">ViTImageProcessor.<strong>call</strong>()</a>
for details.`,name:"pixel_values"},{anchor:"transformers.ViTMSNForImageClassification.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.ViTMSNForImageClassification.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.ViTMSNForImageClassification.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 layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.ViTMSNForImageClassification.forward.interpolate_pos_encoding",description:`<strong>interpolate_pos_encoding</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether to interpolate the pre-trained position encodings.`,name:"interpolate_pos_encoding"},{anchor:"transformers.ViTMSNForImageClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/vit_msn/modeling_vit_msn.py#L612",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.ImageClassifierOutput"
>transformers.modeling_outputs.ImageClassifierOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/vit_msn#transformers.ViTMSNConfig"
>ViTMSNConfig</a>) and inputs.</p>
<ul>
<li>
<p><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.</p>
</li>
<li>
<p><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).</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 stage) of shape <code>(batch_size, sequence_length, hidden_size)</code>. Hidden-states
(also called feature maps) of the model at the output of each stage.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, patch_size, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.ImageClassifierOutput"
>transformers.modeling_outputs.ImageClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),oe=new Ns({props:{$$slots:{default:[Fs]},$$scope:{ctx:V}}}),ae=new Ea({props:{anchor:"transformers.ViTMSNForImageClassification.forward.example",$$slots:{default:[qs]},$$scope:{ctx:V}}}),{c(){p=a("meta"),b=h(),_=a("h1"),u=a("a"),v=a("span"),w(l.$$.fragment),g=h(),C=a("span"),Yt=n("ViTMSN"),yt=h(),q=a("h2"),K=a("a"),st=a("span"),w(ce.$$.fragment),Zt=h(),rt=a("span"),eo=n("Overview"),Nt=h(),U=a("p"),to=n("The ViTMSN model was proposed in "),de=a("a"),oo=n("Masked Siamese Networks for Label-Efficient Learning"),ao=n(` by Mahmoud Assran, Mathilde Caron, Ishan Misra, Piotr Bojanowski, Florian Bordes,
Pascal Vincent, Armand Joulin, Michael Rabbat, Nicolas Ballas. The paper presents a joint-embedding architecture to match the prototypes
of masked patches with that of the unmasked patches. With this setup, their method yields excellent performance in the low-shot and extreme low-shot
regimes.`),St=h(),Ae=a("p"),so=n("The abstract from the paper is the following:"),kt=h(),Fe=a("p"),nt=a("em"),ro=n(`We propose Masked Siamese Networks (MSN), a self-supervised learning framework for learning image representations. Our
approach matches the representation of an image view containing randomly masked patches to the representation of the original
unmasked image. This self-supervised pre-training strategy is particularly scalable when applied to Vision Transformers since only the
unmasked patches are processed by the network. As a result, MSNs improve the scalability of joint-embedding architectures,
while producing representations of a high semantic level that perform competitively on low-shot image classification. For instance,
on ImageNet-1K, with only 5,000 annotated images, our base MSN model achieves 72.4% top-1 accuracy,
and with 1% of ImageNet-1K labels, we achieve 75.7% top-1 accuracy, setting a new state-of-the-art for self-supervised learning on this benchmark.`),Vt=h(),qe=a("p"),no=n("Tips:"),It=h(),j=a("ul"),it=a("li"),io=n(`MSN (masked siamese networks) is a method for self-supervised pre-training of Vision Transformers (ViTs). The pre-training
objective is to match the prototypes assigned to the unmasked views of the images to that of the masked views of the same images.`),lo=h(),x=a("li"),co=n(`The authors have only released pre-trained weights of the backbone (ImageNet-1k pre-training). So, to use that on your own image classification dataset,
use the `),ze=a("a"),mo=n("ViTMSNForImageClassification"),po=n(" class which is initialized from "),Oe=a("a"),ho=n("ViTMSNModel"),fo=n(`. Follow
`),me=a("a"),uo=n("this notebook"),go=n(" for a detailed tutorial on fine-tuning."),_o=h(),lt=a("li"),vo=n(`MSN is particularly useful in the low-shot and extreme low-shot regimes. Notably, it achieves 75.7% top-1 accuracy with only 1% of ImageNet-1K
labels when fine-tuned.`),Et=h(),J=a("img"),Ct=h(),pe=a("small"),bo=n("MSN architecture. Taken from the "),Le=a("a"),wo=n("original paper."),xt=h(),A=a("p"),To=n("This model was contributed by "),he=a("a"),Mo=n("sayakpaul"),$o=n(". The original code can be found "),fe=a("a"),yo=n("here"),No=n("."),Pt=h(),z=a("h2"),G=a("a"),ct=a("span"),w(ue.$$.fragment),So=h(),dt=a("span"),ko=n("Resources"),jt=h(),De=a("p"),Vo=n("A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with ViT MSN."),At=h(),w(ge.$$.fragment),Ft=h(),Be=a("ul"),F=a("li"),We=a("a"),Io=n("ViTMSNForImageClassification"),Eo=n(" is supported by this "),_e=a("a"),Co=n("example script"),xo=n(" and "),ve=a("a"),Po=n("notebook"),jo=n("."),qt=h(),He=a("p"),Ao=n("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."),zt=h(),O=a("h2"),Q=a("a"),mt=a("span"),w(be.$$.fragment),Fo=h(),pt=a("span"),qo=n("ViTMSNConfig"),Ot=h(),S=a("div"),w(we.$$.fragment),zo=h(),L=a("p"),Oo=n("This is the configuration class to store the configuration of a "),Re=a("a"),Lo=n("ViTMSNModel"),Do=n(`. It is used to instantiate an ViT
MSN 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 ViT
`),Te=a("a"),Bo=n("facebook/vit_msn_base"),Wo=n(" architecture."),Ho=h(),D=a("p"),Ro=n("Configuration objects inherit from "),Ke=a("a"),Ko=n("PretrainedConfig"),Uo=n(` and can be used to control the model outputs. Read the
documentation from `),Ue=a("a"),Jo=n("PretrainedConfig"),Go=n(" for more information."),Qo=h(),w(X.$$.fragment),Lt=h(),B=a("h2"),Y=a("a"),ht=a("span"),w(Me.$$.fragment),Xo=h(),ft=a("span"),Yo=n("ViTMSNModel"),Dt=h(),P=a("div"),w($e.$$.fragment),Zo=h(),ye=a("p"),ea=n(`The bare ViTMSN Model outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),Ne=a("a"),ta=n("torch.nn.Module"),oa=n(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),aa=h(),I=a("div"),w(Se.$$.fragment),sa=h(),W=a("p"),ra=n("The "),Je=a("a"),na=n("ViTMSNModel"),ia=n(" forward method, overrides the "),ut=a("code"),la=n("__call__"),ca=n(" special method."),da=h(),w(Z.$$.fragment),ma=h(),w(ee.$$.fragment),Bt=h(),H=a("h2"),te=a("a"),gt=a("span"),w(ke.$$.fragment),pa=h(),_t=a("span"),ha=n("ViTMSNForImageClassification"),Wt=h(),k=a("div"),w(Ve.$$.fragment),fa=h(),vt=a("p"),ua=n("ViTMSN Model with an image classification head on top e.g. for ImageNet."),ga=h(),Ie=a("p"),_a=n("This model is a PyTorch "),Ee=a("a"),va=n("torch.nn.Module"),ba=n(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),wa=h(),E=a("div"),w(Ce.$$.fragment),Ta=h(),R=a("p"),Ma=n("The "),Ge=a("a"),$a=n("ViTMSNForImageClassification"),ya=n(" forward method, overrides the "),bt=a("code"),Na=n("__call__"),Sa=n(" special method."),ka=h(),w(oe.$$.fragment),Va=h(),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(o),b=f(e),_=s(e,"H1",{class:!0});var xe=r(_);u=s(xe,"A",{id:!0,class:!0,href:!0});var wt=r(u);v=s(wt,"SPAN",{});var Tt=r(v);T(l.$$.fragment,Tt),Tt.forEach(o),wt.forEach(o),g=f(xe),C=s(xe,"SPAN",{});var Mt=r(C);Yt=i(Mt,"ViTMSN"),Mt.forEach(o),xe.forEach(o),yt=f(e),q=s(e,"H2",{class:!0});var Pe=r(q);K=s(Pe,"A",{id:!0,class:!0,href:!0});var ja=r(K);st=s(ja,"SPAN",{});var Aa=r(st);T(ce.$$.fragment,Aa),Aa.forEach(o),ja.forEach(o),Zt=f(Pe),rt=s(Pe,"SPAN",{});var Fa=r(rt);eo=i(Fa,"Overview"),Fa.forEach(o),Pe.forEach(o),Nt=f(e),U=s(e,"P",{});var Rt=r(U);to=i(Rt,"The ViTMSN model was proposed in "),de=s(Rt,"A",{href:!0,rel:!0});var qa=r(de);oo=i(qa,"Masked Siamese Networks for Label-Efficient Learning"),qa.forEach(o),ao=i(Rt,` by Mahmoud Assran, Mathilde Caron, Ishan Misra, Piotr Bojanowski, Florian Bordes,
Pascal Vincent, Armand Joulin, Michael Rabbat, Nicolas Ballas. The paper presents a joint-embedding architecture to match the prototypes
of masked patches with that of the unmasked patches. With this setup, their method yields excellent performance in the low-shot and extreme low-shot
regimes.`),Rt.forEach(o),St=f(e),Ae=s(e,"P",{});var za=r(Ae);so=i(za,"The abstract from the paper is the following:"),za.forEach(o),kt=f(e),Fe=s(e,"P",{});var Oa=r(Fe);nt=s(Oa,"EM",{});var La=r(nt);ro=i(La,`We propose Masked Siamese Networks (MSN), a self-supervised learning framework for learning image representations. Our
approach matches the representation of an image view containing randomly masked patches to the representation of the original
unmasked image. This self-supervised pre-training strategy is particularly scalable when applied to Vision Transformers since only the
unmasked patches are processed by the network. As a result, MSNs improve the scalability of joint-embedding architectures,
while producing representations of a high semantic level that perform competitively on low-shot image classification. For instance,
on ImageNet-1K, with only 5,000 annotated images, our base MSN model achieves 72.4% top-1 accuracy,
and with 1% of ImageNet-1K labels, we achieve 75.7% top-1 accuracy, setting a new state-of-the-art for self-supervised learning on this benchmark.`),La.forEach(o),Oa.forEach(o),Vt=f(e),qe=s(e,"P",{});var Da=r(qe);no=i(Da,"Tips:"),Da.forEach(o),It=f(e),j=s(e,"UL",{});var Qe=r(j);it=s(Qe,"LI",{});var Ba=r(it);io=i(Ba,`MSN (masked siamese networks) is a method for self-supervised pre-training of Vision Transformers (ViTs). The pre-training
objective is to match the prototypes assigned to the unmasked views of the images to that of the masked views of the same images.`),Ba.forEach(o),lo=f(Qe),x=s(Qe,"LI",{});var se=r(x);co=i(se,`The authors have only released pre-trained weights of the backbone (ImageNet-1k pre-training). So, to use that on your own image classification dataset,
use the `),ze=s(se,"A",{href:!0});var Wa=r(ze);mo=i(Wa,"ViTMSNForImageClassification"),Wa.forEach(o),po=i(se," class which is initialized from "),Oe=s(se,"A",{href:!0});var Ha=r(Oe);ho=i(Ha,"ViTMSNModel"),Ha.forEach(o),fo=i(se,`. Follow
`),me=s(se,"A",{href:!0,rel:!0});var Ra=r(me);uo=i(Ra,"this notebook"),Ra.forEach(o),go=i(se," for a detailed tutorial on fine-tuning."),se.forEach(o),_o=f(Qe),lt=s(Qe,"LI",{});var Ka=r(lt);vo=i(Ka,`MSN is particularly useful in the low-shot and extreme low-shot regimes. Notably, it achieves 75.7% top-1 accuracy with only 1% of ImageNet-1K
labels when fine-tuned.`),Ka.forEach(o),Qe.forEach(o),Et=f(e),J=s(e,"IMG",{src:!0,alt:!0,width:!0}),Ct=f(e),pe=s(e,"SMALL",{});var Ia=r(pe);bo=i(Ia,"MSN architecture. Taken from the "),Le=s(Ia,"A",{href:!0});var Ua=r(Le);wo=i(Ua,"original paper."),Ua.forEach(o),Ia.forEach(o),xt=f(e),A=s(e,"P",{});var Xe=r(A);To=i(Xe,"This model was contributed by "),he=s(Xe,"A",{href:!0,rel:!0});var Ja=r(he);Mo=i(Ja,"sayakpaul"),Ja.forEach(o),$o=i(Xe,". The original code can be found "),fe=s(Xe,"A",{href:!0,rel:!0});var Ga=r(fe);yo=i(Ga,"here"),Ga.forEach(o),No=i(Xe,"."),Xe.forEach(o),Pt=f(e),z=s(e,"H2",{class:!0});var Kt=r(z);G=s(Kt,"A",{id:!0,class:!0,href:!0});var Qa=r(G);ct=s(Qa,"SPAN",{});var Xa=r(ct);T(ue.$$.fragment,Xa),Xa.forEach(o),Qa.forEach(o),So=f(Kt),dt=s(Kt,"SPAN",{});var Ya=r(dt);ko=i(Ya,"Resources"),Ya.forEach(o),Kt.forEach(o),jt=f(e),De=s(e,"P",{});var Za=r(De);Vo=i(Za,"A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with ViT MSN."),Za.forEach(o),At=f(e),T(ge.$$.fragment,e),Ft=f(e),Be=s(e,"UL",{});var es=r(Be);F=s(es,"LI",{});var je=r(F);We=s(je,"A",{href:!0});var ts=r(We);Io=i(ts,"ViTMSNForImageClassification"),ts.forEach(o),Eo=i(je," is supported by this "),_e=s(je,"A",{href:!0,rel:!0});var os=r(_e);Co=i(os,"example script"),os.forEach(o),xo=i(je," and "),ve=s(je,"A",{href:!0,rel:!0});var as=r(ve);Po=i(as,"notebook"),as.forEach(o),jo=i(je,"."),je.forEach(o),es.forEach(o),qt=f(e),He=s(e,"P",{});var ss=r(He);Ao=i(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(o),zt=f(e),O=s(e,"H2",{class:!0});var Ut=r(O);Q=s(Ut,"A",{id:!0,class:!0,href:!0});var rs=r(Q);mt=s(rs,"SPAN",{});var ns=r(mt);T(be.$$.fragment,ns),ns.forEach(o),rs.forEach(o),Fo=f(Ut),pt=s(Ut,"SPAN",{});var is=r(pt);qo=i(is,"ViTMSNConfig"),is.forEach(o),Ut.forEach(o),Ot=f(e),S=s(e,"DIV",{class:!0});var re=r(S);T(we.$$.fragment,re),zo=f(re),L=s(re,"P",{});var Ye=r(L);Oo=i(Ye,"This is the configuration class to store the configuration of a "),Re=s(Ye,"A",{href:!0});var ls=r(Re);Lo=i(ls,"ViTMSNModel"),ls.forEach(o),Do=i(Ye,`. It is used to instantiate an ViT
MSN 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 ViT
`),Te=s(Ye,"A",{href:!0,rel:!0});var cs=r(Te);Bo=i(cs,"facebook/vit_msn_base"),cs.forEach(o),Wo=i(Ye," architecture."),Ye.forEach(o),Ho=f(re),D=s(re,"P",{});var Ze=r(D);Ro=i(Ze,"Configuration objects inherit from "),Ke=s(Ze,"A",{href:!0});var ds=r(Ke);Ko=i(ds,"PretrainedConfig"),ds.forEach(o),Uo=i(Ze,` and can be used to control the model outputs. Read the
documentation from `),Ue=s(Ze,"A",{href:!0});var ms=r(Ue);Jo=i(ms,"PretrainedConfig"),ms.forEach(o),Go=i(Ze," for more information."),Ze.forEach(o),Qo=f(re),T(X.$$.fragment,re),re.forEach(o),Lt=f(e),B=s(e,"H2",{class:!0});var Jt=r(B);Y=s(Jt,"A",{id:!0,class:!0,href:!0});var ps=r(Y);ht=s(ps,"SPAN",{});var hs=r(ht);T(Me.$$.fragment,hs),hs.forEach(o),ps.forEach(o),Xo=f(Jt),ft=s(Jt,"SPAN",{});var fs=r(ft);Yo=i(fs,"ViTMSNModel"),fs.forEach(o),Jt.forEach(o),Dt=f(e),P=s(e,"DIV",{class:!0});var et=r(P);T($e.$$.fragment,et),Zo=f(et),ye=s(et,"P",{});var Gt=r(ye);ea=i(Gt,`The bare ViTMSN Model outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),Ne=s(Gt,"A",{href:!0,rel:!0});var us=r(Ne);ta=i(us,"torch.nn.Module"),us.forEach(o),oa=i(Gt,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Gt.forEach(o),aa=f(et),I=s(et,"DIV",{class:!0});var ne=r(I);T(Se.$$.fragment,ne),sa=f(ne),W=s(ne,"P",{});var tt=r(W);ra=i(tt,"The "),Je=s(tt,"A",{href:!0});var gs=r(Je);na=i(gs,"ViTMSNModel"),gs.forEach(o),ia=i(tt," forward method, overrides the "),ut=s(tt,"CODE",{});var _s=r(ut);la=i(_s,"__call__"),_s.forEach(o),ca=i(tt," special method."),tt.forEach(o),da=f(ne),T(Z.$$.fragment,ne),ma=f(ne),T(ee.$$.fragment,ne),ne.forEach(o),et.forEach(o),Bt=f(e),H=s(e,"H2",{class:!0});var Qt=r(H);te=s(Qt,"A",{id:!0,class:!0,href:!0});var vs=r(te);gt=s(vs,"SPAN",{});var bs=r(gt);T(ke.$$.fragment,bs),bs.forEach(o),vs.forEach(o),pa=f(Qt),_t=s(Qt,"SPAN",{});var ws=r(_t);ha=i(ws,"ViTMSNForImageClassification"),ws.forEach(o),Qt.forEach(o),Wt=f(e),k=s(e,"DIV",{class:!0});var ie=r(k);T(Ve.$$.fragment,ie),fa=f(ie),vt=s(ie,"P",{});var Ts=r(vt);ua=i(Ts,"ViTMSN Model with an image classification head on top e.g. for ImageNet."),Ts.forEach(o),ga=f(ie),Ie=s(ie,"P",{});var Xt=r(Ie);_a=i(Xt,"This model is a PyTorch "),Ee=s(Xt,"A",{href:!0,rel:!0});var Ms=r(Ee);va=i(Ms,"torch.nn.Module"),Ms.forEach(o),ba=i(Xt,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Xt.forEach(o),wa=f(ie),E=s(ie,"DIV",{class:!0});var le=r(E);T(Ce.$$.fragment,le),Ta=f(le),R=s(le,"P",{});var ot=r(R);Ma=i(ot,"The "),Ge=s(ot,"A",{href:!0});var $s=r(Ge);$a=i($s,"ViTMSNForImageClassification"),$s.forEach(o),ya=i(ot," forward method, overrides the "),bt=s(ot,"CODE",{});var ys=r(bt);Na=i(ys,"__call__"),ys.forEach(o),Sa=i(ot," special method."),ot.forEach(o),ka=f(le),T(oe.$$.fragment,le),Va=f(le),T(ae.$$.fragment,le),le.forEach(o),ie.forEach(o),this.h()},h(){c(p,"name","hf:doc:metadata"),c(p,"content",JSON.stringify(Os)),c(u,"id","vitmsn"),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","#vitmsn"),c(_,"class","relative group"),c(K,"id","overview"),c(K,"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(K,"href","#overview"),c(q,"class","relative group"),c(de,"href","https://arxiv.org/abs/2204.07141"),c(de,"rel","nofollow"),c(ze,"href","/docs/transformers/main/en/model_doc/vit_msn#transformers.ViTMSNForImageClassification"),c(Oe,"href","/docs/transformers/main/en/model_doc/vit_msn#transformers.ViTMSNModel"),c(me,"href","https://github.com/huggingface/notebooks/blob/main/examples/image_classification.ipynb"),c(me,"rel","nofollow"),Es(J.src,Pa="https://i.ibb.co/W6PQMdC/Screenshot-2022-09-13-at-9-08-40-AM.png")||c(J,"src",Pa),c(J,"alt","drawing"),c(J,"width","600"),c(Le,"href","https://arxiv.org/abs/2204.07141"),c(he,"href","https://huggingface.co/sayakpaul"),c(he,"rel","nofollow"),c(fe,"href","https://github.com/facebookresearch/msn"),c(fe,"rel","nofollow"),c(G,"id","resources"),c(G,"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(G,"href","#resources"),c(z,"class","relative group"),c(We,"href","/docs/transformers/main/en/model_doc/vit_msn#transformers.ViTMSNForImageClassification"),c(_e,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/image-classification"),c(_e,"rel","nofollow"),c(ve,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/image_classification.ipynb"),c(ve,"rel","nofollow"),c(Q,"id","transformers.ViTMSNConfig"),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.ViTMSNConfig"),c(O,"class","relative group"),c(Re,"href","/docs/transformers/main/en/model_doc/vit_msn#transformers.ViTMSNModel"),c(Te,"href","https://huggingface.co/facebook/vit_msn_base"),c(Te,"rel","nofollow"),c(Ke,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),c(Ue,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),c(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Y,"id","transformers.ViTMSNModel"),c(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"),c(Y,"href","#transformers.ViTMSNModel"),c(B,"class","relative group"),c(Ne,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(Ne,"rel","nofollow"),c(Je,"href","/docs/transformers/main/en/model_doc/vit_msn#transformers.ViTMSNModel"),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(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(te,"id","transformers.ViTMSNForImageClassification"),c(te,"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(te,"href","#transformers.ViTMSNForImageClassification"),c(H,"class","relative group"),c(Ee,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(Ee,"rel","nofollow"),c(Ge,"href","/docs/transformers/main/en/model_doc/vit_msn#transformers.ViTMSNForImageClassification"),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(k,"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),m(e,b,d),m(e,_,d),t(_,u),t(u,v),M(l,v,null),t(_,g),t(_,C),t(C,Yt),m(e,yt,d),m(e,q,d),t(q,K),t(K,st),M(ce,st,null),t(q,Zt),t(q,rt),t(rt,eo),m(e,Nt,d),m(e,U,d),t(U,to),t(U,de),t(de,oo),t(U,ao),m(e,St,d),m(e,Ae,d),t(Ae,so),m(e,kt,d),m(e,Fe,d),t(Fe,nt),t(nt,ro),m(e,Vt,d),m(e,qe,d),t(qe,no),m(e,It,d),m(e,j,d),t(j,it),t(it,io),t(j,lo),t(j,x),t(x,co),t(x,ze),t(ze,mo),t(x,po),t(x,Oe),t(Oe,ho),t(x,fo),t(x,me),t(me,uo),t(x,go),t(j,_o),t(j,lt),t(lt,vo),m(e,Et,d),m(e,J,d),m(e,Ct,d),m(e,pe,d),t(pe,bo),t(pe,Le),t(Le,wo),m(e,xt,d),m(e,A,d),t(A,To),t(A,he),t(he,Mo),t(A,$o),t(A,fe),t(fe,yo),t(A,No),m(e,Pt,d),m(e,z,d),t(z,G),t(G,ct),M(ue,ct,null),t(z,So),t(z,dt),t(dt,ko),m(e,jt,d),m(e,De,d),t(De,Vo),m(e,At,d),M(ge,e,d),m(e,Ft,d),m(e,Be,d),t(Be,F),t(F,We),t(We,Io),t(F,Eo),t(F,_e),t(_e,Co),t(F,xo),t(F,ve),t(ve,Po),t(F,jo),m(e,qt,d),m(e,He,d),t(He,Ao),m(e,zt,d),m(e,O,d),t(O,Q),t(Q,mt),M(be,mt,null),t(O,Fo),t(O,pt),t(pt,qo),m(e,Ot,d),m(e,S,d),M(we,S,null),t(S,zo),t(S,L),t(L,Oo),t(L,Re),t(Re,Lo),t(L,Do),t(L,Te),t(Te,Bo),t(L,Wo),t(S,Ho),t(S,D),t(D,Ro),t(D,Ke),t(Ke,Ko),t(D,Uo),t(D,Ue),t(Ue,Jo),t(D,Go),t(S,Qo),M(X,S,null),m(e,Lt,d),m(e,B,d),t(B,Y),t(Y,ht),M(Me,ht,null),t(B,Xo),t(B,ft),t(ft,Yo),m(e,Dt,d),m(e,P,d),M($e,P,null),t(P,Zo),t(P,ye),t(ye,ea),t(ye,Ne),t(Ne,ta),t(ye,oa),t(P,aa),t(P,I),M(Se,I,null),t(I,sa),t(I,W),t(W,ra),t(W,Je),t(Je,na),t(W,ia),t(W,ut),t(ut,la),t(W,ca),t(I,da),M(Z,I,null),t(I,ma),M(ee,I,null),m(e,Bt,d),m(e,H,d),t(H,te),t(te,gt),M(ke,gt,null),t(H,pa),t(H,_t),t(_t,ha),m(e,Wt,d),m(e,k,d),M(Ve,k,null),t(k,fa),t(k,vt),t(vt,ua),t(k,ga),t(k,Ie),t(Ie,_a),t(Ie,Ee),t(Ee,va),t(Ie,ba),t(k,wa),t(k,E),M(Ce,E,null),t(E,Ta),t(E,R),t(R,Ma),t(R,Ge),t(Ge,$a),t(R,ya),t(R,bt),t(bt,Na),t(R,Sa),t(E,ka),M(oe,E,null),t(E,Va),M(ae,E,null),Ht=!0},p(e,[d]){const xe={};d&2&&(xe.$$scope={dirty:d,ctx:e}),X.$set(xe);const wt={};d&2&&(wt.$$scope={dirty:d,ctx:e}),Z.$set(wt);const Tt={};d&2&&(Tt.$$scope={dirty:d,ctx:e}),ee.$set(Tt);const Mt={};d&2&&(Mt.$$scope={dirty:d,ctx:e}),oe.$set(Mt);const Pe={};d&2&&(Pe.$$scope={dirty:d,ctx:e}),ae.$set(Pe)},i(e){Ht||($(l.$$.fragment,e),$(ce.$$.fragment,e),$(ue.$$.fragment,e),$(ge.$$.fragment,e),$(be.$$.fragment,e),$(we.$$.fragment,e),$(X.$$.fragment,e),$(Me.$$.fragment,e),$($e.$$.fragment,e),$(Se.$$.fragment,e),$(Z.$$.fragment,e),$(ee.$$.fragment,e),$(ke.$$.fragment,e),$(Ve.$$.fragment,e),$(Ce.$$.fragment,e),$(oe.$$.fragment,e),$(ae.$$.fragment,e),Ht=!0)},o(e){y(l.$$.fragment,e),y(ce.$$.fragment,e),y(ue.$$.fragment,e),y(ge.$$.fragment,e),y(be.$$.fragment,e),y(we.$$.fragment,e),y(X.$$.fragment,e),y(Me.$$.fragment,e),y($e.$$.fragment,e),y(Se.$$.fragment,e),y(Z.$$.fragment,e),y(ee.$$.fragment,e),y(ke.$$.fragment,e),y(Ve.$$.fragment,e),y(Ce.$$.fragment,e),y(oe.$$.fragment,e),y(ae.$$.fragment,e),Ht=!1},d(e){o(p),e&&o(b),e&&o(_),N(l),e&&o(yt),e&&o(q),N(ce),e&&o(Nt),e&&o(U),e&&o(St),e&&o(Ae),e&&o(kt),e&&o(Fe),e&&o(Vt),e&&o(qe),e&&o(It),e&&o(j),e&&o(Et),e&&o(J),e&&o(Ct),e&&o(pe),e&&o(xt),e&&o(A),e&&o(Pt),e&&o(z),N(ue),e&&o(jt),e&&o(De),e&&o(At),N(ge,e),e&&o(Ft),e&&o(Be),e&&o(qt),e&&o(He),e&&o(zt),e&&o(O),N(be),e&&o(Ot),e&&o(S),N(we),N(X),e&&o(Lt),e&&o(B),N(Me),e&&o(Dt),e&&o(P),N($e),N(Se),N(Z),N(ee),e&&o(Bt),e&&o(H),N(ke),e&&o(Wt),e&&o(k),N(Ve),N(Ce),N(oe),N(ae)}}}const Os={local:"vitmsn",sections:[{local:"overview",title:"Overview"},{local:"resources",title:"Resources"},{local:"transformers.ViTMSNConfig",title:"ViTMSNConfig"},{local:"transformers.ViTMSNModel",title:"ViTMSNModel"},{local:"transformers.ViTMSNForImageClassification",title:"ViTMSNForImageClassification"}],title:"ViTMSN"};function Ls(V){return Cs(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Js extends Ss{constructor(p){super();ks(this,p,Ls,zs,Vs,{})}}export{Js as default,Os as metadata};
