import{S as tu,i as ou,s as au,e as a,k as c,w as y,t as r,M as su,c as s,d as o,m,a as n,x as w,h as i,b as d,N as nu,G as e,g as u,y as T,q as M,o as B,B as $,v as ru,L as jt}from"../../chunks/vendor-hf-doc-builder.js";import{T as ua}from"../../chunks/Tip-hf-doc-builder.js";import{D as F}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Ct}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as Z}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as kt}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";import{P as iu}from"../../chunks/PipelineTag-hf-doc-builder.js";function lu(x){let p,v,_,g,b;return g=new Ct({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEJlaXRDb25maWclMkMlMjBCZWl0TW9kZWwlMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwQkVpVCUyMGJlaXQtYmFzZS1wYXRjaDE2LTIyNC1wdDIyayUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBCZWl0Q29uZmlnKCklMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwbW9kZWwlMjAod2l0aCUyMHJhbmRvbSUyMHdlaWdodHMpJTIwZnJvbSUyMHRoZSUyMGJlaXQtYmFzZS1wYXRjaDE2LTIyNC1wdDIyayUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQW1vZGVsJTIwJTNEJTIwQmVpdE1vZGVsKGNvbmZpZ3VyYXRpb24pJTBBJTBBJTIzJTIwQWNjZXNzaW5nJTIwdGhlJTIwbW9kZWwlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMG1vZGVsLmNvbmZpZw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> BeitConfig, BeitModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a BEiT beit-base-patch16-224-pt22k style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = BeitConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model (with random weights) from the beit-base-patch16-224-pt22k style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BeitModel(configuration)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Accessing the model configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = model.config`}}),{c(){p=a("p"),v=r("Example:"),_=c(),y(g.$$.fragment)},l(l){p=s(l,"P",{});var f=n(p);v=i(f,"Example:"),f.forEach(o),_=m(l),w(g.$$.fragment,l)},m(l,f){u(l,p,f),e(p,v),u(l,_,f),T(g,l,f),b=!0},p:jt,i(l){b||(M(g.$$.fragment,l),b=!0)},o(l){B(g.$$.fragment,l),b=!1},d(l){l&&o(p),l&&o(_),$(g,l)}}}function du(x){let p,v,_,g,b;return{c(){p=a("p"),v=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a("code"),g=r("Module"),b=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){p=s(l,"P",{});var f=n(p);v=i(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=s(f,"CODE",{});var E=n(_);g=i(E,"Module"),E.forEach(o),b=i(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(o)},m(l,f){u(l,p,f),e(p,v),e(p,_),e(_,g),e(p,b)},d(l){l&&o(p)}}}function cu(x){let p,v,_,g,b;return g=new Ct({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMEJlaXRNb2RlbCUwQWltcG9ydCUyMHRvcmNoJTBBZnJvbSUyMGRhdGFzZXRzJTIwaW1wb3J0JTIwbG9hZF9kYXRhc2V0JTBBJTBBZGF0YXNldCUyMCUzRCUyMGxvYWRfZGF0YXNldCglMjJodWdnaW5nZmFjZSUyRmNhdHMtaW1hZ2UlMjIpJTBBaW1hZ2UlMjAlM0QlMjBkYXRhc2V0JTVCJTIydGVzdCUyMiU1RCU1QiUyMmltYWdlJTIyJTVEJTVCMCU1RCUwQSUwQWltYWdlX3Byb2Nlc3NvciUyMCUzRCUyMEF1dG9JbWFnZVByb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIybWljcm9zb2Z0JTJGYmVpdC1iYXNlLXBhdGNoMTYtMjI0LXB0MjJrJTIyKSUwQW1vZGVsJTIwJTNEJTIwQmVpdE1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJtaWNyb3NvZnQlMkZiZWl0LWJhc2UtcGF0Y2gxNi0yMjQtcHQyMmslMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwaW1hZ2VfcHJvY2Vzc29yKGltYWdlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEElMEF3aXRoJTIwdG9yY2gubm9fZ3JhZCgpJTNBJTBBJTIwJTIwJTIwJTIwb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQSUwQWxhc3RfaGlkZGVuX3N0YXRlcyUyMCUzRCUyMG91dHB1dHMubGFzdF9oaWRkZW5fc3RhdGUlMEFsaXN0KGxhc3RfaGlkZGVuX3N0YXRlcy5zaGFwZSk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, BeitModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset

