import{S as Ca,i as qa,s as za,e as n,k as m,w as b,t as r,M as Oa,c as a,d as t,m as p,a as i,x as $,h as s,b as h,N as Da,G as e,g,y as M,q as A,o as k,B as V,v as Na,L as fr}from"../../chunks/vendor-hf-doc-builder.js";import{T as yo}from"../../chunks/Tip-hf-doc-builder.js";import{D as Tt}from"../../chunks/Docstring-hf-doc-builder.js";import{C as ur}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as bo}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as pr}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function La(I){let d,w,f,u,T;return u=new ur({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:"),f=m(),b(u.$$.fragment)},l(l){d=a(l,"P",{});var c=i(d);w=s(c,"Example:"),c.forEach(t),f=p(l),$(u.$$.fragment,l)},m(l,c){g(l,d,c),e(d,w),g(l,f,c),M(u,l,c),T=!0},p:fr,i(l){T||(A(u.$$.fragment,l),T=!0)},o(l){k(u.$$.fragment,l),T=!1},d(l){l&&t(d),l&&t(f),V(u,l)}}}function Sa(I){let d,w,f,u,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 "),f=n("code"),u=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 c=i(d);w=s(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a(c,"CODE",{});var P=i(f);u=s(P,"Module"),P.forEach(t),T=s(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(t)},m(l,c){g(l,d,c),e(d,w),e(d,f),e(f,u),e(d,T)},d(l){l&&t(d)}}}function Ka(I){let d,w,f,u,T;return u=new ur({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:"),f=m(),b(u.$$.fragment)},l(l){d=a(l,"P",{});var c=i(d);w=s(c,"Examples:"),c.forEach(t),f=p(l),$(u.$$.fragment,l)},m(l,c){g(l,d,c),e(d,w),g(l,f,c),M(u,l,c),T=!0},p:fr,i(l){T||(A(u.$$.fragment,l),T=!0)},o(l){k(u.$$.fragment,l),T=!1},d(l){l&&t(d),l&&t(f),V(u,l)}}}function Ha(I){let d,w,f,u,T;return{c(){d=n("p"),w=r("Note that we provide a script to pre-train this model on custom data in our "),f=n("a"),u=r(`examples
directory`),T=r("."),this.h()},l(l){d=a(l,"P",{});var c=i(d);w=s(c,"Note that we provide a script to pre-train this model on custom data in our "),f=a(c,"A",{href:!0,rel:!0});var P=i(f);u=s(P,`examples
directory`),P.forEach(t),T=s(c,"."),c.forEach(t),this.h()},h(){h(f,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/image-pretraining"),h(f,"rel","nofollow")},m(l,c){g(l,d,c),e(d,w),e(d,f),e(f,u),e(d,T)},d(l){l&&t(d)}}}function Ua(I){let d,w,f,u,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 "),f=n("code"),u=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 c=i(d);w=s(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a(c,"CODE",{});var P=i(f);u=s(P,"Module"),P.forEach(t),T=s(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(t)},m(l,c){g(l,d,c),e(d,w),e(d,f),e(f,u),e(d,T)},d(l){l&&t(d)}}}function Wa(I){let d,w,f,u,T;return u=new ur({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:"),f=m(),b(u.$$.fragment)},l(l){d=a(l,"P",{});var c=i(d);w=s(c,"Examples:"),c.forEach(t),f=p(l),$(u.$$.fragment,l)},m(l,c){g(l,d,c),e(d,w),g(l,f,c),M(u,l,c),T=!0},p:fr,i(l){T||(A(u.$$.fragment,l),T=!0)},o(l){k(u.$$.fragment,l),T=!1},d(l){l&&t(d),l&&t(f),V(u,l)}}}function Ra(I){let d,w,f,u,T,l,c,P,Pe,Te,q,Y,Z,E,Fe,W,xe,we,L,je,ee,te,Ie,Ee,K,Ce,ye,H,ue,qe,de,j,z,be,F,oe,ze,U,Oe,De,O,R,re,ce,Ne,se,ne,Le,B,Se,D,Ke,J,N,He,C,Ue,We;return{c(){d=n("p"),w=r("TensorFlow models and layers in "),f=n("code"),u=r("transformers"),T=r(" accept two formats as input:"),l=m(),c=n("ul"),P=n("li"),Pe=r("having all inputs as keyword arguments (like PyTorch models), or"),Te=m(),q=n("li"),Y=r("having all inputs as a list, tuple or dict in the first positional argument."),Z=m(),E=n("p"),Fe=r(`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),W=n("code"),xe=r("model.fit()"),we=r(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),L=n("code"),je=r("model.fit()"),ee=r(` supports! If, however, you want to use the second
format outside of Keras methods like `),te=n("code"),Ie=r("fit()"),Ee=r(" and "),K=n("code"),Ce=r("predict()"),ye=r(`, such as when creating your own layers or models with
the Keras `),H=n("code"),ue=r("Functional"),qe=r(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),de=m(),j=n("ul"),z=n("li"),be=r("a single Tensor with "),F=n("code"),oe=r("pixel_values"),ze=r(" only and nothing else: "),U=n("code"),Oe=r("model(pixel_values)"),De=m(),O=n("li"),R=r(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),re=n("code"),ce=r("model([pixel_values, attention_mask])"),Ne=r(" or "),se=n("code"),ne=r("model([pixel_values, attention_mask, token_type_ids])"),Le=m(),B=n("li"),Se=r(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),D=n("code"),Ke=r('model({"pixel_values": pixel_values, "token_type_ids": token_type_ids})'),J=m(),N=n("p"),He=r(`Note that when creating models and layers with
`),C=n("a"),Ue=r("subclassing"),We=r(` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),this.h()},l(v){d=a(v,"P",{});var y=i(d);w=s(y,"TensorFlow models and layers in "),f=a(y,"CODE",{});var Qe=i(f);u=s(Qe,"transformers"),Qe.forEach(t),T=s(y," accept two formats as input:"),y.forEach(t),l=p(v),c=a(v,"UL",{});var Q=i(c);P=a(Q,"LI",{});var Ze=i(P);Pe=s(Ze,"having all inputs as keyword arguments (like PyTorch models), or"),Ze.forEach(t),Te=p(Q),q=a(Q,"LI",{});var et=i(q);Y=s(et,"having all inputs as a list, tuple or dict in the first positional argument."),et.forEach(t),Q.forEach(t),Z=p(v),E=a(v,"P",{});var x=i(E);Fe=s(x,`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),W=a(x,"CODE",{});var ge=i(W);xe=s(ge,"model.fit()"),ge.forEach(t),we=s(x,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),L=a(x,"CODE",{});var tt=i(L);je=s(tt,"model.fit()"),tt.forEach(t),ee=s(x,` supports! If, however, you want to use the second
format outside of Keras methods like `),te=a(x,"CODE",{});var $e=i(te);Ie=s($e,"fit()"),$e.forEach(t),Ee=s(x," and "),K=a(x,"CODE",{});var ot=i(K);Ce=s(ot,"predict()"),ot.forEach(t),ye=s(x,`, such as when creating your own layers or models with
the Keras `),H=a(x,"CODE",{});var rt=i(H);ue=s(rt,"Functional"),rt.forEach(t),qe=s(x,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),x.forEach(t),de=p(v),j=a(v,"UL",{});var G=i(j);z=a(G,"LI",{});var X=i(z);be=s(X,"a single Tensor with "),F=a(X,"CODE",{});var st=i(F);oe=s(st,"pixel_values"),st.forEach(t),ze=s(X," only and nothing else: "),U=a(X,"CODE",{});var nt=i(U);Oe=s(nt,"model(pixel_values)"),nt.forEach(t),X.forEach(t),De=p(G),O=a(G,"LI",{});var S=i(O);R=s(S,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),re=a(S,"CODE",{});var at=i(re);ce=s(at,"model([pixel_values, attention_mask])"),at.forEach(t),Ne=s(S," or "),se=a(S,"CODE",{});var _e=i(se);ne=s(_e,"model([pixel_values, attention_mask, token_type_ids])"),_e.forEach(t),S.forEach(t),Le=p(G),B=a(G,"LI",{});var Re=i(B);Se=s(Re,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),D=a(Re,"CODE",{});var it=i(D);Ke=s(it,'model({"pixel_values": pixel_values, "token_type_ids": token_type_ids})'),it.forEach(t),Re.forEach(t),G.forEach(t),J=p(v),N=a(v,"P",{});var he=i(N);He=s(he,`Note that when creating models and layers with
`),C=a(he,"A",{href:!0,rel:!0});var me=i(C);Ue=s(me,"subclassing"),me.forEach(t),We=s(he,` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),he.forEach(t),this.h()},h(){h(C,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),h(C,"rel","nofollow")},m(v,y){g(v,d,y),e(d,w),e(d,f),e(f,u),e(d,T),g(v,l,y),g(v,c,y),e(c,P),e(P,Pe),e(c,Te),e(c,q),e(q,Y),g(v,Z,y),g(v,E,y),e(E,Fe),e(E,W),e(W,xe),e(E,we),e(E,L),e(L,je),e(E,ee),e(E,te),e(te,Ie),e(E,Ee),e(E,K),e(K,Ce),e(E,ye),e(E,H),e(H,ue),e(E,qe),g(v,de,y),g(v,j,y),e(j,z),e(z,be),e(z,F),e(F,oe),e(z,ze),e(z,U),e(U,Oe),e(j,De),e(j,O),e(O,R),e(O,re),e(re,ce),e(O,Ne),e(O,se),e(se,ne),e(j,Le),e(j,B),e(B,Se),e(B,D),e(D,Ke),g(v,J,y),g(v,N,y),e(N,He),e(N,C),e(C,Ue),e(N,We)},d(v){v&&t(d),v&&t(l),v&&t(c),v&&t(Z),v&&t(E),v&&t(de),v&&t(j),v&&t(J),v&&t(N)}}}function Ba(I){let d,w,f,u,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 "),f=n("code"),u=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 c=i(d);w=s(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a(c,"CODE",{});var P=i(f);u=s(P,"Module"),P.forEach(t),T=s(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(t)},m(l,c){g(l,d,c),e(d,w),e(d,f),e(f,u),e(d,T)},d(l){l&&t(d)}}}function Ga(I){let d,w,f,u,T;return u=new ur({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:"),f=m(),b(u.$$.fragment)},l(l){d=a(l,"P",{});var c=i(d);w=s(c,"Examples:"),c.forEach(t),f=p(l),$(u.$$.fragment,l)},m(l,c){g(l,d,c),e(d,w),g(l,f,c),M(u,l,c),T=!0},p:fr,i(l){T||(A(u.$$.fragment,l),T=!0)},o(l){k(u.$$.fragment,l),T=!1},d(l){l&&t(d),l&&t(f),V(u,l)}}}function Xa(I){let d,w,f,u,T,l,c,P,Pe,Te,q,Y,Z,E,Fe,W,xe,we,L,je,ee,te,Ie,Ee,K,Ce,ye,H,ue,qe,de,j,z,be,F,oe,ze,U,Oe,De,O,R,re,ce,Ne,se,ne,Le,B,Se,D,Ke,J,N,He,C,Ue,We;return{c(){d=n("p"),w=r("TensorFlow models and layers in "),f=n("code"),u=r("transformers"),T=r(" accept two formats as input:"),l=m(),c=n("ul"),P=n("li"),Pe=r("having all inputs as keyword arguments (like PyTorch models), or"),Te=m(),q=n("li"),Y=r("having all inputs as a list, tuple or dict in the first positional argument."),Z=m(),E=n("p"),Fe=r(`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),W=n("code"),xe=r("model.fit()"),we=r(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),L=n("code"),je=r("model.fit()"),ee=r(` supports! If, however, you want to use the second
format outside of Keras methods like `),te=n("code"),Ie=r("fit()"),Ee=r(" and "),K=n("code"),Ce=r("predict()"),ye=r(`, such as when creating your own layers or models with
the Keras `),H=n("code"),ue=r("Functional"),qe=r(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),de=m(),j=n("ul"),z=n("li"),be=r("a single Tensor with "),F=n("code"),oe=r("pixel_values"),ze=r(" only and nothing else: "),U=n("code"),Oe=r("model(pixel_values)"),De=m(),O=n("li"),R=r(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),re=n("code"),ce=r("model([pixel_values, attention_mask])"),Ne=r(" or "),se=n("code"),ne=r("model([pixel_values, attention_mask, token_type_ids])"),Le=m(),B=n("li"),Se=r(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),D=n("code"),Ke=r('model({"pixel_values": pixel_values, "token_type_ids": token_type_ids})'),J=m(),N=n("p"),He=r(`Note that when creating models and layers with
`),C=n("a"),Ue=r("subclassing"),We=r(` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),this.h()},l(v){d=a(v,"P",{});var y=i(d);w=s(y,"TensorFlow models and layers in "),f=a(y,"CODE",{});var Qe=i(f);u=s(Qe,"transformers"),Qe.forEach(t),T=s(y," accept two formats as input:"),y.forEach(t),l=p(v),c=a(v,"UL",{});var Q=i(c);P=a(Q,"LI",{});var Ze=i(P);Pe=s(Ze,"having all inputs as keyword arguments (like PyTorch models), or"),Ze.forEach(t),Te=p(Q),q=a(Q,"LI",{});var et=i(q);Y=s(et,"having all inputs as a list, tuple or dict in the first positional argument."),et.forEach(t),Q.forEach(t),Z=p(v),E=a(v,"P",{});var x=i(E);Fe=s(x,`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),W=a(x,"CODE",{});var ge=i(W);xe=s(ge,"model.fit()"),ge.forEach(t),we=s(x,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),L=a(x,"CODE",{});var tt=i(L);je=s(tt,"model.fit()"),tt.forEach(t),ee=s(x,` supports! If, however, you want to use the second
format outside of Keras methods like `),te=a(x,"CODE",{});var $e=i(te);Ie=s($e,"fit()"),$e.forEach(t),Ee=s(x," and "),K=a(x,"CODE",{});var ot=i(K);Ce=s(ot,"predict()"),ot.forEach(t),ye=s(x,`, such as when creating your own layers or models with
the Keras `),H=a(x,"CODE",{});var rt=i(H);ue=s(rt,"Functional"),rt.forEach(t),qe=s(x,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),x.forEach(t),de=p(v),j=a(v,"UL",{});var G=i(j);z=a(G,"LI",{});var X=i(z);be=s(X,"a single Tensor with "),F=a(X,"CODE",{});var st=i(F);oe=s(st,"pixel_values"),st.forEach(t),ze=s(X," only and nothing else: "),U=a(X,"CODE",{});var nt=i(U);Oe=s(nt,"model(pixel_values)"),nt.forEach(t),X.forEach(t),De=p(G),O=a(G,"LI",{});var S=i(O);R=s(S,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),re=a(S,"CODE",{});var at=i(re);ce=s(at,"model([pixel_values, attention_mask])"),at.forEach(t),Ne=s(S," or "),se=a(S,"CODE",{});var _e=i(se);ne=s(_e,"model([pixel_values, attention_mask, token_type_ids])"),_e.forEach(t),S.forEach(t),Le=p(G),B=a(G,"LI",{});var Re=i(B);Se=s(Re,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),D=a(Re,"CODE",{});var it=i(D);Ke=s(it,'model({"pixel_values": pixel_values, "token_type_ids": token_type_ids})'),it.forEach(t),Re.forEach(t),G.forEach(t),J=p(v),N=a(v,"P",{});var he=i(N);He=s(he,`Note that when creating models and layers with
`),C=a(he,"A",{href:!0,rel:!0});var me=i(C);Ue=s(me,"subclassing"),me.forEach(t),We=s(he,` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),he.forEach(t),this.h()},h(){h(C,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),h(C,"rel","nofollow")},m(v,y){g(v,d,y),e(d,w),e(d,f),e(f,u),e(d,T),g(v,l,y),g(v,c,y),e(c,P),e(P,Pe),e(c,Te),e(c,q),e(q,Y),g(v,Z,y),g(v,E,y),e(E,Fe),e(E,W),e(W,xe),e(E,we),e(E,L),e(L,je),e(E,ee),e(E,te),e(te,Ie),e(E,Ee),e(E,K),e(K,Ce),e(E,ye),e(E,H),e(H,ue),e(E,qe),g(v,de,y),g(v,j,y),e(j,z),e(z,be),e(z,F),e(F,oe),e(z,ze),e(z,U),e(U,Oe),e(j,De),e(j,O),e(O,R),e(O,re),e(re,ce),e(O,Ne),e(O,se),e(se,ne),e(j,Le),e(j,B),e(B,Se),e(B,D),e(D,Ke),g(v,J,y),g(v,N,y),e(N,He),e(N,C),e(C,Ue),e(N,We)},d(v){v&&t(d),v&&t(l),v&&t(c),v&&t(Z),v&&t(E),v&&t(de),v&&t(j),v&&t(J),v&&t(N)}}}function Ya(I){let d,w,f,u,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 "),f=n("code"),u=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 c=i(d);w=s(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a(c,"CODE",{});var P=i(f);u=s(P,"Module"),P.forEach(t),T=s(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(t)},m(l,c){g(l,d,c),e(d,w),e(d,f),e(f,u),e(d,T)},d(l){l&&t(d)}}}function Ja(I){let d,w,f,u,T;return u=new ur({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:"),f=m(),b(u.$$.fragment)},l(l){d=a(l,"P",{});var c=i(d);w=s(c,"Examples:"),c.forEach(t),f=p(l),$(u.$$.fragment,l)},m(l,c){g(l,d,c),e(d,w),g(l,f,c),M(u,l,c),T=!0},p:fr,i(l){T||(A(u.$$.fragment,l),T=!0)},o(l){k(u.$$.fragment,l),T=!1},d(l){l&&t(d),l&&t(f),V(u,l)}}}function Qa(I){let d,w,f,u,T,l,c,P,Pe,Te,q,Y,Z,E,Fe,W,xe,we,L,je,ee,te,Ie,Ee,K,Ce,ye,H,ue,qe,de,j,z,be,F,oe,ze,U,Oe,De,O,R,re,ce,Ne,se,ne,Le,B,Se,D,Ke,J,N,He,C,Ue,We,v,y,Qe,Q,Ze,et,x,ge,tt,$e,ot,rt,G,X,st,nt,S,at,_e,Re,it,he,me,On,gr,Kt,Ur,$o,Wr,_r,pe,Rr,Ht,Br,Gr,Ut,Xr,Yr,Wt,Jr,Qr,Rt,Zr,es,vr,lt,wt,Ho,Bt,ts,Uo,os,Tr,ve,Gt,rs,dt,ss,Mo,ns,as,Xt,is,ls,ds,ct,cs,Ao,hs,ms,ko,ps,fs,us,Et,wr,ht,yt,Wo,Yt,gs,Ro,_s,Er,Be,Jt,vs,Qt,Ts,Zt,ws,Es,ys,Me,eo,bs,mt,$s,Vo,Ms,As,Bo,ks,Vs,Ps,bt,Fs,$t,yr,pt,Mt,Go,to,xs,Xo,js,br,ae,oo,Is,Yo,Cs,qs,At,zs,ro,Os,so,Ds,Ns,Ls,Ae,no,Ss,ft,Ks,Po,Hs,Us,Jo,Ws,Rs,Bs,kt,Gs,Vt,$r,ut,Pt,Qo,ao,Xs,Zo,Ys,Mr,ie,io,Js,lo,Qs,Fo,Zs,en,tn,co,on,ho,rn,sn,nn,Ft,an,ke,mo,ln,gt,dn,xo,cn,hn,er,mn,pn,fn,xt,un,jt,Ar,_t,It,tr,po,gn,or,_n,kr,le,fo,vn,uo,Tn,jo,wn,En,yn,go,bn,_o,$n,Mn,An,Ct,kn,Ve,vo,Vn,vt,Pn,Io,Fn,xn,rr,jn,In,Cn,qt,qn,zt,Vr;return l=new bo({}),E=new bo({}),Bt=new bo({}),Gt=new Tt({props:{name:"class transformers.ViTMAEConfig",anchor:"transformers.ViTMAEConfig",parameters:[{name:"hidden_size",val:" = 768"},{name:"num_hidden_layers",val:" = 12"},{name:"num_attention_heads",val:" = 12"},{name:"intermediate_size",val:" = 3072"},{name:"hidden_act",val:" = 'gelu'"},{name:"hidden_dropout_prob",val:" = 0.0"},{name:"attention_probs_dropout_prob",val:" = 0.0"},{name:"initializer_range",val:" = 0.02"},{name:"layer_norm_eps",val:" = 1e-12"},{name:"is_encoder_decoder",val:" = False"},{name:"image_size",val:" = 224"},{name:"patch_size",val:" = 16"},{name:"num_channels",val:" = 3"},{name:"qkv_bias",val:" = True"},{name:"decoder_num_attention_heads",val:" = 16"},{name:"decoder_hidden_size",val:" = 512"},{name:"decoder_num_hidden_layers",val:" = 8"},{name:"decoder_intermediate_size",val:" = 2048"},{name:"mask_ratio",val:" = 0.75"},{name:"norm_pix_loss",val:" = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.ViTMAEConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 768) &#x2014;
Dimensionality of the encoder layers and the pooler layer.`,name:"hidden_size"},{anchor:"transformers.ViTMAEConfig.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"num_hidden_layers"},{anchor:"transformers.ViTMAEConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"num_attention_heads"},{anchor:"transformers.ViTMAEConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 3072) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (i.e., feed-forward) layer in the Transformer encoder.`,name:"intermediate_size"},{anchor:"transformers.ViTMAEConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;gelu&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the encoder and pooler. If string, <code>&quot;gelu&quot;</code>,
<code>&quot;relu&quot;</code>, <code>&quot;selu&quot;</code> and <code>&quot;gelu_new&quot;</code> are supported.`,name:"hidden_act"},{anchor:"transformers.ViTMAEConfig.hidden_dropout_prob",description:`<strong>hidden_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout probabilitiy for all fully connected layers in the embeddings, encoder, and pooler.`,name:"hidden_dropout_prob"},{anchor:"transformers.ViTMAEConfig.attention_probs_dropout_prob",description:`<strong>attention_probs_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout ratio for the attention probabilities.`,name:"attention_probs_dropout_prob"},{anchor:"transformers.ViTMAEConfig.initializer_range",description:`<strong>initializer_range</strong> (<code>float</code>, <em>optional</em>, defaults to 0.02) &#x2014;
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.`,name:"initializer_range"},{anchor:"transformers.ViTMAEConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-12) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.ViTMAEConfig.image_size",description:`<strong>image_size</strong> (<code>int</code>, <em>optional</em>, defaults to 224) &#x2014;
The size (resolution) of each image.`,name:"image_size"},{anchor:"transformers.ViTMAEConfig.patch_size",description:`<strong>patch_size</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014;
The size (resolution) of each patch.`,name:"patch_size"},{anchor:"transformers.ViTMAEConfig.num_channels",description:`<strong>num_channels</strong> (<code>int</code>, <em>optional</em>, defaults to 3) &#x2014;
The number of input channels.`,name:"num_channels"},{anchor:"transformers.ViTMAEConfig.qkv_bias",description:`<strong>qkv_bias</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to add a bias to the queries, keys and values.`,name:"qkv_bias"},{anchor:"transformers.ViTMAEConfig.decoder_num_attention_heads",description:`<strong>decoder_num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of attention heads for each attention layer in the decoder.`,name:"decoder_num_attention_heads"},{anchor:"transformers.ViTMAEConfig.decoder_hidden_size",description:`<strong>decoder_hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
Dimensionality of the decoder.`,name:"decoder_hidden_size"},{anchor:"transformers.ViTMAEConfig.decoder_num_hidden_layers",description:`<strong>decoder_num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 8) &#x2014;
Number of hidden layers in the decoder.`,name:"decoder_num_hidden_layers"},{anchor:"transformers.ViTMAEConfig.decoder_intermediate_size",description:`<strong>decoder_intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 2048) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (i.e., feed-forward) layer in the decoder.`,name:"decoder_intermediate_size"},{anchor:"transformers.ViTMAEConfig.mask_ratio",description:`<strong>mask_ratio</strong> (<code>float</code>, <em>optional</em>, defaults to 0.75) &#x2014;
The ratio of the number of masked tokens in the input sequence.`,name:"mask_ratio"},{anchor:"transformers.ViTMAEConfig.norm_pix_loss",description:`<strong>norm_pix_loss</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to train with normalized pixels (see Table 3 in the paper). Using normalized pixels improved
representation quality in the experiments of the authors.`,name:"norm_pix_loss"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/vit_mae/configuration_vit_mae.py#L29"}}),Et=new pr({props:{anchor:"transformers.ViTMAEConfig.example",$$slots:{default:[La]},$$scope:{ctx:I}}}),Yt=new bo({}),Jt=new Tt({props:{name:"class transformers.ViTMAEModel",anchor:"transformers.ViTMAEModel",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.ViTMAEModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.25.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.25.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.25.1/src/transformers/models/vit_mae/modeling_vit_mae.py#L639"}}),eo=new Tt({props:{name:"forward",anchor:"transformers.ViTMAEModel.forward",parameters:[{name:"pixel_values",val:": typing.Optional[torch.FloatTensor] = None"},{name:"noise",val:": typing.Optional[torch.FloatTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.ViTMAEModel.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/v4.25.1/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<code>AutoImageProcessor.__call__()</code> for details.`,name:"pixel_values"},{anchor:"transformers.ViTMAEModel.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.ViTMAEModel.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.ViTMAEModel.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.ViTMAEModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.25.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.25.1/src/transformers/models/vit_mae/modeling_vit_mae.py#L663",returnDescription:`
<p>A <code>transformers.models.vit_mae.modeling_vit_mae.ViTMAEModelOutput</code> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.25.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>
`}}),bt=new yo({props:{$$slots:{default:[Sa]},$$scope:{ctx:I}}}),$t=new pr({props:{anchor:"transformers.ViTMAEModel.forward.example",$$slots:{default:[Ka]},$$scope:{ctx:I}}}),to=new bo({}),oo=new Tt({props:{name:"class transformers.ViTMAEForPreTraining",anchor:"transformers.ViTMAEForPreTraining",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.ViTMAEForPreTraining.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.25.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.25.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.25.1/src/transformers/models/vit_mae/modeling_vit_mae.py#L851"}}),At=new yo({props:{$$slots:{default:[Ha]},$$scope:{ctx:I}}}),no=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.25.1/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<code>AutoImageProcessor.__call__()</code> for details.`,name:"pixel_values"},{anchor:"transformers.ViTMAEForPreTraining.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.ViTMAEForPreTraining.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.ViTMAEForPreTraining.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.ViTMAEForPreTraining.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.25.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.25.1/src/transformers/models/vit_mae/modeling_vit_mae.py#L964",returnDescription:`
<p>A <code>transformers.models.vit_mae.modeling_vit_mae.ViTMAEForPreTrainingOutput</code> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.25.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>
`}}),kt=new yo({props:{$$slots:{default:[Ua]},$$scope:{ctx:I}}}),Vt=new pr({props:{anchor:"transformers.ViTMAEForPreTraining.forward.example",$$slots:{default:[Wa]},$$scope:{ctx:I}}}),ao=new bo({}),io=new Tt({props:{name:"class transformers.TFViTMAEModel",anchor:"transformers.TFViTMAEModel",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFViTMAEModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.25.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.25.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.25.1/src/transformers/models/vit_mae/modeling_tf_vit_mae.py#L805"}}),Ft=new yo({props:{$$slots:{default:[Ra]},$$scope:{ctx:I}}}),mo=new Tt({props:{name:"call",anchor:"transformers.TFViTMAEModel.call",parameters:[{name:"pixel_values",val:": typing.Union[typing.List[tensorflow.python.framework.ops.Tensor], typing.List[numpy.ndarray], typing.List[tensorflow.python.keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, tensorflow.python.keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, tensorflow.python.keras.engine.keras_tensor.KerasTensor, NoneType] = None"},{name:"noise",val:": Tensor = None"},{name:"head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"training",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TFViTMAEModel.call.pixel_values",description:`<strong>pixel_values</strong> (<code>np.ndarray</code>, <code>tf.Tensor</code>, <code>List[tf.Tensor]</code> \`<code>Dict[str, tf.Tensor]</code> or <code>Dict[str, np.ndarray]</code> and each example must have the shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/v4.25.1/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<code>AutoImageProcessor.__call__()</code> for details.`,name:"pixel_values"},{anchor:"transformers.TFViTMAEModel.call.head_mask",description:`<strong>head_mask</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TFViTMAEModel.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFViTMAEModel.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFViTMAEModel.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.25.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.25.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.25.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>
`}}),xt=new yo({props:{$$slots:{default:[Ba]},$$scope:{ctx:I}}}),jt=new pr({props:{anchor:"transformers.TFViTMAEModel.call.example",$$slots:{default:[Ga]},$$scope:{ctx:I}}}),po=new bo({}),fo=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.25.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.25.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.25.1/src/transformers/models/vit_mae/modeling_tf_vit_mae.py#L978"}}),Ct=new yo({props:{$$slots:{default:[Xa]},$$scope:{ctx:I}}}),vo=new Tt({props:{name:"call",anchor:"transformers.TFViTMAEForPreTraining.call",parameters:[{name:"pixel_values",val:": typing.Union[typing.List[tensorflow.python.framework.ops.Tensor], typing.List[numpy.ndarray], typing.List[tensorflow.python.keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, tensorflow.python.keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, tensorflow.python.keras.engine.keras_tensor.KerasTensor, NoneType] = None"},{name:"noise",val:": Tensor = None"},{name:"head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"training",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TFViTMAEForPreTraining.call.pixel_values",description:`<strong>pixel_values</strong> (<code>np.ndarray</code>, <code>tf.Tensor</code>, <code>List[tf.Tensor]</code> \`<code>Dict[str, tf.Tensor]</code> or <code>Dict[str, np.ndarray]</code> and each example must have the shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/v4.25.1/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<code>AutoImageProcessor.__call__()</code> for details.`,name:"pixel_values"},{anchor:"transformers.TFViTMAEForPreTraining.call.head_mask",description:`<strong>head_mask</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TFViTMAEForPreTraining.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFViTMAEForPreTraining.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFViTMAEForPreTraining.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.25.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.25.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.25.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>
`}}),qt=new yo({props:{$$slots:{default:[Ya]},$$scope:{ctx:I}}}),zt=new pr({props:{anchor:"transformers.TFViTMAEForPreTraining.call.example",$$slots:{default:[Ja]},$$scope:{ctx:I}}}),{c(){d=n("meta"),w=m(),f=n("h1"),u=n("a"),T=n("span"),b(l.$$.fragment),c=m(),P=n("span"),Pe=r("ViTMAE"),Te=m(),q=n("h2"),Y=n("a"),Z=n("span"),b(E.$$.fragment),Fe=m(),W=n("span"),xe=r("Overview"),we=m(),L=n("p"),je=r("The ViTMAE model was proposed in "),ee=n("a"),te=r("Masked Autoencoders Are Scalable Vision Learners"),Ie=r(` by Kaiming He, Xinlei Chen, Saining Xie, Yanghao Li,
Piotr Doll\xE1r, Ross Girshick. The paper shows that, by pre-training a Vision Transformer (ViT) to reconstruct pixel values for masked patches, one can get results after
fine-tuning that outperform supervised pre-training.`),Ee=m(),K=n("p"),Ce=r("The abstract from the paper is the following:"),ye=m(),H=n("p"),ue=n("em"),qe=r(`This paper shows that masked autoencoders (MAE) are scalable self-supervised learners for computer vision. Our MAE approach is simple: we mask random patches of the
input image and reconstruct the missing pixels. It is based on two core designs. First, we develop an asymmetric encoder-decoder architecture, with an encoder that operates
only on the visible subset of patches (without mask tokens), along with a lightweight decoder that reconstructs the original image from the latent representation and mask
tokens. Second, we find that masking a high proportion of the input image, e.g., 75%, yields a nontrivial and meaningful self-supervisory task. Coupling these two designs
enables us to train large models efficiently and effectively: we accelerate training (by 3x or more) and improve accuracy. Our scalable approach allows for learning high-capacity
models that generalize well: e.g., a vanilla ViT-Huge model achieves the best accuracy (87.8%) among methods that use only ImageNet-1K data. Transfer performance in downstream
tasks outperforms supervised pre-training and shows promising scaling behavior.`),de=m(),j=n("p"),z=r("Tips:"),be=m(),F=n("ul"),oe=n("li"),ze=r(`MAE (masked auto encoding) is a method for self-supervised pre-training of Vision Transformers (ViTs). The pre-training objective is relatively simple:
by masking a large portion (75%) of the image patches, the model must reconstruct raw pixel values. One can use `),U=n("a"),Oe=r("ViTMAEForPreTraining"),De=r(" for this purpose."),O=m(),R=n("li"),re=r("An example Python script that illustrates how to pre-train "),ce=n("a"),Ne=r("ViTMAEForPreTraining"),se=r(" from scratch can be found "),ne=n("a"),Le=r("here"),B=r(`.
One can easily tweak it for their own use case.`),Se=m(),D=n("li"),Ke=r("A notebook that illustrates how to visualize reconstructed pixel values with "),J=n("a"),N=r("ViTMAEForPreTraining"),He=r(" can be found "),C=n("a"),Ue=r("here"),We=r("."),v=m(),y=n("li"),Qe=r(`After pre-training, one \u201Cthrows away\u201D the decoder used to reconstruct pixels, and one uses the encoder for fine-tuning/linear probing. This means that after
fine-tuning, one can directly plug in the weights into a `),Q=n("a"),Ze=r("ViTForImageClassification"),et=r("."),x=m(),ge=n("li"),tt=r("One can use "),$e=n("a"),ot=r("ViTImageProcessor"),rt=r(" to prepare images for the model. See the code examples for more info."),G=m(),X=n("li"),st=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.`),nt=m(),S=n("li"),at=r("For a visual understanding of how MAEs work you can check out this "),_e=n("a"),Re=r("post"),it=r("."),he=m(),me=n("img"),gr=m(),Kt=n("small"),Ur=r("MAE architecture. Taken from the "),$o=n("a"),Wr=r("original paper."),_r=m(),pe=n("p"),Rr=r("This model was contributed by "),Ht=n("a"),Br=r("nielsr"),Gr=r(". TensorFlow version of the model was contributed by "),Ut=n("a"),Xr=r("sayakpaul"),Yr=r(` and
`),Wt=n("a"),Jr=r("ariG23498"),Qr=r(" (equal contribution). The original code can be found "),Rt=n("a"),Zr=r("here"),es=r("."),vr=m(),lt=n("h2"),wt=n("a"),Ho=n("span"),b(Bt.$$.fragment),ts=m(),Uo=n("span"),os=r("ViTMAEConfig"),Tr=m(),ve=n("div"),b(Gt.$$.fragment),rs=m(),dt=n("p"),ss=r("This is the configuration class to store the configuration of a "),Mo=n("a"),ns=r("ViTMAEModel"),as=r(`. It is used to instantiate an ViT
MAE model according to the specified arguments, defining the model architecture. Instantiating a configuration with
the defaults will yield a similar configuration to that of the ViT
`),Xt=n("a"),is=r("facebook/vit-mae-base"),ls=r(" architecture."),ds=m(),ct=n("p"),cs=r("Configuration objects inherit from "),Ao=n("a"),hs=r("PretrainedConfig"),ms=r(` and can be used to control the model outputs. Read the
documentation from `),ko=n("a"),ps=r("PretrainedConfig"),fs=r(" for more information."),us=m(),b(Et.$$.fragment),wr=m(),ht=n("h2"),yt=n("a"),Wo=n("span"),b(Yt.$$.fragment),gs=m(),Ro=n("span"),_s=r("ViTMAEModel"),Er=m(),Be=n("div"),b(Jt.$$.fragment),vs=m(),Qt=n("p"),Ts=r(`The bare ViTMAE Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),Zt=n("a"),ws=r("torch.nn.Module"),Es=r(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),ys=m(),Me=n("div"),b(eo.$$.fragment),bs=m(),mt=n("p"),$s=r("The "),Vo=n("a"),Ms=r("ViTMAEModel"),As=r(" forward method, overrides the "),Bo=n("code"),ks=r("__call__"),Vs=r(" special method."),Ps=m(),b(bt.$$.fragment),Fs=m(),b($t.$$.fragment),yr=m(),pt=n("h2"),Mt=n("a"),Go=n("span"),b(to.$$.fragment),xs=m(),Xo=n("span"),js=r("ViTMAEForPreTraining"),br=m(),ae=n("div"),b(oo.$$.fragment),Is=m(),Yo=n("p"),Cs=r("The ViTMAE Model transformer with the decoder on top for self-supervised pre-training."),qs=m(),b(At.$$.fragment),zs=m(),ro=n("p"),Os=r("This model is a PyTorch "),so=n("a"),Ds=r("torch.nn.Module"),Ns=r(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Ls=m(),Ae=n("div"),b(no.$$.fragment),Ss=m(),ft=n("p"),Ks=r("The "),Po=n("a"),Hs=r("ViTMAEForPreTraining"),Us=r(" forward method, overrides the "),Jo=n("code"),Ws=r("__call__"),Rs=r(" special method."),Bs=m(),b(kt.$$.fragment),Gs=m(),b(Vt.$$.fragment),$r=m(),ut=n("h2"),Pt=n("a"),Qo=n("span"),b(ao.$$.fragment),Xs=m(),Zo=n("span"),Ys=r("TFViTMAEModel"),Mr=m(),ie=n("div"),b(io.$$.fragment),Js=m(),lo=n("p"),Qs=r(`The bare ViTMAE Model transformer outputting raw hidden-states without any specific head on top.
This model inherits from `),Fo=n("a"),Zs=r("TFPreTrainedModel"),en=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(),co=n("p"),on=r("This model is also a "),ho=n("a"),rn=r("tf.keras.Model"),sn=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.`),nn=m(),b(Ft.$$.fragment),an=m(),ke=n("div"),b(mo.$$.fragment),ln=m(),gt=n("p"),dn=r("The "),xo=n("a"),cn=r("TFViTMAEModel"),hn=r(" forward method, overrides the "),er=n("code"),mn=r("__call__"),pn=r(" special method."),fn=m(),b(xt.$$.fragment),un=m(),b(jt.$$.fragment),Ar=m(),_t=n("h2"),It=n("a"),tr=n("span"),b(po.$$.fragment),gn=m(),or=n("span"),_n=r("TFViTMAEForPreTraining"),kr=m(),le=n("div"),b(fo.$$.fragment),vn=m(),uo=n("p"),Tn=r(`The ViTMAE Model transformer with the decoder on top for self-supervised pre-training.
This model inherits from `),jo=n("a"),wn=r("TFPreTrainedModel"),En=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.)`),yn=m(),go=n("p"),bn=r("This model is also a "),_o=n("a"),$n=r("tf.keras.Model"),Mn=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.`),An=m(),b(Ct.$$.fragment),kn=m(),Ve=n("div"),b(vo.$$.fragment),Vn=m(),vt=n("p"),Pn=r("The "),Io=n("a"),Fn=r("TFViTMAEForPreTraining"),xn=r(" forward method, overrides the "),rr=n("code"),jn=r("__call__"),In=r(" special method."),Cn=m(),b(qt.$$.fragment),qn=m(),b(zt.$$.fragment),this.h()},l(o){const _=Oa('[data-svelte="svelte-1phssyn"]',document.head);d=a(_,"META",{name:!0,content:!0}),_.forEach(t),w=p(o),f=a(o,"H1",{class:!0});var To=i(f);u=a(To,"A",{id:!0,class:!0,href:!0});var sr=i(u);T=a(sr,"SPAN",{});var nr=i(T);$(l.$$.fragment,nr),nr.forEach(t),sr.forEach(t),c=p(To),P=a(To,"SPAN",{});var ar=i(P);Pe=s(ar,"ViTMAE"),ar.forEach(t),To.forEach(t),Te=p(o),q=a(o,"H2",{class:!0});var wo=i(q);Y=a(wo,"A",{id:!0,class:!0,href:!0});var ir=i(Y);Z=a(ir,"SPAN",{});var lr=i(Z);$(E.$$.fragment,lr),lr.forEach(t),ir.forEach(t),Fe=p(wo),W=a(wo,"SPAN",{});var dr=i(W);xe=s(dr,"Overview"),dr.forEach(t),wo.forEach(t),we=p(o),L=a(o,"P",{});var Eo=i(L);je=s(Eo,"The ViTMAE model was proposed in "),ee=a(Eo,"A",{href:!0,rel:!0});var cr=i(ee);te=s(cr,"Masked Autoencoders Are Scalable Vision Learners"),cr.forEach(t),Ie=s(Eo,` by Kaiming He, Xinlei Chen, Saining Xie, Yanghao Li,
Piotr Doll\xE1r, Ross Girshick. The paper shows that, by pre-training a Vision Transformer (ViT) to reconstruct pixel values for masked patches, one can get results after
fine-tuning that outperform supervised pre-training.`),Eo.forEach(t),Ee=p(o),K=a(o,"P",{});var hr=i(K);Ce=s(hr,"The abstract from the paper is the following:"),hr.forEach(t),ye=p(o),H=a(o,"P",{});var mr=i(H);ue=a(mr,"EM",{});var Dn=i(ue);qe=s(Dn,`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.`),Dn.forEach(t),mr.forEach(t),de=p(o),j=a(o,"P",{});var Nn=i(j);z=s(Nn,"Tips:"),Nn.forEach(t),be=p(o),F=a(o,"UL",{});var fe=i(F);oe=a(fe,"LI",{});var Pr=i(oe);ze=s(Pr,`MAE (masked auto encoding) is a method for self-supervised pre-training of Vision Transformers (ViTs). The pre-training objective is relatively simple:
by masking a large portion (75%) of the image patches, the model must reconstruct raw pixel values. One can use `),U=a(Pr,"A",{href:!0});var Ln=i(U);Oe=s(Ln,"ViTMAEForPreTraining"),Ln.forEach(t),De=s(Pr," for this purpose."),Pr.forEach(t),O=p(fe),R=a(fe,"LI",{});var Co=i(R);re=s(Co,"An example Python script that illustrates how to pre-train "),ce=a(Co,"A",{href:!0});var Sn=i(ce);Ne=s(Sn,"ViTMAEForPreTraining"),Sn.forEach(t),se=s(Co," from scratch can be found "),ne=a(Co,"A",{href:!0,rel:!0});var Kn=i(ne);Le=s(Kn,"here"),Kn.forEach(t),B=s(Co,`.
One can easily tweak it for their own use case.`),Co.forEach(t),Se=p(fe),D=a(fe,"LI",{});var qo=i(D);Ke=s(qo,"A notebook that illustrates how to visualize reconstructed pixel values with "),J=a(qo,"A",{href:!0});var Hn=i(J);N=s(Hn,"ViTMAEForPreTraining"),Hn.forEach(t),He=s(qo," can be found "),C=a(qo,"A",{href:!0,rel:!0});var Un=i(C);Ue=s(Un,"here"),Un.forEach(t),We=s(qo,"."),qo.forEach(t),v=p(fe),y=a(fe,"LI",{});var Fr=i(y);Qe=s(Fr,`After pre-training, one \u201Cthrows away\u201D the decoder used to reconstruct pixels, and one uses the encoder for fine-tuning/linear probing. This means that after
fine-tuning, one can directly plug in the weights into a `),Q=a(Fr,"A",{href:!0});var Wn=i(Q);Ze=s(Wn,"ViTForImageClassification"),Wn.forEach(t),et=s(Fr,"."),Fr.forEach(t),x=p(fe),ge=a(fe,"LI",{});var xr=i(ge);tt=s(xr,"One can use "),$e=a(xr,"A",{href:!0});var Rn=i($e);ot=s(Rn,"ViTImageProcessor"),Rn.forEach(t),rt=s(xr," to prepare images for the model. See the code examples for more info."),xr.forEach(t),G=p(fe),X=a(fe,"LI",{});var Bn=i(X);st=s(Bn,`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.`),Bn.forEach(t),nt=p(fe),S=a(fe,"LI",{});var jr=i(S);at=s(jr,"For a visual understanding of how MAEs work you can check out this "),_e=a(jr,"A",{href:!0,rel:!0});var Gn=i(_e);Re=s(Gn,"post"),Gn.forEach(t),it=s(jr,"."),jr.forEach(t),fe.forEach(t),he=p(o),me=a(o,"IMG",{src:!0,alt:!0,width:!0}),gr=p(o),Kt=a(o,"SMALL",{});var zn=i(Kt);Ur=s(zn,"MAE architecture. Taken from the "),$o=a(zn,"A",{href:!0});var Xn=i($o);Wr=s(Xn,"original paper."),Xn.forEach(t),zn.forEach(t),_r=p(o),pe=a(o,"P",{});var Ge=i(pe);Rr=s(Ge,"This model was contributed by "),Ht=a(Ge,"A",{href:!0,rel:!0});var Yn=i(Ht);Br=s(Yn,"nielsr"),Yn.forEach(t),Gr=s(Ge,". TensorFlow version of the model was contributed by "),Ut=a(Ge,"A",{href:!0,rel:!0});var Jn=i(Ut);Xr=s(Jn,"sayakpaul"),Jn.forEach(t),Yr=s(Ge,` and
`),Wt=a(Ge,"A",{href:!0,rel:!0});var Qn=i(Wt);Jr=s(Qn,"ariG23498"),Qn.forEach(t),Qr=s(Ge," (equal contribution). The original code can be found "),Rt=a(Ge,"A",{href:!0,rel:!0});var Zn=i(Rt);Zr=s(Zn,"here"),Zn.forEach(t),es=s(Ge,"."),Ge.forEach(t),vr=p(o),lt=a(o,"H2",{class:!0});var Ir=i(lt);wt=a(Ir,"A",{id:!0,class:!0,href:!0});var ea=i(wt);Ho=a(ea,"SPAN",{});var ta=i(Ho);$(Bt.$$.fragment,ta),ta.forEach(t),ea.forEach(t),ts=p(Ir),Uo=a(Ir,"SPAN",{});var oa=i(Uo);os=s(oa,"ViTMAEConfig"),oa.forEach(t),Ir.forEach(t),Tr=p(o),ve=a(o,"DIV",{class:!0});var Ot=i(ve);$(Gt.$$.fragment,Ot),rs=p(Ot),dt=a(Ot,"P",{});var zo=i(dt);ss=s(zo,"This is the configuration class to store the configuration of a "),Mo=a(zo,"A",{href:!0});var ra=i(Mo);ns=s(ra,"ViTMAEModel"),ra.forEach(t),as=s(zo,`. It is used to instantiate an ViT
MAE model according to the specified arguments, defining the model architecture. Instantiating a configuration with
the defaults will yield a similar configuration to that of the ViT
`),Xt=a(zo,"A",{href:!0,rel:!0});var sa=i(Xt);is=s(sa,"facebook/vit-mae-base"),sa.forEach(t),ls=s(zo," architecture."),zo.forEach(t),ds=p(Ot),ct=a(Ot,"P",{});var Oo=i(ct);cs=s(Oo,"Configuration objects inherit from "),Ao=a(Oo,"A",{href:!0});var na=i(Ao);hs=s(na,"PretrainedConfig"),na.forEach(t),ms=s(Oo,` and can be used to control the model outputs. Read the
documentation from `),ko=a(Oo,"A",{href:!0});var aa=i(ko);ps=s(aa,"PretrainedConfig"),aa.forEach(t),fs=s(Oo," for more information."),Oo.forEach(t),us=p(Ot),$(Et.$$.fragment,Ot),Ot.forEach(t),wr=p(o),ht=a(o,"H2",{class:!0});var Cr=i(ht);yt=a(Cr,"A",{id:!0,class:!0,href:!0});var ia=i(yt);Wo=a(ia,"SPAN",{});var la=i(Wo);$(Yt.$$.fragment,la),la.forEach(t),ia.forEach(t),gs=p(Cr),Ro=a(Cr,"SPAN",{});var da=i(Ro);_s=s(da,"ViTMAEModel"),da.forEach(t),Cr.forEach(t),Er=p(o),Be=a(o,"DIV",{class:!0});var Do=i(Be);$(Jt.$$.fragment,Do),vs=p(Do),Qt=a(Do,"P",{});var qr=i(Qt);Ts=s(qr,`The bare ViTMAE Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),Zt=a(qr,"A",{href:!0,rel:!0});var ca=i(Zt);ws=s(ca,"torch.nn.Module"),ca.forEach(t),Es=s(qr,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),qr.forEach(t),ys=p(Do),Me=a(Do,"DIV",{class:!0});var Dt=i(Me);$(eo.$$.fragment,Dt),bs=p(Dt),mt=a(Dt,"P",{});var No=i(mt);$s=s(No,"The "),Vo=a(No,"A",{href:!0});var ha=i(Vo);Ms=s(ha,"ViTMAEModel"),ha.forEach(t),As=s(No," forward method, overrides the "),Bo=a(No,"CODE",{});var ma=i(Bo);ks=s(ma,"__call__"),ma.forEach(t),Vs=s(No," special method."),No.forEach(t),Ps=p(Dt),$(bt.$$.fragment,Dt),Fs=p(Dt),$($t.$$.fragment,Dt),Dt.forEach(t),Do.forEach(t),yr=p(o),pt=a(o,"H2",{class:!0});var zr=i(pt);Mt=a(zr,"A",{id:!0,class:!0,href:!0});var pa=i(Mt);Go=a(pa,"SPAN",{});var fa=i(Go);$(to.$$.fragment,fa),fa.forEach(t),pa.forEach(t),xs=p(zr),Xo=a(zr,"SPAN",{});var ua=i(Xo);js=s(ua,"ViTMAEForPreTraining"),ua.forEach(t),zr.forEach(t),br=p(o),ae=a(o,"DIV",{class:!0});var Xe=i(ae);$(oo.$$.fragment,Xe),Is=p(Xe),Yo=a(Xe,"P",{});var ga=i(Yo);Cs=s(ga,"The ViTMAE Model transformer with the decoder on top for self-supervised pre-training."),ga.forEach(t),qs=p(Xe),$(At.$$.fragment,Xe),zs=p(Xe),ro=a(Xe,"P",{});var Or=i(ro);Os=s(Or,"This model is a PyTorch "),so=a(Or,"A",{href:!0,rel:!0});var _a=i(so);Ds=s(_a,"torch.nn.Module"),_a.forEach(t),Ns=s(Or,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Or.forEach(t),Ls=p(Xe),Ae=a(Xe,"DIV",{class:!0});var Nt=i(Ae);$(no.$$.fragment,Nt),Ss=p(Nt),ft=a(Nt,"P",{});var Lo=i(ft);Ks=s(Lo,"The "),Po=a(Lo,"A",{href:!0});var va=i(Po);Hs=s(va,"ViTMAEForPreTraining"),va.forEach(t),Us=s(Lo," forward method, overrides the "),Jo=a(Lo,"CODE",{});var Ta=i(Jo);Ws=s(Ta,"__call__"),Ta.forEach(t),Rs=s(Lo," special method."),Lo.forEach(t),Bs=p(Nt),$(kt.$$.fragment,Nt),Gs=p(Nt),$(Vt.$$.fragment,Nt),Nt.forEach(t),Xe.forEach(t),$r=p(o),ut=a(o,"H2",{class:!0});var Dr=i(ut);Pt=a(Dr,"A",{id:!0,class:!0,href:!0});var wa=i(Pt);Qo=a(wa,"SPAN",{});var Ea=i(Qo);$(ao.$$.fragment,Ea),Ea.forEach(t),wa.forEach(t),Xs=p(Dr),Zo=a(Dr,"SPAN",{});var ya=i(Zo);Ys=s(ya,"TFViTMAEModel"),ya.forEach(t),Dr.forEach(t),Mr=p(o),ie=a(o,"DIV",{class:!0});var Ye=i(ie);$(io.$$.fragment,Ye),Js=p(Ye),lo=a(Ye,"P",{});var Nr=i(lo);Qs=s(Nr,`The bare ViTMAE Model transformer outputting raw hidden-states without any specific head on top.
This model inherits from `),Fo=a(Nr,"A",{href:!0});var ba=i(Fo);Zs=s(ba,"TFPreTrainedModel"),ba.forEach(t),en=s(Nr,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Nr.forEach(t),tn=p(Ye),co=a(Ye,"P",{});var Lr=i(co);on=s(Lr,"This model is also a "),ho=a(Lr,"A",{href:!0,rel:!0});var $a=i(ho);rn=s($a,"tf.keras.Model"),$a.forEach(t),sn=s(Lr,` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),Lr.forEach(t),nn=p(Ye),$(Ft.$$.fragment,Ye),an=p(Ye),ke=a(Ye,"DIV",{class:!0});var Lt=i(ke);$(mo.$$.fragment,Lt),ln=p(Lt),gt=a(Lt,"P",{});var So=i(gt);dn=s(So,"The "),xo=a(So,"A",{href:!0});var Ma=i(xo);cn=s(Ma,"TFViTMAEModel"),Ma.forEach(t),hn=s(So," forward method, overrides the "),er=a(So,"CODE",{});var Aa=i(er);mn=s(Aa,"__call__"),Aa.forEach(t),pn=s(So," special method."),So.forEach(t),fn=p(Lt),$(xt.$$.fragment,Lt),un=p(Lt),$(jt.$$.fragment,Lt),Lt.forEach(t),Ye.forEach(t),Ar=p(o),_t=a(o,"H2",{class:!0});var Sr=i(_t);It=a(Sr,"A",{id:!0,class:!0,href:!0});var ka=i(It);tr=a(ka,"SPAN",{});var Va=i(tr);$(po.$$.fragment,Va),Va.forEach(t),ka.forEach(t),gn=p(Sr),or=a(Sr,"SPAN",{});var Pa=i(or);_n=s(Pa,"TFViTMAEForPreTraining"),Pa.forEach(t),Sr.forEach(t),kr=p(o),le=a(o,"DIV",{class:!0});var Je=i(le);$(fo.$$.fragment,Je),vn=p(Je),uo=a(Je,"P",{});var Kr=i(uo);Tn=s(Kr,`The ViTMAE Model transformer with the decoder on top for self-supervised pre-training.
This model inherits from `),jo=a(Kr,"A",{href:!0});var Fa=i(jo);wn=s(Fa,"TFPreTrainedModel"),Fa.forEach(t),En=s(Kr,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Kr.forEach(t),yn=p(Je),go=a(Je,"P",{});var Hr=i(go);bn=s(Hr,"This model is also a "),_o=a(Hr,"A",{href:!0,rel:!0});var xa=i(_o);$n=s(xa,"tf.keras.Model"),xa.forEach(t),Mn=s(Hr,` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),Hr.forEach(t),An=p(Je),$(Ct.$$.fragment,Je),kn=p(Je),Ve=a(Je,"DIV",{class:!0});var St=i(Ve);$(vo.$$.fragment,St),Vn=p(St),vt=a(St,"P",{});var Ko=i(vt);Pn=s(Ko,"The "),Io=a(Ko,"A",{href:!0});var ja=i(Io);Fn=s(ja,"TFViTMAEForPreTraining"),ja.forEach(t),xn=s(Ko," forward method, overrides the "),rr=a(Ko,"CODE",{});var Ia=i(rr);jn=s(Ia,"__call__"),Ia.forEach(t),In=s(Ko," special method."),Ko.forEach(t),Cn=p(St),$(qt.$$.fragment,St),qn=p(St),$(zt.$$.fragment,St),St.forEach(t),Je.forEach(t),this.h()},h(){h(d,"name","hf:doc:metadata"),h(d,"content",JSON.stringify(Za)),h(u,"id","vitmae"),h(u,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(u,"href","#vitmae"),h(f,"class","relative group"),h(Y,"id","overview"),h(Y,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(Y,"href","#overview"),h(q,"class","relative group"),h(ee,"href","https://arxiv.org/abs/2111.06377v2"),h(ee,"rel","nofollow"),h(U,"href","/docs/transformers/v4.25.1/en/model_doc/vit_mae#transformers.ViTMAEForPreTraining"),h(ce,"href","/docs/transformers/v4.25.1/en/model_doc/vit_mae#transformers.ViTMAEForPreTraining"),h(ne,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/image-pretraining"),h(ne,"rel","nofollow"),h(J,"href","/docs/transformers/v4.25.1/en/model_doc/vit_mae#transformers.ViTMAEForPreTraining"),h(C,"href","https://github.com/NielsRogge/Transformers-Tutorials/blob/master/ViTMAE/ViT_MAE_visualization_demo.ipynb"),h(C,"rel","nofollow"),h(Q,"href","/docs/transformers/v4.25.1/en/model_doc/vit#transformers.ViTForImageClassification"),h($e,"href","/docs/transformers/v4.25.1/en/model_doc/vit#transformers.ViTImageProcessor"),h(_e,"href","https://keras.io/examples/vision/masked_image_modeling/"),h(_e,"rel","nofollow"),Da(me.src,On="https://user-images.githubusercontent.com/11435359/146857310-f258c86c-fde6-48e8-9cee-badd2b21bd2c.png")||h(me,"src",On),h(me,"alt","drawing"),h(me,"width","600"),h($o,"href","https://arxiv.org/abs/2111.06377"),h(Ht,"href","https://huggingface.co/nielsr"),h(Ht,"rel","nofollow"),h(Ut,"href","https://github.com/sayakpaul"),h(Ut,"rel","nofollow"),h(Wt,"href","https://github.com/ariG23498"),h(Wt,"rel","nofollow"),h(Rt,"href","https://github.com/facebookresearch/mae"),h(Rt,"rel","nofollow"),h(wt,"id","transformers.ViTMAEConfig"),h(wt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(wt,"href","#transformers.ViTMAEConfig"),h(lt,"class","relative group"),h(Mo,"href","/docs/transformers/v4.25.1/en/model_doc/vit_mae#transformers.ViTMAEModel"),h(Xt,"href","https://huggingface.co/facebook/vit-mae-base"),h(Xt,"rel","nofollow"),h(Ao,"href","/docs/transformers/v4.25.1/en/main_classes/configuration#transformers.PretrainedConfig"),h(ko,"href","/docs/transformers/v4.25.1/en/main_classes/configuration#transformers.PretrainedConfig"),h(ve,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(yt,"id","transformers.ViTMAEModel"),h(yt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(yt,"href","#transformers.ViTMAEModel"),h(ht,"class","relative group"),h(Zt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(Zt,"rel","nofollow"),h(Vo,"href","/docs/transformers/v4.25.1/en/model_doc/vit_mae#transformers.ViTMAEModel"),h(Me,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Be,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Mt,"id","transformers.ViTMAEForPreTraining"),h(Mt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(Mt,"href","#transformers.ViTMAEForPreTraining"),h(pt,"class","relative group"),h(so,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(so,"rel","nofollow"),h(Po,"href","/docs/transformers/v4.25.1/en/model_doc/vit_mae#transformers.ViTMAEForPreTraining"),h(Ae,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(ae,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Pt,"id","transformers.TFViTMAEModel"),h(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"),h(Pt,"href","#transformers.TFViTMAEModel"),h(ut,"class","relative group"),h(Fo,"href","/docs/transformers/v4.25.1/en/main_classes/model#transformers.TFPreTrainedModel"),h(ho,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),h(ho,"rel","nofollow"),h(xo,"href","/docs/transformers/v4.25.1/en/model_doc/vit_mae#transformers.TFViTMAEModel"),h(ke,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(ie,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(It,"id","transformers.TFViTMAEForPreTraining"),h(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"),h(It,"href","#transformers.TFViTMAEForPreTraining"),h(_t,"class","relative group"),h(jo,"href","/docs/transformers/v4.25.1/en/main_classes/model#transformers.TFPreTrainedModel"),h(_o,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),h(_o,"rel","nofollow"),h(Io,"href","/docs/transformers/v4.25.1/en/model_doc/vit_mae#transformers.TFViTMAEForPreTraining"),h(Ve,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(le,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(o,_){e(document.head,d),g(o,w,_),g(o,f,_),e(f,u),e(u,T),M(l,T,null),e(f,c),e(f,P),e(P,Pe),g(o,Te,_),g(o,q,_),e(q,Y),e(Y,Z),M(E,Z,null),e(q,Fe),e(q,W),e(W,xe),g(o,we,_),g(o,L,_),e(L,je),e(L,ee),e(ee,te),e(L,Ie),g(o,Ee,_),g(o,K,_),e(K,Ce),g(o,ye,_),g(o,H,_),e(H,ue),e(ue,qe),g(o,de,_),g(o,j,_),e(j,z),g(o,be,_),g(o,F,_),e(F,oe),e(oe,ze),e(oe,U),e(U,Oe),e(oe,De),e(F,O),e(F,R),e(R,re),e(R,ce),e(ce,Ne),e(R,se),e(R,ne),e(ne,Le),e(R,B),e(F,Se),e(F,D),e(D,Ke),e(D,J),e(J,N),e(D,He),e(D,C),e(C,Ue),e(D,We),e(F,v),e(F,y),e(y,Qe),e(y,Q),e(Q,Ze),e(y,et),e(F,x),e(F,ge),e(ge,tt),e(ge,$e),e($e,ot),e(ge,rt),e(F,G),e(F,X),e(X,st),e(F,nt),e(F,S),e(S,at),e(S,_e),e(_e,Re),e(S,it),g(o,he,_),g(o,me,_),g(o,gr,_),g(o,Kt,_),e(Kt,Ur),e(Kt,$o),e($o,Wr),g(o,_r,_),g(o,pe,_),e(pe,Rr),e(pe,Ht),e(Ht,Br),e(pe,Gr),e(pe,Ut),e(Ut,Xr),e(pe,Yr),e(pe,Wt),e(Wt,Jr),e(pe,Qr),e(pe,Rt),e(Rt,Zr),e(pe,es),g(o,vr,_),g(o,lt,_),e(lt,wt),e(wt,Ho),M(Bt,Ho,null),e(lt,ts),e(lt,Uo),e(Uo,os),g(o,Tr,_),g(o,ve,_),M(Gt,ve,null),e(ve,rs),e(ve,dt),e(dt,ss),e(dt,Mo),e(Mo,ns),e(dt,as),e(dt,Xt),e(Xt,is),e(dt,ls),e(ve,ds),e(ve,ct),e(ct,cs),e(ct,Ao),e(Ao,hs),e(ct,ms),e(ct,ko),e(ko,ps),e(ct,fs),e(ve,us),M(Et,ve,null),g(o,wr,_),g(o,ht,_),e(ht,yt),e(yt,Wo),M(Yt,Wo,null),e(ht,gs),e(ht,Ro),e(Ro,_s),g(o,Er,_),g(o,Be,_),M(Jt,Be,null),e(Be,vs),e(Be,Qt),e(Qt,Ts),e(Qt,Zt),e(Zt,ws),e(Qt,Es),e(Be,ys),e(Be,Me),M(eo,Me,null),e(Me,bs),e(Me,mt),e(mt,$s),e(mt,Vo),e(Vo,Ms),e(mt,As),e(mt,Bo),e(Bo,ks),e(mt,Vs),e(Me,Ps),M(bt,Me,null),e(Me,Fs),M($t,Me,null),g(o,yr,_),g(o,pt,_),e(pt,Mt),e(Mt,Go),M(to,Go,null),e(pt,xs),e(pt,Xo),e(Xo,js),g(o,br,_),g(o,ae,_),M(oo,ae,null),e(ae,Is),e(ae,Yo),e(Yo,Cs),e(ae,qs),M(At,ae,null),e(ae,zs),e(ae,ro),e(ro,Os),e(ro,so),e(so,Ds),e(ro,Ns),e(ae,Ls),e(ae,Ae),M(no,Ae,null),e(Ae,Ss),e(Ae,ft),e(ft,Ks),e(ft,Po),e(Po,Hs),e(ft,Us),e(ft,Jo),e(Jo,Ws),e(ft,Rs),e(Ae,Bs),M(kt,Ae,null),e(Ae,Gs),M(Vt,Ae,null),g(o,$r,_),g(o,ut,_),e(ut,Pt),e(Pt,Qo),M(ao,Qo,null),e(ut,Xs),e(ut,Zo),e(Zo,Ys),g(o,Mr,_),g(o,ie,_),M(io,ie,null),e(ie,Js),e(ie,lo),e(lo,Qs),e(lo,Fo),e(Fo,Zs),e(lo,en),e(ie,tn),e(ie,co),e(co,on),e(co,ho),e(ho,rn),e(co,sn),e(ie,nn),M(Ft,ie,null),e(ie,an),e(ie,ke),M(mo,ke,null),e(ke,ln),e(ke,gt),e(gt,dn),e(gt,xo),e(xo,cn),e(gt,hn),e(gt,er),e(er,mn),e(gt,pn),e(ke,fn),M(xt,ke,null),e(ke,un),M(jt,ke,null),g(o,Ar,_),g(o,_t,_),e(_t,It),e(It,tr),M(po,tr,null),e(_t,gn),e(_t,or),e(or,_n),g(o,kr,_),g(o,le,_),M(fo,le,null),e(le,vn),e(le,uo),e(uo,Tn),e(uo,jo),e(jo,wn),e(uo,En),e(le,yn),e(le,go),e(go,bn),e(go,_o),e(_o,$n),e(go,Mn),e(le,An),M(Ct,le,null),e(le,kn),e(le,Ve),M(vo,Ve,null),e(Ve,Vn),e(Ve,vt),e(vt,Pn),e(vt,Io),e(Io,Fn),e(vt,xn),e(vt,rr),e(rr,jn),e(vt,In),e(Ve,Cn),M(qt,Ve,null),e(Ve,qn),M(zt,Ve,null),Vr=!0},p(o,[_]){const To={};_&2&&(To.$$scope={dirty:_,ctx:o}),Et.$set(To);const sr={};_&2&&(sr.$$scope={dirty:_,ctx:o}),bt.$set(sr);const nr={};_&2&&(nr.$$scope={dirty:_,ctx:o}),$t.$set(nr);const ar={};_&2&&(ar.$$scope={dirty:_,ctx:o}),At.$set(ar);const wo={};_&2&&(wo.$$scope={dirty:_,ctx:o}),kt.$set(wo);const ir={};_&2&&(ir.$$scope={dirty:_,ctx:o}),Vt.$set(ir);const lr={};_&2&&(lr.$$scope={dirty:_,ctx:o}),Ft.$set(lr);const dr={};_&2&&(dr.$$scope={dirty:_,ctx:o}),xt.$set(dr);const Eo={};_&2&&(Eo.$$scope={dirty:_,ctx:o}),jt.$set(Eo);const cr={};_&2&&(cr.$$scope={dirty:_,ctx:o}),Ct.$set(cr);const hr={};_&2&&(hr.$$scope={dirty:_,ctx:o}),qt.$set(hr);const mr={};_&2&&(mr.$$scope={dirty:_,ctx:o}),zt.$set(mr)},i(o){Vr||(A(l.$$.fragment,o),A(E.$$.fragment,o),A(Bt.$$.fragment,o),A(Gt.$$.fragment,o),A(Et.$$.fragment,o),A(Yt.$$.fragment,o),A(Jt.$$.fragment,o),A(eo.$$.fragment,o),A(bt.$$.fragment,o),A($t.$$.fragment,o),A(to.$$.fragment,o),A(oo.$$.fragment,o),A(At.$$.fragment,o),A(no.$$.fragment,o),A(kt.$$.fragment,o),A(Vt.$$.fragment,o),A(ao.$$.fragment,o),A(io.$$.fragment,o),A(Ft.$$.fragment,o),A(mo.$$.fragment,o),A(xt.$$.fragment,o),A(jt.$$.fragment,o),A(po.$$.fragment,o),A(fo.$$.fragment,o),A(Ct.$$.fragment,o),A(vo.$$.fragment,o),A(qt.$$.fragment,o),A(zt.$$.fragment,o),Vr=!0)},o(o){k(l.$$.fragment,o),k(E.$$.fragment,o),k(Bt.$$.fragment,o),k(Gt.$$.fragment,o),k(Et.$$.fragment,o),k(Yt.$$.fragment,o),k(Jt.$$.fragment,o),k(eo.$$.fragment,o),k(bt.$$.fragment,o),k($t.$$.fragment,o),k(to.$$.fragment,o),k(oo.$$.fragment,o),k(At.$$.fragment,o),k(no.$$.fragment,o),k(kt.$$.fragment,o),k(Vt.$$.fragment,o),k(ao.$$.fragment,o),k(io.$$.fragment,o),k(Ft.$$.fragment,o),k(mo.$$.fragment,o),k(xt.$$.fragment,o),k(jt.$$.fragment,o),k(po.$$.fragment,o),k(fo.$$.fragment,o),k(Ct.$$.fragment,o),k(vo.$$.fragment,o),k(qt.$$.fragment,o),k(zt.$$.fragment,o),Vr=!1},d(o){t(d),o&&t(w),o&&t(f),V(l),o&&t(Te),o&&t(q),V(E),o&&t(we),o&&t(L),o&&t(Ee),o&&t(K),o&&t(ye),o&&t(H),o&&t(de),o&&t(j),o&&t(be),o&&t(F),o&&t(he),o&&t(me),o&&t(gr),o&&t(Kt),o&&t(_r),o&&t(pe),o&&t(vr),o&&t(lt),V(Bt),o&&t(Tr),o&&t(ve),V(Gt),V(Et),o&&t(wr),o&&t(ht),V(Yt),o&&t(Er),o&&t(Be),V(Jt),V(eo),V(bt),V($t),o&&t(yr),o&&t(pt),V(to),o&&t(br),o&&t(ae),V(oo),V(At),V(no),V(kt),V(Vt),o&&t($r),o&&t(ut),V(ao),o&&t(Mr),o&&t(ie),V(io),V(Ft),V(mo),V(xt),V(jt),o&&t(Ar),o&&t(_t),V(po),o&&t(kr),o&&t(le),V(fo),V(Ct),V(vo),V(qt),V(zt)}}}const Za={local:"vitmae",sections:[{local:"overview",title:"Overview"},{local:"transformers.ViTMAEConfig",title:"ViTMAEConfig"},{local:"transformers.ViTMAEModel",title:"ViTMAEModel"},{local:"transformers.ViTMAEForPreTraining",title:"ViTMAEForPreTraining"},{local:"transformers.TFViTMAEModel",title:"TFViTMAEModel"},{local:"transformers.TFViTMAEForPreTraining",title:"TFViTMAEForPreTraining"}],title:"ViTMAE"};function ei(I){return Na(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ii extends Ca{constructor(d){super();qa(this,d,ei,Qa,za,{})}}export{ii as default,Za as metadata};
