import{S as wa,i as ba,s as Aa,e as r,k as d,w as E,t as s,M as Ma,c as a,d as o,m as c,a as n,x as w,h as i,b as l,N as ya,F as e,g as m,y as b,q as A,o as M,B as y}from"../../chunks/vendor-4833417e.js";import{T as Ea}from"../../chunks/Tip-fffd6df1.js";import{D as ut}from"../../chunks/Docstring-4f315ed9.js";import{C as xr}from"../../chunks/CodeBlock-6a3d1b46.js";import{I as gt}from"../../chunks/IconCopyLink-4b81c553.js";import"../../chunks/CopyButton-dacfbfaf.js";function Va(oe){let f,V,p,u,x;return{c(){f=r("p"),V=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),p=r("code"),u=s("Module"),x=s(`
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(g){f=a(g,"P",{});var _=n(f);V=i(_,"Although the recipe for forward pass needs to be defined within this function, one should call the "),p=a(_,"CODE",{});var F=n(p);u=i(F,"Module"),F.forEach(o),x=i(_,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),_.forEach(o)},m(g,_){m(g,f,_),e(f,V),e(f,p),e(p,u),e(f,x)},d(g){g&&o(f)}}}function ka(oe){let f,V,p,u,x;return{c(){f=r("p"),V=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),p=r("code"),u=s("Module"),x=s(`
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(g){f=a(g,"P",{});var _=n(f);V=i(_,"Although the recipe for forward pass needs to be defined within this function, one should call the "),p=a(_,"CODE",{});var F=n(p);u=i(F,"Module"),F.forEach(o),x=i(_,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),_.forEach(o)},m(g,_){m(g,f,_),e(f,V),e(f,p),e(p,u),e(f,x)},d(g){g&&o(f)}}}function $a(oe){let f,V,p,u,x,g,_,F,Wt,_t,S,G,Ze,re,Ut,et,Rt,vt,B,Kt,ae,Xt,Gt,Tt,Pe,Bt,Et,Fe,tt,Yt,wt,Ce,Jt,bt,v,ne,Qt,je,Zt,eo,to,D,oo,ze,ro,ao,se,no,so,io,O,lo,qe,co,ho,ie,mo,fo,po,le,uo,Ie,go,_o,vo,de,To,Ne,Eo,wo,bo,ot,Ao,At,Y,Pr,Mt,ce,Mo,Se,yo,yt,z,Vo,he,ko,$o,me,xo,Po,Vt,L,J,rt,fe,Fo,at,Co,kt,T,pe,jo,H,zo,De,qo,Io,ue,No,So,Do,W,Oo,Oe,Lo,Ho,Le,Wo,Uo,Ro,nt,Ko,Xo,ge,$t,U,Q,st,_e,Go,it,Bo,xt,C,ve,Yo,Te,Jo,Ee,Qo,Zo,er,k,we,tr,R,or,He,rr,ar,lt,nr,sr,ir,Z,lr,dt,dr,cr,be,Pt,K,ee,ct,Ae,hr,ht,mr,Ft,j,Me,fr,ye,pr,Ve,ur,gr,_r,$,ke,vr,X,Tr,We,Er,wr,mt,br,Ar,Mr,te,yr,ft,Vr,kr,$e,Ct;return g=new gt({}),re=new gt({}),fe=new gt({}),pe=new ut({props:{name:"class transformers.ViTMAEConfig",anchor:"transformers.ViTMAEConfig",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-12"},{name:"is_encoder_decoder",val:" = False"},{name:"image_size",val:" = 224"},{name:"patch_size",val:" = 16"},{name:"num_channels",val:" = 3"},{name:"qkv_bias",val:" = True"},{name:"decoder_num_attention_heads",val:" = 16"},{name:"decoder_hidden_size",val:" = 512"},{name:"decoder_num_hidden_layers",val:" = 8"},{name:"decoder_intermediate_size",val:" = 2048"},{name:"mask_ratio",val:" = 0.75"},{name:"norm_pix_loss",val:" = False"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/vit_mae/configuration_vit_mae.py#L29",parametersDescription:[{anchor:"transformers.ViTMAEConfig.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.ViTMAEConfig.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.ViTMAEConfig.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.ViTMAEConfig.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.ViTMAEConfig.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.ViTMAEConfig.hidden_dropout_prob",description:`<strong>hidden_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout probabilitiy for all fully connected layers in the embeddings, encoder, and pooler.`,name:"hidden_dropout_prob"},{anchor:"transformers.ViTMAEConfig.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.ViTMAEConfig.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.ViTMAEConfig.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.ViTMAEConfig.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.ViTMAEConfig.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.ViTMAEConfig.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.ViTMAEConfig.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"},{anchor:"transformers.ViTMAEConfig.decoder_num_attention_heads",description:`<strong>decoder_num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of attention heads for each attention layer in the decoder.`,name:"decoder_num_attention_heads"},{anchor:"transformers.ViTMAEConfig.decoder_hidden_size",description:`<strong>decoder_hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
Dimensionality of the decoder.`,name:"decoder_hidden_size"},{anchor:"transformers.ViTMAEConfig.decoder_num_hidden_layers",description:`<strong>decoder_num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 8) &#x2014;
Number of hidden layers in the decoder.`,name:"decoder_num_hidden_layers"},{anchor:"transformers.ViTMAEConfig.decoder_intermediate_size",description:`<strong>decoder_intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 2048) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (i.e., feed-forward) layer in the decoder.`,name:"decoder_intermediate_size"},{anchor:"transformers.ViTMAEConfig.mask_ratio",description:`<strong>mask_ratio</strong> (<code>float</code>, <em>optional</em>, defaults to 0.75) &#x2014;
The ratio of the number of masked tokens in the input sequence.`,name:"mask_ratio"},{anchor:"transformers.ViTMAEConfig.norm_pix_loss",description:`<strong>norm_pix_loss</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to train with normalized pixels (see Table 3 in the paper). Using normalized pixels improved
representation quality in the experiments of the authors.`,name:"norm_pix_loss"}]}}),ge=new xr({props:{code:`from transformers import ViTMAEModel, ViTMAEConfig

# Initializing a ViT MAE vit-mae-base style configuration
configuration = ViTMAEConfig()

# Initializing a model from the vit-mae-base style configuration
model = ViTMAEModel(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> ViTMAEModel, ViTMAEConfig

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model from the vit-mae-base style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ViTMAEModel(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`}}),_e=new gt({}),ve=new ut({props:{name:"class transformers.ViTMAEModel",anchor:"transformers.ViTMAEModel",parameters:[{name:"config",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/vit_mae/modeling_vit_mae.py#L630",parametersDescription:[{anchor:"transformers.ViTMAEModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/en/model_doc/vit_mae#transformers.ViTMAEConfig">ViTMAEConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/pr_15839/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}]}}),we=new ut({props:{name:"forward",anchor:"transformers.ViTMAEModel.forward",parameters:[{name:"pixel_values",val:" = None"},{name:"head_mask",val:" = None"},{name:"output_attentions",val:" = None"},{name:"output_hidden_states",val:" = None"},{name:"return_dict",val:" = None"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/vit_mae/modeling_vit_mae.py#L654",parametersDescription:[{anchor:"transformers.ViTMAEModel.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/pr_15839/en/model_doc/auto#transformers.AutoFeatureExtractor">AutoFeatureExtractor</a>. See
<code>AutoFeatureExtractor.__call__()</code>for details.`,name:"pixel_values"},{anchor:"transformers.ViTMAEModel.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.ViTMAEModel.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.ViTMAEModel.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.ViTMAEModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/pr_15839/en/main_classes/output#transformers.file_utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],returnDescription:`
<p>A <code>transformers.models.vit_mae.modeling_vit_mae.ViTMAEModelOutput</code>or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/pr_15839/en/model_doc/vit_mae#transformers.ViTMAEConfig"
>ViTMAEConfig</a>) and inputs.</p>
<ul>
<li><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.</li>
<li><strong>mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>) \u2014 Tensor indicating which patches are masked (1) and which are not (0).</li>
<li><strong>ids_restore</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) \u2014 Tensor containing the original index of the (shuffled) masked patches.</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 + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>. Hidden-states of the model at the output of each layer
plus the initial embedding outputs.</li>
<li><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>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.</li>
</ul>
`,returnType:`
<p><code>transformers.models.vit_mae.modeling_vit_mae.ViTMAEModelOutput</code>or <code>tuple(torch.FloatTensor)</code></p>
`}}),Z=new Ea({props:{$$slots:{default:[Va]},$$scope:{ctx:oe}}}),be=new xr({props:{code:`from transformers import AutoFeatureExtractor, ViTMAEModel
from PIL import Image
import requests

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

feature_extractor = AutoFeatureExtractor.from_pretrained("facebook/vit-mae-base")
model = ViTMAEModel.from_pretrained("facebook/vit-mae-base")

inputs = feature_extractor(images=image, return_tensors="pt")
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> AutoFeatureExtractor, ViTMAEModel
<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>feature_extractor = AutoFeatureExtractor.from_pretrained(<span class="hljs-string">&quot;facebook/vit-mae-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ViTMAEModel.from_pretrained(<span class="hljs-string">&quot;facebook/vit-mae-base&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = feature_extractor(images=image, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state`}}),Ae=new gt({}),Me=new ut({props:{name:"class transformers.ViTMAEForPreTraining",anchor:"transformers.ViTMAEForPreTraining",parameters:[{name:"config",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/vit_mae/modeling_vit_mae.py#L832",parametersDescription:[{anchor:"transformers.ViTMAEForPreTraining.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/en/model_doc/vit_mae#transformers.ViTMAEConfig">ViTMAEConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/pr_15839/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}]}}),ke=new ut({props:{name:"forward",anchor:"transformers.ViTMAEForPreTraining.forward",parameters:[{name:"pixel_values",val:" = None"},{name:"head_mask",val:" = None"},{name:"output_attentions",val:" = None"},{name:"output_hidden_states",val:" = None"},{name:"return_dict",val:" = None"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/vit_mae/modeling_vit_mae.py#L896",parametersDescription:[{anchor:"transformers.ViTMAEForPreTraining.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/pr_15839/en/model_doc/auto#transformers.AutoFeatureExtractor">AutoFeatureExtractor</a>. See
<code>AutoFeatureExtractor.__call__()</code>for details.`,name:"pixel_values"},{anchor:"transformers.ViTMAEForPreTraining.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.ViTMAEForPreTraining.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.ViTMAEForPreTraining.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.ViTMAEForPreTraining.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/pr_15839/en/main_classes/output#transformers.file_utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],returnDescription:`
<p>A <code>transformers.models.vit_mae.modeling_vit_mae.ViTMAEForPreTrainingOutput</code>or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/pr_15839/en/model_doc/vit_mae#transformers.ViTMAEConfig"
>ViTMAEConfig</a>) and inputs.</p>
<ul>
<li><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>) \u2014 Pixel reconstruction loss.</li>
<li><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, patch_size ** 2 * num_channels)</code>) \u2014 Pixel reconstruction logits.</li>
<li><strong>mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>) \u2014 Tensor indicating which patches are masked (1) and which are not (0).</li>
<li><strong>ids_restore</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) \u2014 Tensor containing the original index of the (shuffled) masked patches.</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 + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>. Hidden-states of the model at the output of each layer
plus the initial embedding outputs.</li>
<li><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>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.</li>
</ul>
`,returnType:`
<p><code>transformers.models.vit_mae.modeling_vit_mae.ViTMAEForPreTrainingOutput</code>or <code>tuple(torch.FloatTensor)</code></p>
`}}),te=new Ea({props:{$$slots:{default:[ka]},$$scope:{ctx:oe}}}),$e=new xr({props:{code:`from transformers import AutoFeatureExtractor, ViTMAEForPreTraining
from PIL import Image
import requests

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

feature_extractor = AutoFeatureExtractor.from_pretrained("facebook/vit-mae-base")
model = ViTMAEForPreTraining.from_pretrained("facebook/vit-mae-base")

inputs = feature_extractor(images=image, return_tensors="pt")
outputs = model(**inputs)
loss = outputs.loss
mask = outputs.mask
ids_restore = outputs.ids_restore`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoFeatureExtractor, ViTMAEForPreTraining
<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>feature_extractor = AutoFeatureExtractor.from_pretrained(<span class="hljs-string">&quot;facebook/vit-mae-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ViTMAEForPreTraining.from_pretrained(<span class="hljs-string">&quot;facebook/vit-mae-base&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = feature_extractor(images=image, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = outputs.loss
<span class="hljs-meta">&gt;&gt;&gt; </span>mask = outputs.mask
<span class="hljs-meta">&gt;&gt;&gt; </span>ids_restore = outputs.ids_restore`}}),{c(){f=r("meta"),V=d(),p=r("h1"),u=r("a"),x=r("span"),E(g.$$.fragment),_=d(),F=r("span"),Wt=s("ViTMAE"),_t=d(),S=r("h2"),G=r("a"),Ze=r("span"),E(re.$$.fragment),Ut=d(),et=r("span"),Rt=s("Overview"),vt=d(),B=r("p"),Kt=s("The ViTMAE model was proposed in "),ae=r("a"),Xt=s("Masked Autoencoders Are Scalable Vision Learners"),Gt=s(` by Kaiming He, Xinlei Chen, Saining Xie, Yanghao Li,
Piotr Doll\xE1r, Ross Girshick. The paper shows that, by pre-training a Vision Transformer (ViT) to reconstruct pixel values for masked patches, one can get results after
fine-tuning that outperform supervised pre-training.`),Tt=d(),Pe=r("p"),Bt=s("The abstract from the paper is the following:"),Et=d(),Fe=r("p"),tt=r("em"),Yt=s(`This paper shows that masked autoencoders (MAE) are scalable self-supervised learners for computer vision. Our MAE approach is simple: we mask random patches of the
input image and reconstruct the missing pixels. It is based on two core designs. First, we develop an asymmetric encoder-decoder architecture, with an encoder that operates
only on the visible subset of patches (without mask tokens), along with a lightweight decoder that reconstructs the original image from the latent representation and mask
tokens. Second, we find that masking a high proportion of the input image, e.g., 75%, yields a nontrivial and meaningful self-supervisory task. Coupling these two designs
enables us to train large models efficiently and effectively: we accelerate training (by 3x or more) and improve accuracy. Our scalable approach allows for learning high-capacity
models that generalize well: e.g., a vanilla ViT-Huge model achieves the best accuracy (87.8%) among methods that use only ImageNet-1K data. Transfer performance in downstream
tasks outperforms supervised pre-training and shows promising scaling behavior.`),wt=d(),Ce=r("p"),Jt=s("Tips:"),bt=d(),v=r("ul"),ne=r("li"),Qt=s(`MAE (masked auto encoding) is a method for self-supervised pre-training of Vision Transformers (ViTs). The pre-training objective is relatively simple:
by masking a large portion (75%) of the image patches, the model must reconstruct raw pixel values. One can use `),je=r("a"),Zt=s("ViTMAEForPreTraining"),eo=s(" for this purpose."),to=d(),D=r("li"),oo=s("An example Python script that illustrates how to pre-train "),ze=r("a"),ro=s("ViTMAEForPreTraining"),ao=s(" from scratch can be found "),se=r("a"),no=s("here"),so=s(`.
One can easily tweak it for their own use case.`),io=d(),O=r("li"),lo=s("A notebook that illustrates how to visualize reconstructed pixel values with "),qe=r("a"),co=s("ViTMAEForPreTraining"),ho=s(" can be found "),ie=r("a"),mo=s("here"),fo=s("."),po=d(),le=r("li"),uo=s(`After pre-training, one \u201Cthrows away\u201D the decoder used to reconstruct pixels, and one uses the encoder for fine-tuning/linear probing. This means that after
fine-tuning, one can directly plug in the weights into a `),Ie=r("a"),go=s("ViTForImageClassification"),_o=s("."),vo=d(),de=r("li"),To=s("One can use "),Ne=r("a"),Eo=s("ViTFeatureExtractor"),wo=s(" to prepare images for the model. See the code examples for more info."),bo=d(),ot=r("li"),Ao=s(`Note that the encoder of MAE is only used to encode the visual patches. The encoded patches are then concatenated with mask tokens, which the decoder (which also
consists of Transformer blocks) takes as input. Each mask token is a shared, learned vector that indicates the presence of a missing patch to be predicted. Fixed
sin/cos position embeddings are added both to the input of the encoder and the decoder.`),At=d(),Y=r("img"),Mt=d(),ce=r("small"),Mo=s("MAE architecture. Taken from the "),Se=r("a"),yo=s("original paper."),yt=d(),z=r("p"),Vo=s("This model was contributed by "),he=r("a"),ko=s("nielsr"),$o=s(". The original code can be found "),me=r("a"),xo=s("here"),Po=s("."),Vt=d(),L=r("h2"),J=r("a"),rt=r("span"),E(fe.$$.fragment),Fo=d(),at=r("span"),Co=s("ViTMAEConfig"),kt=d(),T=r("div"),E(pe.$$.fragment),jo=d(),H=r("p"),zo=s("This is the configuration class to store the configuration of a "),De=r("a"),qo=s("ViTMAEModel"),Io=s(`. It is used to instantiate an ViT
MAE 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
`),ue=r("a"),No=s("facebook/vit-mae-base"),So=s(" architecture."),Do=d(),W=r("p"),Oo=s("Configuration objects inherit from "),Oe=r("a"),Lo=s("PretrainedConfig"),Ho=s(` and can be used to control the model outputs. Read the
documentation from `),Le=r("a"),Wo=s("PretrainedConfig"),Uo=s(" for more information."),Ro=d(),nt=r("p"),Ko=s("Example:"),Xo=d(),E(ge.$$.fragment),$t=d(),U=r("h2"),Q=r("a"),st=r("span"),E(_e.$$.fragment),Go=d(),it=r("span"),Bo=s("ViTMAEModel"),xt=d(),C=r("div"),E(ve.$$.fragment),Yo=d(),Te=r("p"),Jo=s(`The bare ViTMAE Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),Ee=r("a"),Qo=s("torch.nn.Module"),Zo=s(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),er=d(),k=r("div"),E(we.$$.fragment),tr=d(),R=r("p"),or=s("The "),He=r("a"),rr=s("ViTMAEModel"),ar=s(" forward method, overrides the "),lt=r("code"),nr=s("__call__"),sr=s(" special method."),ir=d(),E(Z.$$.fragment),lr=d(),dt=r("p"),dr=s("Examples:"),cr=d(),E(be.$$.fragment),Pt=d(),K=r("h2"),ee=r("a"),ct=r("span"),E(Ae.$$.fragment),hr=d(),ht=r("span"),mr=s("ViTMAEForPreTraining"),Ft=d(),j=r("div"),E(Me.$$.fragment),fr=d(),ye=r("p"),pr=s(`The ViTMAE Model transformer with the decoder on top for self-supervised pre-training.
This model is a PyTorch `),Ve=r("a"),ur=s("torch.nn.Module"),gr=s(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),_r=d(),$=r("div"),E(ke.$$.fragment),vr=d(),X=r("p"),Tr=s("The "),We=r("a"),Er=s("ViTMAEForPreTraining"),wr=s(" forward method, overrides the "),mt=r("code"),br=s("__call__"),Ar=s(" special method."),Mr=d(),E(te.$$.fragment),yr=d(),ft=r("p"),Vr=s("Examples:"),kr=d(),E($e.$$.fragment),this.h()},l(t){const h=Ma('[data-svelte="svelte-1phssyn"]',document.head);f=a(h,"META",{name:!0,content:!0}),h.forEach(o),V=c(t),p=a(t,"H1",{class:!0});var xe=n(p);u=a(xe,"A",{id:!0,class:!0,href:!0});var pt=n(u);x=a(pt,"SPAN",{});var Fr=n(x);w(g.$$.fragment,Fr),Fr.forEach(o),pt.forEach(o),_=c(xe),F=a(xe,"SPAN",{});var Cr=n(F);Wt=i(Cr,"ViTMAE"),Cr.forEach(o),xe.forEach(o),_t=c(t),S=a(t,"H2",{class:!0});var jt=n(S);G=a(jt,"A",{id:!0,class:!0,href:!0});var jr=n(G);Ze=a(jr,"SPAN",{});var zr=n(Ze);w(re.$$.fragment,zr),zr.forEach(o),jr.forEach(o),Ut=c(jt),et=a(jt,"SPAN",{});var qr=n(et);Rt=i(qr,"Overview"),qr.forEach(o),jt.forEach(o),vt=c(t),B=a(t,"P",{});var zt=n(B);Kt=i(zt,"The ViTMAE model was proposed in "),ae=a(zt,"A",{href:!0,rel:!0});var Ir=n(ae);Xt=i(Ir,"Masked Autoencoders Are Scalable Vision Learners"),Ir.forEach(o),Gt=i(zt,` by Kaiming He, Xinlei Chen, Saining Xie, Yanghao Li,
Piotr Doll\xE1r, Ross Girshick. The paper shows that, by pre-training a Vision Transformer (ViT) to reconstruct pixel values for masked patches, one can get results after
fine-tuning that outperform supervised pre-training.`),zt.forEach(o),Tt=c(t),Pe=a(t,"P",{});var Nr=n(Pe);Bt=i(Nr,"The abstract from the paper is the following:"),Nr.forEach(o),Et=c(t),Fe=a(t,"P",{});var Sr=n(Fe);tt=a(Sr,"EM",{});var Dr=n(tt);Yt=i(Dr,`This paper shows that masked autoencoders (MAE) are scalable self-supervised learners for computer vision. Our MAE approach is simple: we mask random patches of the
input image and reconstruct the missing pixels. It is based on two core designs. First, we develop an asymmetric encoder-decoder architecture, with an encoder that operates
only on the visible subset of patches (without mask tokens), along with a lightweight decoder that reconstructs the original image from the latent representation and mask
tokens. Second, we find that masking a high proportion of the input image, e.g., 75%, yields a nontrivial and meaningful self-supervisory task. Coupling these two designs
enables us to train large models efficiently and effectively: we accelerate training (by 3x or more) and improve accuracy. Our scalable approach allows for learning high-capacity
models that generalize well: e.g., a vanilla ViT-Huge model achieves the best accuracy (87.8%) among methods that use only ImageNet-1K data. Transfer performance in downstream
tasks outperforms supervised pre-training and shows promising scaling behavior.`),Dr.forEach(o),Sr.forEach(o),wt=c(t),Ce=a(t,"P",{});var Or=n(Ce);Jt=i(Or,"Tips:"),Or.forEach(o),bt=c(t),v=a(t,"UL",{});var P=n(v);ne=a(P,"LI",{});var qt=n(ne);Qt=i(qt,`MAE (masked auto encoding) is a method for self-supervised pre-training of Vision Transformers (ViTs). The pre-training objective is relatively simple:
by masking a large portion (75%) of the image patches, the model must reconstruct raw pixel values. One can use `),je=a(qt,"A",{href:!0});var Lr=n(je);Zt=i(Lr,"ViTMAEForPreTraining"),Lr.forEach(o),eo=i(qt," for this purpose."),qt.forEach(o),to=c(P),D=a(P,"LI",{});var Ue=n(D);oo=i(Ue,"An example Python script that illustrates how to pre-train "),ze=a(Ue,"A",{href:!0});var Hr=n(ze);ro=i(Hr,"ViTMAEForPreTraining"),Hr.forEach(o),ao=i(Ue," from scratch can be found "),se=a(Ue,"A",{href:!0,rel:!0});var Wr=n(se);no=i(Wr,"here"),Wr.forEach(o),so=i(Ue,`.
One can easily tweak it for their own use case.`),Ue.forEach(o),io=c(P),O=a(P,"LI",{});var Re=n(O);lo=i(Re,"A notebook that illustrates how to visualize reconstructed pixel values with "),qe=a(Re,"A",{href:!0});var Ur=n(qe);co=i(Ur,"ViTMAEForPreTraining"),Ur.forEach(o),ho=i(Re," can be found "),ie=a(Re,"A",{href:!0,rel:!0});var Rr=n(ie);mo=i(Rr,"here"),Rr.forEach(o),fo=i(Re,"."),Re.forEach(o),po=c(P),le=a(P,"LI",{});var It=n(le);uo=i(It,`After pre-training, one \u201Cthrows away\u201D the decoder used to reconstruct pixels, and one uses the encoder for fine-tuning/linear probing. This means that after
fine-tuning, one can directly plug in the weights into a `),Ie=a(It,"A",{href:!0});var Kr=n(Ie);go=i(Kr,"ViTForImageClassification"),Kr.forEach(o),_o=i(It,"."),It.forEach(o),vo=c(P),de=a(P,"LI",{});var Nt=n(de);To=i(Nt,"One can use "),Ne=a(Nt,"A",{href:!0});var Xr=n(Ne);Eo=i(Xr,"ViTFeatureExtractor"),Xr.forEach(o),wo=i(Nt," to prepare images for the model. See the code examples for more info."),Nt.forEach(o),bo=c(P),ot=a(P,"LI",{});var Gr=n(ot);Ao=i(Gr,`Note that the encoder of MAE is only used to encode the visual patches. The encoded patches are then concatenated with mask tokens, which the decoder (which also
consists of Transformer blocks) takes as input. Each mask token is a shared, learned vector that indicates the presence of a missing patch to be predicted. Fixed
sin/cos position embeddings are added both to the input of the encoder and the decoder.`),Gr.forEach(o),P.forEach(o),At=c(t),Y=a(t,"IMG",{src:!0,alt:!0,width:!0}),Mt=c(t),ce=a(t,"SMALL",{});var $r=n(ce);Mo=i($r,"MAE architecture. Taken from the "),Se=a($r,"A",{href:!0});var Br=n(Se);yo=i(Br,"original paper."),Br.forEach(o),$r.forEach(o),yt=c(t),z=a(t,"P",{});var Ke=n(z);Vo=i(Ke,"This model was contributed by "),he=a(Ke,"A",{href:!0,rel:!0});var Yr=n(he);ko=i(Yr,"nielsr"),Yr.forEach(o),$o=i(Ke,". The original code can be found "),me=a(Ke,"A",{href:!0,rel:!0});var Jr=n(me);xo=i(Jr,"here"),Jr.forEach(o),Po=i(Ke,"."),Ke.forEach(o),Vt=c(t),L=a(t,"H2",{class:!0});var St=n(L);J=a(St,"A",{id:!0,class:!0,href:!0});var Qr=n(J);rt=a(Qr,"SPAN",{});var Zr=n(rt);w(fe.$$.fragment,Zr),Zr.forEach(o),Qr.forEach(o),Fo=c(St),at=a(St,"SPAN",{});var ea=n(at);Co=i(ea,"ViTMAEConfig"),ea.forEach(o),St.forEach(o),kt=c(t),T=a(t,"DIV",{class:!0});var q=n(T);w(pe.$$.fragment,q),jo=c(q),H=a(q,"P",{});var Xe=n(H);zo=i(Xe,"This is the configuration class to store the configuration of a "),De=a(Xe,"A",{href:!0});var ta=n(De);qo=i(ta,"ViTMAEModel"),ta.forEach(o),Io=i(Xe,`. It is used to instantiate an ViT
MAE 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
`),ue=a(Xe,"A",{href:!0,rel:!0});var oa=n(ue);No=i(oa,"facebook/vit-mae-base"),oa.forEach(o),So=i(Xe," architecture."),Xe.forEach(o),Do=c(q),W=a(q,"P",{});var Ge=n(W);Oo=i(Ge,"Configuration objects inherit from "),Oe=a(Ge,"A",{href:!0});var ra=n(Oe);Lo=i(ra,"PretrainedConfig"),ra.forEach(o),Ho=i(Ge,` and can be used to control the model outputs. Read the
documentation from `),Le=a(Ge,"A",{href:!0});var aa=n(Le);Wo=i(aa,"PretrainedConfig"),aa.forEach(o),Uo=i(Ge," for more information."),Ge.forEach(o),Ro=c(q),nt=a(q,"P",{});var na=n(nt);Ko=i(na,"Example:"),na.forEach(o),Xo=c(q),w(ge.$$.fragment,q),q.forEach(o),$t=c(t),U=a(t,"H2",{class:!0});var Dt=n(U);Q=a(Dt,"A",{id:!0,class:!0,href:!0});var sa=n(Q);st=a(sa,"SPAN",{});var ia=n(st);w(_e.$$.fragment,ia),ia.forEach(o),sa.forEach(o),Go=c(Dt),it=a(Dt,"SPAN",{});var la=n(it);Bo=i(la,"ViTMAEModel"),la.forEach(o),Dt.forEach(o),xt=c(t),C=a(t,"DIV",{class:!0});var Be=n(C);w(ve.$$.fragment,Be),Yo=c(Be),Te=a(Be,"P",{});var Ot=n(Te);Jo=i(Ot,`The bare ViTMAE Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),Ee=a(Ot,"A",{href:!0,rel:!0});var da=n(Ee);Qo=i(da,"torch.nn.Module"),da.forEach(o),Zo=i(Ot,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Ot.forEach(o),er=c(Be),k=a(Be,"DIV",{class:!0});var I=n(k);w(we.$$.fragment,I),tr=c(I),R=a(I,"P",{});var Ye=n(R);or=i(Ye,"The "),He=a(Ye,"A",{href:!0});var ca=n(He);rr=i(ca,"ViTMAEModel"),ca.forEach(o),ar=i(Ye," forward method, overrides the "),lt=a(Ye,"CODE",{});var ha=n(lt);nr=i(ha,"__call__"),ha.forEach(o),sr=i(Ye," special method."),Ye.forEach(o),ir=c(I),w(Z.$$.fragment,I),lr=c(I),dt=a(I,"P",{});var ma=n(dt);dr=i(ma,"Examples:"),ma.forEach(o),cr=c(I),w(be.$$.fragment,I),I.forEach(o),Be.forEach(o),Pt=c(t),K=a(t,"H2",{class:!0});var Lt=n(K);ee=a(Lt,"A",{id:!0,class:!0,href:!0});var fa=n(ee);ct=a(fa,"SPAN",{});var pa=n(ct);w(Ae.$$.fragment,pa),pa.forEach(o),fa.forEach(o),hr=c(Lt),ht=a(Lt,"SPAN",{});var ua=n(ht);mr=i(ua,"ViTMAEForPreTraining"),ua.forEach(o),Lt.forEach(o),Ft=c(t),j=a(t,"DIV",{class:!0});var Je=n(j);w(Me.$$.fragment,Je),fr=c(Je),ye=a(Je,"P",{});var Ht=n(ye);pr=i(Ht,`The ViTMAE Model transformer with the decoder on top for self-supervised pre-training.
This model is a PyTorch `),Ve=a(Ht,"A",{href:!0,rel:!0});var ga=n(Ve);ur=i(ga,"torch.nn.Module"),ga.forEach(o),gr=i(Ht,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Ht.forEach(o),_r=c(Je),$=a(Je,"DIV",{class:!0});var N=n($);w(ke.$$.fragment,N),vr=c(N),X=a(N,"P",{});var Qe=n(X);Tr=i(Qe,"The "),We=a(Qe,"A",{href:!0});var _a=n(We);Er=i(_a,"ViTMAEForPreTraining"),_a.forEach(o),wr=i(Qe," forward method, overrides the "),mt=a(Qe,"CODE",{});var va=n(mt);br=i(va,"__call__"),va.forEach(o),Ar=i(Qe," special method."),Qe.forEach(o),Mr=c(N),w(te.$$.fragment,N),yr=c(N),ft=a(N,"P",{});var Ta=n(ft);Vr=i(Ta,"Examples:"),Ta.forEach(o),kr=c(N),w($e.$$.fragment,N),N.forEach(o),Je.forEach(o),this.h()},h(){l(f,"name","hf:doc:metadata"),l(f,"content",JSON.stringify(xa)),l(u,"id","vitmae"),l(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"),l(u,"href","#vitmae"),l(p,"class","relative group"),l(G,"id","overview"),l(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"),l(G,"href","#overview"),l(S,"class","relative group"),l(ae,"href","https://arxiv.org/abs/2111.06377v2"),l(ae,"rel","nofollow"),l(je,"href","/docs/transformers/pr_15839/en/model_doc/vit_mae#transformers.ViTMAEForPreTraining"),l(ze,"href","/docs/transformers/pr_15839/en/model_doc/vit_mae#transformers.ViTMAEForPreTraining"),l(se,"href","https://github.com/huggingface/transformers/tree/master/examples/pytorch/image-pretraining"),l(se,"rel","nofollow"),l(qe,"href","/docs/transformers/pr_15839/en/model_doc/vit_mae#transformers.ViTMAEForPreTraining"),l(ie,"href","https://github.com/NielsRogge/Transformers-Tutorials/blob/master/ViTMAE/ViT_MAE_visualization_demo.ipynb"),l(ie,"rel","nofollow"),l(Ie,"href","/docs/transformers/pr_15839/en/model_doc/vit#transformers.ViTForImageClassification"),l(Ne,"href","/docs/transformers/pr_15839/en/model_doc/vit#transformers.ViTFeatureExtractor"),ya(Y.src,Pr="https://user-images.githubusercontent.com/11435359/146857310-f258c86c-fde6-48e8-9cee-badd2b21bd2c.png")||l(Y,"src",Pr),l(Y,"alt","drawing"),l(Y,"width","600"),l(Se,"href","https://arxiv.org/abs/2111.06377"),l(he,"href","https://huggingface.co/nielsr"),l(he,"rel","nofollow"),l(me,"href","https://github.com/facebookresearch/mae"),l(me,"rel","nofollow"),l(J,"id","transformers.ViTMAEConfig"),l(J,"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"),l(J,"href","#transformers.ViTMAEConfig"),l(L,"class","relative group"),l(De,"href","/docs/transformers/pr_15839/en/model_doc/vit_mae#transformers.ViTMAEModel"),l(ue,"href","https://huggingface.co/facebook/vit-mae-base"),l(ue,"rel","nofollow"),l(Oe,"href","/docs/transformers/pr_15839/en/main_classes/configuration#transformers.PretrainedConfig"),l(Le,"href","/docs/transformers/pr_15839/en/main_classes/configuration#transformers.PretrainedConfig"),l(T,"class","docstring"),l(Q,"id","transformers.ViTMAEModel"),l(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"),l(Q,"href","#transformers.ViTMAEModel"),l(U,"class","relative group"),l(Ee,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(Ee,"rel","nofollow"),l(He,"href","/docs/transformers/pr_15839/en/model_doc/vit_mae#transformers.ViTMAEModel"),l(k,"class","docstring"),l(C,"class","docstring"),l(ee,"id","transformers.ViTMAEForPreTraining"),l(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"),l(ee,"href","#transformers.ViTMAEForPreTraining"),l(K,"class","relative group"),l(Ve,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(Ve,"rel","nofollow"),l(We,"href","/docs/transformers/pr_15839/en/model_doc/vit_mae#transformers.ViTMAEForPreTraining"),l($,"class","docstring"),l(j,"class","docstring")},m(t,h){e(document.head,f),m(t,V,h),m(t,p,h),e(p,u),e(u,x),b(g,x,null),e(p,_),e(p,F),e(F,Wt),m(t,_t,h),m(t,S,h),e(S,G),e(G,Ze),b(re,Ze,null),e(S,Ut),e(S,et),e(et,Rt),m(t,vt,h),m(t,B,h),e(B,Kt),e(B,ae),e(ae,Xt),e(B,Gt),m(t,Tt,h),m(t,Pe,h),e(Pe,Bt),m(t,Et,h),m(t,Fe,h),e(Fe,tt),e(tt,Yt),m(t,wt,h),m(t,Ce,h),e(Ce,Jt),m(t,bt,h),m(t,v,h),e(v,ne),e(ne,Qt),e(ne,je),e(je,Zt),e(ne,eo),e(v,to),e(v,D),e(D,oo),e(D,ze),e(ze,ro),e(D,ao),e(D,se),e(se,no),e(D,so),e(v,io),e(v,O),e(O,lo),e(O,qe),e(qe,co),e(O,ho),e(O,ie),e(ie,mo),e(O,fo),e(v,po),e(v,le),e(le,uo),e(le,Ie),e(Ie,go),e(le,_o),e(v,vo),e(v,de),e(de,To),e(de,Ne),e(Ne,Eo),e(de,wo),e(v,bo),e(v,ot),e(ot,Ao),m(t,At,h),m(t,Y,h),m(t,Mt,h),m(t,ce,h),e(ce,Mo),e(ce,Se),e(Se,yo),m(t,yt,h),m(t,z,h),e(z,Vo),e(z,he),e(he,ko),e(z,$o),e(z,me),e(me,xo),e(z,Po),m(t,Vt,h),m(t,L,h),e(L,J),e(J,rt),b(fe,rt,null),e(L,Fo),e(L,at),e(at,Co),m(t,kt,h),m(t,T,h),b(pe,T,null),e(T,jo),e(T,H),e(H,zo),e(H,De),e(De,qo),e(H,Io),e(H,ue),e(ue,No),e(H,So),e(T,Do),e(T,W),e(W,Oo),e(W,Oe),e(Oe,Lo),e(W,Ho),e(W,Le),e(Le,Wo),e(W,Uo),e(T,Ro),e(T,nt),e(nt,Ko),e(T,Xo),b(ge,T,null),m(t,$t,h),m(t,U,h),e(U,Q),e(Q,st),b(_e,st,null),e(U,Go),e(U,it),e(it,Bo),m(t,xt,h),m(t,C,h),b(ve,C,null),e(C,Yo),e(C,Te),e(Te,Jo),e(Te,Ee),e(Ee,Qo),e(Te,Zo),e(C,er),e(C,k),b(we,k,null),e(k,tr),e(k,R),e(R,or),e(R,He),e(He,rr),e(R,ar),e(R,lt),e(lt,nr),e(R,sr),e(k,ir),b(Z,k,null),e(k,lr),e(k,dt),e(dt,dr),e(k,cr),b(be,k,null),m(t,Pt,h),m(t,K,h),e(K,ee),e(ee,ct),b(Ae,ct,null),e(K,hr),e(K,ht),e(ht,mr),m(t,Ft,h),m(t,j,h),b(Me,j,null),e(j,fr),e(j,ye),e(ye,pr),e(ye,Ve),e(Ve,ur),e(ye,gr),e(j,_r),e(j,$),b(ke,$,null),e($,vr),e($,X),e(X,Tr),e(X,We),e(We,Er),e(X,wr),e(X,mt),e(mt,br),e(X,Ar),e($,Mr),b(te,$,null),e($,yr),e($,ft),e(ft,Vr),e($,kr),b($e,$,null),Ct=!0},p(t,[h]){const xe={};h&2&&(xe.$$scope={dirty:h,ctx:t}),Z.$set(xe);const pt={};h&2&&(pt.$$scope={dirty:h,ctx:t}),te.$set(pt)},i(t){Ct||(A(g.$$.fragment,t),A(re.$$.fragment,t),A(fe.$$.fragment,t),A(pe.$$.fragment,t),A(ge.$$.fragment,t),A(_e.$$.fragment,t),A(ve.$$.fragment,t),A(we.$$.fragment,t),A(Z.$$.fragment,t),A(be.$$.fragment,t),A(Ae.$$.fragment,t),A(Me.$$.fragment,t),A(ke.$$.fragment,t),A(te.$$.fragment,t),A($e.$$.fragment,t),Ct=!0)},o(t){M(g.$$.fragment,t),M(re.$$.fragment,t),M(fe.$$.fragment,t),M(pe.$$.fragment,t),M(ge.$$.fragment,t),M(_e.$$.fragment,t),M(ve.$$.fragment,t),M(we.$$.fragment,t),M(Z.$$.fragment,t),M(be.$$.fragment,t),M(Ae.$$.fragment,t),M(Me.$$.fragment,t),M(ke.$$.fragment,t),M(te.$$.fragment,t),M($e.$$.fragment,t),Ct=!1},d(t){o(f),t&&o(V),t&&o(p),y(g),t&&o(_t),t&&o(S),y(re),t&&o(vt),t&&o(B),t&&o(Tt),t&&o(Pe),t&&o(Et),t&&o(Fe),t&&o(wt),t&&o(Ce),t&&o(bt),t&&o(v),t&&o(At),t&&o(Y),t&&o(Mt),t&&o(ce),t&&o(yt),t&&o(z),t&&o(Vt),t&&o(L),y(fe),t&&o(kt),t&&o(T),y(pe),y(ge),t&&o($t),t&&o(U),y(_e),t&&o(xt),t&&o(C),y(ve),y(we),y(Z),y(be),t&&o(Pt),t&&o(K),y(Ae),t&&o(Ft),t&&o(j),y(Me),y(ke),y(te),y($e)}}}const xa={local:"vitmae",sections:[{local:"overview",title:"Overview"},{local:"transformers.ViTMAEConfig",title:"ViTMAEConfig"},{local:"transformers.ViTMAEModel",title:"ViTMAEModel"},{local:"transformers.ViTMAEForPreTraining",title:"ViTMAEForPreTraining"}],title:"ViTMAE"};function Pa(oe,f,V){let{fw:p}=f;return oe.$$set=u=>{"fw"in u&&V(0,p=u.fw)},[p]}class Na extends wa{constructor(f){super();ba(this,f,Pa,$a,Aa,{fw:0})}}export{Na as default,xa as metadata};