<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = load_dataset(<span class="hljs-string">&quot;huggingface/cats-image&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>image = dataset[<span class="hljs-string">&quot;test&quot;</span>][<span class="hljs-string">&quot;image&quot;</span>][<span class="hljs-number">0</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span>image_processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">&quot;microsoft/beit-base-patch16-224-pt22k&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BeitModel.from_pretrained(<span class="hljs-string">&quot;microsoft/beit-base-patch16-224-pt22k&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = image_processor(image, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    outputs = model(**inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(last_hidden_states.shape)
[<span class="hljs-number">1</span>, <span class="hljs-number">197</span>, <span class="hljs-number">768</span>]`}}),{c(){p=a("p"),v=r("Example:"),_=c(),y(g.$$.fragment)},l(l){p=s(l,"P",{});var f=n(p);v=i(f,"Example:"),f.forEach(o),_=m(l),w(g.$$.fragment,l)},m(l,f){u(l,p,f),e(p,v),u(l,_,f),T(g,l,f),b=!0},p:jt,i(l){b||(M(g.$$.fragment,l),b=!0)},o(l){B(g.$$.fragment,l),b=!1},d(l){l&&o(p),l&&o(_),$(g,l)}}}function mu(x){let p,v,_,g,b;return{c(){p=a("p"),v=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a("code"),g=r("Module"),b=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){p=s(l,"P",{});var f=n(p);v=i(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=s(f,"CODE",{});var E=n(_);g=i(E,"Module"),E.forEach(o),b=i(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(o)},m(l,f){u(l,p,f),e(p,v),e(p,_),e(_,g),e(p,b)},d(l){l&&o(p)}}}function pu(x){let p,v,_,g,b;return g=new Ct({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMEJlaXRGb3JNYXNrZWRJbWFnZU1vZGVsaW5nJTBBaW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwUElMJTIwaW1wb3J0JTIwSW1hZ2UlMEFpbXBvcnQlMjByZXF1ZXN0cyUwQSUwQXVybCUyMCUzRCUyMCUyMmh0dHAlM0ElMkYlMkZpbWFnZXMuY29jb2RhdGFzZXQub3JnJTJGdmFsMjAxNyUyRjAwMDAwMDAzOTc2OS5qcGclMjIlMEFpbWFnZSUyMCUzRCUyMEltYWdlLm9wZW4ocmVxdWVzdHMuZ2V0KHVybCUyQyUyMHN0cmVhbSUzRFRydWUpLnJhdyklMEElMEFpbWFnZV9wcm9jZXNzb3IlMjAlM0QlMjBBdXRvSW1hZ2VQcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMm1pY3Jvc29mdCUyRmJlaXQtYmFzZS1wYXRjaDE2LTIyNC1wdDIyayUyMiklMEFtb2RlbCUyMCUzRCUyMEJlaXRGb3JNYXNrZWRJbWFnZU1vZGVsaW5nLmZyb21fcHJldHJhaW5lZCglMjJtaWNyb3NvZnQlMkZiZWl0LWJhc2UtcGF0Y2gxNi0yMjQtcHQyMmslMjIpJTBBJTBBbnVtX3BhdGNoZXMlMjAlM0QlMjAobW9kZWwuY29uZmlnLmltYWdlX3NpemUlMjAlMkYlMkYlMjBtb2RlbC5jb25maWcucGF0Y2hfc2l6ZSklMjAqKiUyMDIlMEFwaXhlbF92YWx1ZXMlMjAlM0QlMjBpbWFnZV9wcm9jZXNzb3IoaW1hZ2VzJTNEaW1hZ2UlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKS5waXhlbF92YWx1ZXMlMEElMjMlMjBjcmVhdGUlMjByYW5kb20lMjBib29sZWFuJTIwbWFzayUyMG9mJTIwc2hhcGUlMjAoYmF0Y2hfc2l6ZSUyQyUyMG51bV9wYXRjaGVzKSUwQWJvb2xfbWFza2VkX3BvcyUyMCUzRCUyMHRvcmNoLnJhbmRpbnQobG93JTNEMCUyQyUyMGhpZ2glM0QyJTJDJTIwc2l6ZSUzRCgxJTJDJTIwbnVtX3BhdGNoZXMpKS5ib29sKCklMEElMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwocGl4ZWxfdmFsdWVzJTJDJTIwYm9vbF9tYXNrZWRfcG9zJTNEYm9vbF9tYXNrZWRfcG9zKSUwQWxvc3MlMkMlMjBsb2dpdHMlMjAlM0QlMjBvdXRwdXRzLmxvc3MlMkMlMjBvdXRwdXRzLmxvZ2l0cyUwQWxpc3QobG9naXRzLnNoYXBlKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, BeitForMaskedImageModeling
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests

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

<span class="hljs-meta">&gt;&gt;&gt; </span>image_processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">&quot;microsoft/beit-base-patch16-224-pt22k&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BeitForMaskedImageModeling.from_pretrained(<span class="hljs-string">&quot;microsoft/beit-base-patch16-224-pt22k&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>num_patches = (model.config.image_size // model.config.patch_size) ** <span class="hljs-number">2</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pixel_values = image_processor(images=image, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>).pixel_values
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># create random boolean mask of shape (batch_size, num_patches)</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>bool_masked_pos = torch.randint(low=<span class="hljs-number">0</span>, high=<span class="hljs-number">2</span>, size=(<span class="hljs-number">1</span>, num_patches)).<span class="hljs-built_in">bool</span>()

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(pixel_values, bool_masked_pos=bool_masked_pos)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss, logits = outputs.loss, outputs.logits
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(logits.shape)
[<span class="hljs-number">1</span>, <span class="hljs-number">196</span>, <span class="hljs-number">8192</span>]`}}),{c(){p=a("p"),v=r("Examples:"),_=c(),y(g.$$.fragment)},l(l){p=s(l,"P",{});var f=n(p);v=i(f,"Examples:"),f.forEach(o),_=m(l),w(g.$$.fragment,l)},m(l,f){u(l,p,f),e(p,v),u(l,_,f),T(g,l,f),b=!0},p:jt,i(l){b||(M(g.$$.fragment,l),b=!0)},o(l){B(g.$$.fragment,l),b=!1},d(l){l&&o(p),l&&o(_),$(g,l)}}}function hu(x){let p,v,_,g,b;return{c(){p=a("p"),v=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a("code"),g=r("Module"),b=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){p=s(l,"P",{});var f=n(p);v=i(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=s(f,"CODE",{});var E=n(_);g=i(E,"Module"),E.forEach(o),b=i(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(o)},m(l,f){u(l,p,f),e(p,v),e(p,_),e(_,g),e(p,b)},d(l){l&&o(p)}}}function fu(x){let p,v,_,g,b;return g=new Ct({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMEJlaXRGb3JJbWFnZUNsYXNzaWZpY2F0aW9uJTBBaW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGF0YXNldHMlMjBpbXBvcnQlMjBsb2FkX2RhdGFzZXQlMEElMEFkYXRhc2V0JTIwJTNEJTIwbG9hZF9kYXRhc2V0KCUyMmh1Z2dpbmdmYWNlJTJGY2F0cy1pbWFnZSUyMiklMEFpbWFnZSUyMCUzRCUyMGRhdGFzZXQlNUIlMjJ0ZXN0JTIyJTVEJTVCJTIyaW1hZ2UlMjIlNUQlNUIwJTVEJTBBJTBBaW1hZ2VfcHJvY2Vzc29yJTIwJTNEJTIwQXV0b0ltYWdlUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJtaWNyb3NvZnQlMkZiZWl0LWJhc2UtcGF0Y2gxNi0yMjQlMjIpJTBBbW9kZWwlMjAlM0QlMjBCZWl0Rm9ySW1hZ2VDbGFzc2lmaWNhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIybWljcm9zb2Z0JTJGYmVpdC1iYXNlLXBhdGNoMTYtMjI0JTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMGltYWdlX3Byb2Nlc3NvcihpbWFnZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMCUyMGxvZ2l0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKS5sb2dpdHMlMEElMEElMjMlMjBtb2RlbCUyMHByZWRpY3RzJTIwb25lJTIwb2YlMjB0aGUlMjAxMDAwJTIwSW1hZ2VOZXQlMjBjbGFzc2VzJTBBcHJlZGljdGVkX2xhYmVsJTIwJTNEJTIwbG9naXRzLmFyZ21heCgtMSkuaXRlbSgpJTBBcHJpbnQobW9kZWwuY29uZmlnLmlkMmxhYmVsJTVCcHJlZGljdGVkX2xhYmVsJTVEKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, BeitForImageClassification
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset

<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = load_dataset(<span class="hljs-string">&quot;huggingface/cats-image&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>image = dataset[<span class="hljs-string">&quot;test&quot;</span>][<span class="hljs-string">&quot;image&quot;</span>][<span class="hljs-number">0</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span>image_processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">&quot;microsoft/beit-base-patch16-224&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BeitForImageClassification.from_pretrained(<span class="hljs-string">&quot;microsoft/beit-base-patch16-224&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = image_processor(image, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    logits = model(**inputs).logits

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># model predicts one of the 1000 ImageNet classes</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_label = logits.argmax(-<span class="hljs-number">1</span>).item()
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(model.config.id2label[predicted_label])
tabby, tabby cat`}}),{c(){p=a("p"),v=r("Example:"),_=c(),y(g.$$.fragment)},l(l){p=s(l,"P",{});var f=n(p);v=i(f,"Example:"),f.forEach(o),_=m(l),w(g.$$.fragment,l)},m(l,f){u(l,p,f),e(p,v),u(l,_,f),T(g,l,f),b=!0},p:jt,i(l){b||(M(g.$$.fragment,l),b=!0)},o(l){B(g.$$.fragment,l),b=!1},d(l){l&&o(p),l&&o(_),$(g,l)}}}function uu(x){let p,v,_,g,b;return{c(){p=a("p"),v=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a("code"),g=r("Module"),b=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){p=s(l,"P",{});var f=n(p);v=i(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=s(f,"CODE",{});var E=n(_);g=i(E,"Module"),E.forEach(o),b=i(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(o)},m(l,f){u(l,p,f),e(p,v),e(p,_),e(_,g),e(p,b)},d(l){l&&o(p)}}}function gu(x){let p,v,_,g,b;return g=new Ct({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMEJlaXRGb3JTZW1hbnRpY1NlZ21lbnRhdGlvbiUwQWZyb20lMjBQSUwlMjBpbXBvcnQlMjBJbWFnZSUwQWltcG9ydCUyMHJlcXVlc3RzJTBBJTBBdXJsJTIwJTNEJTIwJTIyaHR0cCUzQSUyRiUyRmltYWdlcy5jb2NvZGF0YXNldC5vcmclMkZ2YWwyMDE3JTJGMDAwMDAwMDM5NzY5LmpwZyUyMiUwQWltYWdlJTIwJTNEJTIwSW1hZ2Uub3BlbihyZXF1ZXN0cy5nZXQodXJsJTJDJTIwc3RyZWFtJTNEVHJ1ZSkucmF3KSUwQSUwQWltYWdlX3Byb2Nlc3NvciUyMCUzRCUyMEF1dG9JbWFnZVByb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIybWljcm9zb2Z0JTJGYmVpdC1iYXNlLWZpbmV0dW5lZC1hZGUtNjQwLTY0MCUyMiklMEFtb2RlbCUyMCUzRCUyMEJlaXRGb3JTZW1hbnRpY1NlZ21lbnRhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIybWljcm9zb2Z0JTJGYmVpdC1iYXNlLWZpbmV0dW5lZC1hZGUtNjQwLTY0MCUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjBpbWFnZV9wcm9jZXNzb3IoaW1hZ2VzJTNEaW1hZ2UlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEElMjMlMjBsb2dpdHMlMjBhcmUlMjBvZiUyMHNoYXBlJTIwKGJhdGNoX3NpemUlMkMlMjBudW1fbGFiZWxzJTJDJTIwaGVpZ2h0JTJDJTIwd2lkdGgpJTBBbG9naXRzJTIwJTNEJTIwb3V0cHV0cy5sb2dpdHM=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, BeitForSemanticSegmentation
<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;microsoft/beit-base-finetuned-ade-640-640&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BeitForSemanticSegmentation.from_pretrained(<span class="hljs-string">&quot;microsoft/beit-base-finetuned-ade-640-640&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><span class="hljs-comment"># logits are of shape (batch_size, num_labels, height, width)</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits`}}),{c(){p=a("p"),v=r("Examples:"),_=c(),y(g.$$.fragment)},l(l){p=s(l,"P",{});var f=n(p);v=i(f,"Examples:"),f.forEach(o),_=m(l),w(g.$$.fragment,l)},m(l,f){u(l,p,f),e(p,v),u(l,_,f),T(g,l,f),b=!0},p:jt,i(l){b||(M(g.$$.fragment,l),b=!0)},o(l){B(g.$$.fragment,l),b=!1},d(l){l&&o(p),l&&o(_),$(g,l)}}}function _u(x){let p,v,_,g,b;return{c(){p=a("p"),v=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a("code"),g=r("Module"),b=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){p=s(l,"P",{});var f=n(p);v=i(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=s(f,"CODE",{});var E=n(_);g=i(E,"Module"),E.forEach(o),b=i(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(o)},m(l,f){u(l,p,f),e(p,v),e(p,_),e(_,g),e(p,b)},d(l){l&&o(p)}}}function bu(x){let p,v,_,g,b;return g=new Ct({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMEZsYXhCZWl0TW9kZWwlMEFmcm9tJTIwUElMJTIwaW1wb3J0JTIwSW1hZ2UlMEFpbXBvcnQlMjByZXF1ZXN0cyUwQSUwQXVybCUyMCUzRCUyMCUyMmh0dHAlM0ElMkYlMkZpbWFnZXMuY29jb2RhdGFzZXQub3JnJTJGdmFsMjAxNyUyRjAwMDAwMDAzOTc2OS5qcGclMjIlMEFpbWFnZSUyMCUzRCUyMEltYWdlLm9wZW4ocmVxdWVzdHMuZ2V0KHVybCUyQyUyMHN0cmVhbSUzRFRydWUpLnJhdyklMEElMEFpbWFnZV9wcm9jZXNzb3IlMjAlM0QlMjBBdXRvSW1hZ2VQcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMm1pY3Jvc29mdCUyRmJlaXQtYmFzZS1wYXRjaDE2LTIyNC1wdDIyay1mdDIyayUyMiklMEFtb2RlbCUyMCUzRCUyMEZsYXhCZWl0TW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMm1pY3Jvc29mdCUyRmJlaXQtYmFzZS1wYXRjaDE2LTIyNC1wdDIyay1mdDIyayUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjBpbWFnZV9wcm9jZXNzb3IoaW1hZ2VzJTNEaW1hZ2UlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMm5wJTIyKSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEFsYXN0X2hpZGRlbl9zdGF0ZXMlMjAlM0QlMjBvdXRwdXRzLmxhc3RfaGlkZGVuX3N0YXRl",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, FlaxBeitModel
<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;microsoft/beit-base-patch16-224-pt22k-ft22k&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxBeitModel.from_pretrained(<span class="hljs-string">&quot;microsoft/beit-base-patch16-224-pt22k-ft22k&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = image_processor(images=image, return_tensors=<span class="hljs-string">&quot;np&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(){p=a("p"),v=r("Examples:"),_=c(),y(g.$$.fragment)},l(l){p=s(l,"P",{});var f=n(p);v=i(f,"Examples:"),f.forEach(o),_=m(l),w(g.$$.fragment,l)},m(l,f){u(l,p,f),e(p,v),u(l,_,f),T(g,l,f),b=!0},p:jt,i(l){b||(M(g.$$.fragment,l),b=!0)},o(l){B(g.$$.fragment,l),b=!1},d(l){l&&o(p),l&&o(_),$(g,l)}}}function vu(x){let p,v,_,g,b;return{c(){p=a("p"),v=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a("code"),g=r("Module"),b=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){p=s(l,"P",{});var f=n(p);v=i(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=s(f,"CODE",{});var E=n(_);g=i(E,"Module"),E.forEach(o),b=i(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(o)},m(l,f){u(l,p,f),e(p,v),e(p,_),e(_,g),e(p,b)},d(l){l&&o(p)}}}function yu(x){let p,v,_,g,b;return g=new Ct({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMEJlaXRGb3JNYXNrZWRJbWFnZU1vZGVsaW5nJTBBZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEElMEF1cmwlMjAlM0QlMjAlMjJodHRwJTNBJTJGJTJGaW1hZ2VzLmNvY29kYXRhc2V0Lm9yZyUyRnZhbDIwMTclMkYwMDAwMDAwMzk3NjkuanBnJTIyJTBBaW1hZ2UlMjAlM0QlMjBJbWFnZS5vcGVuKHJlcXVlc3RzLmdldCh1cmwlMkMlMjBzdHJlYW0lM0RUcnVlKS5yYXcpJTBBJTBBaW1hZ2VfcHJvY2Vzc29yJTIwJTNEJTIwQXV0b0ltYWdlUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJtaWNyb3NvZnQlMkZiZWl0LWJhc2UtcGF0Y2gxNi0yMjQtcHQyMmslMjIpJTBBbW9kZWwlMjAlM0QlMjBCZWl0Rm9yTWFza2VkSW1hZ2VNb2RlbGluZy5mcm9tX3ByZXRyYWluZWQoJTIybWljcm9zb2Z0JTJGYmVpdC1iYXNlLXBhdGNoMTYtMjI0LXB0MjJrJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMGltYWdlX3Byb2Nlc3NvcihpbWFnZXMlM0RpbWFnZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIybnAlMjIpJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQWxvZ2l0cyUyMCUzRCUyMG91dHB1dHMubG9naXRz",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, BeitForMaskedImageModeling
<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;microsoft/beit-base-patch16-224-pt22k&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BeitForMaskedImageModeling.from_pretrained(<span class="hljs-string">&quot;microsoft/beit-base-patch16-224-pt22k&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = image_processor(images=image, return_tensors=<span class="hljs-string">&quot;np&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits`}}),{c(){p=a("p"),v=r("Examples:"),_=c(),y(g.$$.fragment)},l(l){p=s(l,"P",{});var f=n(p);v=i(f,"Examples:"),f.forEach(o),_=m(l),w(g.$$.fragment,l)},m(l,f){u(l,p,f),e(p,v),u(l,_,f),T(g,l,f),b=!0},p:jt,i(l){b||(M(g.$$.fragment,l),b=!0)},o(l){B(g.$$.fragment,l),b=!1},d(l){l&&o(p),l&&o(_),$(g,l)}}}function wu(x){let p,v,_,g,b;return{c(){p=a("p"),v=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a("code"),g=r("Module"),b=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){p=s(l,"P",{});var f=n(p);v=i(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=s(f,"CODE",{});var E=n(_);g=i(E,"Module"),E.forEach(o),b=i(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(o)},m(l,f){u(l,p,f),e(p,v),e(p,_),e(_,g),e(p,b)},d(l){l&&o(p)}}}function Tu(x){let p,v,_,g,b;return g=new Ct({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMEZsYXhCZWl0Rm9ySW1hZ2VDbGFzc2lmaWNhdGlvbiUwQWZyb20lMjBQSUwlMjBpbXBvcnQlMjBJbWFnZSUwQWltcG9ydCUyMHJlcXVlc3RzJTBBJTBBdXJsJTIwJTNEJTIwJTIyaHR0cCUzQSUyRiUyRmltYWdlcy5jb2NvZGF0YXNldC5vcmclMkZ2YWwyMDE3JTJGMDAwMDAwMDM5NzY5LmpwZyUyMiUwQWltYWdlJTIwJTNEJTIwSW1hZ2Uub3BlbihyZXF1ZXN0cy5nZXQodXJsJTJDJTIwc3RyZWFtJTNEVHJ1ZSkucmF3KSUwQSUwQWltYWdlX3Byb2Nlc3NvciUyMCUzRCUyMEF1dG9JbWFnZVByb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIybWljcm9zb2Z0JTJGYmVpdC1iYXNlLXBhdGNoMTYtMjI0JTIyKSUwQW1vZGVsJTIwJTNEJTIwRmxheEJlaXRGb3JJbWFnZUNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZCglMjJtaWNyb3NvZnQlMkZiZWl0LWJhc2UtcGF0Y2gxNi0yMjQlMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwaW1hZ2VfcHJvY2Vzc29yKGltYWdlcyUzRGltYWdlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJucCUyMiklMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBbG9naXRzJTIwJTNEJTIwb3V0cHV0cy5sb2dpdHMlMEElMjMlMjBtb2RlbCUyMHByZWRpY3RzJTIwb25lJTIwb2YlMjB0aGUlMjAxMDAwJTIwSW1hZ2VOZXQlMjBjbGFzc2VzJTBBcHJlZGljdGVkX2NsYXNzX2lkeCUyMCUzRCUyMGxvZ2l0cy5hcmdtYXgoLTEpLml0ZW0oKSUwQXByaW50KCUyMlByZWRpY3RlZCUyMGNsYXNzJTNBJTIyJTJDJTIwbW9kZWwuY29uZmlnLmlkMmxhYmVsJTVCcHJlZGljdGVkX2NsYXNzX2lkeCU1RCk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, FlaxBeitForImageClassification
<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;microsoft/beit-base-patch16-224&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxBeitForImageClassification.from_pretrained(<span class="hljs-string">&quot;microsoft/beit-base-patch16-224&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = image_processor(images=image, return_tensors=<span class="hljs-string">&quot;np&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># model predicts one of the 1000 ImageNet classes</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_class_idx = logits.argmax(-<span class="hljs-number">1</span>).item()
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(<span class="hljs-string">&quot;Predicted class:&quot;</span>, model.config.id2label[predicted_class_idx])`}}),{c(){p=a("p"),v=r("Example:"),_=c(),y(g.$$.fragment)},l(l){p=s(l,"P",{});var f=n(p);v=i(f,"Example:"),f.forEach(o),_=m(l),w(g.$$.fragment,l)},m(l,f){u(l,p,f),e(p,v),u(l,_,f),T(g,l,f),b=!0},p:jt,i(l){b||(M(g.$$.fragment,l),b=!0)},o(l){B(g.$$.fragment,l),b=!1},d(l){l&&o(p),l&&o(_),$(g,l)}}}function Mu(x){let p,v,_,g,b,l,f,E,ai,Pn,me,Ue,ps,Jt,si,hs,ni,Zn,X,ri,zt,ii,li,Nt,di,ci,Wt,mi,pi,An,ga,hi,Sn,_a,fs,fi,Rn,ba,ui,Vn,J,I,gi,va,_i,bi,ya,vi,yi,Ut,wi,Ti,wa,Mi,Bi,Ta,$i,xi,Ma,Ei,Fi,Ba,Ii,ki,ji,Pt,Ci,Zt,Ji,zi,Ni,At,Wi,$a,Ui,Pi,Zi,pe,Ai,us,Si,Ri,St,Vi,Xi,Gi,he,Li,Rt,Di,Yi,Vt,qi,Oi,Qi,A,Hi,gs,Ki,el,_s,tl,ol,xa,al,sl,bs,nl,rl,Xn,Pe,Mp,Gn,Xt,il,Ea,ll,Ln,G,dl,Gt,cl,ml,Lt,pl,hl,Dt,fl,ul,Dn,fe,Ze,vs,Yt,gl,ys,_l,Yn,Fa,bl,qn,qt,On,Ae,le,Ia,vl,yl,Ot,wl,Tl,Qt,Ml,Bl,$l,ka,xl,ja,El,Qn,Ca,ws,Fl,Hn,Ja,Ts,za,Il,Kn,Na,kl,er,ue,Se,Ms,Ht,jl,Bs,Cl,tr,ge,Kt,Jl,eo,zl,Wa,Nl,Wl,or,_e,to,Ul,oo,Pl,Ua,Zl,Al,ar,be,Re,$s,ao,Sl,xs,Rl,sr,K,so,Vl,ve,Xl,Pa,Gl,Ll,no,Dl,Yl,ql,Ve,nr,ye,Xe,Es,ro,Ol,Fs,Ql,rr,ee,io,Hl,Za,lo,Kl,Ge,co,ed,mo,td,Aa,od,ad,ir,we,Le,Is,po,sd,ks,nd,lr,S,ho,rd,js,id,ld,De,fo,dd,Cs,cd,md,Ye,uo,pd,go,hd,Sa,fd,ud,dr,Te,qe,Js,_o,gd,zs,_d,cr,te,bo,bd,vo,vd,yo,yd,wd,Td,L,wo,Md,Me,Bd,Ra,$d,xd,Ns,Ed,Fd,Id,Oe,kd,Qe,mr,Be,He,Ws,To,jd,Us,Cd,pr,oe,Mo,Jd,ae,zd,Va,Nd,Wd,Xa,Ud,Pd,Bo,Zd,Ad,Sd,D,$o,Rd,$e,Vd,Ga,Xd,Gd,Ps,Ld,Dd,Yd,Ke,qd,et,hr,xe,tt,Zs,xo,Od,As,Qd,fr,R,Eo,Hd,Ss,Kd,ec,Fo,tc,Io,oc,ac,sc,Y,ko,nc,Ee,rc,La,ic,lc,Rs,dc,cc,mc,ot,pc,at,ur,Fe,st,Vs,jo,hc,Xs,fc,gr,V,Co,uc,Gs,gc,_c,Jo,bc,zo,vc,yc,wc,q,No,Tc,Ie,Mc,Da,Bc,$c,Ls,xc,Ec,Fc,nt,Ic,rt,_r,ke,it,Ds,Wo,kc,Ys,jc,br,k,Uo,Cc,qs,Jc,zc,Po,Nc,Ya,Wc,Uc,Pc,Zo,Zc,Ao,Ac,Sc,Rc,Os,Vc,Xc,se,Qs,So,Gc,Lc,Hs,Ro,Dc,Yc,Ks,Vo,qc,Oc,en,Xo,Qc,Hc,O,Go,Kc,je,em,tn,tm,om,on,am,sm,nm,lt,rm,dt,vr,Ce,ct,an,Lo,im,sn,lm,yr,j,Do,dm,nn,cm,mm,Yo,pm,qa,hm,fm,um,qo,gm,Oo,_m,bm,vm,rn,ym,wm,ne,ln,Qo,Tm,Mm,dn,Ho,Bm,$m,cn,Ko,xm,Em,mn,ea,Fm,Im,N,ta,km,Je,jm,pn,Cm,Jm,hn,zm,Nm,Wm,mt,Um,ze,Pm,fn,Zm,Am,un,Sm,Rm,Vm,pt,wr,Ne,ht,gn,oa,Xm,_n,Gm,Tr,C,aa,Lm,bn,Dm,Ym,sa,qm,Oa,Om,Qm,Hm,na,Km,ra,ep,tp,op,vn,ap,sp,re,yn,ia,np,rp,wn,la,ip,lp,Tn,da,dp,cp,Mn,ca,mp,pp,Q,ma,hp,We,fp,Bn,up,gp,$n,_p,bp,vp,ft,yp,ut,Mr;return l=new Z({}),Jt=new Z({}),Yt=new Z({}),qt=new iu({props:{pipeline:"image-classification"}}),Ht=new Z({}),Kt=new F({props:{name:"class transformers.models.beit.modeling_beit.BeitModelOutputWithPooling",anchor:"transformers.models.beit.modeling_beit.BeitModelOutputWithPooling",parameters:[{name:"last_hidden_state",val:": FloatTensor = None"},{name:"pooler_output",val:": FloatTensor = None"},{name:"hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"}],parametersDescription:[{anchor:"transformers.models.beit.modeling_beit.BeitModelOutputWithPooling.last_hidden_state",description:`<strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) &#x2014;
Sequence of hidden-states at the output of the last layer of the model.`,name:"last_hidden_state"},{anchor:"transformers.models.beit.modeling_beit.BeitModelOutputWithPooling.pooler_output",description:`<strong>pooler_output</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, hidden_size)</code>) &#x2014;
Average of the last layer hidden states of the patch tokens (excluding the <em>[CLS]</em> token) if
<em>config.use_mean_pooling</em> is set to True. If set to False, then the final hidden state of the <em>[CLS]</em> token
will be returned.`,name:"pooler_output"},{anchor:"transformers.models.beit.modeling_beit.BeitModelOutputWithPooling.hidden_states",description:`<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>) &#x2014;
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>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.`,name:"hidden_states"},{anchor:"transformers.models.beit.modeling_beit.BeitModelOutputWithPooling.attentions",description:`<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>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.`,name:"attentions"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/beit/modeling_beit.py#L68"}}),to=new F({props:{name:"class transformers.models.beit.modeling_flax_beit.FlaxBeitModelOutputWithPooling",anchor:"transformers.models.beit.modeling_flax_beit.FlaxBeitModelOutputWithPooling",parameters:[{name:"last_hidden_state",val:": ndarray = None"},{name:"pooler_output",val:": ndarray = None"},{name:"hidden_states",val:": typing.Optional[typing.Tuple[jax._src.numpy.ndarray.ndarray]] = None"},{name:"attentions",val:": typing.Optional[typing.Tuple[jax._src.numpy.ndarray.ndarray]] = None"}],parametersDescription:[{anchor:"transformers.models.beit.modeling_flax_beit.FlaxBeitModelOutputWithPooling.last_hidden_state",description:`<strong>last_hidden_state</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) &#x2014;
Sequence of hidden-states at the output of the last layer of the model.`,name:"last_hidden_state"},{anchor:"transformers.models.beit.modeling_flax_beit.FlaxBeitModelOutputWithPooling.pooler_output",description:`<strong>pooler_output</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, hidden_size)</code>) &#x2014;
Average of the last layer hidden states of the patch tokens (excluding the <em>[CLS]</em> token) if
<em>config.use_mean_pooling</em> is set to True. If set to False, then the final hidden state of the <em>[CLS]</em> token
will be returned.`,name:"pooler_output"},{anchor:"transformers.models.beit.modeling_flax_beit.FlaxBeitModelOutputWithPooling.hidden_states",description:`<strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>jnp.ndarray</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.`,name:"hidden_states"},{anchor:"transformers.models.beit.modeling_flax_beit.FlaxBeitModelOutputWithPooling.attentions",description:`<strong>attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>jnp.ndarray</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.`,name:"attentions"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/beit/modeling_flax_beit.py#L45"}}),ao=new Z({}),so=new F({props:{name:"class transformers.BeitConfig",anchor:"transformers.BeitConfig",parameters:[{name:"vocab_size",val:" = 8192"},{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:"use_mask_token",val:" = False"},{name:"use_absolute_position_embeddings",val:" = False"},{name:"use_relative_position_bias",val:" = False"},{name:"use_shared_relative_position_bias",val:" = False"},{name:"layer_scale_init_value",val:" = 0.1"},{name:"drop_path_rate",val:" = 0.1"},{name:"use_mean_pooling",val:" = True"},{name:"out_indices",val:" = [3, 5, 7, 11]"},{name:"pool_scales",val:" = [1, 2, 3, 6]"},{name:"use_auxiliary_head",val:" = True"},{name:"auxiliary_loss_weight",val:" = 0.4"},{name:"auxiliary_channels",val:" = 256"},{name:"auxiliary_num_convs",val:" = 1"},{name:"auxiliary_concat_input",val:" = False"},{name:"semantic_loss_ignore_index",val:" = 255"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.BeitConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 8092) &#x2014;
Vocabulary size of the BEiT model. Defines the number of different image tokens that can be used during
pre-training.`,name:"vocab_size"},{anchor:"transformers.BeitConfig.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.BeitConfig.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.BeitConfig.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.BeitConfig.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.BeitConfig.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.BeitConfig.hidden_dropout_prob",description:`<strong>hidden_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout probability for all fully connected layers in the embeddings, encoder, and pooler.`,name:"hidden_dropout_prob"},{anchor:"transformers.BeitConfig.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.BeitConfig.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.BeitConfig.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.BeitConfig.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.BeitConfig.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.BeitConfig.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.BeitConfig.use_mask_token",description:`<strong>use_mask_token</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to use a mask token for masked image modeling.`,name:"use_mask_token"},{anchor:"transformers.BeitConfig.use_absolute_position_embeddings",description:`<strong>use_absolute_position_embeddings</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to use BERT-style absolute position embeddings.`,name:"use_absolute_position_embeddings"},{anchor:"transformers.BeitConfig.use_relative_position_bias",description:`<strong>use_relative_position_bias</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to use T5-style relative position embeddings in the self-attention layers.`,name:"use_relative_position_bias"},{anchor:"transformers.BeitConfig.use_shared_relative_position_bias",description:`<strong>use_shared_relative_position_bias</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to use the same relative position embeddings across all self-attention layers of the Transformer.`,name:"use_shared_relative_position_bias"},{anchor:"transformers.BeitConfig.layer_scale_init_value",description:`<strong>layer_scale_init_value</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
Scale to use in the self-attention layers. 0.1 for base, 1e-5 for large. Set 0 to disable layer scale.`,name:"layer_scale_init_value"},{anchor:"transformers.BeitConfig.drop_path_rate",description:`<strong>drop_path_rate</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
Stochastic depth rate per sample (when applied in the main path of residual layers).`,name:"drop_path_rate"},{anchor:"transformers.BeitConfig.use_mean_pooling",description:`<strong>use_mean_pooling</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to mean pool the final hidden states of the patches instead of using the final hidden state of the
CLS token, before applying the classification head.`,name:"use_mean_pooling"},{anchor:"transformers.BeitConfig.out_indices",description:`<strong>out_indices</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[3, 5, 7, 11]</code>) &#x2014;
Indices of the feature maps to use for semantic segmentation.`,name:"out_indices"},{anchor:"transformers.BeitConfig.pool_scales",description:`<strong>pool_scales</strong> (<code>Tuple[int]</code>, <em>optional</em>, defaults to <code>[1, 2, 3, 6]</code>) &#x2014;
Pooling scales used in Pooling Pyramid Module applied on the last feature map.`,name:"pool_scales"},{anchor:"transformers.BeitConfig.use_auxiliary_head",description:`<strong>use_auxiliary_head</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to use an auxiliary head during training.`,name:"use_auxiliary_head"},{anchor:"transformers.BeitConfig.auxiliary_loss_weight",description:`<strong>auxiliary_loss_weight</strong> (<code>float</code>, <em>optional</em>, defaults to 0.4) &#x2014;
Weight of the cross-entropy loss of the auxiliary head.`,name:"auxiliary_loss_weight"},{anchor:"transformers.BeitConfig.auxiliary_channels",description:`<strong>auxiliary_channels</strong> (<code>int</code>, <em>optional</em>, defaults to 256) &#x2014;
Number of channels to use in the auxiliary head.`,name:"auxiliary_channels"},{anchor:"transformers.BeitConfig.auxiliary_num_convs",description:`<strong>auxiliary_num_convs</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
Number of convolutional layers to use in the auxiliary head.`,name:"auxiliary_num_convs"},{anchor:"transformers.BeitConfig.auxiliary_concat_input",description:`<strong>auxiliary_concat_input</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to concatenate the output of the auxiliary head with the input before the classification layer.`,name:"auxiliary_concat_input"},{anchor:"transformers.BeitConfig.semantic_loss_ignore_index",description:`<strong>semantic_loss_ignore_index</strong> (<code>int</code>, <em>optional</em>, defaults to 255) &#x2014;
The index that is ignored by the loss function of the semantic segmentation model.`,name:"semantic_loss_ignore_index"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/beit/configuration_beit.py#L36"}}),Ve=new kt({props:{anchor:"transformers.BeitConfig.example",$$slots:{default:[lu]},$$scope:{ctx:x}}}),ro=new Z({}),io=new F({props:{name:"class transformers.BeitFeatureExtractor",anchor:"transformers.BeitFeatureExtractor",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/beit/feature_extraction_beit.py#L26"}}),lo=new F({props:{name:"__call__",anchor:"transformers.BeitFeatureExtractor.__call__",parameters:[{name:"images",val:""},{name:"segmentation_maps",val:" = None"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/beit/image_processing_beit.py#L356"}}),co=new F({props:{name:"post_process_semantic_segmentation",anchor:"transformers.BeitFeatureExtractor.post_process_semantic_segmentation",parameters:[{name:"outputs",val:""},{name:"target_sizes",val:": typing.List[typing.Tuple] = None"}],parametersDescription:[{anchor:"transformers.BeitFeatureExtractor.post_process_semantic_segmentation.outputs",description:`<strong>outputs</strong> (<a href="/docs/transformers/v4.30.0/en/model_doc/beit#transformers.BeitForSemanticSegmentation">BeitForSemanticSegmentation</a>) &#x2014;
Raw outputs of the model.`,name:"outputs"},{anchor:"transformers.BeitFeatureExtractor.post_process_semantic_segmentation.target_sizes",description:`<strong>target_sizes</strong> (<code>List[Tuple]</code> of length <code>batch_size</code>, <em>optional</em>) &#x2014;
List of tuples corresponding to the requested final size (height, width) of each prediction. If left to
None, predictions will not be resized.`,name:"target_sizes"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/beit/image_processing_beit.py#L503",returnDescription:`
<p><code>List[torch.Tensor]</code> of length <code>batch_size</code>, where each item is a semantic
segmentation map of shape (height, width) corresponding to the target_sizes entry (if <code>target_sizes</code> is
specified). Each entry of each <code>torch.Tensor</code> correspond to a semantic class id.</p>
`,returnType:`
<p>semantic_segmentation</p>
`}}),po=new Z({}),ho=new F({props:{name:"class transformers.BeitImageProcessor",anchor:"transformers.BeitImageProcessor",parameters:[{name:"do_resize",val:": bool = True"},{name:"size",val:": typing.Dict[str, int] = None"},{name:"resample",val:": Resampling = <Resampling.BICUBIC: 3>"},{name:"do_center_crop",val:": bool = True"},{name:"crop_size",val:": typing.Dict[str, int] = None"},{name:"rescale_factor",val:": typing.Union[int, float] = 0.00392156862745098"},{name:"do_rescale",val:": bool = True"},{name:"do_normalize",val:": bool = True"},{name:"image_mean",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"image_std",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"do_reduce_labels",val:": bool = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.BeitImageProcessor.do_resize",description:`<strong>do_resize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to resize the image&#x2019;s (height, width) dimensions to the specified <code>size</code>. Can be overridden by the
<code>do_resize</code> parameter in the <code>preprocess</code> method.`,name:"do_resize"},{anchor:"transformers.BeitImageProcessor.size",description:`<strong>size</strong> (<code>Dict[str, int]</code> <em>optional</em>, defaults to <code>{&quot;height&quot; -- 256, &quot;width&quot;: 256}</code>):
Size of the output image after resizing. Can be overridden by the <code>size</code> parameter in the <code>preprocess</code>
method.`,name:"size"},{anchor:"transformers.BeitImageProcessor.resample",description:`<strong>resample</strong> (<code>PILImageResampling</code>, <em>optional</em>, defaults to <code>PILImageResampling.BICUBIC</code>) &#x2014;
Resampling filter to use if resizing the image. Can be overridden by the <code>resample</code> parameter in the
<code>preprocess</code> method.`,name:"resample"},{anchor:"transformers.BeitImageProcessor.do_center_crop",description:`<strong>do_center_crop</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to center crop the image. If the input size is smaller than <code>crop_size</code> along any edge, the image
is padded with 0&#x2019;s and then center cropped. Can be overridden by the <code>do_center_crop</code> parameter in the
<code>preprocess</code> method.`,name:"do_center_crop"},{anchor:"transformers.BeitImageProcessor.crop_size",description:`<strong>crop_size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>{&quot;height&quot; -- 224, &quot;width&quot;: 224}</code>):
Desired output size when applying center-cropping. Only has an effect if <code>do_center_crop</code> is set to <code>True</code>.
Can be overridden by the <code>crop_size</code> parameter in the <code>preprocess</code> method.`,name:"crop_size"},{anchor:"transformers.BeitImageProcessor.do_rescale",description:`<strong>do_rescale</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to rescale the image by the specified scale <code>rescale_factor</code>. Can be overridden by the <code>do_rescale</code>
parameter in the <code>preprocess</code> method.`,name:"do_rescale"},{anchor:"transformers.BeitImageProcessor.rescale_factor",description:`<strong>rescale_factor</strong> (<code>int</code> or <code>float</code>, <em>optional</em>, defaults to <code>1/255</code>) &#x2014;
Scale factor to use if rescaling the image. Can be overridden by the <code>rescale_factor</code> parameter in the
<code>preprocess</code> method.`,name:"rescale_factor"},{anchor:"transformers.BeitImageProcessor.do_normalize",description:`<strong>do_normalize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to normalize the image. Can be overridden by the <code>do_normalize</code> parameter in the <code>preprocess</code>
method.`,name:"do_normalize"},{anchor:"transformers.BeitImageProcessor.image_mean",description:`<strong>image_mean</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>IMAGENET_STANDARD_MEAN</code>) &#x2014;
The mean to use if normalizing the image. This is a float or list of floats of length of the number of
channels of the image. Can be overridden by the <code>image_mean</code> parameter in the <code>preprocess</code> method.`,name:"image_mean"},{anchor:"transformers.BeitImageProcessor.image_std",description:`<strong>image_std</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>IMAGENET_STANDARD_STD</code>) &#x2014;
The standard deviation to use if normalizing the image. This is a float or list of floats of length of the
number of channels of the image. Can be overridden by the <code>image_std</code> parameter in the <code>preprocess</code> method.`,name:"image_std"},{anchor:"transformers.BeitImageProcessor.do_reduce_labels",description:`<strong>do_reduce_labels</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to reduce all label values of segmentation maps by 1. Usually used for datasets where 0 is
used for background, and background itself is not included in all classes of a dataset (e.g. ADE20k). The
background label will be replaced by 255. Can be overridden by the <code>do_reduce_labels</code> parameter in the
<code>preprocess</code> method.`,name:"do_reduce_labels"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/beit/image_processing_beit.py#L47"}}),fo=new F({props:{name:"preprocess",anchor:"transformers.BeitImageProcessor.preprocess",parameters:[{name:"images",val:": typing.Union[ForwardRef('PIL.Image.Image'), numpy.ndarray, ForwardRef('torch.Tensor'), typing.List[ForwardRef('PIL.Image.Image')], typing.List[numpy.ndarray], typing.List[ForwardRef('torch.Tensor')]]"},{name:"segmentation_maps",val:": typing.Union[ForwardRef('PIL.Image.Image'), numpy.ndarray, ForwardRef('torch.Tensor'), typing.List[ForwardRef('PIL.Image.Image')], typing.List[numpy.ndarray], typing.List[ForwardRef('torch.Tensor')], NoneType] = None"},{name:"do_resize",val:": bool = None"},{name:"size",val:": typing.Dict[str, int] = None"},{name:"resample",val:": Resampling = None"},{name:"do_center_crop",val:": bool = None"},{name:"crop_size",val:": typing.Dict[str, int] = None"},{name:"do_rescale",val:": bool = None"},{name:"rescale_factor",val:": float = None"},{name:"do_normalize",val:": bool = None"},{name:"image_mean",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"image_std",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"do_reduce_labels",val:": typing.Optional[bool] = None"},{name:"return_tensors",val:": typing.Union[str, transformers.utils.generic.TensorType, NoneType] = None"},{name:"data_format",val:": ChannelDimension = <ChannelDimension.FIRST: 'channels_first'>"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.BeitImageProcessor.preprocess.images",description:`<strong>images</strong> (<code>ImageInput</code>) &#x2014;
Image to preprocess.`,name:"images"},{anchor:"transformers.BeitImageProcessor.preprocess.do_resize",description:`<strong>do_resize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_resize</code>) &#x2014;
Whether to resize the image.`,name:"do_resize"},{anchor:"transformers.BeitImageProcessor.preprocess.size",description:`<strong>size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>self.size</code>) &#x2014;
Size of the image after resizing.`,name:"size"},{anchor:"transformers.BeitImageProcessor.preprocess.resample",description:`<strong>resample</strong> (<code>int</code>, <em>optional</em>, defaults to <code>self.resample</code>) &#x2014;
Resampling filter to use if resizing the image. This can be one of the enum <code>PILImageResampling</code>, Only
has an effect if <code>do_resize</code> is set to <code>True</code>.`,name:"resample"},{anchor:"transformers.BeitImageProcessor.preprocess.do_center_crop",description:`<strong>do_center_crop</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_center_crop</code>) &#x2014;
Whether to center crop the image.`,name:"do_center_crop"},{anchor:"transformers.BeitImageProcessor.preprocess.crop_size",description:`<strong>crop_size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>self.crop_size</code>) &#x2014;
Size of the image after center crop. If one edge the image is smaller than <code>crop_size</code>, it will be
padded with zeros and then cropped`,name:"crop_size"},{anchor:"transformers.BeitImageProcessor.preprocess.do_rescale",description:`<strong>do_rescale</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_rescale</code>) &#x2014;
Whether to rescale the image values between [0 - 1].`,name:"do_rescale"},{anchor:"transformers.BeitImageProcessor.preprocess.rescale_factor",description:`<strong>rescale_factor</strong> (<code>float</code>, <em>optional</em>, defaults to <code>self.rescale_factor</code>) &#x2014;
Rescale factor to rescale the image by if <code>do_rescale</code> is set to <code>True</code>.`,name:"rescale_factor"},{anchor:"transformers.BeitImageProcessor.preprocess.do_normalize",description:`<strong>do_normalize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_normalize</code>) &#x2014;
Whether to normalize the image.`,name:"do_normalize"},{anchor:"transformers.BeitImageProcessor.preprocess.image_mean",description:`<strong>image_mean</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>self.image_mean</code>) &#x2014;
Image mean.`,name:"image_mean"},{anchor:"transformers.BeitImageProcessor.preprocess.image_std",description:`<strong>image_std</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>self.image_std</code>) &#x2014;
Image standard deviation.`,name:"image_std"},{anchor:"transformers.BeitImageProcessor.preprocess.do_reduce_labels",description:`<strong>do_reduce_labels</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_reduce_labels</code>) &#x2014;
Whether or not to reduce all label values of segmentation maps by 1. Usually used for datasets where 0
is used for background, and background itself is not included in all classes of a dataset (e.g.
ADE20k). The background label will be replaced by 255.`,name:"do_reduce_labels"},{anchor:"transformers.BeitImageProcessor.preprocess.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <code>TensorType</code>, <em>optional</em>) &#x2014;
The type of tensors to return. Can be one of:<ul>
<li>Unset: Return a list of <code>np.ndarray</code>.</li>
<li><code>TensorType.TENSORFLOW</code> or <code>&apos;tf&apos;</code>: Return a batch of type <code>tf.Tensor</code>.</li>
<li><code>TensorType.PYTORCH</code> or <code>&apos;pt&apos;</code>: Return a batch of type <code>torch.Tensor</code>.</li>
<li><code>TensorType.NUMPY</code> or <code>&apos;np&apos;</code>: Return a batch of type <code>np.ndarray</code>.</li>
<li><code>TensorType.JAX</code> or <code>&apos;jax&apos;</code>: Return a batch of type <code>jax.numpy.ndarray</code>.</li>
</ul>`,name:"return_tensors"},{anchor:"transformers.BeitImageProcessor.preprocess.data_format",description:`<strong>data_format</strong> (<code>ChannelDimension</code> or <code>str</code>, <em>optional</em>, defaults to <code>ChannelDimension.FIRST</code>) &#x2014;
The channel dimension format for the output image. Can be one of:<ul>
<li><code>ChannelDimension.FIRST</code>: image in (num_channels, height, width) format.</li>
<li><code>ChannelDimension.LAST</code>: image in (height, width, num_channels) format.</li>
</ul>`,name:"data_format"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/beit/image_processing_beit.py#L361"}}),uo=new F({props:{name:"post_process_semantic_segmentation",anchor:"transformers.BeitImageProcessor.post_process_semantic_segmentation",parameters:[{name:"outputs",val:""},{name:"target_sizes",val:": typing.List[typing.Tuple] = None"}],parametersDescription:[{anchor:"transformers.BeitImageProcessor.post_process_semantic_segmentation.outputs",description:`<strong>outputs</strong> (<a href="/docs/transformers/v4.30.0/en/model_doc/beit#transformers.BeitForSemanticSegmentation">BeitForSemanticSegmentation</a>) &#x2014;
Raw outputs of the model.`,name:"outputs"},{anchor:"transformers.BeitImageProcessor.post_process_semantic_segmentation.target_sizes",description:`<strong>target_sizes</strong> (<code>List[Tuple]</code> of length <code>batch_size</code>, <em>optional</em>) &#x2014;
List of tuples corresponding to the requested final size (height, width) of each prediction. If left to
None, predictions will not be resized.`,name:"target_sizes"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/beit/image_processing_beit.py#L503",returnDescription:`
<p><code>List[torch.Tensor]</code> of length <code>batch_size</code>, where each item is a semantic
segmentation map of shape (height, width) corresponding to the target_sizes entry (if <code>target_sizes</code> is
specified). Each entry of each <code>torch.Tensor</code> correspond to a semantic class id.</p>
`,returnType:`
<p>semantic_segmentation</p>
`}}),_o=new Z({}),bo=new F({props:{name:"class transformers.BeitModel",anchor:"transformers.BeitModel",parameters:[{name:"config",val:": BeitConfig"},{name:"add_pooling_layer",val:": bool = True"}],parametersDescription:[{anchor:"transformers.BeitModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.30.0/en/model_doc/beit#transformers.BeitConfig">BeitConfig</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.30.0/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.30.0/src/transformers/models/beit/modeling_beit.py#L618"}}),wo=new F({props:{name:"forward",anchor:"transformers.BeitModel.forward",parameters:[{name:"pixel_values",val:": typing.Optional[torch.Tensor] = None"},{name:"bool_masked_pos",val:": typing.Optional[torch.BoolTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.BeitModel.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.30.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.30.0/en/model_doc/beit#transformers.BeitFeatureExtractor.__call__">BeitImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.BeitModel.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.BeitModel.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.BeitModel.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.BeitModel.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.30.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.BeitModel.forward.bool_masked_pos",description:`<strong>bool_masked_pos</strong> (<code>torch.BoolTensor</code> of shape <code>(batch_size, num_patches)</code>, <em>optional</em>) &#x2014;
Boolean masked positions. Indicates which patches are masked (1) and which aren&#x2019;t (0).`,name:"bool_masked_pos"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/beit/modeling_beit.py#L645",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.30.0/en/model_doc/beit#transformers.models.beit.modeling_beit.BeitModelOutputWithPooling"
>transformers.models.beit.modeling_beit.BeitModelOutputWithPooling</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.30.0/en/model_doc/beit#transformers.BeitConfig"
>BeitConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>pooler_output</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, hidden_size)</code>) \u2014 Average of the last layer hidden states of the patch tokens (excluding the <em>[CLS]</em> token) if
<em>config.use_mean_pooling</em> is set to True. If set to False, then the final hidden state of the <em>[CLS]</em> token
will be returned.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.30.0/en/model_doc/beit#transformers.models.beit.modeling_beit.BeitModelOutputWithPooling"
>transformers.models.beit.modeling_beit.BeitModelOutputWithPooling</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Oe=new ua({props:{$$slots:{default:[du]},$$scope:{ctx:x}}}),Qe=new kt({props:{anchor:"transformers.BeitModel.forward.example",$$slots:{default:[cu]},$$scope:{ctx:x}}}),To=new Z({}),Mo=new F({props:{name:"class transformers.BeitForMaskedImageModeling",anchor:"transformers.BeitForMaskedImageModeling",parameters:[{name:"config",val:": BeitConfig"}],parametersDescription:[{anchor:"transformers.BeitForMaskedImageModeling.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.30.0/en/model_doc/beit#transformers.BeitConfig">BeitConfig</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.30.0/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.30.0/src/transformers/models/beit/modeling_beit.py#L733"}}),$o=new F({props:{name:"forward",anchor:"transformers.BeitForMaskedImageModeling.forward",parameters:[{name:"pixel_values",val:": typing.Optional[torch.Tensor] = None"},{name:"bool_masked_pos",val:": typing.Optional[torch.BoolTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.BeitForMaskedImageModeling.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.30.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.30.0/en/model_doc/beit#transformers.BeitFeatureExtractor.__call__">BeitImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.BeitForMaskedImageModeling.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.BeitForMaskedImageModeling.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.BeitForMaskedImageModeling.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.BeitForMaskedImageModeling.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.30.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.BeitForMaskedImageModeling.forward.bool_masked_pos",description:`<strong>bool_masked_pos</strong> (<code>torch.BoolTensor</code> of shape <code>(batch_size, num_patches)</code>) &#x2014;
Boolean masked positions. Indicates which patches are masked (1) and which aren&#x2019;t (0).`,name:"bool_masked_pos"},{anchor:"transformers.BeitForMaskedImageModeling.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the image classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss), If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/beit/modeling_beit.py#L747",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.30.0/en/main_classes/output#transformers.modeling_outputs.MaskedLMOutput"
>transformers.modeling_outputs.MaskedLMOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.30.0/en/model_doc/beit#transformers.BeitConfig"
>BeitConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Masked language modeling (MLM) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.30.0/en/main_classes/output#transformers.modeling_outputs.MaskedLMOutput"
>transformers.modeling_outputs.MaskedLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ke=new ua({props:{$$slots:{default:[mu]},$$scope:{ctx:x}}}),et=new kt({props:{anchor:"transformers.BeitForMaskedImageModeling.forward.example",$$slots:{default:[pu]},$$scope:{ctx:x}}}),xo=new Z({}),Eo=new F({props:{name:"class transformers.BeitForImageClassification",anchor:"transformers.BeitForImageClassification",parameters:[{name:"config",val:": BeitConfig"}],parametersDescription:[{anchor:"transformers.BeitForImageClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.30.0/en/model_doc/beit#transformers.BeitConfig">BeitConfig</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.30.0/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.30.0/src/transformers/models/beit/modeling_beit.py#L833"}}),ko=new F({props:{name:"forward",anchor:"transformers.BeitForImageClassification.forward",parameters:[{name:"pixel_values",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.BeitForImageClassification.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.30.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.30.0/en/model_doc/beit#transformers.BeitFeatureExtractor.__call__">BeitImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.BeitForImageClassification.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.BeitForImageClassification.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.BeitForImageClassification.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.BeitForImageClassification.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.30.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.BeitForImageClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the image classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss), If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/beit/modeling_beit.py#L846",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.30.0/en/main_classes/output#transformers.modeling_outputs.ImageClassifierOutput"
>transformers.modeling_outputs.ImageClassifierOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.30.0/en/model_doc/beit#transformers.BeitConfig"
>BeitConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification (or regression if config.num_labels==1) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Classification (or regression if config.num_labels==1) scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each stage) of shape <code>(batch_size, sequence_length, hidden_size)</code>. Hidden-states
(also called feature maps) of the model at the output of each stage.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, patch_size, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.30.0/en/main_classes/output#transformers.modeling_outputs.ImageClassifierOutput"
>transformers.modeling_outputs.ImageClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ot=new ua({props:{$$slots:{default:[hu]},$$scope:{ctx:x}}}),at=new kt({props:{anchor:"transformers.BeitForImageClassification.forward.example",$$slots:{default:[fu]},$$scope:{ctx:x}}}),jo=new Z({}),Co=new F({props:{name:"class transformers.BeitForSemanticSegmentation",anchor:"transformers.BeitForSemanticSegmentation",parameters:[{name:"config",val:": BeitConfig"}],parametersDescription:[{anchor:"transformers.BeitForSemanticSegmentation.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.30.0/en/model_doc/beit#transformers.BeitConfig">BeitConfig</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.30.0/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.30.0/src/transformers/models/beit/modeling_beit.py#L1156"}}),No=new F({props:{name:"forward",anchor:"transformers.BeitForSemanticSegmentation.forward",parameters:[{name:"pixel_values",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.BeitForSemanticSegmentation.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.30.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.30.0/en/model_doc/beit#transformers.BeitFeatureExtractor.__call__">BeitImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.BeitForSemanticSegmentation.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.BeitForSemanticSegmentation.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.BeitForSemanticSegmentation.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.BeitForSemanticSegmentation.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.30.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.BeitForSemanticSegmentation.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, height, width)</code>, <em>optional</em>) &#x2014;
Ground truth semantic segmentation maps for computing the loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels &gt; 1</code>, a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/beit/modeling_beit.py#L1202",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.30.0/en/main_classes/output#transformers.modeling_outputs.SemanticSegmenterOutput"
>transformers.modeling_outputs.SemanticSegmenterOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.30.0/en/model_doc/beit#transformers.BeitConfig"
>BeitConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification (or regression if config.num_labels==1) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels, logits_height, logits_width)</code>) \u2014 Classification scores for each pixel.</p>
<Tip warning={true}>
<p>The logits returned do not necessarily have the same size as the <code>pixel_values</code> passed as inputs. This is
to avoid doing two interpolations and lose some quality when a user needs to resize the logits to the
original image size as post-processing. You should always check your logits shape and resize as needed.</p>
</Tip>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, patch_size, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, patch_size, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.30.0/en/main_classes/output#transformers.modeling_outputs.SemanticSegmenterOutput"
>transformers.modeling_outputs.SemanticSegmenterOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),nt=new ua({props:{$$slots:{default:[uu]},$$scope:{ctx:x}}}),rt=new kt({props:{anchor:"transformers.BeitForSemanticSegmentation.forward.example",$$slots:{default:[gu]},$$scope:{ctx:x}}}),Wo=new Z({}),Uo=new F({props:{name:"class transformers.FlaxBeitModel",anchor:"transformers.FlaxBeitModel",parameters:[{name:"config",val:": BeitConfig"},{name:"input_shape",val:" = None"},{name:"seed",val:": int = 0"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"},{name:"_do_init",val:": bool = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlaxBeitModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.30.0/en/model_doc/beit#transformers.BeitConfig">BeitConfig</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.30.0/en/main_classes/model#transformers.FlaxPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.FlaxBeitModel.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/v4.30.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.30.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/beit/modeling_flax_beit.py#L744"}}),Go=new F({props:{name:"__call__",anchor:"transformers.FlaxBeitModel.__call__",parameters:[{name:"pixel_values",val:""},{name:"bool_masked_pos",val:" = None"},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"},{name:"train",val:": bool = False"},{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"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/beit/modeling_flax_beit.py#L631",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.30.0/en/model_doc/beit#transformers.models.beit.modeling_flax_beit.FlaxBeitModelOutputWithPooling"
>transformers.models.beit.modeling_flax_beit.FlaxBeitModelOutputWithPooling</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<code>&lt;class 'transformers.models.beit.configuration_beit.BeitConfig'&gt;</code>) and inputs.</p>
<ul>
<li><strong>last_hidden_state</strong> (<code>jnp.ndarray</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>pooler_output</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, hidden_size)</code>) \u2014 Average of the last layer hidden states of the patch tokens (excluding the <em>[CLS]</em> token) if
<em>config.use_mean_pooling</em> is set to True. If set to False, then the final hidden state of the <em>[CLS]</em> token
will be returned.</li>
<li><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</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>jnp.ndarray</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(jnp.ndarray)</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>jnp.ndarray</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><a
  href="/docs/transformers/v4.30.0/en/model_doc/beit#transformers.models.beit.modeling_flax_beit.FlaxBeitModelOutputWithPooling"
>transformers.models.beit.modeling_flax_beit.FlaxBeitModelOutputWithPooling</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),lt=new ua({props:{$$slots:{default:[_u]},$$scope:{ctx:x}}}),dt=new kt({props:{anchor:"transformers.FlaxBeitModel.__call__.example",$$slots:{default:[bu]},$$scope:{ctx:x}}}),Lo=new Z({}),Do=new F({props:{name:"class transformers.FlaxBeitForMaskedImageModeling",anchor:"transformers.FlaxBeitForMaskedImageModeling",parameters:[{name:"config",val:": BeitConfig"},{name:"input_shape",val:" = None"},{name:"seed",val:": int = 0"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"},{name:"_do_init",val:": bool = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlaxBeitForMaskedImageModeling.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.30.0/en/model_doc/beit#transformers.BeitConfig">BeitConfig</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.30.0/en/main_classes/model#transformers.FlaxPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.FlaxBeitForMaskedImageModeling.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/v4.30.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.30.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/beit/modeling_flax_beit.py#L828"}}),ta=new F({props:{name:"__call__",anchor:"transformers.FlaxBeitForMaskedImageModeling.__call__",parameters:[{name:"pixel_values",val:""},{name:"bool_masked_pos",val:" = None"},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"},{name:"train",val:": bool = False"},{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"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/beit/modeling_flax_beit.py#L631",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.30.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxMaskedLMOutput"
>transformers.modeling_flax_outputs.FlaxMaskedLMOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<code>&lt;class 'transformers.models.beit.configuration_beit.BeitConfig'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>logits</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</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>jnp.ndarray</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>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</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>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.30.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxMaskedLMOutput"
>transformers.modeling_flax_outputs.FlaxMaskedLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),mt=new ua({props:{$$slots:{default:[vu]},$$scope:{ctx:x}}}),pt=new kt({props:{anchor:"transformers.FlaxBeitForMaskedImageModeling.__call__.example",$$slots:{default:[yu]},$$scope:{ctx:x}}}),oa=new Z({}),aa=new F({props:{name:"class transformers.FlaxBeitForImageClassification",anchor:"transformers.FlaxBeitForImageClassification",parameters:[{name:"config",val:": BeitConfig"},{name:"input_shape",val:" = None"},{name:"seed",val:": int = 0"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"},{name:"_do_init",val:": bool = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlaxBeitForImageClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.30.0/en/model_doc/beit#transformers.BeitConfig">BeitConfig</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.30.0/en/main_classes/model#transformers.FlaxPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.FlaxBeitForImageClassification.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/v4.30.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.30.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/beit/modeling_flax_beit.py#L915"}}),ma=new F({props:{name:"__call__",anchor:"transformers.FlaxBeitForImageClassification.__call__",parameters:[{name:"pixel_values",val:""},{name:"bool_masked_pos",val:" = None"},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"},{name:"train",val:": bool = False"},{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"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/beit/modeling_flax_beit.py#L631",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.30.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxSequenceClassifierOutput"
>transformers.modeling_flax_outputs.FlaxSequenceClassifierOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<code>&lt;class 'transformers.models.beit.configuration_beit.BeitConfig'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>logits</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Classification (or regression if config.num_labels==1) scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</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>jnp.ndarray</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>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</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>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.30.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxSequenceClassifierOutput"
>transformers.modeling_flax_outputs.FlaxSequenceClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ft=new ua({props:{$$slots:{default:[wu]},$$scope:{ctx:x}}}),ut=new kt({props:{anchor:"transformers.FlaxBeitForImageClassification.__call__.example",$$slots:{default:[Tu]},$$scope:{ctx:x}}}),{c(){p=a("meta"),v=c(),_=a("h1"),g=a("a"),b=a("span"),y(l.$$.fragment),f=c(),E=a("span"),ai=r("BEiT"),Pn=c(),me=a("h2"),Ue=a("a"),ps=a("span"),y(Jt.$$.fragment),si=c(),hs=a("span"),ni=r("Overview"),Zn=c(),X=a("p"),ri=r("The BEiT model was proposed in "),zt=a("a"),ii=r("BEiT: BERT Pre-Training of Image Transformers"),li=r(` by
Hangbo Bao, Li Dong and Furu Wei. Inspired by BERT, BEiT is the first paper that makes self-supervised pre-training of
Vision Transformers (ViTs) outperform supervised pre-training. Rather than pre-training the model to predict the class
of an image (as done in the `),Nt=a("a"),di=r("original ViT paper"),ci=r(`), BEiT models are pre-trained to
predict visual tokens from the codebook of OpenAI\u2019s `),Wt=a("a"),mi=r("DALL-E model"),pi=r(` given masked
patches.`),An=c(),ga=a("p"),hi=r("The abstract from the paper is the following:"),Sn=c(),_a=a("p"),fs=a("em"),fi=r(`We introduce a self-supervised vision representation model BEiT, which stands for Bidirectional Encoder representation
from Image Transformers. Following BERT developed in the natural language processing area, we propose a masked image
modeling task to pretrain vision Transformers. Specifically, each image has two views in our pre-training, i.e, image
patches (such as 16x16 pixels), and visual tokens (i.e., discrete tokens). We first \u201Ctokenize\u201D the original image into
visual tokens. Then we randomly mask some image patches and fed them into the backbone Transformer. The pre-training
objective is to recover the original visual tokens based on the corrupted image patches. After pre-training BEiT, we
directly fine-tune the model parameters on downstream tasks by appending task layers upon the pretrained encoder.
Experimental results on image classification and semantic segmentation show that our model achieves competitive results
with previous pre-training methods. For example, base-size BEiT achieves 83.2% top-1 accuracy on ImageNet-1K,
significantly outperforming from-scratch DeiT training (81.8%) with the same setup. Moreover, large-size BEiT obtains
86.3% only using ImageNet-1K, even outperforming ViT-L with supervised pre-training on ImageNet-22K (85.2%).`),Rn=c(),ba=a("p"),ui=r("Tips:"),Vn=c(),J=a("ul"),I=a("li"),gi=r(`BEiT models are regular Vision Transformers, but pre-trained in a self-supervised way rather than supervised. They
outperform both the `),va=a("a"),_i=r("original model (ViT)"),bi=r(" as well as "),ya=a("a"),vi=r("Data-efficient Image Transformers (DeiT)"),yi=r(` when fine-tuned on ImageNet-1K and CIFAR-100. You can check out demo notebooks regarding inference as well as
fine-tuning on custom data `),Ut=a("a"),wi=r("here"),Ti=r(` (you can just replace
`),wa=a("a"),Mi=r("ViTFeatureExtractor"),Bi=r(" by "),Ta=a("a"),$i=r("BeitImageProcessor"),xi=r(` and
`),Ma=a("a"),Ei=r("ViTForImageClassification"),Fi=r(" by "),Ba=a("a"),Ii=r("BeitForImageClassification"),ki=r(")."),ji=c(),Pt=a("li"),Ci=r(`There\u2019s also a demo notebook available which showcases how to combine DALL-E\u2019s image tokenizer with BEiT for
performing masked image modeling. You can find it `),Zt=a("a"),Ji=r("here"),zi=r("."),Ni=c(),At=a("li"),Wi=r(`As the BEiT models expect each image to be of the same size (resolution), one can use
`),$a=a("a"),Ui=r("BeitImageProcessor"),Pi=r(" to resize (or rescale) and normalize images for the model."),Zi=c(),pe=a("li"),Ai=r(`Both the patch resolution and image resolution used during pre-training or fine-tuning are reflected in the name of
each checkpoint. For example, `),us=a("code"),Si=r("microsoft/beit-base-patch16-224"),Ri=r(` refers to a base-sized architecture with patch
resolution of 16x16 and fine-tuning resolution of 224x224. All checkpoints can be found on the `),St=a("a"),Vi=r("hub"),Xi=r("."),Gi=c(),he=a("li"),Li=r("The available checkpoints are either (1) pre-trained on "),Rt=a("a"),Di=r("ImageNet-22k"),Yi=r(` (a collection of
14 million images and 22k classes) only, (2) also fine-tuned on ImageNet-22k or (3) also fine-tuned on `),Vt=a("a"),qi=r("ImageNet-1k"),Oi=r(` (also referred to as ILSVRC 2012, a collection of 1.3 million
images and 1,000 classes).`),Qi=c(),A=a("li"),Hi=r(`BEiT uses relative position embeddings, inspired by the T5 model. During pre-training, the authors shared the
relative position bias among the several self-attention layers. During fine-tuning, each layer\u2019s relative position
bias is initialized with the shared relative position bias obtained after pre-training. Note that, if one wants to
pre-train a model from scratch, one needs to either set the `),gs=a("code"),Ki=r("use_relative_position_bias"),el=r(` or the
`),_s=a("code"),tl=r("use_relative_position_bias"),ol=r(" attribute of "),xa=a("a"),al=r("BeitConfig"),sl=r(" to "),bs=a("code"),nl=r("True"),rl=r(` in order to add
position embeddings.`),Xn=c(),Pe=a("img"),Gn=c(),Xt=a("small"),il=r("BEiT pre-training. Taken from the "),Ea=a("a"),ll=r("original paper."),Ln=c(),G=a("p"),dl=r("This model was contributed by "),Gt=a("a"),cl=r("nielsr"),ml=r(`. The JAX/FLAX version of this model was
contributed by `),Lt=a("a"),pl=r("kamalkraj"),hl=r(". The original code can be found "),Dt=a("a"),fl=r("here"),ul=r("."),Dn=c(),fe=a("h2"),Ze=a("a"),vs=a("span"),y(Yt.$$.fragment),gl=c(),ys=a("span"),_l=r("Resources"),Yn=c(),Fa=a("p"),bl=r("A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with BEiT."),qn=c(),y(qt.$$.fragment),On=c(),Ae=a("ul"),le=a("li"),Ia=a("a"),vl=r("BeitForImageClassification"),yl=r(" is supported by this "),Ot=a("a"),wl=r("example script"),Tl=r(" and "),Qt=a("a"),Ml=r("notebook"),Bl=r("."),$l=c(),ka=a("li"),xl=r("See also: "),ja=a("a"),El=r("Image classification task guide"),Qn=c(),Ca=a("p"),ws=a("strong"),Fl=r("Semantic segmentation"),Hn=c(),Ja=a("ul"),Ts=a("li"),za=a("a"),Il=r("Semantic segmentation task guide"),Kn=c(),Na=a("p"),kl=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."),er=c(),ue=a("h2"),Se=a("a"),Ms=a("span"),y(Ht.$$.fragment),jl=c(),Bs=a("span"),Cl=r("BEiT specific outputs"),tr=c(),ge=a("div"),y(Kt.$$.fragment),Jl=c(),eo=a("p"),zl=r("Class for outputs of "),Wa=a("a"),Nl=r("BeitModel"),Wl=r("."),or=c(),_e=a("div"),y(to.$$.fragment),Ul=c(),oo=a("p"),Pl=r("Class for outputs of "),Ua=a("a"),Zl=r("FlaxBeitModel"),Al=r("."),ar=c(),be=a("h2"),Re=a("a"),$s=a("span"),y(ao.$$.fragment),Sl=c(),xs=a("span"),Rl=r("BeitConfig"),sr=c(),K=a("div"),y(so.$$.fragment),Vl=c(),ve=a("p"),Xl=r("This is the configuration class to store the configuration of a "),Pa=a("a"),Gl=r("BeitModel"),Ll=r(`. It is used to instantiate an BEiT
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 BEiT
`),no=a("a"),Dl=r("microsoft/beit-base-patch16-224-pt22k"),Yl=r(" architecture."),ql=c(),y(Ve.$$.fragment),nr=c(),ye=a("h2"),Xe=a("a"),Es=a("span"),y(ro.$$.fragment),Ol=c(),Fs=a("span"),Ql=r("BeitFeatureExtractor"),rr=c(),ee=a("div"),y(io.$$.fragment),Hl=c(),Za=a("div"),y(lo.$$.fragment),Kl=c(),Ge=a("div"),y(co.$$.fragment),ed=c(),mo=a("p"),td=r("Converts the output of "),Aa=a("a"),od=r("BeitForSemanticSegmentation"),ad=r(" into semantic segmentation maps. Only supports PyTorch."),ir=c(),we=a("h2"),Le=a("a"),Is=a("span"),y(po.$$.fragment),sd=c(),ks=a("span"),nd=r("BeitImageProcessor"),lr=c(),S=a("div"),y(ho.$$.fragment),rd=c(),js=a("p"),id=r("Constructs a BEiT image processor."),ld=c(),De=a("div"),y(fo.$$.fragment),dd=c(),Cs=a("p"),cd=r("Preprocess an image or batch of images."),md=c(),Ye=a("div"),y(uo.$$.fragment),pd=c(),go=a("p"),hd=r("Converts the output of "),Sa=a("a"),fd=r("BeitForSemanticSegmentation"),ud=r(" into semantic segmentation maps. Only supports PyTorch."),dr=c(),Te=a("h2"),qe=a("a"),Js=a("span"),y(_o.$$.fragment),gd=c(),zs=a("span"),_d=r("BeitModel"),cr=c(),te=a("div"),y(bo.$$.fragment),bd=c(),vo=a("p"),vd=r(`The bare Beit Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),yo=a("a"),yd=r("torch.nn.Module"),wd=r(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Td=c(),L=a("div"),y(wo.$$.fragment),Md=c(),Me=a("p"),Bd=r("The "),Ra=a("a"),$d=r("BeitModel"),xd=r(" forward method, overrides the "),Ns=a("code"),Ed=r("__call__"),Fd=r(" special method."),Id=c(),y(Oe.$$.fragment),kd=c(),y(Qe.$$.fragment),mr=c(),Be=a("h2"),He=a("a"),Ws=a("span"),y(To.$$.fragment),jd=c(),Us=a("span"),Cd=r("BeitForMaskedImageModeling"),pr=c(),oe=a("div"),y(Mo.$$.fragment),Jd=c(),ae=a("p"),zd=r(`Beit Model transformer with a \u2018language\u2019 modeling head on top. BEiT does masked image modeling by predicting
visual tokens of a Vector-Quantize Variational Autoencoder (VQ-VAE), whereas other vision models like ViT and DeiT
predict RGB pixel values. As a result, this class is incompatible with `),Va=a("a"),Nd=r("AutoModelForMaskedImageModeling"),Wd=r(`, so you
will need to use `),Xa=a("a"),Ud=r("BeitForMaskedImageModeling"),Pd=r(` directly if you wish to do masked image modeling with BEiT.
This model is a PyTorch `),Bo=a("a"),Zd=r("torch.nn.Module"),Ad=r(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Sd=c(),D=a("div"),y($o.$$.fragment),Rd=c(),$e=a("p"),Vd=r("The "),Ga=a("a"),Xd=r("BeitForMaskedImageModeling"),Gd=r(" forward method, overrides the "),Ps=a("code"),Ld=r("__call__"),Dd=r(" special method."),Yd=c(),y(Ke.$$.fragment),qd=c(),y(et.$$.fragment),hr=c(),xe=a("h2"),tt=a("a"),Zs=a("span"),y(xo.$$.fragment),Od=c(),As=a("span"),Qd=r("BeitForImageClassification"),fr=c(),R=a("div"),y(Eo.$$.fragment),Hd=c(),Ss=a("p"),Kd=r(`Beit Model transformer with an image classification head on top (a linear layer on top of the average of the final
hidden states of the patch tokens) e.g. for ImageNet.`),ec=c(),Fo=a("p"),tc=r("This model is a PyTorch "),Io=a("a"),oc=r("torch.nn.Module"),ac=r(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),sc=c(),Y=a("div"),y(ko.$$.fragment),nc=c(),Ee=a("p"),rc=r("The "),La=a("a"),ic=r("BeitForImageClassification"),lc=r(" forward method, overrides the "),Rs=a("code"),dc=r("__call__"),cc=r(" special method."),mc=c(),y(ot.$$.fragment),pc=c(),y(at.$$.fragment),ur=c(),Fe=a("h2"),st=a("a"),Vs=a("span"),y(jo.$$.fragment),hc=c(),Xs=a("span"),fc=r("BeitForSemanticSegmentation"),gr=c(),V=a("div"),y(Co.$$.fragment),uc=c(),Gs=a("p"),gc=r("Beit Model transformer with a semantic segmentation head on top e.g. for ADE20k, CityScapes."),_c=c(),Jo=a("p"),bc=r("This model is a PyTorch "),zo=a("a"),vc=r("torch.nn.Module"),yc=r(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),wc=c(),q=a("div"),y(No.$$.fragment),Tc=c(),Ie=a("p"),Mc=r("The "),Da=a("a"),Bc=r("BeitForSemanticSegmentation"),$c=r(" forward method, overrides the "),Ls=a("code"),xc=r("__call__"),Ec=r(" special method."),Fc=c(),y(nt.$$.fragment),Ic=c(),y(rt.$$.fragment),_r=c(),ke=a("h2"),it=a("a"),Ds=a("span"),y(Wo.$$.fragment),kc=c(),Ys=a("span"),jc=r("FlaxBeitModel"),br=c(),k=a("div"),y(Uo.$$.fragment),Cc=c(),qs=a("p"),Jc=r("The bare Beit Model transformer outputting raw hidden-states without any specific head on top."),zc=c(),Po=a("p"),Nc=r("This model inherits from "),Ya=a("a"),Wc=r("FlaxPreTrainedModel"),Uc=r(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading, saving and converting weights from PyTorch models)`),Pc=c(),Zo=a("p"),Zc=r("This model is also a Flax Linen "),Ao=a("a"),Ac=r("flax.linen.Module"),Sc=r(`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),Rc=c(),Os=a("p"),Vc=r("Finally, this model supports inherent JAX features such as:"),Xc=c(),se=a("ul"),Qs=a("li"),So=a("a"),Gc=r("Just-In-Time (JIT) compilation"),Lc=c(),Hs=a("li"),Ro=a("a"),Dc=r("Automatic Differentiation"),Yc=c(),Ks=a("li"),Vo=a("a"),qc=r("Vectorization"),Oc=c(),en=a("li"),Xo=a("a"),Qc=r("Parallelization"),Hc=c(),O=a("div"),y(Go.$$.fragment),Kc=c(),je=a("p"),em=r("The "),tn=a("code"),tm=r("FlaxBeitPreTrainedModel"),om=r(" forward method, overrides the "),on=a("code"),am=r("__call__"),sm=r(" special method."),nm=c(),y(lt.$$.fragment),rm=c(),y(dt.$$.fragment),vr=c(),Ce=a("h2"),ct=a("a"),an=a("span"),y(Lo.$$.fragment),im=c(),sn=a("span"),lm=r("FlaxBeitForMaskedImageModeling"),yr=c(),j=a("div"),y(Do.$$.fragment),dm=c(),nn=a("p"),cm=r("Beit Model transformer with a \u2018language\u2019 modeling head on top (to predict visual tokens)."),mm=c(),Yo=a("p"),pm=r("This model inherits from "),qa=a("a"),hm=r("FlaxPreTrainedModel"),fm=r(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading, saving and converting weights from PyTorch models)`),um=c(),qo=a("p"),gm=r("This model is also a Flax Linen "),Oo=a("a"),_m=r("flax.linen.Module"),bm=r(`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),vm=c(),rn=a("p"),ym=r("Finally, this model supports inherent JAX features such as:"),wm=c(),ne=a("ul"),ln=a("li"),Qo=a("a"),Tm=r("Just-In-Time (JIT) compilation"),Mm=c(),dn=a("li"),Ho=a("a"),Bm=r("Automatic Differentiation"),$m=c(),cn=a("li"),Ko=a("a"),xm=r("Vectorization"),Em=c(),mn=a("li"),ea=a("a"),Fm=r("Parallelization"),Im=c(),N=a("div"),y(ta.$$.fragment),km=c(),Je=a("p"),jm=r("The "),pn=a("code"),Cm=r("FlaxBeitPreTrainedModel"),Jm=r(" forward method, overrides the "),hn=a("code"),zm=r("__call__"),Nm=r(" special method."),Wm=c(),y(mt.$$.fragment),Um=c(),ze=a("p"),Pm=r("bool_masked_pos ("),fn=a("code"),Zm=r("numpy.ndarray"),Am=r(" of shape "),un=a("code"),Sm=r("(batch_size, num_patches)"),Rm=r(`):
Boolean masked positions. Indicates which patches are masked (1) and which aren\u2019t (0).`),Vm=c(),y(pt.$$.fragment),wr=c(),Ne=a("h2"),ht=a("a"),gn=a("span"),y(oa.$$.fragment),Xm=c(),_n=a("span"),Gm=r("FlaxBeitForImageClassification"),Tr=c(),C=a("div"),y(aa.$$.fragment),Lm=c(),bn=a("p"),Dm=r(`Beit Model transformer with an image classification head on top (a linear layer on top of the average of the final
hidden states of the patch tokens) e.g. for ImageNet.`),Ym=c(),sa=a("p"),qm=r("This model inherits from "),Oa=a("a"),Om=r("FlaxPreTrainedModel"),Qm=r(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading, saving and converting weights from PyTorch models)`),Hm=c(),na=a("p"),Km=r("This model is also a Flax Linen "),ra=a("a"),ep=r("flax.linen.Module"),tp=r(`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),op=c(),vn=a("p"),ap=r("Finally, this model supports inherent JAX features such as:"),sp=c(),re=a("ul"),yn=a("li"),ia=a("a"),np=r("Just-In-Time (JIT) compilation"),rp=c(),wn=a("li"),la=a("a"),ip=r("Automatic Differentiation"),lp=c(),Tn=a("li"),da=a("a"),dp=r("Vectorization"),cp=c(),Mn=a("li"),ca=a("a"),mp=r("Parallelization"),pp=c(),Q=a("div"),y(ma.$$.fragment),hp=c(),We=a("p"),fp=r("The "),Bn=a("code"),up=r("FlaxBeitPreTrainedModel"),gp=r(" forward method, overrides the "),$n=a("code"),_p=r("__call__"),bp=r(" special method."),vp=c(),y(ft.$$.fragment),yp=c(),y(ut.$$.fragment),this.h()},l(t){const h=su('[data-svelte="svelte-1phssyn"]',document.head);p=s(h,"META",{name:!0,content:!0}),h.forEach(o),v=m(t),_=s(t,"H1",{class:!0});var pa=n(_);g=s(pa,"A",{id:!0,class:!0,href:!0});var xn=n(g);b=s(xn,"SPAN",{});var En=n(b);w(l.$$.fragment,En),En.forEach(o),xn.forEach(o),f=m(pa),E=s(pa,"SPAN",{});var Fn=n(E);ai=i(Fn,"BEiT"),Fn.forEach(o),pa.forEach(o),Pn=m(t),me=s(t,"H2",{class:!0});var ha=n(me);Ue=s(ha,"A",{id:!0,class:!0,href:!0});var In=n(Ue);ps=s(In,"SPAN",{});var kn=n(ps);w(Jt.$$.fragment,kn),kn.forEach(o),In.forEach(o),si=m(ha),hs=s(ha,"SPAN",{});var jn=n(hs);ni=i(jn,"Overview"),jn.forEach(o),ha.forEach(o),Zn=m(t),X=s(t,"P",{});var ie=n(X);ri=i(ie,"The BEiT model was proposed in "),zt=s(ie,"A",{href:!0,rel:!0});var Cn=n(zt);ii=i(Cn,"BEiT: BERT Pre-Training of Image Transformers"),Cn.forEach(o),li=i(ie,` by
Hangbo Bao, Li Dong and Furu Wei. Inspired by BERT, BEiT is the first paper that makes self-supervised pre-training of
Vision Transformers (ViTs) outperform supervised pre-training. Rather than pre-training the model to predict the class
of an image (as done in the `),Nt=s(ie,"A",{href:!0,rel:!0});var Jn=n(Nt);di=i(Jn,"original ViT paper"),Jn.forEach(o),ci=i(ie,`), BEiT models are pre-trained to
predict visual tokens from the codebook of OpenAI\u2019s `),Wt=s(ie,"A",{href:!0,rel:!0});var zn=n(Wt);mi=i(zn,"DALL-E model"),zn.forEach(o),pi=i(ie,` given masked
patches.`),ie.forEach(o),An=m(t),ga=s(t,"P",{});var Nn=n(ga);hi=i(Nn,"The abstract from the paper is the following:"),Nn.forEach(o),Sn=m(t),_a=s(t,"P",{});var Wn=n(_a);fs=s(Wn,"EM",{});var Un=n(fs);fi=i(Un,`We introduce a self-supervised vision representation model BEiT, which stands for Bidirectional Encoder representation
from Image Transformers. Following BERT developed in the natural language processing area, we propose a masked image
modeling task to pretrain vision Transformers. Specifically, each image has two views in our pre-training, i.e, image
patches (such as 16x16 pixels), and visual tokens (i.e., discrete tokens). We first \u201Ctokenize\u201D the original image into
visual tokens. Then we randomly mask some image patches and fed them into the backbone Transformer. The pre-training
objective is to recover the original visual tokens based on the corrupted image patches. After pre-training BEiT, we
directly fine-tune the model parameters on downstream tasks by appending task layers upon the pretrained encoder.
Experimental results on image classification and semantic segmentation show that our model achieves competitive results
with previous pre-training methods. For example, base-size BEiT achieves 83.2% top-1 accuracy on ImageNet-1K,
significantly outperforming from-scratch DeiT training (81.8%) with the same setup. Moreover, large-size BEiT obtains
86.3% only using ImageNet-1K, even outperforming ViT-L with supervised pre-training on ImageNet-22K (85.2%).`),Un.forEach(o),Wn.forEach(o),Rn=m(t),ba=s(t,"P",{});var Bp=n(ba);ui=i(Bp,"Tips:"),Bp.forEach(o),Vn=m(t),J=s(t,"UL",{});var H=n(J);I=s(H,"LI",{});var z=n(I);gi=i(z,`BEiT models are regular Vision Transformers, but pre-trained in a self-supervised way rather than supervised. They
outperform both the `),va=s(z,"A",{href:!0});var $p=n(va);_i=i($p,"original model (ViT)"),$p.forEach(o),bi=i(z," as well as "),ya=s(z,"A",{href:!0});var xp=n(ya);vi=i(xp,"Data-efficient Image Transformers (DeiT)"),xp.forEach(o),yi=i(z,` when fine-tuned on ImageNet-1K and CIFAR-100. You can check out demo notebooks regarding inference as well as
fine-tuning on custom data `),Ut=s(z,"A",{href:!0,rel:!0});var Ep=n(Ut);wi=i(Ep,"here"),Ep.forEach(o),Ti=i(z,` (you can just replace
`),wa=s(z,"A",{href:!0});var Fp=n(wa);Mi=i(Fp,"ViTFeatureExtractor"),Fp.forEach(o),Bi=i(z," by "),Ta=s(z,"A",{href:!0});var Ip=n(Ta);$i=i(Ip,"BeitImageProcessor"),Ip.forEach(o),xi=i(z,` and
`),Ma=s(z,"A",{href:!0});var kp=n(Ma);Ei=i(kp,"ViTForImageClassification"),kp.forEach(o),Fi=i(z," by "),Ba=s(z,"A",{href:!0});var jp=n(Ba);Ii=i(jp,"BeitForImageClassification"),jp.forEach(o),ki=i(z,")."),z.forEach(o),ji=m(H),Pt=s(H,"LI",{});var Br=n(Pt);Ci=i(Br,`There\u2019s also a demo notebook available which showcases how to combine DALL-E\u2019s image tokenizer with BEiT for
performing masked image modeling. You can find it `),Zt=s(Br,"A",{href:!0,rel:!0});var Cp=n(Zt);Ji=i(Cp,"here"),Cp.forEach(o),zi=i(Br,"."),Br.forEach(o),Ni=m(H),At=s(H,"LI",{});var $r=n(At);Wi=i($r,`As the BEiT models expect each image to be of the same size (resolution), one can use
`),$a=s($r,"A",{href:!0});var Jp=n($a);Ui=i(Jp,"BeitImageProcessor"),Jp.forEach(o),Pi=i($r," to resize (or rescale) and normalize images for the model."),$r.forEach(o),Zi=m(H),pe=s(H,"LI",{});var Qa=n(pe);Ai=i(Qa,`Both the patch resolution and image resolution used during pre-training or fine-tuning are reflected in the name of
each checkpoint. For example, `),us=s(Qa,"CODE",{});var zp=n(us);Si=i(zp,"microsoft/beit-base-patch16-224"),zp.forEach(o),Ri=i(Qa,` refers to a base-sized architecture with patch
resolution of 16x16 and fine-tuning resolution of 224x224. All checkpoints can be found on the `),St=s(Qa,"A",{href:!0,rel:!0});var Np=n(St);Vi=i(Np,"hub"),Np.forEach(o),Xi=i(Qa,"."),Qa.forEach(o),Gi=m(H),he=s(H,"LI",{});var Ha=n(he);Li=i(Ha,"The available checkpoints are either (1) pre-trained on "),Rt=s(Ha,"A",{href:!0,rel:!0});var Wp=n(Rt);Di=i(Wp,"ImageNet-22k"),Wp.forEach(o),Yi=i(Ha,` (a collection of
14 million images and 22k classes) only, (2) also fine-tuned on ImageNet-22k or (3) also fine-tuned on `),Vt=s(Ha,"A",{href:!0,rel:!0});var Up=n(Vt);qi=i(Up,"ImageNet-1k"),Up.forEach(o),Oi=i(Ha,` (also referred to as ILSVRC 2012, a collection of 1.3 million
images and 1,000 classes).`),Ha.forEach(o),Qi=m(H),A=s(H,"LI",{});var de=n(A);Hi=i(de,`BEiT uses relative position embeddings, inspired by the T5 model. During pre-training, the authors shared the
relative position bias among the several self-attention layers. During fine-tuning, each layer\u2019s relative position
bias is initialized with the shared relative position bias obtained after pre-training. Note that, if one wants to
pre-train a model from scratch, one needs to either set the `),gs=s(de,"CODE",{});var Pp=n(gs);Ki=i(Pp,"use_relative_position_bias"),Pp.forEach(o),el=i(de,` or the
`),_s=s(de,"CODE",{});var Zp=n(_s);tl=i(Zp,"use_relative_position_bias"),Zp.forEach(o),ol=i(de," attribute of "),xa=s(de,"A",{href:!0});var Ap=n(xa);al=i(Ap,"BeitConfig"),Ap.forEach(o),sl=i(de," to "),bs=s(de,"CODE",{});var Sp=n(bs);nl=i(Sp,"True"),Sp.forEach(o),rl=i(de,` in order to add
position embeddings.`),de.forEach(o),H.forEach(o),Xn=m(t),Pe=s(t,"IMG",{src:!0,alt:!0,width:!0}),Gn=m(t),Xt=s(t,"SMALL",{});var wp=n(Xt);il=i(wp,"BEiT pre-training. Taken from the "),Ea=s(wp,"A",{href:!0});var Rp=n(Ea);ll=i(Rp,"original paper."),Rp.forEach(o),wp.forEach(o),Ln=m(t),G=s(t,"P",{});var gt=n(G);dl=i(gt,"This model was contributed by "),Gt=s(gt,"A",{href:!0,rel:!0});var Vp=n(Gt);cl=i(Vp,"nielsr"),Vp.forEach(o),ml=i(gt,`. The JAX/FLAX version of this model was
contributed by `),Lt=s(gt,"A",{href:!0,rel:!0});var Xp=n(Lt);pl=i(Xp,"kamalkraj"),Xp.forEach(o),hl=i(gt,". The original code can be found "),Dt=s(gt,"A",{href:!0,rel:!0});var Gp=n(Dt);fl=i(Gp,"here"),Gp.forEach(o),ul=i(gt,"."),gt.forEach(o),Dn=m(t),fe=s(t,"H2",{class:!0});var xr=n(fe);Ze=s(xr,"A",{id:!0,class:!0,href:!0});var Lp=n(Ze);vs=s(Lp,"SPAN",{});var Dp=n(vs);w(Yt.$$.fragment,Dp),Dp.forEach(o),Lp.forEach(o),gl=m(xr),ys=s(xr,"SPAN",{});var Yp=n(ys);_l=i(Yp,"Resources"),Yp.forEach(o),xr.forEach(o),Yn=m(t),Fa=s(t,"P",{});var qp=n(Fa);bl=i(qp,"A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with BEiT."),qp.forEach(o),qn=m(t),w(qt.$$.fragment,t),On=m(t),Ae=s(t,"UL",{});var Er=n(Ae);le=s(Er,"LI",{});var fa=n(le);Ia=s(fa,"A",{href:!0});var Op=n(Ia);vl=i(Op,"BeitForImageClassification"),Op.forEach(o),yl=i(fa," is supported by this "),Ot=s(fa,"A",{href:!0,rel:!0});var Qp=n(Ot);wl=i(Qp,"example script"),Qp.forEach(o),Tl=i(fa," and "),Qt=s(fa,"A",{href:!0,rel:!0});var Hp=n(Qt);Ml=i(Hp,"notebook"),Hp.forEach(o),Bl=i(fa,"."),fa.forEach(o),$l=m(Er),ka=s(Er,"LI",{});var Tp=n(ka);xl=i(Tp,"See also: "),ja=s(Tp,"A",{href:!0});var Kp=n(ja);El=i(Kp,"Image classification task guide"),Kp.forEach(o),Tp.forEach(o),Er.forEach(o),Qn=m(t),Ca=s(t,"P",{});var eh=n(Ca);ws=s(eh,"STRONG",{});var th=n(ws);Fl=i(th,"Semantic segmentation"),th.forEach(o),eh.forEach(o),Hn=m(t),Ja=s(t,"UL",{});var oh=n(Ja);Ts=s(oh,"LI",{});var ah=n(Ts);za=s(ah,"A",{href:!0});var sh=n(za);Il=i(sh,"Semantic segmentation task guide"),sh.forEach(o),ah.forEach(o),oh.forEach(o),Kn=m(t),Na=s(t,"P",{});var nh=n(Na);kl=i(nh,"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."),nh.forEach(o),er=m(t),ue=s(t,"H2",{class:!0});var Fr=n(ue);Se=s(Fr,"A",{id:!0,class:!0,href:!0});var rh=n(Se);Ms=s(rh,"SPAN",{});var ih=n(Ms);w(Ht.$$.fragment,ih),ih.forEach(o),rh.forEach(o),jl=m(Fr),Bs=s(Fr,"SPAN",{});var lh=n(Bs);Cl=i(lh,"BEiT specific outputs"),lh.forEach(o),Fr.forEach(o),tr=m(t),ge=s(t,"DIV",{class:!0});var Ir=n(ge);w(Kt.$$.fragment,Ir),Jl=m(Ir),eo=s(Ir,"P",{});var kr=n(eo);zl=i(kr,"Class for outputs of "),Wa=s(kr,"A",{href:!0});var dh=n(Wa);Nl=i(dh,"BeitModel"),dh.forEach(o),Wl=i(kr,"."),kr.forEach(o),Ir.forEach(o),or=m(t),_e=s(t,"DIV",{class:!0});var jr=n(_e);w(to.$$.fragment,jr),Ul=m(jr),oo=s(jr,"P",{});var Cr=n(oo);Pl=i(Cr,"Class for outputs of "),Ua=s(Cr,"A",{href:!0});var ch=n(Ua);Zl=i(ch,"FlaxBeitModel"),ch.forEach(o),Al=i(Cr,"."),Cr.forEach(o),jr.forEach(o),ar=m(t),be=s(t,"H2",{class:!0});var Jr=n(be);Re=s(Jr,"A",{id:!0,class:!0,href:!0});var mh=n(Re);$s=s(mh,"SPAN",{});var ph=n($s);w(ao.$$.fragment,ph),ph.forEach(o),mh.forEach(o),Sl=m(Jr),xs=s(Jr,"SPAN",{});var hh=n(xs);Rl=i(hh,"BeitConfig"),hh.forEach(o),Jr.forEach(o),sr=m(t),K=s(t,"DIV",{class:!0});var Ka=n(K);w(so.$$.fragment,Ka),Vl=m(Ka),ve=s(Ka,"P",{});var es=n(ve);Xl=i(es,"This is the configuration class to store the configuration of a "),Pa=s(es,"A",{href:!0});var fh=n(Pa);Gl=i(fh,"BeitModel"),fh.forEach(o),Ll=i(es,`. It is used to instantiate an BEiT
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 BEiT
`),no=s(es,"A",{href:!0,rel:!0});var uh=n(no);Dl=i(uh,"microsoft/beit-base-patch16-224-pt22k"),uh.forEach(o),Yl=i(es," architecture."),es.forEach(o),ql=m(Ka),w(Ve.$$.fragment,Ka),Ka.forEach(o),nr=m(t),ye=s(t,"H2",{class:!0});var zr=n(ye);Xe=s(zr,"A",{id:!0,class:!0,href:!0});var gh=n(Xe);Es=s(gh,"SPAN",{});var _h=n(Es);w(ro.$$.fragment,_h),_h.forEach(o),gh.forEach(o),Ol=m(zr),Fs=s(zr,"SPAN",{});var bh=n(Fs);Ql=i(bh,"BeitFeatureExtractor"),bh.forEach(o),zr.forEach(o),rr=m(t),ee=s(t,"DIV",{class:!0});var ts=n(ee);w(io.$$.fragment,ts),Hl=m(ts),Za=s(ts,"DIV",{class:!0});var vh=n(Za);w(lo.$$.fragment,vh),vh.forEach(o),Kl=m(ts),Ge=s(ts,"DIV",{class:!0});var Nr=n(Ge);w(co.$$.fragment,Nr),ed=m(Nr),mo=s(Nr,"P",{});var Wr=n(mo);td=i(Wr,"Converts the output of "),Aa=s(Wr,"A",{href:!0});var yh=n(Aa);od=i(yh,"BeitForSemanticSegmentation"),yh.forEach(o),ad=i(Wr," into semantic segmentation maps. Only supports PyTorch."),Wr.forEach(o),Nr.forEach(o),ts.forEach(o),ir=m(t),we=s(t,"H2",{class:!0});var Ur=n(we);Le=s(Ur,"A",{id:!0,class:!0,href:!0});var wh=n(Le);Is=s(wh,"SPAN",{});var Th=n(Is);w(po.$$.fragment,Th),Th.forEach(o),wh.forEach(o),sd=m(Ur),ks=s(Ur,"SPAN",{});var Mh=n(ks);nd=i(Mh,"BeitImageProcessor"),Mh.forEach(o),Ur.forEach(o),lr=m(t),S=s(t,"DIV",{class:!0});var _t=n(S);w(ho.$$.fragment,_t),rd=m(_t),js=s(_t,"P",{});var Bh=n(js);id=i(Bh,"Constructs a BEiT image processor."),Bh.forEach(o),ld=m(_t),De=s(_t,"DIV",{class:!0});var Pr=n(De);w(fo.$$.fragment,Pr),dd=m(Pr),Cs=s(Pr,"P",{});var $h=n(Cs);cd=i($h,"Preprocess an image or batch of images."),$h.forEach(o),Pr.forEach(o),md=m(_t),Ye=s(_t,"DIV",{class:!0});var Zr=n(Ye);w(uo.$$.fragment,Zr),pd=m(Zr),go=s(Zr,"P",{});var Ar=n(go);hd=i(Ar,"Converts the output of "),Sa=s(Ar,"A",{href:!0});var xh=n(Sa);fd=i(xh,"BeitForSemanticSegmentation"),xh.forEach(o),ud=i(Ar," into semantic segmentation maps. Only supports PyTorch."),Ar.forEach(o),Zr.forEach(o),_t.forEach(o),dr=m(t),Te=s(t,"H2",{class:!0});var Sr=n(Te);qe=s(Sr,"A",{id:!0,class:!0,href:!0});var Eh=n(qe);Js=s(Eh,"SPAN",{});var Fh=n(Js);w(_o.$$.fragment,Fh),Fh.forEach(o),Eh.forEach(o),gd=m(Sr),zs=s(Sr,"SPAN",{});var Ih=n(zs);_d=i(Ih,"BeitModel"),Ih.forEach(o),Sr.forEach(o),cr=m(t),te=s(t,"DIV",{class:!0});var os=n(te);w(bo.$$.fragment,os),bd=m(os),vo=s(os,"P",{});var Rr=n(vo);vd=i(Rr,`The bare Beit Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),yo=s(Rr,"A",{href:!0,rel:!0});var kh=n(yo);yd=i(kh,"torch.nn.Module"),kh.forEach(o),wd=i(Rr,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Rr.forEach(o),Td=m(os),L=s(os,"DIV",{class:!0});var bt=n(L);w(wo.$$.fragment,bt),Md=m(bt),Me=s(bt,"P",{});var as=n(Me);Bd=i(as,"The "),Ra=s(as,"A",{href:!0});var jh=n(Ra);$d=i(jh,"BeitModel"),jh.forEach(o),xd=i(as," forward method, overrides the "),Ns=s(as,"CODE",{});var Ch=n(Ns);Ed=i(Ch,"__call__"),Ch.forEach(o),Fd=i(as," special method."),as.forEach(o),Id=m(bt),w(Oe.$$.fragment,bt),kd=m(bt),w(Qe.$$.fragment,bt),bt.forEach(o),os.forEach(o),mr=m(t),Be=s(t,"H2",{class:!0});var Vr=n(Be);He=s(Vr,"A",{id:!0,class:!0,href:!0});var Jh=n(He);Ws=s(Jh,"SPAN",{});var zh=n(Ws);w(To.$$.fragment,zh),zh.forEach(o),Jh.forEach(o),jd=m(Vr),Us=s(Vr,"SPAN",{});var Nh=n(Us);Cd=i(Nh,"BeitForMaskedImageModeling"),Nh.forEach(o),Vr.forEach(o),pr=m(t),oe=s(t,"DIV",{class:!0});var ss=n(oe);w(Mo.$$.fragment,ss),Jd=m(ss),ae=s(ss,"P",{});var vt=n(ae);zd=i(vt,`Beit Model transformer with a \u2018language\u2019 modeling head on top. BEiT does masked image modeling by predicting
visual tokens of a Vector-Quantize Variational Autoencoder (VQ-VAE), whereas other vision models like ViT and DeiT
predict RGB pixel values. As a result, this class is incompatible with `),Va=s(vt,"A",{href:!0});var Wh=n(Va);Nd=i(Wh,"AutoModelForMaskedImageModeling"),Wh.forEach(o),Wd=i(vt,`, so you
will need to use `),Xa=s(vt,"A",{href:!0});var Uh=n(Xa);Ud=i(Uh,"BeitForMaskedImageModeling"),Uh.forEach(o),Pd=i(vt,` directly if you wish to do masked image modeling with BEiT.
This model is a PyTorch `),Bo=s(vt,"A",{href:!0,rel:!0});var Ph=n(Bo);Zd=i(Ph,"torch.nn.Module"),Ph.forEach(o),Ad=i(vt,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),vt.forEach(o),Sd=m(ss),D=s(ss,"DIV",{class:!0});var yt=n(D);w($o.$$.fragment,yt),Rd=m(yt),$e=s(yt,"P",{});var ns=n($e);Vd=i(ns,"The "),Ga=s(ns,"A",{href:!0});var Zh=n(Ga);Xd=i(Zh,"BeitForMaskedImageModeling"),Zh.forEach(o),Gd=i(ns," forward method, overrides the "),Ps=s(ns,"CODE",{});var Ah=n(Ps);Ld=i(Ah,"__call__"),Ah.forEach(o),Dd=i(ns," special method."),ns.forEach(o),Yd=m(yt),w(Ke.$$.fragment,yt),qd=m(yt),w(et.$$.fragment,yt),yt.forEach(o),ss.forEach(o),hr=m(t),xe=s(t,"H2",{class:!0});var Xr=n(xe);tt=s(Xr,"A",{id:!0,class:!0,href:!0});var Sh=n(tt);Zs=s(Sh,"SPAN",{});var Rh=n(Zs);w(xo.$$.fragment,Rh),Rh.forEach(o),Sh.forEach(o),Od=m(Xr),As=s(Xr,"SPAN",{});var Vh=n(As);Qd=i(Vh,"BeitForImageClassification"),Vh.forEach(o),Xr.forEach(o),fr=m(t),R=s(t,"DIV",{class:!0});var wt=n(R);w(Eo.$$.fragment,wt),Hd=m(wt),Ss=s(wt,"P",{});var Xh=n(Ss);Kd=i(Xh,`Beit Model transformer with an image classification head on top (a linear layer on top of the average of the final
hidden states of the patch tokens) e.g. for ImageNet.`),Xh.forEach(o),ec=m(wt),Fo=s(wt,"P",{});var Gr=n(Fo);tc=i(Gr,"This model is a PyTorch "),Io=s(Gr,"A",{href:!0,rel:!0});var Gh=n(Io);oc=i(Gh,"torch.nn.Module"),Gh.forEach(o),ac=i(Gr,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Gr.forEach(o),sc=m(wt),Y=s(wt,"DIV",{class:!0});var Tt=n(Y);w(ko.$$.fragment,Tt),nc=m(Tt),Ee=s(Tt,"P",{});var rs=n(Ee);rc=i(rs,"The "),La=s(rs,"A",{href:!0});var Lh=n(La);ic=i(Lh,"BeitForImageClassification"),Lh.forEach(o),lc=i(rs," forward method, overrides the "),Rs=s(rs,"CODE",{});var Dh=n(Rs);dc=i(Dh,"__call__"),Dh.forEach(o),cc=i(rs," special method."),rs.forEach(o),mc=m(Tt),w(ot.$$.fragment,Tt),pc=m(Tt),w(at.$$.fragment,Tt),Tt.forEach(o),wt.forEach(o),ur=m(t),Fe=s(t,"H2",{class:!0});var Lr=n(Fe);st=s(Lr,"A",{id:!0,class:!0,href:!0});var Yh=n(st);Vs=s(Yh,"SPAN",{});var qh=n(Vs);w(jo.$$.fragment,qh),qh.forEach(o),Yh.forEach(o),hc=m(Lr),Xs=s(Lr,"SPAN",{});var Oh=n(Xs);fc=i(Oh,"BeitForSemanticSegmentation"),Oh.forEach(o),Lr.forEach(o),gr=m(t),V=s(t,"DIV",{class:!0});var Mt=n(V);w(Co.$$.fragment,Mt),uc=m(Mt),Gs=s(Mt,"P",{});var Qh=n(Gs);gc=i(Qh,"Beit Model transformer with a semantic segmentation head on top e.g. for ADE20k, CityScapes."),Qh.forEach(o),_c=m(Mt),Jo=s(Mt,"P",{});var Dr=n(Jo);bc=i(Dr,"This model is a PyTorch "),zo=s(Dr,"A",{href:!0,rel:!0});var Hh=n(zo);vc=i(Hh,"torch.nn.Module"),Hh.forEach(o),yc=i(Dr,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Dr.forEach(o),wc=m(Mt),q=s(Mt,"DIV",{class:!0});var Bt=n(q);w(No.$$.fragment,Bt),Tc=m(Bt),Ie=s(Bt,"P",{});var is=n(Ie);Mc=i(is,"The "),Da=s(is,"A",{href:!0});var Kh=n(Da);Bc=i(Kh,"BeitForSemanticSegmentation"),Kh.forEach(o),$c=i(is," forward method, overrides the "),Ls=s(is,"CODE",{});var ef=n(Ls);xc=i(ef,"__call__"),ef.forEach(o),Ec=i(is," special method."),is.forEach(o),Fc=m(Bt),w(nt.$$.fragment,Bt),Ic=m(Bt),w(rt.$$.fragment,Bt),Bt.forEach(o),Mt.forEach(o),_r=m(t),ke=s(t,"H2",{class:!0});var Yr=n(ke);it=s(Yr,"A",{id:!0,class:!0,href:!0});var tf=n(it);Ds=s(tf,"SPAN",{});var of=n(Ds);w(Wo.$$.fragment,of),of.forEach(o),tf.forEach(o),kc=m(Yr),Ys=s(Yr,"SPAN",{});var af=n(Ys);jc=i(af,"FlaxBeitModel"),af.forEach(o),Yr.forEach(o),br=m(t),k=s(t,"DIV",{class:!0});var W=n(k);w(Uo.$$.fragment,W),Cc=m(W),qs=s(W,"P",{});var sf=n(qs);Jc=i(sf,"The bare Beit Model transformer outputting raw hidden-states without any specific head on top."),sf.forEach(o),zc=m(W),Po=s(W,"P",{});var qr=n(Po);Nc=i(qr,"This model inherits from "),Ya=s(qr,"A",{href:!0});var nf=n(Ya);Wc=i(nf,"FlaxPreTrainedModel"),nf.forEach(o),Uc=i(qr,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading, saving and converting weights from PyTorch models)`),qr.forEach(o),Pc=m(W),Zo=s(W,"P",{});var Or=n(Zo);Zc=i(Or,"This model is also a Flax Linen "),Ao=s(Or,"A",{href:!0,rel:!0});var rf=n(Ao);Ac=i(rf,"flax.linen.Module"),rf.forEach(o),Sc=i(Or,`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),Or.forEach(o),Rc=m(W),Os=s(W,"P",{});var lf=n(Os);Vc=i(lf,"Finally, this model supports inherent JAX features such as:"),lf.forEach(o),Xc=m(W),se=s(W,"UL",{});var $t=n(se);Qs=s($t,"LI",{});var df=n(Qs);So=s(df,"A",{href:!0,rel:!0});var cf=n(So);Gc=i(cf,"Just-In-Time (JIT) compilation"),cf.forEach(o),df.forEach(o),Lc=m($t),Hs=s($t,"LI",{});var mf=n(Hs);Ro=s(mf,"A",{href:!0,rel:!0});var pf=n(Ro);Dc=i(pf,"Automatic Differentiation"),pf.forEach(o),mf.forEach(o),Yc=m($t),Ks=s($t,"LI",{});var hf=n(Ks);Vo=s(hf,"A",{href:!0,rel:!0});var ff=n(Vo);qc=i(ff,"Vectorization"),ff.forEach(o),hf.forEach(o),Oc=m($t),en=s($t,"LI",{});var uf=n(en);Xo=s(uf,"A",{href:!0,rel:!0});var gf=n(Xo);Qc=i(gf,"Parallelization"),gf.forEach(o),uf.forEach(o),$t.forEach(o),Hc=m(W),O=s(W,"DIV",{class:!0});var xt=n(O);w(Go.$$.fragment,xt),Kc=m(xt),je=s(xt,"P",{});var ls=n(je);em=i(ls,"The "),tn=s(ls,"CODE",{});var _f=n(tn);tm=i(_f,"FlaxBeitPreTrainedModel"),_f.forEach(o),om=i(ls," forward method, overrides the "),on=s(ls,"CODE",{});var bf=n(on);am=i(bf,"__call__"),bf.forEach(o),sm=i(ls," special method."),ls.forEach(o),nm=m(xt),w(lt.$$.fragment,xt),rm=m(xt),w(dt.$$.fragment,xt),xt.forEach(o),W.forEach(o),vr=m(t),Ce=s(t,"H2",{class:!0});var Qr=n(Ce);ct=s(Qr,"A",{id:!0,class:!0,href:!0});var vf=n(ct);an=s(vf,"SPAN",{});var yf=n(an);w(Lo.$$.fragment,yf),yf.forEach(o),vf.forEach(o),im=m(Qr),sn=s(Qr,"SPAN",{});var wf=n(sn);lm=i(wf,"FlaxBeitForMaskedImageModeling"),wf.forEach(o),Qr.forEach(o),yr=m(t),j=s(t,"DIV",{class:!0});var U=n(j);w(Do.$$.fragment,U),dm=m(U),nn=s(U,"P",{});var Tf=n(nn);cm=i(Tf,"Beit Model transformer with a \u2018language\u2019 modeling head on top (to predict visual tokens)."),Tf.forEach(o),mm=m(U),Yo=s(U,"P",{});var Hr=n(Yo);pm=i(Hr,"This model inherits from "),qa=s(Hr,"A",{href:!0});var Mf=n(qa);hm=i(Mf,"FlaxPreTrainedModel"),Mf.forEach(o),fm=i(Hr,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading, saving and converting weights from PyTorch models)`),Hr.forEach(o),um=m(U),qo=s(U,"P",{});var Kr=n(qo);gm=i(Kr,"This model is also a Flax Linen "),Oo=s(Kr,"A",{href:!0,rel:!0});var Bf=n(Oo);_m=i(Bf,"flax.linen.Module"),Bf.forEach(o),bm=i(Kr,`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),Kr.forEach(o),vm=m(U),rn=s(U,"P",{});var $f=n(rn);ym=i($f,"Finally, this model supports inherent JAX features such as:"),$f.forEach(o),wm=m(U),ne=s(U,"UL",{});var Et=n(ne);ln=s(Et,"LI",{});var xf=n(ln);Qo=s(xf,"A",{href:!0,rel:!0});var Ef=n(Qo);Tm=i(Ef,"Just-In-Time (JIT) compilation"),Ef.forEach(o),xf.forEach(o),Mm=m(Et),dn=s(Et,"LI",{});var Ff=n(dn);Ho=s(Ff,"A",{href:!0,rel:!0});var If=n(Ho);Bm=i(If,"Automatic Differentiation"),If.forEach(o),Ff.forEach(o),$m=m(Et),cn=s(Et,"LI",{});var kf=n(cn);Ko=s(kf,"A",{href:!0,rel:!0});var jf=n(Ko);xm=i(jf,"Vectorization"),jf.forEach(o),kf.forEach(o),Em=m(Et),mn=s(Et,"LI",{});var Cf=n(mn);ea=s(Cf,"A",{href:!0,rel:!0});var Jf=n(ea);Fm=i(Jf,"Parallelization"),Jf.forEach(o),Cf.forEach(o),Et.forEach(o),Im=m(U),N=s(U,"DIV",{class:!0});var ce=n(N);w(ta.$$.fragment,ce),km=m(ce),Je=s(ce,"P",{});var ds=n(Je);jm=i(ds,"The "),pn=s(ds,"CODE",{});var zf=n(pn);Cm=i(zf,"FlaxBeitPreTrainedModel"),zf.forEach(o),Jm=i(ds," forward method, overrides the "),hn=s(ds,"CODE",{});var Nf=n(hn);zm=i(Nf,"__call__"),Nf.forEach(o),Nm=i(ds," special method."),ds.forEach(o),Wm=m(ce),w(mt.$$.fragment,ce),Um=m(ce),ze=s(ce,"P",{});var cs=n(ze);Pm=i(cs,"bool_masked_pos ("),fn=s(cs,"CODE",{});var Wf=n(fn);Zm=i(Wf,"numpy.ndarray"),Wf.forEach(o),Am=i(cs," of shape "),un=s(cs,"CODE",{});var Uf=n(un);Sm=i(Uf,"(batch_size, num_patches)"),Uf.forEach(o),Rm=i(cs,`):
Boolean masked positions. Indicates which patches are masked (1) and which aren\u2019t (0).`),cs.forEach(o),Vm=m(ce),w(pt.$$.fragment,ce),ce.forEach(o),U.forEach(o),wr=m(t),Ne=s(t,"H2",{class:!0});var ei=n(Ne);ht=s(ei,"A",{id:!0,class:!0,href:!0});var Pf=n(ht);gn=s(Pf,"SPAN",{});var Zf=n(gn);w(oa.$$.fragment,Zf),Zf.forEach(o),Pf.forEach(o),Xm=m(ei),_n=s(ei,"SPAN",{});var Af=n(_n);Gm=i(Af,"FlaxBeitForImageClassification"),Af.forEach(o),ei.forEach(o),Tr=m(t),C=s(t,"DIV",{class:!0});var P=n(C);w(aa.$$.fragment,P),Lm=m(P),bn=s(P,"P",{});var Sf=n(bn);Dm=i(Sf,`Beit Model transformer with an image classification head on top (a linear layer on top of the average of the final
hidden states of the patch tokens) e.g. for ImageNet.`),Sf.forEach(o),Ym=m(P),sa=s(P,"P",{});var ti=n(sa);qm=i(ti,"This model inherits from "),Oa=s(ti,"A",{href:!0});var Rf=n(Oa);Om=i(Rf,"FlaxPreTrainedModel"),Rf.forEach(o),Qm=i(ti,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading, saving and converting weights from PyTorch models)`),ti.forEach(o),Hm=m(P),na=s(P,"P",{});var oi=n(na);Km=i(oi,"This model is also a Flax Linen "),ra=s(oi,"A",{href:!0,rel:!0});var Vf=n(ra);ep=i(Vf,"flax.linen.Module"),Vf.forEach(o),tp=i(oi,`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),oi.forEach(o),op=m(P),vn=s(P,"P",{});var Xf=n(vn);ap=i(Xf,"Finally, this model supports inherent JAX features such as:"),Xf.forEach(o),sp=m(P),re=s(P,"UL",{});var Ft=n(re);yn=s(Ft,"LI",{});var Gf=n(yn);ia=s(Gf,"A",{href:!0,rel:!0});var Lf=n(ia);np=i(Lf,"Just-In-Time (JIT) compilation"),Lf.forEach(o),Gf.forEach(o),rp=m(Ft),wn=s(Ft,"LI",{});var Df=n(wn);la=s(Df,"A",{href:!0,rel:!0});var Yf=n(la);ip=i(Yf,"Automatic Differentiation"),Yf.forEach(o),Df.forEach(o),lp=m(Ft),Tn=s(Ft,"LI",{});var qf=n(Tn);da=s(qf,"A",{href:!0,rel:!0});var Of=n(da);dp=i(Of,"Vectorization"),Of.forEach(o),qf.forEach(o),cp=m(Ft),Mn=s(Ft,"LI",{});var Qf=n(Mn);ca=s(Qf,"A",{href:!0,rel:!0});var Hf=n(ca);mp=i(Hf,"Parallelization"),Hf.forEach(o),Qf.forEach(o),Ft.forEach(o),pp=m(P),Q=s(P,"DIV",{class:!0});var It=n(Q);w(ma.$$.fragment,It),hp=m(It),We=s(It,"P",{});var ms=n(We);fp=i(ms,"The "),Bn=s(ms,"CODE",{});var Kf=n(Bn);up=i(Kf,"FlaxBeitPreTrainedModel"),Kf.forEach(o),gp=i(ms," forward method, overrides the "),$n=s(ms,"CODE",{});var eu=n($n);_p=i(eu,"__call__"),eu.forEach(o),bp=i(ms," special method."),ms.forEach(o),vp=m(It),w(ft.$$.fragment,It),yp=m(It),w(ut.$$.fragment,It),It.forEach(o),P.forEach(o),this.h()},h(){d(p,"name","hf:doc:metadata"),d(p,"content",JSON.stringify(Bu)),d(g,"id","beit"),d(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"),d(g,"href","#beit"),d(_,"class","relative group"),d(Ue,"id","overview"),d(Ue,"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"),d(Ue,"href","#overview"),d(me,"class","relative group"),d(zt,"href","https://arxiv.org/abs/2106.08254"),d(zt,"rel","nofollow"),d(Nt,"href","https://arxiv.org/abs/2010.11929"),d(Nt,"rel","nofollow"),d(Wt,"href","https://arxiv.org/abs/2102.12092"),d(Wt,"rel","nofollow"),d(va,"href","vit"),d(ya,"href","deit"),d(Ut,"href","https://github.com/NielsRogge/Transformers-Tutorials/tree/master/VisionTransformer"),d(Ut,"rel","nofollow"),d(wa,"href","/docs/transformers/v4.30.0/en/model_doc/vit#transformers.ViTFeatureExtractor"),d(Ta,"href","/docs/transformers/v4.30.0/en/model_doc/beit#transformers.BeitImageProcessor"),d(Ma,"href","/docs/transformers/v4.30.0/en/model_doc/vit#transformers.ViTForImageClassification"),d(Ba,"href","/docs/transformers/v4.30.0/en/model_doc/beit#transformers.BeitForImageClassification"),d(Zt,"href","https://github.com/NielsRogge/Transformers-Tutorials/tree/master/BEiT"),d(Zt,"rel","nofollow"),d($a,"href","/docs/transformers/v4.30.0/en/model_doc/beit#transformers.BeitImageProcessor"),d(St,"href","https://huggingface.co/models?search=microsoft/beit"),d(St,"rel","nofollow"),d(Rt,"href","http://www.image-net.org/"),d(Rt,"rel","nofollow"),d(Vt,"href","http://www.image-net.org/challenges/LSVRC/2012/"),d(Vt,"rel","nofollow"),d(xa,"href","/docs/transformers/v4.30.0/en/model_doc/beit#transformers.BeitConfig"),nu(Pe.src,Mp="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/model_doc/beit_architecture.jpg")||d(Pe,"src",Mp),d(Pe,"alt","drawing"),d(Pe,"width","600"),d(Ea,"href","https://arxiv.org/abs/2106.08254"),d(Gt,"href","https://huggingface.co/nielsr"),d(Gt,"rel","nofollow"),d(Lt,"href","https://huggingface.co/kamalkraj"),d(Lt,"rel","nofollow"),d(Dt,"href","https://github.com/microsoft/unilm/tree/master/beit"),d(Dt,"rel","nofollow"),d(Ze,"id","resources"),d(Ze,"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"),d(Ze,"href","#resources"),d(fe,"class","relative group"),d(Ia,"href","/docs/transformers/v4.30.0/en/model_doc/beit#transformers.BeitForImageClassification"),d(Ot,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/image-classification"),d(Ot,"rel","nofollow"),d(Qt,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/image_classification.ipynb"),d(Qt,"rel","nofollow"),d(ja,"href","../tasks/image_classification"),d(za,"href","../tasks/semantic_segmentation"),d(Se,"id","transformers.models.beit.modeling_beit.BeitModelOutputWithPooling"),d(Se,"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"),d(Se,"href","#transformers.models.beit.modeling_beit.BeitModelOutputWithPooling"),d(ue,"class","relative group"),d(Wa,"href","/docs/transformers/v4.30.0/en/model_doc/beit#transformers.BeitModel"),d(ge,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ua,"href","/docs/transformers/v4.30.0/en/model_doc/beit#transformers.FlaxBeitModel"),d(_e,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Re,"id","transformers.BeitConfig"),d(Re,"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"),d(Re,"href","#transformers.BeitConfig"),d(be,"class","relative group"),d(Pa,"href","/docs/transformers/v4.30.0/en/model_doc/beit#transformers.BeitModel"),d(no,"href","https://huggingface.co/microsoft/beit-base-patch16-224-pt22k"),d(no,"rel","nofollow"),d(K,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Xe,"id","transformers.BeitFeatureExtractor"),d(Xe,"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"),d(Xe,"href","#transformers.BeitFeatureExtractor"),d(ye,"class","relative group"),d(Za,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Aa,"href","/docs/transformers/v4.30.0/en/model_doc/beit#transformers.BeitForSemanticSegmentation"),d(Ge,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ee,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Le,"id","transformers.BeitImageProcessor"),d(Le,"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"),d(Le,"href","#transformers.BeitImageProcessor"),d(we,"class","relative group"),d(De,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Sa,"href","/docs/transformers/v4.30.0/en/model_doc/beit#transformers.BeitForSemanticSegmentation"),d(Ye,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(qe,"id","transformers.BeitModel"),d(qe,"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"),d(qe,"href","#transformers.BeitModel"),d(Te,"class","relative group"),d(yo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(yo,"rel","nofollow"),d(Ra,"href","/docs/transformers/v4.30.0/en/model_doc/beit#transformers.BeitModel"),d(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(te,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(He,"id","transformers.BeitForMaskedImageModeling"),d(He,"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"),d(He,"href","#transformers.BeitForMaskedImageModeling"),d(Be,"class","relative group"),d(Va,"href","/docs/transformers/v4.30.0/en/model_doc/auto#transformers.AutoModelForMaskedImageModeling"),d(Xa,"href","/docs/transformers/v4.30.0/en/model_doc/beit#transformers.BeitForMaskedImageModeling"),d(Bo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(Bo,"rel","nofollow"),d(Ga,"href","/docs/transformers/v4.30.0/en/model_doc/beit#transformers.BeitForMaskedImageModeling"),d(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(oe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(tt,"id","transformers.BeitForImageClassification"),d(tt,"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"),d(tt,"href","#transformers.BeitForImageClassification"),d(xe,"class","relative group"),d(Io,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(Io,"rel","nofollow"),d(La,"href","/docs/transformers/v4.30.0/en/model_doc/beit#transformers.BeitForImageClassification"),d(Y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(st,"id","transformers.BeitForSemanticSegmentation"),d(st,"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"),d(st,"href","#transformers.BeitForSemanticSegmentation"),d(Fe,"class","relative group"),d(zo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(zo,"rel","nofollow"),d(Da,"href","/docs/transformers/v4.30.0/en/model_doc/beit#transformers.BeitForSemanticSegmentation"),d(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(it,"id","transformers.FlaxBeitModel"),d(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"),d(it,"href","#transformers.FlaxBeitModel"),d(ke,"class","relative group"),d(Ya,"href","/docs/transformers/v4.30.0/en/main_classes/model#transformers.FlaxPreTrainedModel"),d(Ao,"href","https://flax.readthedocs.io/en/latest/flax.linen.html#module"),d(Ao,"rel","nofollow"),d(So,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),d(So,"rel","nofollow"),d(Ro,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),d(Ro,"rel","nofollow"),d(Vo,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),d(Vo,"rel","nofollow"),d(Xo,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),d(Xo,"rel","nofollow"),d(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ct,"id","transformers.FlaxBeitForMaskedImageModeling"),d(ct,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(ct,"href","#transformers.FlaxBeitForMaskedImageModeling"),d(Ce,"class","relative group"),d(qa,"href","/docs/transformers/v4.30.0/en/main_classes/model#transformers.FlaxPreTrainedModel"),d(Oo,"href","https://flax.readthedocs.io/en/latest/flax.linen.html#module"),d(Oo,"rel","nofollow"),d(Qo,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),d(Qo,"rel","nofollow"),d(Ho,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),d(Ho,"rel","nofollow"),d(Ko,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),d(Ko,"rel","nofollow"),d(ea,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),d(ea,"rel","nofollow"),d(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ht,"id","transformers.FlaxBeitForImageClassification"),d(ht,"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"),d(ht,"href","#transformers.FlaxBeitForImageClassification"),d(Ne,"class","relative group"),d(Oa,"href","/docs/transformers/v4.30.0/en/main_classes/model#transformers.FlaxPreTrainedModel"),d(ra,"href","https://flax.readthedocs.io/en/latest/flax.linen.html#module"),d(ra,"rel","nofollow"),d(ia,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),d(ia,"rel","nofollow"),d(la,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),d(la,"rel","nofollow"),d(da,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),d(da,"rel","nofollow"),d(ca,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),d(ca,"rel","nofollow"),d(Q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(t,h){e(document.head,p),u(t,v,h),u(t,_,h),e(_,g),e(g,b),T(l,b,null),e(_,f),e(_,E),e(E,ai),u(t,Pn,h),u(t,me,h),e(me,Ue),e(Ue,ps),T(Jt,ps,null),e(me,si),e(me,hs),e(hs,ni),u(t,Zn,h),u(t,X,h),e(X,ri),e(X,zt),e(zt,ii),e(X,li),e(X,Nt),e(Nt,di),e(X,ci),e(X,Wt),e(Wt,mi),e(X,pi),u(t,An,h),u(t,ga,h),e(ga,hi),u(t,Sn,h),u(t,_a,h),e(_a,fs),e(fs,fi),u(t,Rn,h),u(t,ba,h),e(ba,ui),u(t,Vn,h),u(t,J,h),e(J,I),e(I,gi),e(I,va),e(va,_i),e(I,bi),e(I,ya),e(ya,vi),e(I,yi),e(I,Ut),e(Ut,wi),e(I,Ti),e(I,wa),e(wa,Mi),e(I,Bi),e(I,Ta),e(Ta,$i),e(I,xi),e(I,Ma),e(Ma,Ei),e(I,Fi),e(I,Ba),e(Ba,Ii),e(I,ki),e(J,ji),e(J,Pt),e(Pt,Ci),e(Pt,Zt),e(Zt,Ji),e(Pt,zi),e(J,Ni),e(J,At),e(At,Wi),e(At,$a),e($a,Ui),e(At,Pi),e(J,Zi),e(J,pe),e(pe,Ai),e(pe,us),e(us,Si),e(pe,Ri),e(pe,St),e(St,Vi),e(pe,Xi),e(J,Gi),e(J,he),e(he,Li),e(he,Rt),e(Rt,Di),e(he,Yi),e(he,Vt),e(Vt,qi),e(he,Oi),e(J,Qi),e(J,A),e(A,Hi),e(A,gs),e(gs,Ki),e(A,el),e(A,_s),e(_s,tl),e(A,ol),e(A,xa),e(xa,al),e(A,sl),e(A,bs),e(bs,nl),e(A,rl),u(t,Xn,h),u(t,Pe,h),u(t,Gn,h),u(t,Xt,h),e(Xt,il),e(Xt,Ea),e(Ea,ll),u(t,Ln,h),u(t,G,h),e(G,dl),e(G,Gt),e(Gt,cl),e(G,ml),e(G,Lt),e(Lt,pl),e(G,hl),e(G,Dt),e(Dt,fl),e(G,ul),u(t,Dn,h),u(t,fe,h),e(fe,Ze),e(Ze,vs),T(Yt,vs,null),e(fe,gl),e(fe,ys),e(ys,_l),u(t,Yn,h),u(t,Fa,h),e(Fa,bl),u(t,qn,h),T(qt,t,h),u(t,On,h),u(t,Ae,h),e(Ae,le),e(le,Ia),e(Ia,vl),e(le,yl),e(le,Ot),e(Ot,wl),e(le,Tl),e(le,Qt),e(Qt,Ml),e(le,Bl),e(Ae,$l),e(Ae,ka),e(ka,xl),e(ka,ja),e(ja,El),u(t,Qn,h),u(t,Ca,h),e(Ca,ws),e(ws,Fl),u(t,Hn,h),u(t,Ja,h),e(Ja,Ts),e(Ts,za),e(za,Il),u(t,Kn,h),u(t,Na,h),e(Na,kl),u(t,er,h),u(t,ue,h),e(ue,Se),e(Se,Ms),T(Ht,Ms,null),e(ue,jl),e(ue,Bs),e(Bs,Cl),u(t,tr,h),u(t,ge,h),T(Kt,ge,null),e(ge,Jl),e(ge,eo),e(eo,zl),e(eo,Wa),e(Wa,Nl),e(eo,Wl),u(t,or,h),u(t,_e,h),T(to,_e,null),e(_e,Ul),e(_e,oo),e(oo,Pl),e(oo,Ua),e(Ua,Zl),e(oo,Al),u(t,ar,h),u(t,be,h),e(be,Re),e(Re,$s),T(ao,$s,null),e(be,Sl),e(be,xs),e(xs,Rl),u(t,sr,h),u(t,K,h),T(so,K,null),e(K,Vl),e(K,ve),e(ve,Xl),e(ve,Pa),e(Pa,Gl),e(ve,Ll),e(ve,no),e(no,Dl),e(ve,Yl),e(K,ql),T(Ve,K,null),u(t,nr,h),u(t,ye,h),e(ye,Xe),e(Xe,Es),T(ro,Es,null),e(ye,Ol),e(ye,Fs),e(Fs,Ql),u(t,rr,h),u(t,ee,h),T(io,ee,null),e(ee,Hl),e(ee,Za),T(lo,Za,null),e(ee,Kl),e(ee,Ge),T(co,Ge,null),e(Ge,ed),e(Ge,mo),e(mo,td),e(mo,Aa),e(Aa,od),e(mo,ad),u(t,ir,h),u(t,we,h),e(we,Le),e(Le,Is),T(po,Is,null),e(we,sd),e(we,ks),e(ks,nd),u(t,lr,h),u(t,S,h),T(ho,S,null),e(S,rd),e(S,js),e(js,id),e(S,ld),e(S,De),T(fo,De,null),e(De,dd),e(De,Cs),e(Cs,cd),e(S,md),e(S,Ye),T(uo,Ye,null),e(Ye,pd),e(Ye,go),e(go,hd),e(go,Sa),e(Sa,fd),e(go,ud),u(t,dr,h),u(t,Te,h),e(Te,qe),e(qe,Js),T(_o,Js,null),e(Te,gd),e(Te,zs),e(zs,_d),u(t,cr,h),u(t,te,h),T(bo,te,null),e(te,bd),e(te,vo),e(vo,vd),e(vo,yo),e(yo,yd),e(vo,wd),e(te,Td),e(te,L),T(wo,L,null),e(L,Md),e(L,Me),e(Me,Bd),e(Me,Ra),e(Ra,$d),e(Me,xd),e(Me,Ns),e(Ns,Ed),e(Me,Fd),e(L,Id),T(Oe,L,null),e(L,kd),T(Qe,L,null),u(t,mr,h),u(t,Be,h),e(Be,He),e(He,Ws),T(To,Ws,null),e(Be,jd),e(Be,Us),e(Us,Cd),u(t,pr,h),u(t,oe,h),T(Mo,oe,null),e(oe,Jd),e(oe,ae),e(ae,zd),e(ae,Va),e(Va,Nd),e(ae,Wd),e(ae,Xa),e(Xa,Ud),e(ae,Pd),e(ae,Bo),e(Bo,Zd),e(ae,Ad),e(oe,Sd),e(oe,D),T($o,D,null),e(D,Rd),e(D,$e),e($e,Vd),e($e,Ga),e(Ga,Xd),e($e,Gd),e($e,Ps),e(Ps,Ld),e($e,Dd),e(D,Yd),T(Ke,D,null),e(D,qd),T(et,D,null),u(t,hr,h),u(t,xe,h),e(xe,tt),e(tt,Zs),T(xo,Zs,null),e(xe,Od),e(xe,As),e(As,Qd),u(t,fr,h),u(t,R,h),T(Eo,R,null),e(R,Hd),e(R,Ss),e(Ss,Kd),e(R,ec),e(R,Fo),e(Fo,tc),e(Fo,Io),e(Io,oc),e(Fo,ac),e(R,sc),e(R,Y),T(ko,Y,null),e(Y,nc),e(Y,Ee),e(Ee,rc),e(Ee,La),e(La,ic),e(Ee,lc),e(Ee,Rs),e(Rs,dc),e(Ee,cc),e(Y,mc),T(ot,Y,null),e(Y,pc),T(at,Y,null),u(t,ur,h),u(t,Fe,h),e(Fe,st),e(st,Vs),T(jo,Vs,null),e(Fe,hc),e(Fe,Xs),e(Xs,fc),u(t,gr,h),u(t,V,h),T(Co,V,null),e(V,uc),e(V,Gs),e(Gs,gc),e(V,_c),e(V,Jo),e(Jo,bc),e(Jo,zo),e(zo,vc),e(Jo,yc),e(V,wc),e(V,q),T(No,q,null),e(q,Tc),e(q,Ie),e(Ie,Mc),e(Ie,Da),e(Da,Bc),e(Ie,$c),e(Ie,Ls),e(Ls,xc),e(Ie,Ec),e(q,Fc),T(nt,q,null),e(q,Ic),T(rt,q,null),u(t,_r,h),u(t,ke,h),e(ke,it),e(it,Ds),T(Wo,Ds,null),e(ke,kc),e(ke,Ys),e(Ys,jc),u(t,br,h),u(t,k,h),T(Uo,k,null),e(k,Cc),e(k,qs),e(qs,Jc),e(k,zc),e(k,Po),e(Po,Nc),e(Po,Ya),e(Ya,Wc),e(Po,Uc),e(k,Pc),e(k,Zo),e(Zo,Zc),e(Zo,Ao),e(Ao,Ac),e(Zo,Sc),e(k,Rc),e(k,Os),e(Os,Vc),e(k,Xc),e(k,se),e(se,Qs),e(Qs,So),e(So,Gc),e(se,Lc),e(se,Hs),e(Hs,Ro),e(Ro,Dc),e(se,Yc),e(se,Ks),e(Ks,Vo),e(Vo,qc),e(se,Oc),e(se,en),e(en,Xo),e(Xo,Qc),e(k,Hc),e(k,O),T(Go,O,null),e(O,Kc),e(O,je),e(je,em),e(je,tn),e(tn,tm),e(je,om),e(je,on),e(on,am),e(je,sm),e(O,nm),T(lt,O,null),e(O,rm),T(dt,O,null),u(t,vr,h),u(t,Ce,h),e(Ce,ct),e(ct,an),T(Lo,an,null),e(Ce,im),e(Ce,sn),e(sn,lm),u(t,yr,h),u(t,j,h),T(Do,j,null),e(j,dm),e(j,nn),e(nn,cm),e(j,mm),e(j,Yo),e(Yo,pm),e(Yo,qa),e(qa,hm),e(Yo,fm),e(j,um),e(j,qo),e(qo,gm),e(qo,Oo),e(Oo,_m),e(qo,bm),e(j,vm),e(j,rn),e(rn,ym),e(j,wm),e(j,ne),e(ne,ln),e(ln,Qo),e(Qo,Tm),e(ne,Mm),e(ne,dn),e(dn,Ho),e(Ho,Bm),e(ne,$m),e(ne,cn),e(cn,Ko),e(Ko,xm),e(ne,Em),e(ne,mn),e(mn,ea),e(ea,Fm),e(j,Im),e(j,N),T(ta,N,null),e(N,km),e(N,Je),e(Je,jm),e(Je,pn),e(pn,Cm),e(Je,Jm),e(Je,hn),e(hn,zm),e(Je,Nm),e(N,Wm),T(mt,N,null),e(N,Um),e(N,ze),e(ze,Pm),e(ze,fn),e(fn,Zm),e(ze,Am),e(ze,un),e(un,Sm),e(ze,Rm),e(N,Vm),T(pt,N,null),u(t,wr,h),u(t,Ne,h),e(Ne,ht),e(ht,gn),T(oa,gn,null),e(Ne,Xm),e(Ne,_n),e(_n,Gm),u(t,Tr,h),u(t,C,h),T(aa,C,null),e(C,Lm),e(C,bn),e(bn,Dm),e(C,Ym),e(C,sa),e(sa,qm),e(sa,Oa),e(Oa,Om),e(sa,Qm),e(C,Hm),e(C,na),e(na,Km),e(na,ra),e(ra,ep),e(na,tp),e(C,op),e(C,vn),e(vn,ap),e(C,sp),e(C,re),e(re,yn),e(yn,ia),e(ia,np),e(re,rp),e(re,wn),e(wn,la),e(la,ip),e(re,lp),e(re,Tn),e(Tn,da),e(da,dp),e(re,cp),e(re,Mn),e(Mn,ca),e(ca,mp),e(C,pp),e(C,Q),T(ma,Q,null),e(Q,hp),e(Q,We),e(We,fp),e(We,Bn),e(Bn,up),e(We,gp),e(We,$n),e($n,_p),e(We,bp),e(Q,vp),T(ft,Q,null),e(Q,yp),T(ut,Q,null),Mr=!0},p(t,[h]){const pa={};h&2&&(pa.$$scope={dirty:h,ctx:t}),Ve.$set(pa);const xn={};h&2&&(xn.$$scope={dirty:h,ctx:t}),Oe.$set(xn);const En={};h&2&&(En.$$scope={dirty:h,ctx:t}),Qe.$set(En);const Fn={};h&2&&(Fn.$$scope={dirty:h,ctx:t}),Ke.$set(Fn);const ha={};h&2&&(ha.$$scope={dirty:h,ctx:t}),et.$set(ha);const In={};h&2&&(In.$$scope={dirty:h,ctx:t}),ot.$set(In);const kn={};h&2&&(kn.$$scope={dirty:h,ctx:t}),at.$set(kn);const jn={};h&2&&(jn.$$scope={dirty:h,ctx:t}),nt.$set(jn);const ie={};h&2&&(ie.$$scope={dirty:h,ctx:t}),rt.$set(ie);const Cn={};h&2&&(Cn.$$scope={dirty:h,ctx:t}),lt.$set(Cn);const Jn={};h&2&&(Jn.$$scope={dirty:h,ctx:t}),dt.$set(Jn);const zn={};h&2&&(zn.$$scope={dirty:h,ctx:t}),mt.$set(zn);const Nn={};h&2&&(Nn.$$scope={dirty:h,ctx:t}),pt.$set(Nn);const Wn={};h&2&&(Wn.$$scope={dirty:h,ctx:t}),ft.$set(Wn);const Un={};h&2&&(Un.$$scope={dirty:h,ctx:t}),ut.$set(Un)},i(t){Mr||(M(l.$$.fragment,t),M(Jt.$$.fragment,t),M(Yt.$$.fragment,t),M(qt.$$.fragment,t),M(Ht.$$.fragment,t),M(Kt.$$.fragment,t),M(to.$$.fragment,t),M(ao.$$.fragment,t),M(so.$$.fragment,t),M(Ve.$$.fragment,t),M(ro.$$.fragment,t),M(io.$$.fragment,t),M(lo.$$.fragment,t),M(co.$$.fragment,t),M(po.$$.fragment,t),M(ho.$$.fragment,t),M(fo.$$.fragment,t),M(uo.$$.fragment,t),M(_o.$$.fragment,t),M(bo.$$.fragment,t),M(wo.$$.fragment,t),M(Oe.$$.fragment,t),M(Qe.$$.fragment,t),M(To.$$.fragment,t),M(Mo.$$.fragment,t),M($o.$$.fragment,t),M(Ke.$$.fragment,t),M(et.$$.fragment,t),M(xo.$$.fragment,t),M(Eo.$$.fragment,t),M(ko.$$.fragment,t),M(ot.$$.fragment,t),M(at.$$.fragment,t),M(jo.$$.fragment,t),M(Co.$$.fragment,t),M(No.$$.fragment,t),M(nt.$$.fragment,t),M(rt.$$.fragment,t),M(Wo.$$.fragment,t),M(Uo.$$.fragment,t),M(Go.$$.fragment,t),M(lt.$$.fragment,t),M(dt.$$.fragment,t),M(Lo.$$.fragment,t),M(Do.$$.fragment,t),M(ta.$$.fragment,t),M(mt.$$.fragment,t),M(pt.$$.fragment,t),M(oa.$$.fragment,t),M(aa.$$.fragment,t),M(ma.$$.fragment,t),M(ft.$$.fragment,t),M(ut.$$.fragment,t),Mr=!0)},o(t){B(l.$$.fragment,t),B(Jt.$$.fragment,t),B(Yt.$$.fragment,t),B(qt.$$.fragment,t),B(Ht.$$.fragment,t),B(Kt.$$.fragment,t),B(to.$$.fragment,t),B(ao.$$.fragment,t),B(so.$$.fragment,t),B(Ve.$$.fragment,t),B(ro.$$.fragment,t),B(io.$$.fragment,t),B(lo.$$.fragment,t),B(co.$$.fragment,t),B(po.$$.fragment,t),B(ho.$$.fragment,t),B(fo.$$.fragment,t),B(uo.$$.fragment,t),B(_o.$$.fragment,t),B(bo.$$.fragment,t),B(wo.$$.fragment,t),B(Oe.$$.fragment,t),B(Qe.$$.fragment,t),B(To.$$.fragment,t),B(Mo.$$.fragment,t),B($o.$$.fragment,t),B(Ke.$$.fragment,t),B(et.$$.fragment,t),B(xo.$$.fragment,t),B(Eo.$$.fragment,t),B(ko.$$.fragment,t),B(ot.$$.fragment,t),B(at.$$.fragment,t),B(jo.$$.fragment,t),B(Co.$$.fragment,t),B(No.$$.fragment,t),B(nt.$$.fragment,t),B(rt.$$.fragment,t),B(Wo.$$.fragment,t),B(Uo.$$.fragment,t),B(Go.$$.fragment,t),B(lt.$$.fragment,t),B(dt.$$.fragment,t),B(Lo.$$.fragment,t),B(Do.$$.fragment,t),B(ta.$$.fragment,t),B(mt.$$.fragment,t),B(pt.$$.fragment,t),B(oa.$$.fragment,t),B(aa.$$.fragment,t),B(ma.$$.fragment,t),B(ft.$$.fragment,t),B(ut.$$.fragment,t),Mr=!1},d(t){o(p),t&&o(v),t&&o(_),$(l),t&&o(Pn),t&&o(me),$(Jt),t&&o(Zn),t&&o(X),t&&o(An),t&&o(ga),t&&o(Sn),t&&o(_a),t&&o(Rn),t&&o(ba),t&&o(Vn),t&&o(J),t&&o(Xn),t&&o(Pe),t&&o(Gn),t&&o(Xt),t&&o(Ln),t&&o(G),t&&o(Dn),t&&o(fe),$(Yt),t&&o(Yn),t&&o(Fa),t&&o(qn),$(qt,t),t&&o(On),t&&o(Ae),t&&o(Qn),t&&o(Ca),t&&o(Hn),t&&o(Ja),t&&o(Kn),t&&o(Na),t&&o(er),t&&o(ue),$(Ht),t&&o(tr),t&&o(ge),$(Kt),t&&o(or),t&&o(_e),$(to),t&&o(ar),t&&o(be),$(ao),t&&o(sr),t&&o(K),$(so),$(Ve),t&&o(nr),t&&o(ye),$(ro),t&&o(rr),t&&o(ee),$(io),$(lo),$(co),t&&o(ir),t&&o(we),$(po),t&&o(lr),t&&o(S),$(ho),$(fo),$(uo),t&&o(dr),t&&o(Te),$(_o),t&&o(cr),t&&o(te),$(bo),$(wo),$(Oe),$(Qe),t&&o(mr),t&&o(Be),$(To),t&&o(pr),t&&o(oe),$(Mo),$($o),$(Ke),$(et),t&&o(hr),t&&o(xe),$(xo),t&&o(fr),t&&o(R),$(Eo),$(ko),$(ot),$(at),t&&o(ur),t&&o(Fe),$(jo),t&&o(gr),t&&o(V),$(Co),$(No),$(nt),$(rt),t&&o(_r),t&&o(ke),$(Wo),t&&o(br),t&&o(k),$(Uo),$(Go),$(lt),$(dt),t&&o(vr),t&&o(Ce),$(Lo),t&&o(yr),t&&o(j),$(Do),$(ta),$(mt),$(pt),t&&o(wr),t&&o(Ne),$(oa),t&&o(Tr),t&&o(C),$(aa),$(ma),$(ft),$(ut)}}}const Bu={local:"beit",sections:[{local:"overview",title:"Overview"},{local:"resources",title:"Resources"},{local:"transformers.models.beit.modeling_beit.BeitModelOutputWithPooling",title:"BEiT specific outputs"},{local:"transformers.BeitConfig",title:"BeitConfig"},{local:"transformers.BeitFeatureExtractor",title:"BeitFeatureExtractor"},{local:"transformers.BeitImageProcessor",title:"BeitImageProcessor"},{local:"transformers.BeitModel",title:"BeitModel"},{local:"transformers.BeitForMaskedImageModeling",title:"BeitForMaskedImageModeling"},{local:"transformers.BeitForImageClassification",title:"BeitForImageClassification"},{local:"transformers.BeitForSemanticSegmentation",title:"BeitForSemanticSegmentation"},{local:"transformers.FlaxBeitModel",title:"FlaxBeitModel"},{local:"transformers.FlaxBeitForMaskedImageModeling",title:"FlaxBeitForMaskedImageModeling"},{local:"transformers.FlaxBeitForImageClassification",title:"FlaxBeitForImageClassification"}],title:"BEiT"};function $u(x){return ru(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ju extends tu{constructor(p){super();ou(this,p,$u,Mu,au,{})}}export{Ju as default,Bu as metadata};
