import{S as qs,i as Is,s as zs,e as a,k as p,w as b,t as r,M as Os,c as s,d as t,m,a as i,x as $,h as n,b as h,N as Ds,G as e,g,y as M,q as A,o as k,B as x,v as Ns,L as ur}from"../../chunks/vendor-hf-doc-builder.js";import{T as yo}from"../../chunks/Tip-hf-doc-builder.js";import{D as Tt}from"../../chunks/Docstring-hf-doc-builder.js";import{C as fr}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as bo}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as mr}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Ls(C){let d,w,u,f,T;return f=new fr({props:{code:`from transformers import ViTMAEConfig, ViTMAEModel

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

# Initializing a model (with random weights) 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> ViTMAEConfig, ViTMAEModel

<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 (with random weights) 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`}}),{c(){d=a("p"),w=r("Example:"),u=p(),b(f.$$.fragment)},l(l){d=s(l,"P",{});var c=i(d);w=n(c,"Example:"),c.forEach(t),u=m(l),$(f.$$.fragment,l)},m(l,c){g(l,d,c),e(d,w),g(l,u,c),M(f,l,c),T=!0},p:ur,i(l){T||(A(f.$$.fragment,l),T=!0)},o(l){k(f.$$.fragment,l),T=!1},d(l){l&&t(d),l&&t(u),x(f,l)}}}function Ss(C){let d,w,u,f,T;return{c(){d=a("p"),w=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=a("code"),f=r("Module"),T=r(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){d=s(l,"P",{});var c=i(d);w=n(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s(c,"CODE",{});var F=i(u);f=n(F,"Module"),F.forEach(t),T=n(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(t)},m(l,c){g(l,d,c),e(d,w),e(d,u),e(u,f),e(d,T)},d(l){l&&t(d)}}}function Ks(C){let d,w,u,f,T;return f=new fr({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`}}),{c(){d=a("p"),w=r("Examples:"),u=p(),b(f.$$.fragment)},l(l){d=s(l,"P",{});var c=i(d);w=n(c,"Examples:"),c.forEach(t),u=m(l),$(f.$$.fragment,l)},m(l,c){g(l,d,c),e(d,w),g(l,u,c),M(f,l,c),T=!0},p:ur,i(l){T||(A(f.$$.fragment,l),T=!0)},o(l){k(f.$$.fragment,l),T=!1},d(l){l&&t(d),l&&t(u),x(f,l)}}}function Hs(C){let d,w,u,f,T;return{c(){d=a("p"),w=r("Note that we provide a script to pre-train this model on custom data in our "),u=a("a"),f=r(`examples
directory`),T=r("."),this.h()},l(l){d=s(l,"P",{});var c=i(d);w=n(c,"Note that we provide a script to pre-train this model on custom data in our "),u=s(c,"A",{href:!0,rel:!0});var F=i(u);f=n(F,`examples
directory`),F.forEach(t),T=n(c,"."),c.forEach(t),this.h()},h(){h(u,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/image-pretraining"),h(u,"rel","nofollow")},m(l,c){g(l,d,c),e(d,w),e(d,u),e(u,f),e(d,T)},d(l){l&&t(d)}}}function Us(C){let d,w,u,f,T;return{c(){d=a("p"),w=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=a("code"),f=r("Module"),T=r(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){d=s(l,"P",{});var c=i(d);w=n(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s(c,"CODE",{});var F=i(u);f=n(F,"Module"),F.forEach(t),T=n(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(t)},m(l,c){g(l,d,c),e(d,w),e(d,u),e(u,f),e(d,T)},d(l){l&&t(d)}}}function Ws(C){let d,w,u,f,T;return f=new fr({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(){d=a("p"),w=r("Examples:"),u=p(),b(f.$$.fragment)},l(l){d=s(l,"P",{});var c=i(d);w=n(c,"Examples:"),c.forEach(t),u=m(l),$(f.$$.fragment,l)},m(l,c){g(l,d,c),e(d,w),g(l,u,c),M(f,l,c),T=!0},p:ur,i(l){T||(A(f.$$.fragment,l),T=!0)},o(l){k(f.$$.fragment,l),T=!1},d(l){l&&t(d),l&&t(u),x(f,l)}}}function Rs(C){let d,w,u,f,T,l,c,F,Fe,Te,I,Y,Z,E,Ve,W,Pe,we,L,je,ee,te,Ce,Ee,K,qe,ye,H,fe,Ie,de,j,z,be,V,oe,ze,U,Oe,De,O,R,re,ce,Ne,ne,ae,Le,B,Se,D,Ke,J,N,He,q,Ue,We;return{c(){d=a("p"),w=r("TensorFlow models and layers in "),u=a("code"),f=r("transformers"),T=r(" accept two formats as input:"),l=p(),c=a("ul"),F=a("li"),Fe=r("having all inputs as keyword arguments (like PyTorch models), or"),Te=p(),I=a("li"),Y=r("having all inputs as a list, tuple or dict in the first positional argument."),Z=p(),E=a("p"),Ve=r(`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),W=a("code"),Pe=r("model.fit()"),we=r(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),L=a("code"),je=r("model.fit()"),ee=r(` supports! If, however, you want to use the second
format outside of Keras methods like `),te=a("code"),Ce=r("fit()"),Ee=r(" and "),K=a("code"),qe=r("predict()"),ye=r(`, such as when creating your own layers or models with
the Keras `),H=a("code"),fe=r("Functional"),Ie=r(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),de=p(),j=a("ul"),z=a("li"),be=r("a single Tensor with "),V=a("code"),oe=r("pixel_values"),ze=r(" only and nothing else: "),U=a("code"),Oe=r("model(pixel_values)"),De=p(),O=a("li"),R=r(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),re=a("code"),ce=r("model([pixel_values, attention_mask])"),Ne=r(" or "),ne=a("code"),ae=r("model([pixel_values, attention_mask, token_type_ids])"),Le=p(),B=a("li"),Se=r(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),D=a("code"),Ke=r('model({"pixel_values": pixel_values, "token_type_ids": token_type_ids})'),J=p(),N=a("p"),He=r(`Note that when creating models and layers with
`),q=a("a"),Ue=r("subclassing"),We=r(` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),this.h()},l(v){d=s(v,"P",{});var y=i(d);w=n(y,"TensorFlow models and layers in "),u=s(y,"CODE",{});var Qe=i(u);f=n(Qe,"transformers"),Qe.forEach(t),T=n(y," accept two formats as input:"),y.forEach(t),l=m(v),c=s(v,"UL",{});var Q=i(c);F=s(Q,"LI",{});var Ze=i(F);Fe=n(Ze,"having all inputs as keyword arguments (like PyTorch models), or"),Ze.forEach(t),Te=m(Q),I=s(Q,"LI",{});var et=i(I);Y=n(et,"having all inputs as a list, tuple or dict in the first positional argument."),et.forEach(t),Q.forEach(t),Z=m(v),E=s(v,"P",{});var P=i(E);Ve=n(P,`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),W=s(P,"CODE",{});var ge=i(W);Pe=n(ge,"model.fit()"),ge.forEach(t),we=n(P,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),L=s(P,"CODE",{});var tt=i(L);je=n(tt,"model.fit()"),tt.forEach(t),ee=n(P,` supports! If, however, you want to use the second
format outside of Keras methods like `),te=s(P,"CODE",{});var $e=i(te);Ce=n($e,"fit()"),$e.forEach(t),Ee=n(P," and "),K=s(P,"CODE",{});var ot=i(K);qe=n(ot,"predict()"),ot.forEach(t),ye=n(P,`, such as when creating your own layers or models with
the Keras `),H=s(P,"CODE",{});var rt=i(H);fe=n(rt,"Functional"),rt.forEach(t),Ie=n(P,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),P.forEach(t),de=m(v),j=s(v,"UL",{});var G=i(j);z=s(G,"LI",{});var X=i(z);be=n(X,"a single Tensor with "),V=s(X,"CODE",{});var nt=i(V);oe=n(nt,"pixel_values"),nt.forEach(t),ze=n(X," only and nothing else: "),U=s(X,"CODE",{});var at=i(U);Oe=n(at,"model(pixel_values)"),at.forEach(t),X.forEach(t),De=m(G),O=s(G,"LI",{});var S=i(O);R=n(S,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),re=s(S,"CODE",{});var st=i(re);ce=n(st,"model([pixel_values, attention_mask])"),st.forEach(t),Ne=n(S," or "),ne=s(S,"CODE",{});var _e=i(ne);ae=n(_e,"model([pixel_values, attention_mask, token_type_ids])"),_e.forEach(t),S.forEach(t),Le=m(G),B=s(G,"LI",{});var Re=i(B);Se=n(Re,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),D=s(Re,"CODE",{});var it=i(D);Ke=n(it,'model({"pixel_values": pixel_values, "token_type_ids": token_type_ids})'),it.forEach(t),Re.forEach(t),G.forEach(t),J=m(v),N=s(v,"P",{});var he=i(N);He=n(he,`Note that when creating models and layers with
`),q=s(he,"A",{href:!0,rel:!0});var pe=i(q);Ue=n(pe,"subclassing"),pe.forEach(t),We=n(he,` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),he.forEach(t),this.h()},h(){h(q,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),h(q,"rel","nofollow")},m(v,y){g(v,d,y),e(d,w),e(d,u),e(u,f),e(d,T),g(v,l,y),g(v,c,y),e(c,F),e(F,Fe),e(c,Te),e(c,I),e(I,Y),g(v,Z,y),g(v,E,y),e(E,Ve),e(E,W),e(W,Pe),e(E,we),e(E,L),e(L,je),e(E,ee),e(E,te),e(te,Ce),e(E,Ee),e(E,K),e(K,qe),e(E,ye),e(E,H),e(H,fe),e(E,Ie),g(v,de,y),g(v,j,y),e(j,z),e(z,be),e(z,V),e(V,oe),e(z,ze),e(z,U),e(U,Oe),e(j,De),e(j,O),e(O,R),e(O,re),e(re,ce),e(O,Ne),e(O,ne),e(ne,ae),e(j,Le),e(j,B),e(B,Se),e(B,D),e(D,Ke),g(v,J,y),g(v,N,y),e(N,He),e(N,q),e(q,Ue),e(N,We)},d(v){v&&t(d),v&&t(l),v&&t(c),v&&t(Z),v&&t(E),v&&t(de),v&&t(j),v&&t(J),v&&t(N)}}}function Bs(C){let d,w,u,f,T;return{c(){d=a("p"),w=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=a("code"),f=r("Module"),T=r(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){d=s(l,"P",{});var c=i(d);w=n(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s(c,"CODE",{});var F=i(u);f=n(F,"Module"),F.forEach(t),T=n(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(t)},m(l,c){g(l,d,c),e(d,w),e(d,u),e(u,f),e(d,T)},d(l){l&&t(d)}}}function Gs(C){let d,w,u,f,T;return f=new fr({props:{code:`from transformers import AutoFeatureExtractor, TFViTMAEModel
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 = TFViTMAEModel.from_pretrained("facebook/vit-mae-base")

inputs = feature_extractor(images=image, return_tensors="tf")
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, TFViTMAEModel
<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 = TFViTMAEModel.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;tf&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`}}),{c(){d=a("p"),w=r("Examples:"),u=p(),b(f.$$.fragment)},l(l){d=s(l,"P",{});var c=i(d);w=n(c,"Examples:"),c.forEach(t),u=m(l),$(f.$$.fragment,l)},m(l,c){g(l,d,c),e(d,w),g(l,u,c),M(f,l,c),T=!0},p:ur,i(l){T||(A(f.$$.fragment,l),T=!0)},o(l){k(f.$$.fragment,l),T=!1},d(l){l&&t(d),l&&t(u),x(f,l)}}}function Xs(C){let d,w,u,f,T,l,c,F,Fe,Te,I,Y,Z,E,Ve,W,Pe,we,L,je,ee,te,Ce,Ee,K,qe,ye,H,fe,Ie,de,j,z,be,V,oe,ze,U,Oe,De,O,R,re,ce,Ne,ne,ae,Le,B,Se,D,Ke,J,N,He,q,Ue,We;return{c(){d=a("p"),w=r("TensorFlow models and layers in "),u=a("code"),f=r("transformers"),T=r(" accept two formats as input:"),l=p(),c=a("ul"),F=a("li"),Fe=r("having all inputs as keyword arguments (like PyTorch models), or"),Te=p(),I=a("li"),Y=r("having all inputs as a list, tuple or dict in the first positional argument."),Z=p(),E=a("p"),Ve=r(`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),W=a("code"),Pe=r("model.fit()"),we=r(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),L=a("code"),je=r("model.fit()"),ee=r(` supports! If, however, you want to use the second
format outside of Keras methods like `),te=a("code"),Ce=r("fit()"),Ee=r(" and "),K=a("code"),qe=r("predict()"),ye=r(`, such as when creating your own layers or models with
the Keras `),H=a("code"),fe=r("Functional"),Ie=r(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),de=p(),j=a("ul"),z=a("li"),be=r("a single Tensor with "),V=a("code"),oe=r("pixel_values"),ze=r(" only and nothing else: "),U=a("code"),Oe=r("model(pixel_values)"),De=p(),O=a("li"),R=r(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),re=a("code"),ce=r("model([pixel_values, attention_mask])"),Ne=r(" or "),ne=a("code"),ae=r("model([pixel_values, attention_mask, token_type_ids])"),Le=p(),B=a("li"),Se=r(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),D=a("code"),Ke=r('model({"pixel_values": pixel_values, "token_type_ids": token_type_ids})'),J=p(),N=a("p"),He=r(`Note that when creating models and layers with
`),q=a("a"),Ue=r("subclassing"),We=r(` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),this.h()},l(v){d=s(v,"P",{});var y=i(d);w=n(y,"TensorFlow models and layers in "),u=s(y,"CODE",{});var Qe=i(u);f=n(Qe,"transformers"),Qe.forEach(t),T=n(y," accept two formats as input:"),y.forEach(t),l=m(v),c=s(v,"UL",{});var Q=i(c);F=s(Q,"LI",{});var Ze=i(F);Fe=n(Ze,"having all inputs as keyword arguments (like PyTorch models), or"),Ze.forEach(t),Te=m(Q),I=s(Q,"LI",{});var et=i(I);Y=n(et,"having all inputs as a list, tuple or dict in the first positional argument."),et.forEach(t),Q.forEach(t),Z=m(v),E=s(v,"P",{});var P=i(E);Ve=n(P,`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),W=s(P,"CODE",{});var ge=i(W);Pe=n(ge,"model.fit()"),ge.forEach(t),we=n(P,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),L=s(P,"CODE",{});var tt=i(L);je=n(tt,"model.fit()"),tt.forEach(t),ee=n(P,` supports! If, however, you want to use the second
format outside of Keras methods like `),te=s(P,"CODE",{});var $e=i(te);Ce=n($e,"fit()"),$e.forEach(t),Ee=n(P," and "),K=s(P,"CODE",{});var ot=i(K);qe=n(ot,"predict()"),ot.forEach(t),ye=n(P,`, such as when creating your own layers or models with
the Keras `),H=s(P,"CODE",{});var rt=i(H);fe=n(rt,"Functional"),rt.forEach(t),Ie=n(P,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),P.forEach(t),de=m(v),j=s(v,"UL",{});var G=i(j);z=s(G,"LI",{});var X=i(z);be=n(X,"a single Tensor with "),V=s(X,"CODE",{});var nt=i(V);oe=n(nt,"pixel_values"),nt.forEach(t),ze=n(X," only and nothing else: "),U=s(X,"CODE",{});var at=i(U);Oe=n(at,"model(pixel_values)"),at.forEach(t),X.forEach(t),De=m(G),O=s(G,"LI",{});var S=i(O);R=n(S,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),re=s(S,"CODE",{});var st=i(re);ce=n(st,"model([pixel_values, attention_mask])"),st.forEach(t),Ne=n(S," or "),ne=s(S,"CODE",{});var _e=i(ne);ae=n(_e,"model([pixel_values, attention_mask, token_type_ids])"),_e.forEach(t),S.forEach(t),Le=m(G),B=s(G,"LI",{});var Re=i(B);Se=n(Re,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),D=s(Re,"CODE",{});var it=i(D);Ke=n(it,'model({"pixel_values": pixel_values, "token_type_ids": token_type_ids})'),it.forEach(t),Re.forEach(t),G.forEach(t),J=m(v),N=s(v,"P",{});var he=i(N);He=n(he,`Note that when creating models and layers with
`),q=s(he,"A",{href:!0,rel:!0});var pe=i(q);Ue=n(pe,"subclassing"),pe.forEach(t),We=n(he,` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),he.forEach(t),this.h()},h(){h(q,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),h(q,"rel","nofollow")},m(v,y){g(v,d,y),e(d,w),e(d,u),e(u,f),e(d,T),g(v,l,y),g(v,c,y),e(c,F),e(F,Fe),e(c,Te),e(c,I),e(I,Y),g(v,Z,y),g(v,E,y),e(E,Ve),e(E,W),e(W,Pe),e(E,we),e(E,L),e(L,je),e(E,ee),e(E,te),e(te,Ce),e(E,Ee),e(E,K),e(K,qe),e(E,ye),e(E,H),e(H,fe),e(E,Ie),g(v,de,y),g(v,j,y),e(j,z),e(z,be),e(z,V),e(V,oe),e(z,ze),e(z,U),e(U,Oe),e(j,De),e(j,O),e(O,R),e(O,re),e(re,ce),e(O,Ne),e(O,ne),e(ne,ae),e(j,Le),e(j,B),e(B,Se),e(B,D),e(D,Ke),g(v,J,y),g(v,N,y),e(N,He),e(N,q),e(q,Ue),e(N,We)},d(v){v&&t(d),v&&t(l),v&&t(c),v&&t(Z),v&&t(E),v&&t(de),v&&t(j),v&&t(J),v&&t(N)}}}function Ys(C){let d,w,u,f,T;return{c(){d=a("p"),w=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=a("code"),f=r("Module"),T=r(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){d=s(l,"P",{});var c=i(d);w=n(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s(c,"CODE",{});var F=i(u);f=n(F,"Module"),F.forEach(t),T=n(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(t)},m(l,c){g(l,d,c),e(d,w),e(d,u),e(u,f),e(d,T)},d(l){l&&t(d)}}}function Js(C){let d,w,u,f,T;return f=new fr({props:{code:`from transformers import AutoFeatureExtractor, TFViTMAEForPreTraining
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 = TFViTMAEForPreTraining.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, TFViTMAEForPreTraining
<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 = TFViTMAEForPreTraining.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(){d=a("p"),w=r("Examples:"),u=p(),b(f.$$.fragment)},l(l){d=s(l,"P",{});var c=i(d);w=n(c,"Examples:"),c.forEach(t),u=m(l),$(f.$$.fragment,l)},m(l,c){g(l,d,c),e(d,w),g(l,u,c),M(f,l,c),T=!0},p:ur,i(l){T||(A(f.$$.fragment,l),T=!0)},o(l){k(f.$$.fragment,l),T=!1},d(l){l&&t(d),l&&t(u),x(f,l)}}}function Qs(C){let d,w,u,f,T,l,c,F,Fe,Te,I,Y,Z,E,Ve,W,Pe,we,L,je,ee,te,Ce,Ee,K,qe,ye,H,fe,Ie,de,j,z,be,V,oe,ze,U,Oe,De,O,R,re,ce,Ne,ne,ae,Le,B,Se,D,Ke,J,N,He,q,Ue,We,v,y,Qe,Q,Ze,et,P,ge,tt,$e,ot,rt,G,X,nt,at,S,st,_e,Re,it,he,pe,Oa,gr,Kt,Ur,$o,Wr,_r,me,Rr,Ht,Br,Gr,Ut,Xr,Yr,Wt,Jr,Qr,Rt,Zr,en,vr,lt,wt,Ho,Bt,tn,Uo,on,Tr,ve,Gt,rn,dt,nn,Mo,an,sn,Xt,ln,dn,cn,ct,hn,Ao,pn,mn,ko,un,fn,gn,Et,wr,ht,yt,Wo,Yt,_n,Ro,vn,Er,Be,Jt,Tn,Qt,wn,Zt,En,yn,bn,Me,eo,$n,pt,Mn,xo,An,kn,Bo,xn,Fn,Vn,bt,Pn,$t,yr,mt,Mt,Go,to,jn,Xo,Cn,br,se,oo,qn,Yo,In,zn,At,On,ro,Dn,no,Nn,Ln,Sn,Ae,ao,Kn,ut,Hn,Fo,Un,Wn,Jo,Rn,Bn,Gn,kt,Xn,xt,$r,ft,Ft,Qo,so,Yn,Zo,Jn,Mr,ie,io,Qn,lo,Zn,Vo,ea,ta,oa,co,ra,ho,na,aa,sa,Vt,ia,ke,po,la,gt,da,Po,ca,ha,er,pa,ma,ua,Pt,fa,jt,Ar,_t,Ct,tr,mo,ga,or,_a,kr,le,uo,va,fo,Ta,jo,wa,Ea,ya,go,ba,_o,$a,Ma,Aa,qt,ka,xe,vo,xa,vt,Fa,Co,Va,Pa,rr,ja,Ca,qa,It,Ia,zt,xr;return l=new bo({}),E=new bo({}),Bt=new bo({}),Gt=new Tt({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:""}],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"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/vit_mae/configuration_vit_mae.py#L29"}}),Et=new mr({props:{anchor:"transformers.ViTMAEConfig.example",$$slots:{default:[Ls]},$$scope:{ctx:C}}}),Yt=new bo({}),Jt=new Tt({props:{name:"class transformers.ViTMAEModel",anchor:"transformers.ViTMAEModel",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.ViTMAEModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_19907/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_19907/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/vit_mae/modeling_vit_mae.py#L639"}}),eo=new Tt({props:{name:"forward",anchor:"transformers.ViTMAEModel.forward",parameters:[{name:"pixel_values",val:": typing.Optional[torch.FloatTensor] = None"},{name:"noise",val:": typing.Optional[torch.FloatTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],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_19907/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_19907/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/vit_mae/modeling_vit_mae.py#L663",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_19907/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>
`}}),bt=new yo({props:{$$slots:{default:[Ss]},$$scope:{ctx:C}}}),$t=new mr({props:{anchor:"transformers.ViTMAEModel.forward.example",$$slots:{default:[Ks]},$$scope:{ctx:C}}}),to=new bo({}),oo=new Tt({props:{name:"class transformers.ViTMAEForPreTraining",anchor:"transformers.ViTMAEForPreTraining",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.ViTMAEForPreTraining.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_19907/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_19907/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/vit_mae/modeling_vit_mae.py#L851"}}),At=new yo({props:{$$slots:{default:[Hs]},$$scope:{ctx:C}}}),ao=new Tt({props:{name:"forward",anchor:"transformers.ViTMAEForPreTraining.forward",parameters:[{name:"pixel_values",val:": typing.Optional[torch.FloatTensor] = None"},{name:"noise",val:": typing.Optional[torch.FloatTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],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_19907/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_19907/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/vit_mae/modeling_vit_mae.py#L964",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_19907/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, sequence_length, 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>
`}}),kt=new yo({props:{$$slots:{default:[Us]},$$scope:{ctx:C}}}),xt=new mr({props:{anchor:"transformers.ViTMAEForPreTraining.forward.example",$$slots:{default:[Ws]},$$scope:{ctx:C}}}),so=new bo({}),io=new Tt({props:{name:"class transformers.TFViTMAEModel",anchor:"transformers.TFViTMAEModel",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFViTMAEModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_19907/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_19907/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/vit_mae/modeling_tf_vit_mae.py#L805"}}),Vt=new yo({props:{$$slots:{default:[Rs]},$$scope:{ctx:C}}}),po=new Tt({props:{name:"call",anchor:"transformers.TFViTMAEModel.call",parameters:[{name:"pixel_values",val:": typing.Union[typing.List[tensorflow.python.framework.ops.Tensor], typing.List[numpy.ndarray], typing.List[tensorflow.python.keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, tensorflow.python.keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, tensorflow.python.keras.engine.keras_tensor.KerasTensor, NoneType] = None"},{name:"noise",val:": Tensor = None"},{name:"head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"training",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TFViTMAEModel.call.pixel_values",description:`<strong>pixel_values</strong> (<code>np.ndarray</code>, <code>tf.Tensor</code>, <code>List[tf.Tensor]</code> \`<code>Dict[str, tf.Tensor]</code> or <code>Dict[str, np.ndarray]</code> and each example must have the shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/pr_19907/en/model_doc/auto#transformers.AutoFeatureExtractor">AutoFeatureExtractor</a>. See
<code>AutoFeatureExtractor.__call__()</code> for details.`,name:"pixel_values"},{anchor:"transformers.TFViTMAEModel.call.head_mask",description:`<strong>head_mask</strong> (<code>np.ndarray</code> or <code>tf.Tensor</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.TFViTMAEModel.call.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. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFViTMAEModel.call.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. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFViTMAEModel.call.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_19907/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used
in eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFViTMAEModel.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to \`False&#x201C;) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/vit_mae/modeling_tf_vit_mae.py#L814",returnDescription:`
<p>A <code>transformers.models.vit_mae.modeling_tf_vit_mae.TFViTMAEModelOutput</code> or a tuple of <code>tf.Tensor</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_19907/en/model_doc/vit_mae#transformers.ViTMAEConfig"
>ViTMAEConfig</a>) and inputs.</p>
<ul>
<li><strong>last_hidden_state</strong> (<code>tf.Tensor</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>tf.Tensor</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>tf.Tensor</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(tf.Tensor)</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>tf.Tensor</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(tf.Tensor)</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>tf.Tensor</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_tf_vit_mae.TFViTMAEModelOutput</code> or <code>tuple(tf.Tensor)</code></p>
`}}),Pt=new yo({props:{$$slots:{default:[Bs]},$$scope:{ctx:C}}}),jt=new mr({props:{anchor:"transformers.TFViTMAEModel.call.example",$$slots:{default:[Gs]},$$scope:{ctx:C}}}),mo=new bo({}),uo=new Tt({props:{name:"class transformers.TFViTMAEForPreTraining",anchor:"transformers.TFViTMAEForPreTraining",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFViTMAEForPreTraining.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_19907/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_19907/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/vit_mae/modeling_tf_vit_mae.py#L978"}}),qt=new yo({props:{$$slots:{default:[Xs]},$$scope:{ctx:C}}}),vo=new Tt({props:{name:"call",anchor:"transformers.TFViTMAEForPreTraining.call",parameters:[{name:"pixel_values",val:": typing.Union[typing.List[tensorflow.python.framework.ops.Tensor], typing.List[numpy.ndarray], typing.List[tensorflow.python.keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, tensorflow.python.keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, tensorflow.python.keras.engine.keras_tensor.KerasTensor, NoneType] = None"},{name:"noise",val:": Tensor = None"},{name:"head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"training",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TFViTMAEForPreTraining.call.pixel_values",description:`<strong>pixel_values</strong> (<code>np.ndarray</code>, <code>tf.Tensor</code>, <code>List[tf.Tensor]</code> \`<code>Dict[str, tf.Tensor]</code> or <code>Dict[str, np.ndarray]</code> and each example must have the shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/pr_19907/en/model_doc/auto#transformers.AutoFeatureExtractor">AutoFeatureExtractor</a>. See
<code>AutoFeatureExtractor.__call__()</code> for details.`,name:"pixel_values"},{anchor:"transformers.TFViTMAEForPreTraining.call.head_mask",description:`<strong>head_mask</strong> (<code>np.ndarray</code> or <code>tf.Tensor</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.TFViTMAEForPreTraining.call.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. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFViTMAEForPreTraining.call.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. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFViTMAEForPreTraining.call.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_19907/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used
in eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFViTMAEForPreTraining.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to \`False&#x201C;) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/vit_mae/modeling_tf_vit_mae.py#L1105",returnDescription:`
<p>A <code>transformers.models.vit_mae.modeling_tf_vit_mae.TFViTMAEForPreTrainingOutput</code> or a tuple of <code>tf.Tensor</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_19907/en/model_doc/vit_mae#transformers.ViTMAEConfig"
>ViTMAEConfig</a>) and inputs.</p>
<ul>
<li><strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(1,)</code>) \u2014 Pixel reconstruction loss.</li>
<li><strong>logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, patch_size ** 2 * num_channels)</code>) \u2014 Pixel reconstruction logits.</li>
<li><strong>mask</strong> (<code>tf.Tensor</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>tf.Tensor</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(tf.Tensor)</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>tf.Tensor</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(tf.Tensor)</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>tf.Tensor</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_tf_vit_mae.TFViTMAEForPreTrainingOutput</code> or <code>tuple(tf.Tensor)</code></p>
`}}),It=new yo({props:{$$slots:{default:[Ys]},$$scope:{ctx:C}}}),zt=new mr({props:{anchor:"transformers.TFViTMAEForPreTraining.call.example",$$slots:{default:[Js]},$$scope:{ctx:C}}}),{c(){d=a("meta"),w=p(),u=a("h1"),f=a("a"),T=a("span"),b(l.$$.fragment),c=p(),F=a("span"),Fe=r("ViTMAE"),Te=p(),I=a("h2"),Y=a("a"),Z=a("span"),b(E.$$.fragment),Ve=p(),W=a("span"),Pe=r("Overview"),we=p(),L=a("p"),je=r("The ViTMAE model was proposed in "),ee=a("a"),te=r("Masked Autoencoders Are Scalable Vision Learners"),Ce=r(` 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.`),Ee=p(),K=a("p"),qe=r("The abstract from the paper is the following:"),ye=p(),H=a("p"),fe=a("em"),Ie=r(`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.`),de=p(),j=a("p"),z=r("Tips:"),be=p(),V=a("ul"),oe=a("li"),ze=r(`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 `),U=a("a"),Oe=r("ViTMAEForPreTraining"),De=r(" for this purpose."),O=p(),R=a("li"),re=r("An example Python script that illustrates how to pre-train "),ce=a("a"),Ne=r("ViTMAEForPreTraining"),ne=r(" from scratch can be found "),ae=a("a"),Le=r("here"),B=r(`.
One can easily tweak it for their own use case.`),Se=p(),D=a("li"),Ke=r("A notebook that illustrates how to visualize reconstructed pixel values with "),J=a("a"),N=r("ViTMAEForPreTraining"),He=r(" can be found "),q=a("a"),Ue=r("here"),We=r("."),v=p(),y=a("li"),Qe=r(`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 `),Q=a("a"),Ze=r("ViTForImageClassification"),et=r("."),P=p(),ge=a("li"),tt=r("One can use "),$e=a("a"),ot=r("ViTFeatureExtractor"),rt=r(" to prepare images for the model. See the code examples for more info."),G=p(),X=a("li"),nt=r(`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=p(),S=a("li"),st=r("For a visual understanding of how MAEs work you can check out this "),_e=a("a"),Re=r("post"),it=r("."),he=p(),pe=a("img"),gr=p(),Kt=a("small"),Ur=r("MAE architecture. Taken from the "),$o=a("a"),Wr=r("original paper."),_r=p(),me=a("p"),Rr=r("This model was contributed by "),Ht=a("a"),Br=r("nielsr"),Gr=r(". TensorFlow version of the model was contributed by "),Ut=a("a"),Xr=r("sayakpaul"),Yr=r(` and
`),Wt=a("a"),Jr=r("ariG23498"),Qr=r(" (equal contribution). The original code can be found "),Rt=a("a"),Zr=r("here"),en=r("."),vr=p(),lt=a("h2"),wt=a("a"),Ho=a("span"),b(Bt.$$.fragment),tn=p(),Uo=a("span"),on=r("ViTMAEConfig"),Tr=p(),ve=a("div"),b(Gt.$$.fragment),rn=p(),dt=a("p"),nn=r("This is the configuration class to store the configuration of a "),Mo=a("a"),an=r("ViTMAEModel"),sn=r(`. 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
`),Xt=a("a"),ln=r("facebook/vit-mae-base"),dn=r(" architecture."),cn=p(),ct=a("p"),hn=r("Configuration objects inherit from "),Ao=a("a"),pn=r("PretrainedConfig"),mn=r(` and can be used to control the model outputs. Read the
documentation from `),ko=a("a"),un=r("PretrainedConfig"),fn=r(" for more information."),gn=p(),b(Et.$$.fragment),wr=p(),ht=a("h2"),yt=a("a"),Wo=a("span"),b(Yt.$$.fragment),_n=p(),Ro=a("span"),vn=r("ViTMAEModel"),Er=p(),Be=a("div"),b(Jt.$$.fragment),Tn=p(),Qt=a("p"),wn=r(`The bare ViTMAE Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),Zt=a("a"),En=r("torch.nn.Module"),yn=r(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),bn=p(),Me=a("div"),b(eo.$$.fragment),$n=p(),pt=a("p"),Mn=r("The "),xo=a("a"),An=r("ViTMAEModel"),kn=r(" forward method, overrides the "),Bo=a("code"),xn=r("__call__"),Fn=r(" special method."),Vn=p(),b(bt.$$.fragment),Pn=p(),b($t.$$.fragment),yr=p(),mt=a("h2"),Mt=a("a"),Go=a("span"),b(to.$$.fragment),jn=p(),Xo=a("span"),Cn=r("ViTMAEForPreTraining"),br=p(),se=a("div"),b(oo.$$.fragment),qn=p(),Yo=a("p"),In=r("The ViTMAE Model transformer with the decoder on top for self-supervised pre-training."),zn=p(),b(At.$$.fragment),On=p(),ro=a("p"),Dn=r("This model is a PyTorch "),no=a("a"),Nn=r("torch.nn.Module"),Ln=r(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Sn=p(),Ae=a("div"),b(ao.$$.fragment),Kn=p(),ut=a("p"),Hn=r("The "),Fo=a("a"),Un=r("ViTMAEForPreTraining"),Wn=r(" forward method, overrides the "),Jo=a("code"),Rn=r("__call__"),Bn=r(" special method."),Gn=p(),b(kt.$$.fragment),Xn=p(),b(xt.$$.fragment),$r=p(),ft=a("h2"),Ft=a("a"),Qo=a("span"),b(so.$$.fragment),Yn=p(),Zo=a("span"),Jn=r("TFViTMAEModel"),Mr=p(),ie=a("div"),b(io.$$.fragment),Qn=p(),lo=a("p"),Zn=r(`The bare ViTMAE Model transformer outputting raw hidden-states without any specific head on top.
This model inherits from `),Vo=a("a"),ea=r("TFPreTrainedModel"),ta=r(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),oa=p(),co=a("p"),ra=r("This model is also a "),ho=a("a"),na=r("tf.keras.Model"),aa=r(` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),sa=p(),b(Vt.$$.fragment),ia=p(),ke=a("div"),b(po.$$.fragment),la=p(),gt=a("p"),da=r("The "),Po=a("a"),ca=r("TFViTMAEModel"),ha=r(" forward method, overrides the "),er=a("code"),pa=r("__call__"),ma=r(" special method."),ua=p(),b(Pt.$$.fragment),fa=p(),b(jt.$$.fragment),Ar=p(),_t=a("h2"),Ct=a("a"),tr=a("span"),b(mo.$$.fragment),ga=p(),or=a("span"),_a=r("TFViTMAEForPreTraining"),kr=p(),le=a("div"),b(uo.$$.fragment),va=p(),fo=a("p"),Ta=r(`The ViTMAE Model transformer with the decoder on top for self-supervised pre-training.
This model inherits from `),jo=a("a"),wa=r("TFPreTrainedModel"),Ea=r(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),ya=p(),go=a("p"),ba=r("This model is also a "),_o=a("a"),$a=r("tf.keras.Model"),Ma=r(` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),Aa=p(),b(qt.$$.fragment),ka=p(),xe=a("div"),b(vo.$$.fragment),xa=p(),vt=a("p"),Fa=r("The "),Co=a("a"),Va=r("TFViTMAEForPreTraining"),Pa=r(" forward method, overrides the "),rr=a("code"),ja=r("__call__"),Ca=r(" special method."),qa=p(),b(It.$$.fragment),Ia=p(),b(zt.$$.fragment),this.h()},l(o){const _=Os('[data-svelte="svelte-1phssyn"]',document.head);d=s(_,"META",{name:!0,content:!0}),_.forEach(t),w=m(o),u=s(o,"H1",{class:!0});var To=i(u);f=s(To,"A",{id:!0,class:!0,href:!0});var nr=i(f);T=s(nr,"SPAN",{});var ar=i(T);$(l.$$.fragment,ar),ar.forEach(t),nr.forEach(t),c=m(To),F=s(To,"SPAN",{});var sr=i(F);Fe=n(sr,"ViTMAE"),sr.forEach(t),To.forEach(t),Te=m(o),I=s(o,"H2",{class:!0});var wo=i(I);Y=s(wo,"A",{id:!0,class:!0,href:!0});var ir=i(Y);Z=s(ir,"SPAN",{});var lr=i(Z);$(E.$$.fragment,lr),lr.forEach(t),ir.forEach(t),Ve=m(wo),W=s(wo,"SPAN",{});var dr=i(W);Pe=n(dr,"Overview"),dr.forEach(t),wo.forEach(t),we=m(o),L=s(o,"P",{});var Eo=i(L);je=n(Eo,"The ViTMAE model was proposed in "),ee=s(Eo,"A",{href:!0,rel:!0});var cr=i(ee);te=n(cr,"Masked Autoencoders Are Scalable Vision Learners"),cr.forEach(t),Ce=n(Eo,` 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.`),Eo.forEach(t),Ee=m(o),K=s(o,"P",{});var hr=i(K);qe=n(hr,"The abstract from the paper is the following:"),hr.forEach(t),ye=m(o),H=s(o,"P",{});var pr=i(H);fe=s(pr,"EM",{});var Da=i(fe);Ie=n(Da,`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.`),Da.forEach(t),pr.forEach(t),de=m(o),j=s(o,"P",{});var Na=i(j);z=n(Na,"Tips:"),Na.forEach(t),be=m(o),V=s(o,"UL",{});var ue=i(V);oe=s(ue,"LI",{});var Fr=i(oe);ze=n(Fr,`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 `),U=s(Fr,"A",{href:!0});var La=i(U);Oe=n(La,"ViTMAEForPreTraining"),La.forEach(t),De=n(Fr," for this purpose."),Fr.forEach(t),O=m(ue),R=s(ue,"LI",{});var qo=i(R);re=n(qo,"An example Python script that illustrates how to pre-train "),ce=s(qo,"A",{href:!0});var Sa=i(ce);Ne=n(Sa,"ViTMAEForPreTraining"),Sa.forEach(t),ne=n(qo," from scratch can be found "),ae=s(qo,"A",{href:!0,rel:!0});var Ka=i(ae);Le=n(Ka,"here"),Ka.forEach(t),B=n(qo,`.
One can easily tweak it for their own use case.`),qo.forEach(t),Se=m(ue),D=s(ue,"LI",{});var Io=i(D);Ke=n(Io,"A notebook that illustrates how to visualize reconstructed pixel values with "),J=s(Io,"A",{href:!0});var Ha=i(J);N=n(Ha,"ViTMAEForPreTraining"),Ha.forEach(t),He=n(Io," can be found "),q=s(Io,"A",{href:!0,rel:!0});var Ua=i(q);Ue=n(Ua,"here"),Ua.forEach(t),We=n(Io,"."),Io.forEach(t),v=m(ue),y=s(ue,"LI",{});var Vr=i(y);Qe=n(Vr,`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 `),Q=s(Vr,"A",{href:!0});var Wa=i(Q);Ze=n(Wa,"ViTForImageClassification"),Wa.forEach(t),et=n(Vr,"."),Vr.forEach(t),P=m(ue),ge=s(ue,"LI",{});var Pr=i(ge);tt=n(Pr,"One can use "),$e=s(Pr,"A",{href:!0});var Ra=i($e);ot=n(Ra,"ViTFeatureExtractor"),Ra.forEach(t),rt=n(Pr," to prepare images for the model. See the code examples for more info."),Pr.forEach(t),G=m(ue),X=s(ue,"LI",{});var Ba=i(X);nt=n(Ba,`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.`),Ba.forEach(t),at=m(ue),S=s(ue,"LI",{});var jr=i(S);st=n(jr,"For a visual understanding of how MAEs work you can check out this "),_e=s(jr,"A",{href:!0,rel:!0});var Ga=i(_e);Re=n(Ga,"post"),Ga.forEach(t),it=n(jr,"."),jr.forEach(t),ue.forEach(t),he=m(o),pe=s(o,"IMG",{src:!0,alt:!0,width:!0}),gr=m(o),Kt=s(o,"SMALL",{});var za=i(Kt);Ur=n(za,"MAE architecture. Taken from the "),$o=s(za,"A",{href:!0});var Xa=i($o);Wr=n(Xa,"original paper."),Xa.forEach(t),za.forEach(t),_r=m(o),me=s(o,"P",{});var Ge=i(me);Rr=n(Ge,"This model was contributed by "),Ht=s(Ge,"A",{href:!0,rel:!0});var Ya=i(Ht);Br=n(Ya,"nielsr"),Ya.forEach(t),Gr=n(Ge,". TensorFlow version of the model was contributed by "),Ut=s(Ge,"A",{href:!0,rel:!0});var Ja=i(Ut);Xr=n(Ja,"sayakpaul"),Ja.forEach(t),Yr=n(Ge,` and
`),Wt=s(Ge,"A",{href:!0,rel:!0});var Qa=i(Wt);Jr=n(Qa,"ariG23498"),Qa.forEach(t),Qr=n(Ge," (equal contribution). The original code can be found "),Rt=s(Ge,"A",{href:!0,rel:!0});var Za=i(Rt);Zr=n(Za,"here"),Za.forEach(t),en=n(Ge,"."),Ge.forEach(t),vr=m(o),lt=s(o,"H2",{class:!0});var Cr=i(lt);wt=s(Cr,"A",{id:!0,class:!0,href:!0});var es=i(wt);Ho=s(es,"SPAN",{});var ts=i(Ho);$(Bt.$$.fragment,ts),ts.forEach(t),es.forEach(t),tn=m(Cr),Uo=s(Cr,"SPAN",{});var os=i(Uo);on=n(os,"ViTMAEConfig"),os.forEach(t),Cr.forEach(t),Tr=m(o),ve=s(o,"DIV",{class:!0});var Ot=i(ve);$(Gt.$$.fragment,Ot),rn=m(Ot),dt=s(Ot,"P",{});var zo=i(dt);nn=n(zo,"This is the configuration class to store the configuration of a "),Mo=s(zo,"A",{href:!0});var rs=i(Mo);an=n(rs,"ViTMAEModel"),rs.forEach(t),sn=n(zo,`. 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
`),Xt=s(zo,"A",{href:!0,rel:!0});var ns=i(Xt);ln=n(ns,"facebook/vit-mae-base"),ns.forEach(t),dn=n(zo," architecture."),zo.forEach(t),cn=m(Ot),ct=s(Ot,"P",{});var Oo=i(ct);hn=n(Oo,"Configuration objects inherit from "),Ao=s(Oo,"A",{href:!0});var as=i(Ao);pn=n(as,"PretrainedConfig"),as.forEach(t),mn=n(Oo,` and can be used to control the model outputs. Read the
documentation from `),ko=s(Oo,"A",{href:!0});var ss=i(ko);un=n(ss,"PretrainedConfig"),ss.forEach(t),fn=n(Oo," for more information."),Oo.forEach(t),gn=m(Ot),$(Et.$$.fragment,Ot),Ot.forEach(t),wr=m(o),ht=s(o,"H2",{class:!0});var qr=i(ht);yt=s(qr,"A",{id:!0,class:!0,href:!0});var is=i(yt);Wo=s(is,"SPAN",{});var ls=i(Wo);$(Yt.$$.fragment,ls),ls.forEach(t),is.forEach(t),_n=m(qr),Ro=s(qr,"SPAN",{});var ds=i(Ro);vn=n(ds,"ViTMAEModel"),ds.forEach(t),qr.forEach(t),Er=m(o),Be=s(o,"DIV",{class:!0});var Do=i(Be);$(Jt.$$.fragment,Do),Tn=m(Do),Qt=s(Do,"P",{});var Ir=i(Qt);wn=n(Ir,`The bare ViTMAE Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),Zt=s(Ir,"A",{href:!0,rel:!0});var cs=i(Zt);En=n(cs,"torch.nn.Module"),cs.forEach(t),yn=n(Ir,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Ir.forEach(t),bn=m(Do),Me=s(Do,"DIV",{class:!0});var Dt=i(Me);$(eo.$$.fragment,Dt),$n=m(Dt),pt=s(Dt,"P",{});var No=i(pt);Mn=n(No,"The "),xo=s(No,"A",{href:!0});var hs=i(xo);An=n(hs,"ViTMAEModel"),hs.forEach(t),kn=n(No," forward method, overrides the "),Bo=s(No,"CODE",{});var ps=i(Bo);xn=n(ps,"__call__"),ps.forEach(t),Fn=n(No," special method."),No.forEach(t),Vn=m(Dt),$(bt.$$.fragment,Dt),Pn=m(Dt),$($t.$$.fragment,Dt),Dt.forEach(t),Do.forEach(t),yr=m(o),mt=s(o,"H2",{class:!0});var zr=i(mt);Mt=s(zr,"A",{id:!0,class:!0,href:!0});var ms=i(Mt);Go=s(ms,"SPAN",{});var us=i(Go);$(to.$$.fragment,us),us.forEach(t),ms.forEach(t),jn=m(zr),Xo=s(zr,"SPAN",{});var fs=i(Xo);Cn=n(fs,"ViTMAEForPreTraining"),fs.forEach(t),zr.forEach(t),br=m(o),se=s(o,"DIV",{class:!0});var Xe=i(se);$(oo.$$.fragment,Xe),qn=m(Xe),Yo=s(Xe,"P",{});var gs=i(Yo);In=n(gs,"The ViTMAE Model transformer with the decoder on top for self-supervised pre-training."),gs.forEach(t),zn=m(Xe),$(At.$$.fragment,Xe),On=m(Xe),ro=s(Xe,"P",{});var Or=i(ro);Dn=n(Or,"This model is a PyTorch "),no=s(Or,"A",{href:!0,rel:!0});var _s=i(no);Nn=n(_s,"torch.nn.Module"),_s.forEach(t),Ln=n(Or,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Or.forEach(t),Sn=m(Xe),Ae=s(Xe,"DIV",{class:!0});var Nt=i(Ae);$(ao.$$.fragment,Nt),Kn=m(Nt),ut=s(Nt,"P",{});var Lo=i(ut);Hn=n(Lo,"The "),Fo=s(Lo,"A",{href:!0});var vs=i(Fo);Un=n(vs,"ViTMAEForPreTraining"),vs.forEach(t),Wn=n(Lo," forward method, overrides the "),Jo=s(Lo,"CODE",{});var Ts=i(Jo);Rn=n(Ts,"__call__"),Ts.forEach(t),Bn=n(Lo," special method."),Lo.forEach(t),Gn=m(Nt),$(kt.$$.fragment,Nt),Xn=m(Nt),$(xt.$$.fragment,Nt),Nt.forEach(t),Xe.forEach(t),$r=m(o),ft=s(o,"H2",{class:!0});var Dr=i(ft);Ft=s(Dr,"A",{id:!0,class:!0,href:!0});var ws=i(Ft);Qo=s(ws,"SPAN",{});var Es=i(Qo);$(so.$$.fragment,Es),Es.forEach(t),ws.forEach(t),Yn=m(Dr),Zo=s(Dr,"SPAN",{});var ys=i(Zo);Jn=n(ys,"TFViTMAEModel"),ys.forEach(t),Dr.forEach(t),Mr=m(o),ie=s(o,"DIV",{class:!0});var Ye=i(ie);$(io.$$.fragment,Ye),Qn=m(Ye),lo=s(Ye,"P",{});var Nr=i(lo);Zn=n(Nr,`The bare ViTMAE Model transformer outputting raw hidden-states without any specific head on top.
This model inherits from `),Vo=s(Nr,"A",{href:!0});var bs=i(Vo);ea=n(bs,"TFPreTrainedModel"),bs.forEach(t),ta=n(Nr,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Nr.forEach(t),oa=m(Ye),co=s(Ye,"P",{});var Lr=i(co);ra=n(Lr,"This model is also a "),ho=s(Lr,"A",{href:!0,rel:!0});var $s=i(ho);na=n($s,"tf.keras.Model"),$s.forEach(t),aa=n(Lr,` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),Lr.forEach(t),sa=m(Ye),$(Vt.$$.fragment,Ye),ia=m(Ye),ke=s(Ye,"DIV",{class:!0});var Lt=i(ke);$(po.$$.fragment,Lt),la=m(Lt),gt=s(Lt,"P",{});var So=i(gt);da=n(So,"The "),Po=s(So,"A",{href:!0});var Ms=i(Po);ca=n(Ms,"TFViTMAEModel"),Ms.forEach(t),ha=n(So," forward method, overrides the "),er=s(So,"CODE",{});var As=i(er);pa=n(As,"__call__"),As.forEach(t),ma=n(So," special method."),So.forEach(t),ua=m(Lt),$(Pt.$$.fragment,Lt),fa=m(Lt),$(jt.$$.fragment,Lt),Lt.forEach(t),Ye.forEach(t),Ar=m(o),_t=s(o,"H2",{class:!0});var Sr=i(_t);Ct=s(Sr,"A",{id:!0,class:!0,href:!0});var ks=i(Ct);tr=s(ks,"SPAN",{});var xs=i(tr);$(mo.$$.fragment,xs),xs.forEach(t),ks.forEach(t),ga=m(Sr),or=s(Sr,"SPAN",{});var Fs=i(or);_a=n(Fs,"TFViTMAEForPreTraining"),Fs.forEach(t),Sr.forEach(t),kr=m(o),le=s(o,"DIV",{class:!0});var Je=i(le);$(uo.$$.fragment,Je),va=m(Je),fo=s(Je,"P",{});var Kr=i(fo);Ta=n(Kr,`The ViTMAE Model transformer with the decoder on top for self-supervised pre-training.
This model inherits from `),jo=s(Kr,"A",{href:!0});var Vs=i(jo);wa=n(Vs,"TFPreTrainedModel"),Vs.forEach(t),Ea=n(Kr,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Kr.forEach(t),ya=m(Je),go=s(Je,"P",{});var Hr=i(go);ba=n(Hr,"This model is also a "),_o=s(Hr,"A",{href:!0,rel:!0});var Ps=i(_o);$a=n(Ps,"tf.keras.Model"),Ps.forEach(t),Ma=n(Hr,` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),Hr.forEach(t),Aa=m(Je),$(qt.$$.fragment,Je),ka=m(Je),xe=s(Je,"DIV",{class:!0});var St=i(xe);$(vo.$$.fragment,St),xa=m(St),vt=s(St,"P",{});var Ko=i(vt);Fa=n(Ko,"The "),Co=s(Ko,"A",{href:!0});var js=i(Co);Va=n(js,"TFViTMAEForPreTraining"),js.forEach(t),Pa=n(Ko," forward method, overrides the "),rr=s(Ko,"CODE",{});var Cs=i(rr);ja=n(Cs,"__call__"),Cs.forEach(t),Ca=n(Ko," special method."),Ko.forEach(t),qa=m(St),$(It.$$.fragment,St),Ia=m(St),$(zt.$$.fragment,St),St.forEach(t),Je.forEach(t),this.h()},h(){h(d,"name","hf:doc:metadata"),h(d,"content",JSON.stringify(Zs)),h(f,"id","vitmae"),h(f,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(f,"href","#vitmae"),h(u,"class","relative group"),h(Y,"id","overview"),h(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"),h(Y,"href","#overview"),h(I,"class","relative group"),h(ee,"href","https://arxiv.org/abs/2111.06377v2"),h(ee,"rel","nofollow"),h(U,"href","/docs/transformers/pr_19907/en/model_doc/vit_mae#transformers.ViTMAEForPreTraining"),h(ce,"href","/docs/transformers/pr_19907/en/model_doc/vit_mae#transformers.ViTMAEForPreTraining"),h(ae,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/image-pretraining"),h(ae,"rel","nofollow"),h(J,"href","/docs/transformers/pr_19907/en/model_doc/vit_mae#transformers.ViTMAEForPreTraining"),h(q,"href","https://github.com/NielsRogge/Transformers-Tutorials/blob/master/ViTMAE/ViT_MAE_visualization_demo.ipynb"),h(q,"rel","nofollow"),h(Q,"href","/docs/transformers/pr_19907/en/model_doc/vit#transformers.ViTForImageClassification"),h($e,"href","/docs/transformers/pr_19907/en/model_doc/vit#transformers.ViTFeatureExtractor"),h(_e,"href","https://keras.io/examples/vision/masked_image_modeling/"),h(_e,"rel","nofollow"),Ds(pe.src,Oa="https://user-images.githubusercontent.com/11435359/146857310-f258c86c-fde6-48e8-9cee-badd2b21bd2c.png")||h(pe,"src",Oa),h(pe,"alt","drawing"),h(pe,"width","600"),h($o,"href","https://arxiv.org/abs/2111.06377"),h(Ht,"href","https://huggingface.co/nielsr"),h(Ht,"rel","nofollow"),h(Ut,"href","https://github.com/sayakpaul"),h(Ut,"rel","nofollow"),h(Wt,"href","https://github.com/ariG23498"),h(Wt,"rel","nofollow"),h(Rt,"href","https://github.com/facebookresearch/mae"),h(Rt,"rel","nofollow"),h(wt,"id","transformers.ViTMAEConfig"),h(wt,"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"),h(wt,"href","#transformers.ViTMAEConfig"),h(lt,"class","relative group"),h(Mo,"href","/docs/transformers/pr_19907/en/model_doc/vit_mae#transformers.ViTMAEModel"),h(Xt,"href","https://huggingface.co/facebook/vit-mae-base"),h(Xt,"rel","nofollow"),h(Ao,"href","/docs/transformers/pr_19907/en/main_classes/configuration#transformers.PretrainedConfig"),h(ko,"href","/docs/transformers/pr_19907/en/main_classes/configuration#transformers.PretrainedConfig"),h(ve,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(yt,"id","transformers.ViTMAEModel"),h(yt,"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"),h(yt,"href","#transformers.ViTMAEModel"),h(ht,"class","relative group"),h(Zt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(Zt,"rel","nofollow"),h(xo,"href","/docs/transformers/pr_19907/en/model_doc/vit_mae#transformers.ViTMAEModel"),h(Me,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Be,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Mt,"id","transformers.ViTMAEForPreTraining"),h(Mt,"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"),h(Mt,"href","#transformers.ViTMAEForPreTraining"),h(mt,"class","relative group"),h(no,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(no,"rel","nofollow"),h(Fo,"href","/docs/transformers/pr_19907/en/model_doc/vit_mae#transformers.ViTMAEForPreTraining"),h(Ae,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(se,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Ft,"id","transformers.TFViTMAEModel"),h(Ft,"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"),h(Ft,"href","#transformers.TFViTMAEModel"),h(ft,"class","relative group"),h(Vo,"href","/docs/transformers/pr_19907/en/main_classes/model#transformers.TFPreTrainedModel"),h(ho,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),h(ho,"rel","nofollow"),h(Po,"href","/docs/transformers/pr_19907/en/model_doc/vit_mae#transformers.TFViTMAEModel"),h(ke,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(ie,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Ct,"id","transformers.TFViTMAEForPreTraining"),h(Ct,"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"),h(Ct,"href","#transformers.TFViTMAEForPreTraining"),h(_t,"class","relative group"),h(jo,"href","/docs/transformers/pr_19907/en/main_classes/model#transformers.TFPreTrainedModel"),h(_o,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),h(_o,"rel","nofollow"),h(Co,"href","/docs/transformers/pr_19907/en/model_doc/vit_mae#transformers.TFViTMAEForPreTraining"),h(xe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(le,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(o,_){e(document.head,d),g(o,w,_),g(o,u,_),e(u,f),e(f,T),M(l,T,null),e(u,c),e(u,F),e(F,Fe),g(o,Te,_),g(o,I,_),e(I,Y),e(Y,Z),M(E,Z,null),e(I,Ve),e(I,W),e(W,Pe),g(o,we,_),g(o,L,_),e(L,je),e(L,ee),e(ee,te),e(L,Ce),g(o,Ee,_),g(o,K,_),e(K,qe),g(o,ye,_),g(o,H,_),e(H,fe),e(fe,Ie),g(o,de,_),g(o,j,_),e(j,z),g(o,be,_),g(o,V,_),e(V,oe),e(oe,ze),e(oe,U),e(U,Oe),e(oe,De),e(V,O),e(V,R),e(R,re),e(R,ce),e(ce,Ne),e(R,ne),e(R,ae),e(ae,Le),e(R,B),e(V,Se),e(V,D),e(D,Ke),e(D,J),e(J,N),e(D,He),e(D,q),e(q,Ue),e(D,We),e(V,v),e(V,y),e(y,Qe),e(y,Q),e(Q,Ze),e(y,et),e(V,P),e(V,ge),e(ge,tt),e(ge,$e),e($e,ot),e(ge,rt),e(V,G),e(V,X),e(X,nt),e(V,at),e(V,S),e(S,st),e(S,_e),e(_e,Re),e(S,it),g(o,he,_),g(o,pe,_),g(o,gr,_),g(o,Kt,_),e(Kt,Ur),e(Kt,$o),e($o,Wr),g(o,_r,_),g(o,me,_),e(me,Rr),e(me,Ht),e(Ht,Br),e(me,Gr),e(me,Ut),e(Ut,Xr),e(me,Yr),e(me,Wt),e(Wt,Jr),e(me,Qr),e(me,Rt),e(Rt,Zr),e(me,en),g(o,vr,_),g(o,lt,_),e(lt,wt),e(wt,Ho),M(Bt,Ho,null),e(lt,tn),e(lt,Uo),e(Uo,on),g(o,Tr,_),g(o,ve,_),M(Gt,ve,null),e(ve,rn),e(ve,dt),e(dt,nn),e(dt,Mo),e(Mo,an),e(dt,sn),e(dt,Xt),e(Xt,ln),e(dt,dn),e(ve,cn),e(ve,ct),e(ct,hn),e(ct,Ao),e(Ao,pn),e(ct,mn),e(ct,ko),e(ko,un),e(ct,fn),e(ve,gn),M(Et,ve,null),g(o,wr,_),g(o,ht,_),e(ht,yt),e(yt,Wo),M(Yt,Wo,null),e(ht,_n),e(ht,Ro),e(Ro,vn),g(o,Er,_),g(o,Be,_),M(Jt,Be,null),e(Be,Tn),e(Be,Qt),e(Qt,wn),e(Qt,Zt),e(Zt,En),e(Qt,yn),e(Be,bn),e(Be,Me),M(eo,Me,null),e(Me,$n),e(Me,pt),e(pt,Mn),e(pt,xo),e(xo,An),e(pt,kn),e(pt,Bo),e(Bo,xn),e(pt,Fn),e(Me,Vn),M(bt,Me,null),e(Me,Pn),M($t,Me,null),g(o,yr,_),g(o,mt,_),e(mt,Mt),e(Mt,Go),M(to,Go,null),e(mt,jn),e(mt,Xo),e(Xo,Cn),g(o,br,_),g(o,se,_),M(oo,se,null),e(se,qn),e(se,Yo),e(Yo,In),e(se,zn),M(At,se,null),e(se,On),e(se,ro),e(ro,Dn),e(ro,no),e(no,Nn),e(ro,Ln),e(se,Sn),e(se,Ae),M(ao,Ae,null),e(Ae,Kn),e(Ae,ut),e(ut,Hn),e(ut,Fo),e(Fo,Un),e(ut,Wn),e(ut,Jo),e(Jo,Rn),e(ut,Bn),e(Ae,Gn),M(kt,Ae,null),e(Ae,Xn),M(xt,Ae,null),g(o,$r,_),g(o,ft,_),e(ft,Ft),e(Ft,Qo),M(so,Qo,null),e(ft,Yn),e(ft,Zo),e(Zo,Jn),g(o,Mr,_),g(o,ie,_),M(io,ie,null),e(ie,Qn),e(ie,lo),e(lo,Zn),e(lo,Vo),e(Vo,ea),e(lo,ta),e(ie,oa),e(ie,co),e(co,ra),e(co,ho),e(ho,na),e(co,aa),e(ie,sa),M(Vt,ie,null),e(ie,ia),e(ie,ke),M(po,ke,null),e(ke,la),e(ke,gt),e(gt,da),e(gt,Po),e(Po,ca),e(gt,ha),e(gt,er),e(er,pa),e(gt,ma),e(ke,ua),M(Pt,ke,null),e(ke,fa),M(jt,ke,null),g(o,Ar,_),g(o,_t,_),e(_t,Ct),e(Ct,tr),M(mo,tr,null),e(_t,ga),e(_t,or),e(or,_a),g(o,kr,_),g(o,le,_),M(uo,le,null),e(le,va),e(le,fo),e(fo,Ta),e(fo,jo),e(jo,wa),e(fo,Ea),e(le,ya),e(le,go),e(go,ba),e(go,_o),e(_o,$a),e(go,Ma),e(le,Aa),M(qt,le,null),e(le,ka),e(le,xe),M(vo,xe,null),e(xe,xa),e(xe,vt),e(vt,Fa),e(vt,Co),e(Co,Va),e(vt,Pa),e(vt,rr),e(rr,ja),e(vt,Ca),e(xe,qa),M(It,xe,null),e(xe,Ia),M(zt,xe,null),xr=!0},p(o,[_]){const To={};_&2&&(To.$$scope={dirty:_,ctx:o}),Et.$set(To);const nr={};_&2&&(nr.$$scope={dirty:_,ctx:o}),bt.$set(nr);const ar={};_&2&&(ar.$$scope={dirty:_,ctx:o}),$t.$set(ar);const sr={};_&2&&(sr.$$scope={dirty:_,ctx:o}),At.$set(sr);const wo={};_&2&&(wo.$$scope={dirty:_,ctx:o}),kt.$set(wo);const ir={};_&2&&(ir.$$scope={dirty:_,ctx:o}),xt.$set(ir);const lr={};_&2&&(lr.$$scope={dirty:_,ctx:o}),Vt.$set(lr);const dr={};_&2&&(dr.$$scope={dirty:_,ctx:o}),Pt.$set(dr);const Eo={};_&2&&(Eo.$$scope={dirty:_,ctx:o}),jt.$set(Eo);const cr={};_&2&&(cr.$$scope={dirty:_,ctx:o}),qt.$set(cr);const hr={};_&2&&(hr.$$scope={dirty:_,ctx:o}),It.$set(hr);const pr={};_&2&&(pr.$$scope={dirty:_,ctx:o}),zt.$set(pr)},i(o){xr||(A(l.$$.fragment,o),A(E.$$.fragment,o),A(Bt.$$.fragment,o),A(Gt.$$.fragment,o),A(Et.$$.fragment,o),A(Yt.$$.fragment,o),A(Jt.$$.fragment,o),A(eo.$$.fragment,o),A(bt.$$.fragment,o),A($t.$$.fragment,o),A(to.$$.fragment,o),A(oo.$$.fragment,o),A(At.$$.fragment,o),A(ao.$$.fragment,o),A(kt.$$.fragment,o),A(xt.$$.fragment,o),A(so.$$.fragment,o),A(io.$$.fragment,o),A(Vt.$$.fragment,o),A(po.$$.fragment,o),A(Pt.$$.fragment,o),A(jt.$$.fragment,o),A(mo.$$.fragment,o),A(uo.$$.fragment,o),A(qt.$$.fragment,o),A(vo.$$.fragment,o),A(It.$$.fragment,o),A(zt.$$.fragment,o),xr=!0)},o(o){k(l.$$.fragment,o),k(E.$$.fragment,o),k(Bt.$$.fragment,o),k(Gt.$$.fragment,o),k(Et.$$.fragment,o),k(Yt.$$.fragment,o),k(Jt.$$.fragment,o),k(eo.$$.fragment,o),k(bt.$$.fragment,o),k($t.$$.fragment,o),k(to.$$.fragment,o),k(oo.$$.fragment,o),k(At.$$.fragment,o),k(ao.$$.fragment,o),k(kt.$$.fragment,o),k(xt.$$.fragment,o),k(so.$$.fragment,o),k(io.$$.fragment,o),k(Vt.$$.fragment,o),k(po.$$.fragment,o),k(Pt.$$.fragment,o),k(jt.$$.fragment,o),k(mo.$$.fragment,o),k(uo.$$.fragment,o),k(qt.$$.fragment,o),k(vo.$$.fragment,o),k(It.$$.fragment,o),k(zt.$$.fragment,o),xr=!1},d(o){t(d),o&&t(w),o&&t(u),x(l),o&&t(Te),o&&t(I),x(E),o&&t(we),o&&t(L),o&&t(Ee),o&&t(K),o&&t(ye),o&&t(H),o&&t(de),o&&t(j),o&&t(be),o&&t(V),o&&t(he),o&&t(pe),o&&t(gr),o&&t(Kt),o&&t(_r),o&&t(me),o&&t(vr),o&&t(lt),x(Bt),o&&t(Tr),o&&t(ve),x(Gt),x(Et),o&&t(wr),o&&t(ht),x(Yt),o&&t(Er),o&&t(Be),x(Jt),x(eo),x(bt),x($t),o&&t(yr),o&&t(mt),x(to),o&&t(br),o&&t(se),x(oo),x(At),x(ao),x(kt),x(xt),o&&t($r),o&&t(ft),x(so),o&&t(Mr),o&&t(ie),x(io),x(Vt),x(po),x(Pt),x(jt),o&&t(Ar),o&&t(_t),x(mo),o&&t(kr),o&&t(le),x(uo),x(qt),x(vo),x(It),x(zt)}}}const Zs={local:"vitmae",sections:[{local:"overview",title:"Overview"},{local:"transformers.ViTMAEConfig",title:"ViTMAEConfig"},{local:"transformers.ViTMAEModel",title:"ViTMAEModel"},{local:"transformers.ViTMAEForPreTraining",title:"ViTMAEForPreTraining"},{local:"transformers.TFViTMAEModel",title:"TFViTMAEModel"},{local:"transformers.TFViTMAEForPreTraining",title:"TFViTMAEForPreTraining"}],title:"ViTMAE"};function ei(C){return Ns(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ii extends qs{constructor(d){super();Is(this,d,ei,Qs,zs,{})}}export{ii as default,Zs as metadata};
