import{S as ti,i as oi,s as ri,e as n,k as m,w as b,t as r,M as si,c as a,d as t,m as p,a as i,x as y,h as s,b as c,N as ni,G as e,g as f,y as $,q as M,o as A,B as k,v as ai,L as br}from"../../chunks/vendor-hf-doc-builder.js";import{T as Ao}from"../../chunks/Tip-hf-doc-builder.js";import{D as Tt}from"../../chunks/Docstring-hf-doc-builder.js";import{C as yr}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as Wt}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Er}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function ii(I){let d,w,u,g,T;return g=new yr({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=n("p"),w=r("Example:"),u=m(),b(g.$$.fragment)},l(l){d=a(l,"P",{});var h=i(d);w=s(h,"Example:"),h.forEach(t),u=p(l),y(g.$$.fragment,l)},m(l,h){f(l,d,h),e(d,w),f(l,u,h),$(g,l,h),T=!0},p:br,i(l){T||(M(g.$$.fragment,l),T=!0)},o(l){A(g.$$.fragment,l),T=!1},d(l){l&&t(d),l&&t(u),k(g,l)}}}function li(I){let d,w,u,g,T;return{c(){d=n("p"),w=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=n("code"),g=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=a(l,"P",{});var h=i(d);w=s(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=a(h,"CODE",{});var P=i(u);g=s(P,"Module"),P.forEach(t),T=s(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(l,h){f(l,d,h),e(d,w),e(d,u),e(u,g),e(d,T)},d(l){l&&t(d)}}}function di(I){let d,w,u,g,T;return g=new yr({props:{code:`from transformers import AutoImageProcessor, ViTMAEModel
from PIL import Image
import requests

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

image_processor = AutoImageProcessor.from_pretrained("facebook/vit-mae-base")
model = ViTMAEModel.from_pretrained("facebook/vit-mae-base")

inputs = image_processor(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> AutoImageProcessor, 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>image_processor = AutoImageProcessor.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 = image_processor(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=n("p"),w=r("Examples:"),u=m(),b(g.$$.fragment)},l(l){d=a(l,"P",{});var h=i(d);w=s(h,"Examples:"),h.forEach(t),u=p(l),y(g.$$.fragment,l)},m(l,h){f(l,d,h),e(d,w),f(l,u,h),$(g,l,h),T=!0},p:br,i(l){T||(M(g.$$.fragment,l),T=!0)},o(l){A(g.$$.fragment,l),T=!1},d(l){l&&t(d),l&&t(u),k(g,l)}}}function ci(I){let d,w,u,g,T;return{c(){d=n("p"),w=r("Note that we provide a script to pre-train this model on custom data in our "),u=n("a"),g=r(`examples
directory`),T=r("."),this.h()},l(l){d=a(l,"P",{});var h=i(d);w=s(h,"Note that we provide a script to pre-train this model on custom data in our "),u=a(h,"A",{href:!0,rel:!0});var P=i(u);g=s(P,`examples
directory`),P.forEach(t),T=s(h,"."),h.forEach(t),this.h()},h(){c(u,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/image-pretraining"),c(u,"rel","nofollow")},m(l,h){f(l,d,h),e(d,w),e(d,u),e(u,g),e(d,T)},d(l){l&&t(d)}}}function hi(I){let d,w,u,g,T;return{c(){d=n("p"),w=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=n("code"),g=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=a(l,"P",{});var h=i(d);w=s(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=a(h,"CODE",{});var P=i(u);g=s(P,"Module"),P.forEach(t),T=s(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(l,h){f(l,d,h),e(d,w),e(d,u),e(u,g),e(d,T)},d(l){l&&t(d)}}}function mi(I){let d,w,u,g,T;return g=new yr({props:{code:`from transformers import AutoImageProcessor, ViTMAEForPreTraining
from PIL import Image
import requests

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

image_processor = AutoImageProcessor.from_pretrained("facebook/vit-mae-base")
model = ViTMAEForPreTraining.from_pretrained("facebook/vit-mae-base")

inputs = image_processor(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> AutoImageProcessor, 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>image_processor = AutoImageProcessor.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 = image_processor(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=n("p"),w=r("Examples:"),u=m(),b(g.$$.fragment)},l(l){d=a(l,"P",{});var h=i(d);w=s(h,"Examples:"),h.forEach(t),u=p(l),y(g.$$.fragment,l)},m(l,h){f(l,d,h),e(d,w),f(l,u,h),$(g,l,h),T=!0},p:br,i(l){T||(M(g.$$.fragment,l),T=!0)},o(l){A(g.$$.fragment,l),T=!1},d(l){l&&t(d),l&&t(u),k(g,l)}}}function pi(I){let d,w,u,g,T,l,h,P,xe,Ee,z,W,B,E,je,U,Ie,be,N,Ce,G,X,qe,ye,S,ze,$e,K,pe,Oe,le,x,O,Me,C,Y,De,H,Ne,Le,D,J,Q,de,Se,Z,Ke,ee,R,ce,te,He,fe,q,Ue,L,oe,Re;return{c(){d=n("p"),w=r("TensorFlow models and layers in "),u=n("code"),g=r("transformers"),T=r(" accept two formats as input:"),l=m(),h=n("ul"),P=n("li"),xe=r("having all inputs as keyword arguments (like PyTorch models), or"),Ee=m(),z=n("li"),W=r("having all inputs as a list, tuple or dict in the first positional argument."),B=m(),E=n("p"),je=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 `),U=n("code"),Ie=r("model.fit()"),be=r(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),N=n("code"),Ce=r("model.fit()"),G=r(` supports! If, however, you want to use the second
format outside of Keras methods like `),X=n("code"),qe=r("fit()"),ye=r(" and "),S=n("code"),ze=r("predict()"),$e=r(`, such as when creating your own layers or models with
the Keras `),K=n("code"),pe=r("Functional"),Oe=r(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),le=m(),x=n("ul"),O=n("li"),Me=r("a single Tensor with "),C=n("code"),Y=r("pixel_values"),De=r(" only and nothing else: "),H=n("code"),Ne=r("model(pixel_values)"),Le=m(),D=n("li"),J=r(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),Q=n("code"),de=r("model([pixel_values, attention_mask])"),Se=r(" or "),Z=n("code"),Ke=r("model([pixel_values, attention_mask, token_type_ids])"),ee=m(),R=n("li"),ce=r(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),te=n("code"),He=r('model({"pixel_values": pixel_values, "token_type_ids": token_type_ids})'),fe=m(),q=n("p"),Ue=r(`Note that when creating models and layers with
`),L=n("a"),oe=r("subclassing"),Re=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=a(v,"P",{});var V=i(d);w=s(V,"TensorFlow models and layers in "),u=a(V,"CODE",{});var et=i(u);g=s(et,"transformers"),et.forEach(t),T=s(V," accept two formats as input:"),V.forEach(t),l=p(v),h=a(v,"UL",{});var he=i(h);P=a(he,"LI",{});var me=i(P);xe=s(me,"having all inputs as keyword arguments (like PyTorch models), or"),me.forEach(t),Ee=p(he),z=a(he,"LI",{});var wt=i(z);W=s(wt,"having all inputs as a list, tuple or dict in the first positional argument."),wt.forEach(t),he.forEach(t),B=p(v),E=a(v,"P",{});var F=i(E);je=s(F,`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 `),U=a(F,"CODE",{});var ue=i(U);Ie=s(ue,"model.fit()"),ue.forEach(t),be=s(F,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),N=a(F,"CODE",{});var tt=i(N);Ce=s(tt,"model.fit()"),tt.forEach(t),G=s(F,` supports! If, however, you want to use the second
format outside of Keras methods like `),X=a(F,"CODE",{});var Ae=i(X);qe=s(Ae,"fit()"),Ae.forEach(t),ye=s(F," and "),S=a(F,"CODE",{});var ot=i(S);ze=s(ot,"predict()"),ot.forEach(t),$e=s(F,`, such as when creating your own layers or models with
the Keras `),K=a(F,"CODE",{});var Ge=i(K);pe=s(Ge,"Functional"),Ge.forEach(t),Oe=s(F,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),F.forEach(t),le=p(v),x=a(v,"UL",{});var j=i(x);O=a(j,"LI",{});var re=i(O);Me=s(re,"a single Tensor with "),C=a(re,"CODE",{});var ge=i(C);Y=s(ge,"pixel_values"),ge.forEach(t),De=s(re," only and nothing else: "),H=a(re,"CODE",{});var rt=i(H);Ne=s(rt,"model(pixel_values)"),rt.forEach(t),re.forEach(t),Le=p(j),D=a(j,"LI",{});var se=i(D);J=s(se,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),Q=a(se,"CODE",{});var _e=i(Q);de=s(_e,"model([pixel_values, attention_mask])"),_e.forEach(t),Se=s(se," or "),Z=a(se,"CODE",{});var st=i(Z);Ke=s(st,"model([pixel_values, attention_mask, token_type_ids])"),st.forEach(t),se.forEach(t),ee=p(j),R=a(j,"LI",{});var We=i(R);ce=s(We,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),te=a(We,"CODE",{});var ve=i(te);He=s(ve,'model({"pixel_values": pixel_values, "token_type_ids": token_type_ids})'),ve.forEach(t),We.forEach(t),j.forEach(t),fe=p(v),q=a(v,"P",{});var Te=i(q);Ue=s(Te,`Note that when creating models and layers with
`),L=a(Te,"A",{href:!0,rel:!0});var nt=i(L);oe=s(nt,"subclassing"),nt.forEach(t),Re=s(Te,` 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!`),Te.forEach(t),this.h()},h(){c(L,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),c(L,"rel","nofollow")},m(v,V){f(v,d,V),e(d,w),e(d,u),e(u,g),e(d,T),f(v,l,V),f(v,h,V),e(h,P),e(P,xe),e(h,Ee),e(h,z),e(z,W),f(v,B,V),f(v,E,V),e(E,je),e(E,U),e(U,Ie),e(E,be),e(E,N),e(N,Ce),e(E,G),e(E,X),e(X,qe),e(E,ye),e(E,S),e(S,ze),e(E,$e),e(E,K),e(K,pe),e(E,Oe),f(v,le,V),f(v,x,V),e(x,O),e(O,Me),e(O,C),e(C,Y),e(O,De),e(O,H),e(H,Ne),e(x,Le),e(x,D),e(D,J),e(D,Q),e(Q,de),e(D,Se),e(D,Z),e(Z,Ke),e(x,ee),e(x,R),e(R,ce),e(R,te),e(te,He),f(v,fe,V),f(v,q,V),e(q,Ue),e(q,L),e(L,oe),e(q,Re)},d(v){v&&t(d),v&&t(l),v&&t(h),v&&t(B),v&&t(E),v&&t(le),v&&t(x),v&&t(fe),v&&t(q)}}}function fi(I){let d,w,u,g,T;return{c(){d=n("p"),w=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=n("code"),g=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=a(l,"P",{});var h=i(d);w=s(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=a(h,"CODE",{});var P=i(u);g=s(P,"Module"),P.forEach(t),T=s(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(l,h){f(l,d,h),e(d,w),e(d,u),e(u,g),e(d,T)},d(l){l&&t(d)}}}function ui(I){let d,w,u,g,T;return g=new yr({props:{code:`from transformers import AutoImageProcessor, TFViTMAEModel
from PIL import Image
import requests

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

image_processor = AutoImageProcessor.from_pretrained("facebook/vit-mae-base")
model = TFViTMAEModel.from_pretrained("facebook/vit-mae-base")

inputs = image_processor(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> AutoImageProcessor, 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>image_processor = AutoImageProcessor.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 = image_processor(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=n("p"),w=r("Examples:"),u=m(),b(g.$$.fragment)},l(l){d=a(l,"P",{});var h=i(d);w=s(h,"Examples:"),h.forEach(t),u=p(l),y(g.$$.fragment,l)},m(l,h){f(l,d,h),e(d,w),f(l,u,h),$(g,l,h),T=!0},p:br,i(l){T||(M(g.$$.fragment,l),T=!0)},o(l){A(g.$$.fragment,l),T=!1},d(l){l&&t(d),l&&t(u),k(g,l)}}}function gi(I){let d,w,u,g,T,l,h,P,xe,Ee,z,W,B,E,je,U,Ie,be,N,Ce,G,X,qe,ye,S,ze,$e,K,pe,Oe,le,x,O,Me,C,Y,De,H,Ne,Le,D,J,Q,de,Se,Z,Ke,ee,R,ce,te,He,fe,q,Ue,L,oe,Re;return{c(){d=n("p"),w=r("TensorFlow models and layers in "),u=n("code"),g=r("transformers"),T=r(" accept two formats as input:"),l=m(),h=n("ul"),P=n("li"),xe=r("having all inputs as keyword arguments (like PyTorch models), or"),Ee=m(),z=n("li"),W=r("having all inputs as a list, tuple or dict in the first positional argument."),B=m(),E=n("p"),je=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 `),U=n("code"),Ie=r("model.fit()"),be=r(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),N=n("code"),Ce=r("model.fit()"),G=r(` supports! If, however, you want to use the second
format outside of Keras methods like `),X=n("code"),qe=r("fit()"),ye=r(" and "),S=n("code"),ze=r("predict()"),$e=r(`, such as when creating your own layers or models with
the Keras `),K=n("code"),pe=r("Functional"),Oe=r(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),le=m(),x=n("ul"),O=n("li"),Me=r("a single Tensor with "),C=n("code"),Y=r("pixel_values"),De=r(" only and nothing else: "),H=n("code"),Ne=r("model(pixel_values)"),Le=m(),D=n("li"),J=r(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),Q=n("code"),de=r("model([pixel_values, attention_mask])"),Se=r(" or "),Z=n("code"),Ke=r("model([pixel_values, attention_mask, token_type_ids])"),ee=m(),R=n("li"),ce=r(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),te=n("code"),He=r('model({"pixel_values": pixel_values, "token_type_ids": token_type_ids})'),fe=m(),q=n("p"),Ue=r(`Note that when creating models and layers with
`),L=n("a"),oe=r("subclassing"),Re=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=a(v,"P",{});var V=i(d);w=s(V,"TensorFlow models and layers in "),u=a(V,"CODE",{});var et=i(u);g=s(et,"transformers"),et.forEach(t),T=s(V," accept two formats as input:"),V.forEach(t),l=p(v),h=a(v,"UL",{});var he=i(h);P=a(he,"LI",{});var me=i(P);xe=s(me,"having all inputs as keyword arguments (like PyTorch models), or"),me.forEach(t),Ee=p(he),z=a(he,"LI",{});var wt=i(z);W=s(wt,"having all inputs as a list, tuple or dict in the first positional argument."),wt.forEach(t),he.forEach(t),B=p(v),E=a(v,"P",{});var F=i(E);je=s(F,`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 `),U=a(F,"CODE",{});var ue=i(U);Ie=s(ue,"model.fit()"),ue.forEach(t),be=s(F,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),N=a(F,"CODE",{});var tt=i(N);Ce=s(tt,"model.fit()"),tt.forEach(t),G=s(F,` supports! If, however, you want to use the second
format outside of Keras methods like `),X=a(F,"CODE",{});var Ae=i(X);qe=s(Ae,"fit()"),Ae.forEach(t),ye=s(F," and "),S=a(F,"CODE",{});var ot=i(S);ze=s(ot,"predict()"),ot.forEach(t),$e=s(F,`, such as when creating your own layers or models with
the Keras `),K=a(F,"CODE",{});var Ge=i(K);pe=s(Ge,"Functional"),Ge.forEach(t),Oe=s(F,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),F.forEach(t),le=p(v),x=a(v,"UL",{});var j=i(x);O=a(j,"LI",{});var re=i(O);Me=s(re,"a single Tensor with "),C=a(re,"CODE",{});var ge=i(C);Y=s(ge,"pixel_values"),ge.forEach(t),De=s(re," only and nothing else: "),H=a(re,"CODE",{});var rt=i(H);Ne=s(rt,"model(pixel_values)"),rt.forEach(t),re.forEach(t),Le=p(j),D=a(j,"LI",{});var se=i(D);J=s(se,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),Q=a(se,"CODE",{});var _e=i(Q);de=s(_e,"model([pixel_values, attention_mask])"),_e.forEach(t),Se=s(se," or "),Z=a(se,"CODE",{});var st=i(Z);Ke=s(st,"model([pixel_values, attention_mask, token_type_ids])"),st.forEach(t),se.forEach(t),ee=p(j),R=a(j,"LI",{});var We=i(R);ce=s(We,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),te=a(We,"CODE",{});var ve=i(te);He=s(ve,'model({"pixel_values": pixel_values, "token_type_ids": token_type_ids})'),ve.forEach(t),We.forEach(t),j.forEach(t),fe=p(v),q=a(v,"P",{});var Te=i(q);Ue=s(Te,`Note that when creating models and layers with
`),L=a(Te,"A",{href:!0,rel:!0});var nt=i(L);oe=s(nt,"subclassing"),nt.forEach(t),Re=s(Te,` 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!`),Te.forEach(t),this.h()},h(){c(L,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),c(L,"rel","nofollow")},m(v,V){f(v,d,V),e(d,w),e(d,u),e(u,g),e(d,T),f(v,l,V),f(v,h,V),e(h,P),e(P,xe),e(h,Ee),e(h,z),e(z,W),f(v,B,V),f(v,E,V),e(E,je),e(E,U),e(U,Ie),e(E,be),e(E,N),e(N,Ce),e(E,G),e(E,X),e(X,qe),e(E,ye),e(E,S),e(S,ze),e(E,$e),e(E,K),e(K,pe),e(E,Oe),f(v,le,V),f(v,x,V),e(x,O),e(O,Me),e(O,C),e(C,Y),e(O,De),e(O,H),e(H,Ne),e(x,Le),e(x,D),e(D,J),e(D,Q),e(Q,de),e(D,Se),e(D,Z),e(Z,Ke),e(x,ee),e(x,R),e(R,ce),e(R,te),e(te,He),f(v,fe,V),f(v,q,V),e(q,Ue),e(q,L),e(L,oe),e(q,Re)},d(v){v&&t(d),v&&t(l),v&&t(h),v&&t(B),v&&t(E),v&&t(le),v&&t(x),v&&t(fe),v&&t(q)}}}function _i(I){let d,w,u,g,T;return{c(){d=n("p"),w=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=n("code"),g=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=a(l,"P",{});var h=i(d);w=s(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=a(h,"CODE",{});var P=i(u);g=s(P,"Module"),P.forEach(t),T=s(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(l,h){f(l,d,h),e(d,w),e(d,u),e(u,g),e(d,T)},d(l){l&&t(d)}}}function vi(I){let d,w,u,g,T;return g=new yr({props:{code:`from transformers import AutoImageProcessor, TFViTMAEForPreTraining
from PIL import Image
import requests

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

image_processor = AutoImageProcessor.from_pretrained("facebook/vit-mae-base")
model = TFViTMAEForPreTraining.from_pretrained("facebook/vit-mae-base")

inputs = image_processor(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> AutoImageProcessor, 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>image_processor = AutoImageProcessor.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 = image_processor(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=n("p"),w=r("Examples:"),u=m(),b(g.$$.fragment)},l(l){d=a(l,"P",{});var h=i(d);w=s(h,"Examples:"),h.forEach(t),u=p(l),y(g.$$.fragment,l)},m(l,h){f(l,d,h),e(d,w),f(l,u,h),$(g,l,h),T=!0},p:br,i(l){T||(M(g.$$.fragment,l),T=!0)},o(l){A(g.$$.fragment,l),T=!1},d(l){l&&t(d),l&&t(u),k(g,l)}}}function Ti(I){let d,w,u,g,T,l,h,P,xe,Ee,z,W,B,E,je,U,Ie,be,N,Ce,G,X,qe,ye,S,ze,$e,K,pe,Oe,le,x,O,Me,C,Y,De,H,Ne,Le,D,J,Q,de,Se,Z,Ke,ee,R,ce,te,He,fe,q,Ue,L,oe,Re,v,V,et,he,me,wt,F,ue,tt,Ae,ot,Ge,j,re,ge,rt,se,_e,st,We,ve,Te,nt,Bt,os,rs,$r,at,Et,Go,Gt,ss,Xo,ns,Mr,ko,as,Ar,bt,yt,Vo,is,ls,Xt,ds,cs,hs,it,ms,Po,ps,fs,Yt,us,gs,kr,Fo,_s,Vr,lt,$t,Yo,Jt,vs,Jo,Ts,Pr,we,Qt,ws,dt,Es,xo,bs,ys,Zt,$s,Ms,As,ct,ks,jo,Vs,Ps,Io,Fs,xs,js,Mt,Fr,ht,At,Qo,eo,Is,Zo,Cs,xr,Be,to,qs,oo,zs,ro,Os,Ds,Ns,ke,so,Ls,mt,Ss,Co,Ks,Hs,er,Us,Rs,Ws,kt,Bs,Vt,jr,pt,Pt,tr,no,Gs,or,Xs,Ir,ne,ao,Ys,rr,Js,Qs,Ft,Zs,io,en,lo,tn,on,rn,Ve,co,sn,ft,nn,qo,an,ln,sr,dn,cn,hn,xt,mn,jt,Cr,ut,It,nr,ho,pn,ar,fn,qr,ae,mo,un,po,gn,zo,_n,vn,Tn,fo,wn,uo,En,bn,yn,Ct,$n,Pe,go,Mn,gt,An,Oo,kn,Vn,ir,Pn,Fn,xn,qt,jn,zt,zr,_t,Ot,lr,_o,In,dr,Cn,Or,ie,vo,qn,To,zn,Do,On,Dn,Nn,wo,Ln,Eo,Sn,Kn,Hn,Dt,Un,Fe,bo,Rn,vt,Wn,No,Bn,Gn,cr,Xn,Yn,Jn,Nt,Qn,Lt,Dr;return l=new Wt({}),E=new Wt({}),Gt=new Wt({}),Jt=new Wt({}),Qt=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:"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/v4.27.1/src/transformers/models/vit_mae/configuration_vit_mae.py#L29"}}),Mt=new Er({props:{anchor:"transformers.ViTMAEConfig.example",$$slots:{default:[ii]},$$scope:{ctx:I}}}),eo=new Wt({}),to=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/v4.27.1/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/v4.27.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/vit_mae/modeling_vit_mae.py#L637"}}),so=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/v4.27.1/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/v4.27.1/en/model_doc/videomae#transformers.VideoMAEFeatureExtractor.__call__">ViTImageProcessor.<strong>call</strong>()</a>
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/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/vit_mae/modeling_vit_mae.py#L661",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/v4.27.1/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>
`}}),kt=new Ao({props:{$$slots:{default:[li]},$$scope:{ctx:I}}}),Vt=new Er({props:{anchor:"transformers.ViTMAEModel.forward.example",$$slots:{default:[di]},$$scope:{ctx:I}}}),no=new Wt({}),ao=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/v4.27.1/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/v4.27.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/vit_mae/modeling_vit_mae.py#L849"}}),Ft=new Ao({props:{$$slots:{default:[ci]},$$scope:{ctx:I}}}),co=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/v4.27.1/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/v4.27.1/en/model_doc/videomae#transformers.VideoMAEFeatureExtractor.__call__">ViTImageProcessor.<strong>call</strong>()</a>
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/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/vit_mae/modeling_vit_mae.py#L962",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/v4.27.1/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>
`}}),xt=new Ao({props:{$$slots:{default:[hi]},$$scope:{ctx:I}}}),jt=new Er({props:{anchor:"transformers.ViTMAEForPreTraining.forward.example",$$slots:{default:[mi]},$$scope:{ctx:I}}}),ho=new Wt({}),mo=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/v4.27.1/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/v4.27.1/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/v4.27.1/src/transformers/models/vit_mae/modeling_tf_vit_mae.py#L805"}}),Ct=new Ao({props:{$$slots:{default:[pi]},$$scope:{ctx:I}}}),go=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[keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, 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/v4.27.1/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/v4.27.1/en/model_doc/videomae#transformers.VideoMAEFeatureExtractor.__call__">ViTImageProcessor.<strong>call</strong>()</a>
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/v4.27.1/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/v4.27.1/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/v4.27.1/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>
`}}),qt=new Ao({props:{$$slots:{default:[fi]},$$scope:{ctx:I}}}),zt=new Er({props:{anchor:"transformers.TFViTMAEModel.call.example",$$slots:{default:[ui]},$$scope:{ctx:I}}}),_o=new Wt({}),vo=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/v4.27.1/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/v4.27.1/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/v4.27.1/src/transformers/models/vit_mae/modeling_tf_vit_mae.py#L978"}}),Dt=new Ao({props:{$$slots:{default:[gi]},$$scope:{ctx:I}}}),bo=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[keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, 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/v4.27.1/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/v4.27.1/en/model_doc/videomae#transformers.VideoMAEFeatureExtractor.__call__">ViTImageProcessor.<strong>call</strong>()</a>
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/v4.27.1/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/v4.27.1/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/v4.27.1/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>
`}}),Nt=new Ao({props:{$$slots:{default:[_i]},$$scope:{ctx:I}}}),Lt=new Er({props:{anchor:"transformers.TFViTMAEForPreTraining.call.example",$$slots:{default:[vi]},$$scope:{ctx:I}}}),{c(){d=n("meta"),w=m(),u=n("h1"),g=n("a"),T=n("span"),b(l.$$.fragment),h=m(),P=n("span"),xe=r("ViTMAE"),Ee=m(),z=n("h2"),W=n("a"),B=n("span"),b(E.$$.fragment),je=m(),U=n("span"),Ie=r("Overview"),be=m(),N=n("p"),Ce=r("The ViTMAE model was proposed in "),G=n("a"),X=r("Masked Autoencoders Are Scalable Vision Learners"),qe=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.`),ye=m(),S=n("p"),ze=r("The abstract from the paper is the following:"),$e=m(),K=n("p"),pe=n("em"),Oe=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.`),le=m(),x=n("p"),O=r("Tips:"),Me=m(),C=n("ul"),Y=n("li"),De=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 `),H=n("a"),Ne=r("ViTMAEForPreTraining"),Le=r(" for this purpose."),D=m(),J=n("li"),Q=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 `),de=n("a"),Se=r("ViTForImageClassification"),Z=r("."),Ke=m(),ee=n("li"),R=r("One can use "),ce=n("a"),te=r("ViTImageProcessor"),He=r(" to prepare images for the model. See the code examples for more info."),fe=m(),q=n("li"),Ue=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.`),L=m(),oe=n("li"),Re=r("For a visual understanding of how MAEs work you can check out this "),v=n("a"),V=r("post"),et=r("."),he=m(),me=n("img"),F=m(),ue=n("small"),tt=r("MAE architecture. Taken from the "),Ae=n("a"),ot=r("original paper."),Ge=m(),j=n("p"),re=r("This model was contributed by "),ge=n("a"),rt=r("nielsr"),se=r(". TensorFlow version of the model was contributed by "),_e=n("a"),st=r("sayakpaul"),We=r(` and
`),ve=n("a"),Te=r("ariG23498"),nt=r(" (equal contribution). The original code can be found "),Bt=n("a"),os=r("here"),rs=r("."),$r=m(),at=n("h2"),Et=n("a"),Go=n("span"),b(Gt.$$.fragment),ss=m(),Xo=n("span"),ns=r("Resources"),Mr=m(),ko=n("p"),as=r("A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with ViTMAE."),Ar=m(),bt=n("ul"),yt=n("li"),Vo=n("a"),is=r("ViTMAEForPreTraining"),ls=r(" is supported by this "),Xt=n("a"),ds=r("example script"),cs=r(", allowing you to pre-train the model from scratch/further pre-train the model on custom data."),hs=m(),it=n("li"),ms=r("A notebook that illustrates how to visualize reconstructed pixel values with "),Po=n("a"),ps=r("ViTMAEForPreTraining"),fs=r(" can be found "),Yt=n("a"),us=r("here"),gs=r("."),kr=m(),Fo=n("p"),_s=r("If you\u2019re interested in submitting a resource to be included here, please feel free to open a Pull Request and we\u2019ll review it! The resource should ideally demonstrate something new instead of duplicating an existing resource."),Vr=m(),lt=n("h2"),$t=n("a"),Yo=n("span"),b(Jt.$$.fragment),vs=m(),Jo=n("span"),Ts=r("ViTMAEConfig"),Pr=m(),we=n("div"),b(Qt.$$.fragment),ws=m(),dt=n("p"),Es=r("This is the configuration class to store the configuration of a "),xo=n("a"),bs=r("ViTMAEModel"),ys=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
`),Zt=n("a"),$s=r("facebook/vit-mae-base"),Ms=r(" architecture."),As=m(),ct=n("p"),ks=r("Configuration objects inherit from "),jo=n("a"),Vs=r("PretrainedConfig"),Ps=r(` and can be used to control the model outputs. Read the
documentation from `),Io=n("a"),Fs=r("PretrainedConfig"),xs=r(" for more information."),js=m(),b(Mt.$$.fragment),Fr=m(),ht=n("h2"),At=n("a"),Qo=n("span"),b(eo.$$.fragment),Is=m(),Zo=n("span"),Cs=r("ViTMAEModel"),xr=m(),Be=n("div"),b(to.$$.fragment),qs=m(),oo=n("p"),zs=r(`The bare ViTMAE Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),ro=n("a"),Os=r("torch.nn.Module"),Ds=r(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Ns=m(),ke=n("div"),b(so.$$.fragment),Ls=m(),mt=n("p"),Ss=r("The "),Co=n("a"),Ks=r("ViTMAEModel"),Hs=r(" forward method, overrides the "),er=n("code"),Us=r("__call__"),Rs=r(" special method."),Ws=m(),b(kt.$$.fragment),Bs=m(),b(Vt.$$.fragment),jr=m(),pt=n("h2"),Pt=n("a"),tr=n("span"),b(no.$$.fragment),Gs=m(),or=n("span"),Xs=r("ViTMAEForPreTraining"),Ir=m(),ne=n("div"),b(ao.$$.fragment),Ys=m(),rr=n("p"),Js=r("The ViTMAE Model transformer with the decoder on top for self-supervised pre-training."),Qs=m(),b(Ft.$$.fragment),Zs=m(),io=n("p"),en=r("This model is a PyTorch "),lo=n("a"),tn=r("torch.nn.Module"),on=r(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),rn=m(),Ve=n("div"),b(co.$$.fragment),sn=m(),ft=n("p"),nn=r("The "),qo=n("a"),an=r("ViTMAEForPreTraining"),ln=r(" forward method, overrides the "),sr=n("code"),dn=r("__call__"),cn=r(" special method."),hn=m(),b(xt.$$.fragment),mn=m(),b(jt.$$.fragment),Cr=m(),ut=n("h2"),It=n("a"),nr=n("span"),b(ho.$$.fragment),pn=m(),ar=n("span"),fn=r("TFViTMAEModel"),qr=m(),ae=n("div"),b(mo.$$.fragment),un=m(),po=n("p"),gn=r(`The bare ViTMAE Model transformer outputting raw hidden-states without any specific head on top.
This model inherits from `),zo=n("a"),_n=r("TFPreTrainedModel"),vn=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.)`),Tn=m(),fo=n("p"),wn=r("This model is also a "),uo=n("a"),En=r("tf.keras.Model"),bn=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.`),yn=m(),b(Ct.$$.fragment),$n=m(),Pe=n("div"),b(go.$$.fragment),Mn=m(),gt=n("p"),An=r("The "),Oo=n("a"),kn=r("TFViTMAEModel"),Vn=r(" forward method, overrides the "),ir=n("code"),Pn=r("__call__"),Fn=r(" special method."),xn=m(),b(qt.$$.fragment),jn=m(),b(zt.$$.fragment),zr=m(),_t=n("h2"),Ot=n("a"),lr=n("span"),b(_o.$$.fragment),In=m(),dr=n("span"),Cn=r("TFViTMAEForPreTraining"),Or=m(),ie=n("div"),b(vo.$$.fragment),qn=m(),To=n("p"),zn=r(`The ViTMAE Model transformer with the decoder on top for self-supervised pre-training.
This model inherits from `),Do=n("a"),On=r("TFPreTrainedModel"),Dn=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.)`),Nn=m(),wo=n("p"),Ln=r("This model is also a "),Eo=n("a"),Sn=r("tf.keras.Model"),Kn=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.`),Hn=m(),b(Dt.$$.fragment),Un=m(),Fe=n("div"),b(bo.$$.fragment),Rn=m(),vt=n("p"),Wn=r("The "),No=n("a"),Bn=r("TFViTMAEForPreTraining"),Gn=r(" forward method, overrides the "),cr=n("code"),Xn=r("__call__"),Yn=r(" special method."),Jn=m(),b(Nt.$$.fragment),Qn=m(),b(Lt.$$.fragment),this.h()},l(o){const _=si('[data-svelte="svelte-1phssyn"]',document.head);d=a(_,"META",{name:!0,content:!0}),_.forEach(t),w=p(o),u=a(o,"H1",{class:!0});var yo=i(u);g=a(yo,"A",{id:!0,class:!0,href:!0});var hr=i(g);T=a(hr,"SPAN",{});var mr=i(T);y(l.$$.fragment,mr),mr.forEach(t),hr.forEach(t),h=p(yo),P=a(yo,"SPAN",{});var pr=i(P);xe=s(pr,"ViTMAE"),pr.forEach(t),yo.forEach(t),Ee=p(o),z=a(o,"H2",{class:!0});var $o=i(z);W=a($o,"A",{id:!0,class:!0,href:!0});var fr=i(W);B=a(fr,"SPAN",{});var ur=i(B);y(E.$$.fragment,ur),ur.forEach(t),fr.forEach(t),je=p($o),U=a($o,"SPAN",{});var gr=i(U);Ie=s(gr,"Overview"),gr.forEach(t),$o.forEach(t),be=p(o),N=a(o,"P",{});var Mo=i(N);Ce=s(Mo,"The ViTMAE model was proposed in "),G=a(Mo,"A",{href:!0,rel:!0});var _r=i(G);X=s(_r,"Masked Autoencoders Are Scalable Vision Learners"),_r.forEach(t),qe=s(Mo,` 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.`),Mo.forEach(t),ye=p(o),S=a(o,"P",{});var vr=i(S);ze=s(vr,"The abstract from the paper is the following:"),vr.forEach(t),$e=p(o),K=a(o,"P",{});var Tr=i(K);pe=a(Tr,"EM",{});var ea=i(pe);Oe=s(ea,`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.`),ea.forEach(t),Tr.forEach(t),le=p(o),x=a(o,"P",{});var ta=i(x);O=s(ta,"Tips:"),ta.forEach(t),Me=p(o),C=a(o,"UL",{});var Xe=i(C);Y=a(Xe,"LI",{});var Nr=i(Y);De=s(Nr,`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 `),H=a(Nr,"A",{href:!0});var oa=i(H);Ne=s(oa,"ViTMAEForPreTraining"),oa.forEach(t),Le=s(Nr," for this purpose."),Nr.forEach(t),D=p(Xe),J=a(Xe,"LI",{});var Lr=i(J);Q=s(Lr,`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 `),de=a(Lr,"A",{href:!0});var ra=i(de);Se=s(ra,"ViTForImageClassification"),ra.forEach(t),Z=s(Lr,"."),Lr.forEach(t),Ke=p(Xe),ee=a(Xe,"LI",{});var Sr=i(ee);R=s(Sr,"One can use "),ce=a(Sr,"A",{href:!0});var sa=i(ce);te=s(sa,"ViTImageProcessor"),sa.forEach(t),He=s(Sr," to prepare images for the model. See the code examples for more info."),Sr.forEach(t),fe=p(Xe),q=a(Xe,"LI",{});var na=i(q);Ue=s(na,`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.`),na.forEach(t),L=p(Xe),oe=a(Xe,"LI",{});var Kr=i(oe);Re=s(Kr,"For a visual understanding of how MAEs work you can check out this "),v=a(Kr,"A",{href:!0,rel:!0});var aa=i(v);V=s(aa,"post"),aa.forEach(t),et=s(Kr,"."),Kr.forEach(t),Xe.forEach(t),he=p(o),me=a(o,"IMG",{src:!0,alt:!0,width:!0}),F=p(o),ue=a(o,"SMALL",{});var Zn=i(ue);tt=s(Zn,"MAE architecture. Taken from the "),Ae=a(Zn,"A",{href:!0});var ia=i(Ae);ot=s(ia,"original paper."),ia.forEach(t),Zn.forEach(t),Ge=p(o),j=a(o,"P",{});var Ye=i(j);re=s(Ye,"This model was contributed by "),ge=a(Ye,"A",{href:!0,rel:!0});var la=i(ge);rt=s(la,"nielsr"),la.forEach(t),se=s(Ye,". TensorFlow version of the model was contributed by "),_e=a(Ye,"A",{href:!0,rel:!0});var da=i(_e);st=s(da,"sayakpaul"),da.forEach(t),We=s(Ye,` and
`),ve=a(Ye,"A",{href:!0,rel:!0});var ca=i(ve);Te=s(ca,"ariG23498"),ca.forEach(t),nt=s(Ye," (equal contribution). The original code can be found "),Bt=a(Ye,"A",{href:!0,rel:!0});var ha=i(Bt);os=s(ha,"here"),ha.forEach(t),rs=s(Ye,"."),Ye.forEach(t),$r=p(o),at=a(o,"H2",{class:!0});var Hr=i(at);Et=a(Hr,"A",{id:!0,class:!0,href:!0});var ma=i(Et);Go=a(ma,"SPAN",{});var pa=i(Go);y(Gt.$$.fragment,pa),pa.forEach(t),ma.forEach(t),ss=p(Hr),Xo=a(Hr,"SPAN",{});var fa=i(Xo);ns=s(fa,"Resources"),fa.forEach(t),Hr.forEach(t),Mr=p(o),ko=a(o,"P",{});var ua=i(ko);as=s(ua,"A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with ViTMAE."),ua.forEach(t),Ar=p(o),bt=a(o,"UL",{});var Ur=i(bt);yt=a(Ur,"LI",{});var wr=i(yt);Vo=a(wr,"A",{href:!0});var ga=i(Vo);is=s(ga,"ViTMAEForPreTraining"),ga.forEach(t),ls=s(wr," is supported by this "),Xt=a(wr,"A",{href:!0,rel:!0});var _a=i(Xt);ds=s(_a,"example script"),_a.forEach(t),cs=s(wr,", allowing you to pre-train the model from scratch/further pre-train the model on custom data."),wr.forEach(t),hs=p(Ur),it=a(Ur,"LI",{});var Lo=i(it);ms=s(Lo,"A notebook that illustrates how to visualize reconstructed pixel values with "),Po=a(Lo,"A",{href:!0});var va=i(Po);ps=s(va,"ViTMAEForPreTraining"),va.forEach(t),fs=s(Lo," can be found "),Yt=a(Lo,"A",{href:!0,rel:!0});var Ta=i(Yt);us=s(Ta,"here"),Ta.forEach(t),gs=s(Lo,"."),Lo.forEach(t),Ur.forEach(t),kr=p(o),Fo=a(o,"P",{});var wa=i(Fo);_s=s(wa,"If you\u2019re interested in submitting a resource to be included here, please feel free to open a Pull Request and we\u2019ll review it! The resource should ideally demonstrate something new instead of duplicating an existing resource."),wa.forEach(t),Vr=p(o),lt=a(o,"H2",{class:!0});var Rr=i(lt);$t=a(Rr,"A",{id:!0,class:!0,href:!0});var Ea=i($t);Yo=a(Ea,"SPAN",{});var ba=i(Yo);y(Jt.$$.fragment,ba),ba.forEach(t),Ea.forEach(t),vs=p(Rr),Jo=a(Rr,"SPAN",{});var ya=i(Jo);Ts=s(ya,"ViTMAEConfig"),ya.forEach(t),Rr.forEach(t),Pr=p(o),we=a(o,"DIV",{class:!0});var St=i(we);y(Qt.$$.fragment,St),ws=p(St),dt=a(St,"P",{});var So=i(dt);Es=s(So,"This is the configuration class to store the configuration of a "),xo=a(So,"A",{href:!0});var $a=i(xo);bs=s($a,"ViTMAEModel"),$a.forEach(t),ys=s(So,`. 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
`),Zt=a(So,"A",{href:!0,rel:!0});var Ma=i(Zt);$s=s(Ma,"facebook/vit-mae-base"),Ma.forEach(t),Ms=s(So," architecture."),So.forEach(t),As=p(St),ct=a(St,"P",{});var Ko=i(ct);ks=s(Ko,"Configuration objects inherit from "),jo=a(Ko,"A",{href:!0});var Aa=i(jo);Vs=s(Aa,"PretrainedConfig"),Aa.forEach(t),Ps=s(Ko,` and can be used to control the model outputs. Read the
documentation from `),Io=a(Ko,"A",{href:!0});var ka=i(Io);Fs=s(ka,"PretrainedConfig"),ka.forEach(t),xs=s(Ko," for more information."),Ko.forEach(t),js=p(St),y(Mt.$$.fragment,St),St.forEach(t),Fr=p(o),ht=a(o,"H2",{class:!0});var Wr=i(ht);At=a(Wr,"A",{id:!0,class:!0,href:!0});var Va=i(At);Qo=a(Va,"SPAN",{});var Pa=i(Qo);y(eo.$$.fragment,Pa),Pa.forEach(t),Va.forEach(t),Is=p(Wr),Zo=a(Wr,"SPAN",{});var Fa=i(Zo);Cs=s(Fa,"ViTMAEModel"),Fa.forEach(t),Wr.forEach(t),xr=p(o),Be=a(o,"DIV",{class:!0});var Ho=i(Be);y(to.$$.fragment,Ho),qs=p(Ho),oo=a(Ho,"P",{});var Br=i(oo);zs=s(Br,`The bare ViTMAE Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),ro=a(Br,"A",{href:!0,rel:!0});var xa=i(ro);Os=s(xa,"torch.nn.Module"),xa.forEach(t),Ds=s(Br,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Br.forEach(t),Ns=p(Ho),ke=a(Ho,"DIV",{class:!0});var Kt=i(ke);y(so.$$.fragment,Kt),Ls=p(Kt),mt=a(Kt,"P",{});var Uo=i(mt);Ss=s(Uo,"The "),Co=a(Uo,"A",{href:!0});var ja=i(Co);Ks=s(ja,"ViTMAEModel"),ja.forEach(t),Hs=s(Uo," forward method, overrides the "),er=a(Uo,"CODE",{});var Ia=i(er);Us=s(Ia,"__call__"),Ia.forEach(t),Rs=s(Uo," special method."),Uo.forEach(t),Ws=p(Kt),y(kt.$$.fragment,Kt),Bs=p(Kt),y(Vt.$$.fragment,Kt),Kt.forEach(t),Ho.forEach(t),jr=p(o),pt=a(o,"H2",{class:!0});var Gr=i(pt);Pt=a(Gr,"A",{id:!0,class:!0,href:!0});var Ca=i(Pt);tr=a(Ca,"SPAN",{});var qa=i(tr);y(no.$$.fragment,qa),qa.forEach(t),Ca.forEach(t),Gs=p(Gr),or=a(Gr,"SPAN",{});var za=i(or);Xs=s(za,"ViTMAEForPreTraining"),za.forEach(t),Gr.forEach(t),Ir=p(o),ne=a(o,"DIV",{class:!0});var Je=i(ne);y(ao.$$.fragment,Je),Ys=p(Je),rr=a(Je,"P",{});var Oa=i(rr);Js=s(Oa,"The ViTMAE Model transformer with the decoder on top for self-supervised pre-training."),Oa.forEach(t),Qs=p(Je),y(Ft.$$.fragment,Je),Zs=p(Je),io=a(Je,"P",{});var Xr=i(io);en=s(Xr,"This model is a PyTorch "),lo=a(Xr,"A",{href:!0,rel:!0});var Da=i(lo);tn=s(Da,"torch.nn.Module"),Da.forEach(t),on=s(Xr,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Xr.forEach(t),rn=p(Je),Ve=a(Je,"DIV",{class:!0});var Ht=i(Ve);y(co.$$.fragment,Ht),sn=p(Ht),ft=a(Ht,"P",{});var Ro=i(ft);nn=s(Ro,"The "),qo=a(Ro,"A",{href:!0});var Na=i(qo);an=s(Na,"ViTMAEForPreTraining"),Na.forEach(t),ln=s(Ro," forward method, overrides the "),sr=a(Ro,"CODE",{});var La=i(sr);dn=s(La,"__call__"),La.forEach(t),cn=s(Ro," special method."),Ro.forEach(t),hn=p(Ht),y(xt.$$.fragment,Ht),mn=p(Ht),y(jt.$$.fragment,Ht),Ht.forEach(t),Je.forEach(t),Cr=p(o),ut=a(o,"H2",{class:!0});var Yr=i(ut);It=a(Yr,"A",{id:!0,class:!0,href:!0});var Sa=i(It);nr=a(Sa,"SPAN",{});var Ka=i(nr);y(ho.$$.fragment,Ka),Ka.forEach(t),Sa.forEach(t),pn=p(Yr),ar=a(Yr,"SPAN",{});var Ha=i(ar);fn=s(Ha,"TFViTMAEModel"),Ha.forEach(t),Yr.forEach(t),qr=p(o),ae=a(o,"DIV",{class:!0});var Qe=i(ae);y(mo.$$.fragment,Qe),un=p(Qe),po=a(Qe,"P",{});var Jr=i(po);gn=s(Jr,`The bare ViTMAE Model transformer outputting raw hidden-states without any specific head on top.
This model inherits from `),zo=a(Jr,"A",{href:!0});var Ua=i(zo);_n=s(Ua,"TFPreTrainedModel"),Ua.forEach(t),vn=s(Jr,`. 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.)`),Jr.forEach(t),Tn=p(Qe),fo=a(Qe,"P",{});var Qr=i(fo);wn=s(Qr,"This model is also a "),uo=a(Qr,"A",{href:!0,rel:!0});var Ra=i(uo);En=s(Ra,"tf.keras.Model"),Ra.forEach(t),bn=s(Qr,` 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.`),Qr.forEach(t),yn=p(Qe),y(Ct.$$.fragment,Qe),$n=p(Qe),Pe=a(Qe,"DIV",{class:!0});var Ut=i(Pe);y(go.$$.fragment,Ut),Mn=p(Ut),gt=a(Ut,"P",{});var Wo=i(gt);An=s(Wo,"The "),Oo=a(Wo,"A",{href:!0});var Wa=i(Oo);kn=s(Wa,"TFViTMAEModel"),Wa.forEach(t),Vn=s(Wo," forward method, overrides the "),ir=a(Wo,"CODE",{});var Ba=i(ir);Pn=s(Ba,"__call__"),Ba.forEach(t),Fn=s(Wo," special method."),Wo.forEach(t),xn=p(Ut),y(qt.$$.fragment,Ut),jn=p(Ut),y(zt.$$.fragment,Ut),Ut.forEach(t),Qe.forEach(t),zr=p(o),_t=a(o,"H2",{class:!0});var Zr=i(_t);Ot=a(Zr,"A",{id:!0,class:!0,href:!0});var Ga=i(Ot);lr=a(Ga,"SPAN",{});var Xa=i(lr);y(_o.$$.fragment,Xa),Xa.forEach(t),Ga.forEach(t),In=p(Zr),dr=a(Zr,"SPAN",{});var Ya=i(dr);Cn=s(Ya,"TFViTMAEForPreTraining"),Ya.forEach(t),Zr.forEach(t),Or=p(o),ie=a(o,"DIV",{class:!0});var Ze=i(ie);y(vo.$$.fragment,Ze),qn=p(Ze),To=a(Ze,"P",{});var es=i(To);zn=s(es,`The ViTMAE Model transformer with the decoder on top for self-supervised pre-training.
This model inherits from `),Do=a(es,"A",{href:!0});var Ja=i(Do);On=s(Ja,"TFPreTrainedModel"),Ja.forEach(t),Dn=s(es,`. 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.)`),es.forEach(t),Nn=p(Ze),wo=a(Ze,"P",{});var ts=i(wo);Ln=s(ts,"This model is also a "),Eo=a(ts,"A",{href:!0,rel:!0});var Qa=i(Eo);Sn=s(Qa,"tf.keras.Model"),Qa.forEach(t),Kn=s(ts,` 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.`),ts.forEach(t),Hn=p(Ze),y(Dt.$$.fragment,Ze),Un=p(Ze),Fe=a(Ze,"DIV",{class:!0});var Rt=i(Fe);y(bo.$$.fragment,Rt),Rn=p(Rt),vt=a(Rt,"P",{});var Bo=i(vt);Wn=s(Bo,"The "),No=a(Bo,"A",{href:!0});var Za=i(No);Bn=s(Za,"TFViTMAEForPreTraining"),Za.forEach(t),Gn=s(Bo," forward method, overrides the "),cr=a(Bo,"CODE",{});var ei=i(cr);Xn=s(ei,"__call__"),ei.forEach(t),Yn=s(Bo," special method."),Bo.forEach(t),Jn=p(Rt),y(Nt.$$.fragment,Rt),Qn=p(Rt),y(Lt.$$.fragment,Rt),Rt.forEach(t),Ze.forEach(t),this.h()},h(){c(d,"name","hf:doc:metadata"),c(d,"content",JSON.stringify(wi)),c(g,"id","vitmae"),c(g,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(g,"href","#vitmae"),c(u,"class","relative group"),c(W,"id","overview"),c(W,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(W,"href","#overview"),c(z,"class","relative group"),c(G,"href","https://arxiv.org/abs/2111.06377v2"),c(G,"rel","nofollow"),c(H,"href","/docs/transformers/v4.27.1/en/model_doc/vit_mae#transformers.ViTMAEForPreTraining"),c(de,"href","/docs/transformers/v4.27.1/en/model_doc/vit#transformers.ViTForImageClassification"),c(ce,"href","/docs/transformers/v4.27.1/en/model_doc/vit#transformers.ViTImageProcessor"),c(v,"href","https://keras.io/examples/vision/masked_image_modeling/"),c(v,"rel","nofollow"),ni(me.src,wt="https://user-images.githubusercontent.com/11435359/146857310-f258c86c-fde6-48e8-9cee-badd2b21bd2c.png")||c(me,"src",wt),c(me,"alt","drawing"),c(me,"width","600"),c(Ae,"href","https://arxiv.org/abs/2111.06377"),c(ge,"href","https://huggingface.co/nielsr"),c(ge,"rel","nofollow"),c(_e,"href","https://github.com/sayakpaul"),c(_e,"rel","nofollow"),c(ve,"href","https://github.com/ariG23498"),c(ve,"rel","nofollow"),c(Bt,"href","https://github.com/facebookresearch/mae"),c(Bt,"rel","nofollow"),c(Et,"id","resources"),c(Et,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(Et,"href","#resources"),c(at,"class","relative group"),c(Vo,"href","/docs/transformers/v4.27.1/en/model_doc/vit_mae#transformers.ViTMAEForPreTraining"),c(Xt,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/image-pretraining"),c(Xt,"rel","nofollow"),c(Po,"href","/docs/transformers/v4.27.1/en/model_doc/vit_mae#transformers.ViTMAEForPreTraining"),c(Yt,"href","https://github.com/NielsRogge/Transformers-Tutorials/blob/master/ViTMAE/ViT_MAE_visualization_demo.ipynb"),c(Yt,"rel","nofollow"),c($t,"id","transformers.ViTMAEConfig"),c($t,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c($t,"href","#transformers.ViTMAEConfig"),c(lt,"class","relative group"),c(xo,"href","/docs/transformers/v4.27.1/en/model_doc/vit_mae#transformers.ViTMAEModel"),c(Zt,"href","https://huggingface.co/facebook/vit-mae-base"),c(Zt,"rel","nofollow"),c(jo,"href","/docs/transformers/v4.27.1/en/main_classes/configuration#transformers.PretrainedConfig"),c(Io,"href","/docs/transformers/v4.27.1/en/main_classes/configuration#transformers.PretrainedConfig"),c(we,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(At,"id","transformers.ViTMAEModel"),c(At,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(At,"href","#transformers.ViTMAEModel"),c(ht,"class","relative group"),c(ro,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(ro,"rel","nofollow"),c(Co,"href","/docs/transformers/v4.27.1/en/model_doc/vit_mae#transformers.ViTMAEModel"),c(ke,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Be,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Pt,"id","transformers.ViTMAEForPreTraining"),c(Pt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(Pt,"href","#transformers.ViTMAEForPreTraining"),c(pt,"class","relative group"),c(lo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(lo,"rel","nofollow"),c(qo,"href","/docs/transformers/v4.27.1/en/model_doc/vit_mae#transformers.ViTMAEForPreTraining"),c(Ve,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(ne,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(It,"id","transformers.TFViTMAEModel"),c(It,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(It,"href","#transformers.TFViTMAEModel"),c(ut,"class","relative group"),c(zo,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.TFPreTrainedModel"),c(uo,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),c(uo,"rel","nofollow"),c(Oo,"href","/docs/transformers/v4.27.1/en/model_doc/vit_mae#transformers.TFViTMAEModel"),c(Pe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(ae,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Ot,"id","transformers.TFViTMAEForPreTraining"),c(Ot,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(Ot,"href","#transformers.TFViTMAEForPreTraining"),c(_t,"class","relative group"),c(Do,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.TFPreTrainedModel"),c(Eo,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),c(Eo,"rel","nofollow"),c(No,"href","/docs/transformers/v4.27.1/en/model_doc/vit_mae#transformers.TFViTMAEForPreTraining"),c(Fe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(ie,"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),f(o,w,_),f(o,u,_),e(u,g),e(g,T),$(l,T,null),e(u,h),e(u,P),e(P,xe),f(o,Ee,_),f(o,z,_),e(z,W),e(W,B),$(E,B,null),e(z,je),e(z,U),e(U,Ie),f(o,be,_),f(o,N,_),e(N,Ce),e(N,G),e(G,X),e(N,qe),f(o,ye,_),f(o,S,_),e(S,ze),f(o,$e,_),f(o,K,_),e(K,pe),e(pe,Oe),f(o,le,_),f(o,x,_),e(x,O),f(o,Me,_),f(o,C,_),e(C,Y),e(Y,De),e(Y,H),e(H,Ne),e(Y,Le),e(C,D),e(C,J),e(J,Q),e(J,de),e(de,Se),e(J,Z),e(C,Ke),e(C,ee),e(ee,R),e(ee,ce),e(ce,te),e(ee,He),e(C,fe),e(C,q),e(q,Ue),e(C,L),e(C,oe),e(oe,Re),e(oe,v),e(v,V),e(oe,et),f(o,he,_),f(o,me,_),f(o,F,_),f(o,ue,_),e(ue,tt),e(ue,Ae),e(Ae,ot),f(o,Ge,_),f(o,j,_),e(j,re),e(j,ge),e(ge,rt),e(j,se),e(j,_e),e(_e,st),e(j,We),e(j,ve),e(ve,Te),e(j,nt),e(j,Bt),e(Bt,os),e(j,rs),f(o,$r,_),f(o,at,_),e(at,Et),e(Et,Go),$(Gt,Go,null),e(at,ss),e(at,Xo),e(Xo,ns),f(o,Mr,_),f(o,ko,_),e(ko,as),f(o,Ar,_),f(o,bt,_),e(bt,yt),e(yt,Vo),e(Vo,is),e(yt,ls),e(yt,Xt),e(Xt,ds),e(yt,cs),e(bt,hs),e(bt,it),e(it,ms),e(it,Po),e(Po,ps),e(it,fs),e(it,Yt),e(Yt,us),e(it,gs),f(o,kr,_),f(o,Fo,_),e(Fo,_s),f(o,Vr,_),f(o,lt,_),e(lt,$t),e($t,Yo),$(Jt,Yo,null),e(lt,vs),e(lt,Jo),e(Jo,Ts),f(o,Pr,_),f(o,we,_),$(Qt,we,null),e(we,ws),e(we,dt),e(dt,Es),e(dt,xo),e(xo,bs),e(dt,ys),e(dt,Zt),e(Zt,$s),e(dt,Ms),e(we,As),e(we,ct),e(ct,ks),e(ct,jo),e(jo,Vs),e(ct,Ps),e(ct,Io),e(Io,Fs),e(ct,xs),e(we,js),$(Mt,we,null),f(o,Fr,_),f(o,ht,_),e(ht,At),e(At,Qo),$(eo,Qo,null),e(ht,Is),e(ht,Zo),e(Zo,Cs),f(o,xr,_),f(o,Be,_),$(to,Be,null),e(Be,qs),e(Be,oo),e(oo,zs),e(oo,ro),e(ro,Os),e(oo,Ds),e(Be,Ns),e(Be,ke),$(so,ke,null),e(ke,Ls),e(ke,mt),e(mt,Ss),e(mt,Co),e(Co,Ks),e(mt,Hs),e(mt,er),e(er,Us),e(mt,Rs),e(ke,Ws),$(kt,ke,null),e(ke,Bs),$(Vt,ke,null),f(o,jr,_),f(o,pt,_),e(pt,Pt),e(Pt,tr),$(no,tr,null),e(pt,Gs),e(pt,or),e(or,Xs),f(o,Ir,_),f(o,ne,_),$(ao,ne,null),e(ne,Ys),e(ne,rr),e(rr,Js),e(ne,Qs),$(Ft,ne,null),e(ne,Zs),e(ne,io),e(io,en),e(io,lo),e(lo,tn),e(io,on),e(ne,rn),e(ne,Ve),$(co,Ve,null),e(Ve,sn),e(Ve,ft),e(ft,nn),e(ft,qo),e(qo,an),e(ft,ln),e(ft,sr),e(sr,dn),e(ft,cn),e(Ve,hn),$(xt,Ve,null),e(Ve,mn),$(jt,Ve,null),f(o,Cr,_),f(o,ut,_),e(ut,It),e(It,nr),$(ho,nr,null),e(ut,pn),e(ut,ar),e(ar,fn),f(o,qr,_),f(o,ae,_),$(mo,ae,null),e(ae,un),e(ae,po),e(po,gn),e(po,zo),e(zo,_n),e(po,vn),e(ae,Tn),e(ae,fo),e(fo,wn),e(fo,uo),e(uo,En),e(fo,bn),e(ae,yn),$(Ct,ae,null),e(ae,$n),e(ae,Pe),$(go,Pe,null),e(Pe,Mn),e(Pe,gt),e(gt,An),e(gt,Oo),e(Oo,kn),e(gt,Vn),e(gt,ir),e(ir,Pn),e(gt,Fn),e(Pe,xn),$(qt,Pe,null),e(Pe,jn),$(zt,Pe,null),f(o,zr,_),f(o,_t,_),e(_t,Ot),e(Ot,lr),$(_o,lr,null),e(_t,In),e(_t,dr),e(dr,Cn),f(o,Or,_),f(o,ie,_),$(vo,ie,null),e(ie,qn),e(ie,To),e(To,zn),e(To,Do),e(Do,On),e(To,Dn),e(ie,Nn),e(ie,wo),e(wo,Ln),e(wo,Eo),e(Eo,Sn),e(wo,Kn),e(ie,Hn),$(Dt,ie,null),e(ie,Un),e(ie,Fe),$(bo,Fe,null),e(Fe,Rn),e(Fe,vt),e(vt,Wn),e(vt,No),e(No,Bn),e(vt,Gn),e(vt,cr),e(cr,Xn),e(vt,Yn),e(Fe,Jn),$(Nt,Fe,null),e(Fe,Qn),$(Lt,Fe,null),Dr=!0},p(o,[_]){const yo={};_&2&&(yo.$$scope={dirty:_,ctx:o}),Mt.$set(yo);const hr={};_&2&&(hr.$$scope={dirty:_,ctx:o}),kt.$set(hr);const mr={};_&2&&(mr.$$scope={dirty:_,ctx:o}),Vt.$set(mr);const pr={};_&2&&(pr.$$scope={dirty:_,ctx:o}),Ft.$set(pr);const $o={};_&2&&($o.$$scope={dirty:_,ctx:o}),xt.$set($o);const fr={};_&2&&(fr.$$scope={dirty:_,ctx:o}),jt.$set(fr);const ur={};_&2&&(ur.$$scope={dirty:_,ctx:o}),Ct.$set(ur);const gr={};_&2&&(gr.$$scope={dirty:_,ctx:o}),qt.$set(gr);const Mo={};_&2&&(Mo.$$scope={dirty:_,ctx:o}),zt.$set(Mo);const _r={};_&2&&(_r.$$scope={dirty:_,ctx:o}),Dt.$set(_r);const vr={};_&2&&(vr.$$scope={dirty:_,ctx:o}),Nt.$set(vr);const Tr={};_&2&&(Tr.$$scope={dirty:_,ctx:o}),Lt.$set(Tr)},i(o){Dr||(M(l.$$.fragment,o),M(E.$$.fragment,o),M(Gt.$$.fragment,o),M(Jt.$$.fragment,o),M(Qt.$$.fragment,o),M(Mt.$$.fragment,o),M(eo.$$.fragment,o),M(to.$$.fragment,o),M(so.$$.fragment,o),M(kt.$$.fragment,o),M(Vt.$$.fragment,o),M(no.$$.fragment,o),M(ao.$$.fragment,o),M(Ft.$$.fragment,o),M(co.$$.fragment,o),M(xt.$$.fragment,o),M(jt.$$.fragment,o),M(ho.$$.fragment,o),M(mo.$$.fragment,o),M(Ct.$$.fragment,o),M(go.$$.fragment,o),M(qt.$$.fragment,o),M(zt.$$.fragment,o),M(_o.$$.fragment,o),M(vo.$$.fragment,o),M(Dt.$$.fragment,o),M(bo.$$.fragment,o),M(Nt.$$.fragment,o),M(Lt.$$.fragment,o),Dr=!0)},o(o){A(l.$$.fragment,o),A(E.$$.fragment,o),A(Gt.$$.fragment,o),A(Jt.$$.fragment,o),A(Qt.$$.fragment,o),A(Mt.$$.fragment,o),A(eo.$$.fragment,o),A(to.$$.fragment,o),A(so.$$.fragment,o),A(kt.$$.fragment,o),A(Vt.$$.fragment,o),A(no.$$.fragment,o),A(ao.$$.fragment,o),A(Ft.$$.fragment,o),A(co.$$.fragment,o),A(xt.$$.fragment,o),A(jt.$$.fragment,o),A(ho.$$.fragment,o),A(mo.$$.fragment,o),A(Ct.$$.fragment,o),A(go.$$.fragment,o),A(qt.$$.fragment,o),A(zt.$$.fragment,o),A(_o.$$.fragment,o),A(vo.$$.fragment,o),A(Dt.$$.fragment,o),A(bo.$$.fragment,o),A(Nt.$$.fragment,o),A(Lt.$$.fragment,o),Dr=!1},d(o){t(d),o&&t(w),o&&t(u),k(l),o&&t(Ee),o&&t(z),k(E),o&&t(be),o&&t(N),o&&t(ye),o&&t(S),o&&t($e),o&&t(K),o&&t(le),o&&t(x),o&&t(Me),o&&t(C),o&&t(he),o&&t(me),o&&t(F),o&&t(ue),o&&t(Ge),o&&t(j),o&&t($r),o&&t(at),k(Gt),o&&t(Mr),o&&t(ko),o&&t(Ar),o&&t(bt),o&&t(kr),o&&t(Fo),o&&t(Vr),o&&t(lt),k(Jt),o&&t(Pr),o&&t(we),k(Qt),k(Mt),o&&t(Fr),o&&t(ht),k(eo),o&&t(xr),o&&t(Be),k(to),k(so),k(kt),k(Vt),o&&t(jr),o&&t(pt),k(no),o&&t(Ir),o&&t(ne),k(ao),k(Ft),k(co),k(xt),k(jt),o&&t(Cr),o&&t(ut),k(ho),o&&t(qr),o&&t(ae),k(mo),k(Ct),k(go),k(qt),k(zt),o&&t(zr),o&&t(_t),k(_o),o&&t(Or),o&&t(ie),k(vo),k(Dt),k(bo),k(Nt),k(Lt)}}}const wi={local:"vitmae",sections:[{local:"overview",title:"Overview"},{local:"resources",title:"Resources"},{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(I){return ai(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Vi extends ti{constructor(d){super();oi(this,d,Ei,Ti,ri,{})}}export{Vi as default,wi as metadata};
