import{S as Fh,i as Eh,s as kh,e as a,k as p,w,t as n,M as Mh,c as r,d as t,m,a as s,x,h as i,b as d,N as Ih,G as e,g as _,y as $,q as y,o as T,B,v as jh,L as Bt}from"../../chunks/vendor-hf-doc-builder.js";import{T as yt}from"../../chunks/Tip-hf-doc-builder.js";import{D as k}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Ft}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as Q}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Tt}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Ph(F){let c,v,g,f,b;return f=new Ft({props:{code:`from transformers import BeitConfig, BeitModel

# Initializing a BEiT beit-base-patch16-224-pt22k style configuration
configuration = BeitConfig()

# Initializing a model (with random weights) from the beit-base-patch16-224-pt22k style configuration
model = BeitModel(configuration)

# Accessing the model configuration
configuration = model.config`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> 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(){c=a("p"),v=n("Example:"),g=p(),w(f.$$.fragment)},l(l){c=r(l,"P",{});var h=s(c);v=i(h,"Example:"),h.forEach(t),g=m(l),x(f.$$.fragment,l)},m(l,h){_(l,c,h),e(c,v),_(l,g,h),$(f,l,h),b=!0},p:Bt,i(l){b||(y(f.$$.fragment,l),b=!0)},o(l){T(f.$$.fragment,l),b=!1},d(l){l&&t(c),l&&t(g),B(f,l)}}}function Ch(F){let c,v;return{c(){c=a("p"),v=n(`NumPy arrays and PyTorch tensors are converted to PIL images when resizing, so the most efficient is to pass
PIL images.`)},l(g){c=r(g,"P",{});var f=s(c);v=i(f,`NumPy arrays and PyTorch tensors are converted to PIL images when resizing, so the most efficient is to pass
PIL images.`),f.forEach(t)},m(g,f){_(g,c,f),e(c,v)},d(g){g&&t(c)}}}function zh(F){let c,v,g,f,b;return{c(){c=a("p"),v=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=a("code"),f=n("Module"),b=n(`
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){c=r(l,"P",{});var h=s(c);v=i(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r(h,"CODE",{});var E=s(g);f=i(E,"Module"),E.forEach(t),b=i(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(l,h){_(l,c,h),e(c,v),e(c,g),e(g,f),e(c,b)},d(l){l&&t(c)}}}function Ah(F){let c,v,g,f,b;return f=new Ft({props:{code:`from transformers import BeitFeatureExtractor, BeitModel
import torch
from datasets import load_dataset

dataset = load_dataset("huggingface/cats-image")
image = dataset["test"]["image"][0]

feature_extractor = BeitFeatureExtractor.from_pretrained("microsoft/beit-base-patch16-224-pt22k")
model = BeitModel.from_pretrained("microsoft/beit-base-patch16-224-pt22k")

inputs = feature_extractor(image, return_tensors="pt")

with torch.no_grad():
    outputs = model(**inputs)

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

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

feature_extractor = BeitFeatureExtractor.from_pretrained("microsoft/beit-base-patch16-224-pt22k")
model = BeitForMaskedImageModeling.from_pretrained("microsoft/beit-base-patch16-224-pt22k")

num_patches = (model.config.image_size // model.config.patch_size) ** 2
pixel_values = feature_extractor(images=image, return_tensors="pt").pixel_values
# create random boolean mask of shape (batch_size, num_patches)
bool_masked_pos = torch.randint(low=0, high=2, size=(1, num_patches)).bool()

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

dataset = load_dataset("huggingface/cats-image")
image = dataset["test"]["image"][0]

feature_extractor = BeitFeatureExtractor.from_pretrained("microsoft/beit-base-patch16-224")
model = BeitForImageClassification.from_pretrained("microsoft/beit-base-patch16-224")

inputs = feature_extractor(image, return_tensors="pt")

with torch.no_grad():
    logits = model(**inputs).logits

# model predicts one of the 1000 ImageNet classes
predicted_label = logits.argmax(-1).item()
print(model.config.id2label[predicted_label])`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> BeitFeatureExtractor, 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>feature_extractor = BeitFeatureExtractor.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 = feature_extractor(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(){c=a("p"),v=n("Example:"),g=p(),w(f.$$.fragment)},l(l){c=r(l,"P",{});var h=s(c);v=i(h,"Example:"),h.forEach(t),g=m(l),x(f.$$.fragment,l)},m(l,h){_(l,c,h),e(c,v),_(l,g,h),$(f,l,h),b=!0},p:Bt,i(l){b||(y(f.$$.fragment,l),b=!0)},o(l){T(f.$$.fragment,l),b=!1},d(l){l&&t(c),l&&t(g),B(f,l)}}}function Oh(F){let c,v,g,f,b;return{c(){c=a("p"),v=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=a("code"),f=n("Module"),b=n(`
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){c=r(l,"P",{});var h=s(c);v=i(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r(h,"CODE",{});var E=s(g);f=i(E,"Module"),E.forEach(t),b=i(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(l,h){_(l,c,h),e(c,v),e(c,g),e(g,f),e(c,b)},d(l){l&&t(c)}}}function Dh(F){let c,v,g,f,b;return f=new Ft({props:{code:`from transformers import AutoFeatureExtractor, BeitForSemanticSegmentation
from PIL import Image
import requests

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

feature_extractor = AutoFeatureExtractor.from_pretrained("microsoft/beit-base-finetuned-ade-640-640")
model = BeitForSemanticSegmentation.from_pretrained("microsoft/beit-base-finetuned-ade-640-640")

inputs = feature_extractor(images=image, return_tensors="pt")
outputs = model(**inputs)
# logits are of shape (batch_size, num_labels, height, width)
logits = outputs.logits`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoFeatureExtractor, 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>feature_extractor = AutoFeatureExtractor.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 = feature_extractor(images=image, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span><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(){c=a("p"),v=n("Examples:"),g=p(),w(f.$$.fragment)},l(l){c=r(l,"P",{});var h=s(c);v=i(h,"Examples:"),h.forEach(t),g=m(l),x(f.$$.fragment,l)},m(l,h){_(l,c,h),e(c,v),_(l,g,h),$(f,l,h),b=!0},p:Bt,i(l){b||(y(f.$$.fragment,l),b=!0)},o(l){T(f.$$.fragment,l),b=!1},d(l){l&&t(c),l&&t(g),B(f,l)}}}function Vh(F){let c,v,g,f,b;return{c(){c=a("p"),v=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=a("code"),f=n("Module"),b=n(`
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){c=r(l,"P",{});var h=s(c);v=i(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r(h,"CODE",{});var E=s(g);f=i(E,"Module"),E.forEach(t),b=i(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(l,h){_(l,c,h),e(c,v),e(c,g),e(g,f),e(c,b)},d(l){l&&t(c)}}}function Wh(F){let c,v,g,f,b;return f=new Ft({props:{code:`from transformers import BeitFeatureExtractor, FlaxBeitModel
from PIL import Image
import requests

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

feature_extractor = BeitFeatureExtractor.from_pretrained("microsoft/beit-base-patch16-224-pt22k-ft22k")
model = FlaxBeitModel.from_pretrained("microsoft/beit-base-patch16-224-pt22k-ft22k")

inputs = feature_extractor(images=image, return_tensors="np")
outputs = model(**inputs)
last_hidden_states = outputs.last_hidden_state`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> BeitFeatureExtractor, 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>feature_extractor = BeitFeatureExtractor.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 = feature_extractor(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(){c=a("p"),v=n("Examples:"),g=p(),w(f.$$.fragment)},l(l){c=r(l,"P",{});var h=s(c);v=i(h,"Examples:"),h.forEach(t),g=m(l),x(f.$$.fragment,l)},m(l,h){_(l,c,h),e(c,v),_(l,g,h),$(f,l,h),b=!0},p:Bt,i(l){b||(y(f.$$.fragment,l),b=!0)},o(l){T(f.$$.fragment,l),b=!1},d(l){l&&t(c),l&&t(g),B(f,l)}}}function Rh(F){let c,v,g,f,b;return{c(){c=a("p"),v=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=a("code"),f=n("Module"),b=n(`
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){c=r(l,"P",{});var h=s(c);v=i(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r(h,"CODE",{});var E=s(g);f=i(E,"Module"),E.forEach(t),b=i(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(l,h){_(l,c,h),e(c,v),e(c,g),e(g,f),e(c,b)},d(l){l&&t(c)}}}function Uh(F){let c,v,g,f,b;return f=new Ft({props:{code:`from transformers import BeitFeatureExtractor, BeitForMaskedImageModeling
from PIL import Image
import requests

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

feature_extractor = BeitFeatureExtractor.from_pretrained("microsoft/beit-base-patch16-224-pt22k")
model = BeitForMaskedImageModeling.from_pretrained("microsoft/beit-base-patch16-224-pt22k")

inputs = feature_extractor(images=image, return_tensors="np")
outputs = model(**inputs)
logits = outputs.logits`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> BeitFeatureExtractor, 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>feature_extractor = BeitFeatureExtractor.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 = feature_extractor(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(){c=a("p"),v=n("Examples:"),g=p(),w(f.$$.fragment)},l(l){c=r(l,"P",{});var h=s(c);v=i(h,"Examples:"),h.forEach(t),g=m(l),x(f.$$.fragment,l)},m(l,h){_(l,c,h),e(c,v),_(l,g,h),$(f,l,h),b=!0},p:Bt,i(l){b||(y(f.$$.fragment,l),b=!0)},o(l){T(f.$$.fragment,l),b=!1},d(l){l&&t(c),l&&t(g),B(f,l)}}}function Hh(F){let c,v,g,f,b;return{c(){c=a("p"),v=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=a("code"),f=n("Module"),b=n(`
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){c=r(l,"P",{});var h=s(c);v=i(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r(h,"CODE",{});var E=s(g);f=i(E,"Module"),E.forEach(t),b=i(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(l,h){_(l,c,h),e(c,v),e(c,g),e(g,f),e(c,b)},d(l){l&&t(c)}}}function Jh(F){let c,v,g,f,b;return f=new Ft({props:{code:`from transformers import BeitFeatureExtractor, FlaxBeitForImageClassification
from PIL import Image
import requests

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

feature_extractor = BeitFeatureExtractor.from_pretrained("microsoft/beit-base-patch16-224")
model = FlaxBeitForImageClassification.from_pretrained("microsoft/beit-base-patch16-224")

inputs = feature_extractor(images=image, return_tensors="np")
outputs = model(**inputs)
logits = outputs.logits
# model predicts one of the 1000 ImageNet classes
predicted_class_idx = logits.argmax(-1).item()
print("Predicted class:", model.config.id2label[predicted_class_idx])`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> BeitFeatureExtractor, 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>feature_extractor = BeitFeatureExtractor.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 = feature_extractor(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(){c=a("p"),v=n("Example:"),g=p(),w(f.$$.fragment)},l(l){c=r(l,"P",{});var h=s(c);v=i(h,"Example:"),h.forEach(t),g=m(l),x(f.$$.fragment,l)},m(l,h){_(l,c,h),e(c,v),_(l,g,h),$(f,l,h),b=!0},p:Bt,i(l){b||(y(f.$$.fragment,l),b=!0)},o(l){T(f.$$.fragment,l),b=!1},d(l){l&&t(c),l&&t(g),B(f,l)}}}function Gh(F){let c,v,g,f,b,l,h,E,hn,is,pe,Ae,Da,Et,fn,Va,un,ls,W,gn,kt,_n,bn,Mt,vn,wn,It,xn,$n,ds,ea,yn,cs,ta,Wa,Tn,ps,oa,Bn,ms,C,M,Fn,aa,En,kn,ra,Mn,In,jt,jn,Pn,sa,Cn,zn,na,An,qn,ia,Ln,Sn,la,Nn,On,Dn,Pt,Vn,Ct,Wn,Rn,Un,zt,Hn,da,Jn,Gn,Xn,me,Kn,Ra,Yn,Qn,At,Zn,ei,ti,he,oi,qt,ai,ri,Lt,si,ni,ii,O,li,Ua,di,ci,Ha,pi,mi,ca,hi,fi,Ja,ui,gi,hs,qe,fp,fs,St,_i,pa,bi,us,R,vi,Nt,wi,xi,Ot,$i,yi,Dt,Ti,Bi,gs,fe,Le,Ga,Vt,Fi,Xa,Ei,_s,ue,Wt,ki,Rt,Mi,ma,Ii,ji,bs,ge,Ut,Pi,Ht,Ci,ha,zi,Ai,vs,_e,Se,Ka,Jt,qi,Ya,Li,ws,Z,Gt,Si,be,Ni,fa,Oi,Di,Xt,Vi,Wi,Ri,Ne,xs,ve,Oe,Qa,Kt,Ui,Za,Hi,$s,A,Yt,Ji,er,Gi,Xi,Qt,Ki,ua,Yi,Qi,Zi,ie,Zt,el,tr,tl,ol,De,al,Ve,eo,rl,to,sl,ga,nl,il,ys,we,We,or,oo,ll,ar,dl,Ts,ee,ao,cl,ro,pl,so,ml,hl,fl,U,no,ul,xe,gl,_a,_l,bl,rr,vl,wl,xl,Re,$l,Ue,Bs,$e,He,sr,io,yl,nr,Tl,Fs,te,lo,Bl,oe,Fl,ba,El,kl,va,Ml,Il,co,jl,Pl,Cl,H,po,zl,ye,Al,wa,ql,Ll,ir,Sl,Nl,Ol,Je,Dl,Ge,Es,Te,Xe,lr,mo,Vl,dr,Wl,ks,D,ho,Rl,cr,Ul,Hl,fo,Jl,uo,Gl,Xl,Kl,J,go,Yl,Be,Ql,xa,Zl,ed,pr,td,od,ad,Ke,rd,Ye,Ms,Fe,Qe,mr,_o,sd,hr,nd,Is,V,bo,id,fr,ld,dd,vo,cd,wo,pd,md,hd,G,xo,fd,Ee,ud,$a,gd,_d,ur,bd,vd,wd,Ze,xd,et,js,ke,tt,gr,$o,$d,_r,yd,Ps,I,yo,Td,br,Bd,Fd,To,Ed,ya,kd,Md,Id,Bo,jd,Fo,Pd,Cd,zd,vr,Ad,qd,ae,wr,Eo,Ld,Sd,xr,ko,Nd,Od,$r,Mo,Dd,Vd,yr,Io,Wd,Rd,X,jo,Ud,Me,Hd,Tr,Jd,Gd,Br,Xd,Kd,Yd,ot,Qd,at,Cs,Ie,rt,Fr,Po,Zd,Er,ec,zs,j,Co,tc,kr,oc,ac,zo,rc,Ta,sc,nc,ic,Ao,lc,qo,dc,cc,pc,Mr,mc,hc,re,Ir,Lo,fc,uc,jr,So,gc,_c,Pr,No,bc,vc,Cr,Oo,wc,xc,q,Do,$c,je,yc,zr,Tc,Bc,Ar,Fc,Ec,kc,st,Mc,Pe,Ic,qr,jc,Pc,Lr,Cc,zc,Ac,nt,As,Ce,it,Sr,Vo,qc,Nr,Lc,qs,P,Wo,Sc,Or,Nc,Oc,Ro,Dc,Ba,Vc,Wc,Rc,Uo,Uc,Ho,Hc,Jc,Gc,Dr,Xc,Kc,se,Vr,Jo,Yc,Qc,Wr,Go,Zc,ep,Rr,Xo,tp,op,Ur,Ko,ap,rp,K,Yo,sp,ze,np,Hr,ip,lp,Jr,dp,cp,pp,lt,mp,dt,Ls;return l=new Q({}),Et=new Q({}),Vt=new Q({}),Wt=new k({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/vr_19907/src/transformers/models/beit/modeling_beit.py#L69"}}),Ut=new k({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/vr_19907/src/transformers/models/beit/modeling_flax_beit.py#L46"}}),Jt=new Q({}),Gt=new k({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:"is_encoder_decoder",val:" = False"},{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/vr_19907/src/transformers/models/beit/configuration_beit.py#L36"}}),Ne=new Tt({props:{anchor:"transformers.BeitConfig.example",$$slots:{default:[Ph]},$$scope:{ctx:F}}}),Kt=new Q({}),Yt=new k({props:{name:"class transformers.BeitFeatureExtractor",anchor:"transformers.BeitFeatureExtractor",parameters:[{name:"do_resize",val:" = True"},{name:"size",val:" = 256"},{name:"resample",val:" = <Resampling.BICUBIC: 3>"},{name:"do_center_crop",val:" = True"},{name:"crop_size",val:" = 224"},{name:"do_normalize",val:" = True"},{name:"image_mean",val:" = None"},{name:"image_std",val:" = None"},{name:"reduce_labels",val:" = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.BeitFeatureExtractor.do_resize",description:`<strong>do_resize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to resize the input to a certain <code>size</code>.`,name:"do_resize"},{anchor:"transformers.BeitFeatureExtractor.size",description:`<strong>size</strong> (<code>int</code> or <code>Tuple(int)</code>, <em>optional</em>, defaults to 256) &#x2014;
Resize the input to the given size. If a tuple is provided, it should be (width, height). If only an
integer is provided, then the input will be resized to (size, size). Only has an effect if <code>do_resize</code> is
set to <code>True</code>.`,name:"size"},{anchor:"transformers.BeitFeatureExtractor.resample",description:`<strong>resample</strong> (<code>int</code>, <em>optional</em>, defaults to <code>PIL.Image.Resampling.BICUBIC</code>) &#x2014;
An optional resampling filter. This can be one of <code>PIL.Image.Resampling.NEAREST</code>,
<code>PIL.Image.Resampling.BOX</code>, <code>PIL.Image.Resampling.BILINEAR</code>, <code>PIL.Image.Resampling.HAMMING</code>,
<code>PIL.Image.Resampling.BICUBIC</code> or <code>PIL.Image.Resampling.LANCZOS</code>. Only has an effect if <code>do_resize</code> is set
to <code>True</code>.`,name:"resample"},{anchor:"transformers.BeitFeatureExtractor.do_center_crop",description:`<strong>do_center_crop</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to crop the input at the center. 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.`,name:"do_center_crop"},{anchor:"transformers.BeitFeatureExtractor.crop_size",description:`<strong>crop_size</strong> (<code>int</code>, <em>optional</em>, defaults to 224) &#x2014;
Desired output size when applying center-cropping. Only has an effect if <code>do_center_crop</code> is set to <code>True</code>.`,name:"crop_size"},{anchor:"transformers.BeitFeatureExtractor.do_normalize",description:`<strong>do_normalize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to normalize the input with <code>image_mean</code> and <code>image_std</code>.`,name:"do_normalize"},{anchor:"transformers.BeitFeatureExtractor.image_mean",description:`<strong>image_mean</strong> (<code>List[int]</code>, defaults to <code>[0.5, 0.5, 0.5]</code>) &#x2014;
The sequence of means for each channel, to be used when normalizing images.`,name:"image_mean"},{anchor:"transformers.BeitFeatureExtractor.image_std",description:`<strong>image_std</strong> (<code>List[int]</code>, defaults to <code>[0.5, 0.5, 0.5]</code>) &#x2014;
The sequence of standard deviations for each channel, to be used when normalizing images.`,name:"image_std"},{anchor:"transformers.BeitFeatureExtractor.reduce_labels",description:`<strong>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.`,name:"reduce_labels"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/beit/feature_extraction_beit.py#L41"}}),Zt=new k({props:{name:"__call__",anchor:"transformers.BeitFeatureExtractor.__call__",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')]] = None"},{name:"return_tensors",val:": typing.Union[str, transformers.utils.generic.TensorType, NoneType] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.BeitFeatureExtractor.__call__.images",description:`<strong>images</strong> (<code>PIL.Image.Image</code>, <code>np.ndarray</code>, <code>torch.Tensor</code>, <code>List[PIL.Image.Image]</code>, <code>List[np.ndarray]</code>, <code>List[torch.Tensor]</code>) &#x2014;
The image or batch of images to be prepared. Each image can be a PIL image, NumPy array or PyTorch
tensor. In case of a NumPy array/PyTorch tensor, each image should be of shape (C, H, W), where C is a
number of channels, H and W are image height and width.`,name:"images"},{anchor:"transformers.BeitFeatureExtractor.__call__.segmentation_maps",description:`<strong>segmentation_maps</strong> (<code>PIL.Image.Image</code>, <code>np.ndarray</code>, <code>torch.Tensor</code>, <code>List[PIL.Image.Image]</code>, <code>List[np.ndarray]</code>, <code>List[torch.Tensor]</code>, <em>optional</em>) &#x2014;
Optionally, the corresponding semantic segmentation maps with the pixel-wise annotations.`,name:"segmentation_maps"},{anchor:"transformers.BeitFeatureExtractor.__call__.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <a href="/docs/transformers/pr_19907/en/internal/file_utils#transformers.TensorType">TensorType</a>, <em>optional</em>, defaults to <code>&apos;np&apos;</code>) &#x2014;
If set, will return tensors of a particular framework. Acceptable values are:</p>
<ul>
<li><code>&apos;tf&apos;</code>: Return TensorFlow <code>tf.constant</code> objects.</li>
<li><code>&apos;pt&apos;</code>: Return PyTorch <code>torch.Tensor</code> objects.</li>
<li><code>&apos;np&apos;</code>: Return NumPy <code>np.ndarray</code> objects.</li>
<li><code>&apos;jax&apos;</code>: Return JAX <code>jnp.ndarray</code> objects.</li>
</ul>`,name:"return_tensors"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/beit/feature_extraction_beit.py#L103",returnDescription:`
<p>A <a
  href="/docs/transformers/pr_19907/en/main_classes/feature_extractor#transformers.BatchFeature"
>BatchFeature</a> with the following fields:</p>
<ul>
<li><strong>pixel_values</strong> \u2014 Pixel values to be fed to a model, of shape (batch_size, num_channels, height,
width).</li>
<li><strong>labels</strong> \u2014 Optional labels to be fed to a model (when <code>segmentation_maps</code> are provided)</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/pr_19907/en/main_classes/feature_extractor#transformers.BatchFeature"
>BatchFeature</a></p>
`}}),De=new yt({props:{warning:!0,$$slots:{default:[Ch]},$$scope:{ctx:F}}}),eo=new k({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/pr_19907/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/vr_19907/src/transformers/models/beit/feature_extraction_beit.py#L232",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>
`}}),oo=new Q({}),ao=new k({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/pr_19907/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/pr_19907/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/beit/modeling_beit.py#L620"}}),no=new k({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/pr_19907/en/model_doc/beit#transformers.BeitFeatureExtractor">BeitFeatureExtractor</a>. See
<a href="/docs/transformers/pr_19907/en/model_doc/beit#transformers.BeitFeatureExtractor.__call__">BeitFeatureExtractor.<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/pr_19907/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/beit/modeling_beit.py#L647",returnDescription:`
<p>A <a
  href="/docs/transformers/pr_19907/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/pr_19907/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/pr_19907/en/model_doc/beit#transformers.models.beit.modeling_beit.BeitModelOutputWithPooling"
>transformers.models.beit.modeling_beit.BeitModelOutputWithPooling</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Re=new yt({props:{$$slots:{default:[zh]},$$scope:{ctx:F}}}),Ue=new Tt({props:{anchor:"transformers.BeitModel.forward.example",$$slots:{default:[Ah]},$$scope:{ctx:F}}}),io=new Q({}),lo=new k({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/pr_19907/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/pr_19907/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/beit/modeling_beit.py#L732"}}),po=new k({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/pr_19907/en/model_doc/beit#transformers.BeitFeatureExtractor">BeitFeatureExtractor</a>. See
<a href="/docs/transformers/pr_19907/en/model_doc/beit#transformers.BeitFeatureExtractor.__call__">BeitFeatureExtractor.<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/pr_19907/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/vr_19907/src/transformers/models/beit/modeling_beit.py#L746",returnDescription:`
<p>A <a
  href="/docs/transformers/pr_19907/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/pr_19907/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/pr_19907/en/main_classes/output#transformers.modeling_outputs.MaskedLMOutput"
>transformers.modeling_outputs.MaskedLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Je=new yt({props:{$$slots:{default:[qh]},$$scope:{ctx:F}}}),Ge=new Tt({props:{anchor:"transformers.BeitForMaskedImageModeling.forward.example",$$slots:{default:[Lh]},$$scope:{ctx:F}}}),mo=new Q({}),ho=new k({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/pr_19907/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/pr_19907/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/beit/modeling_beit.py#L832"}}),go=new k({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/pr_19907/en/model_doc/beit#transformers.BeitFeatureExtractor">BeitFeatureExtractor</a>. See
<a href="/docs/transformers/pr_19907/en/model_doc/beit#transformers.BeitFeatureExtractor.__call__">BeitFeatureExtractor.<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/pr_19907/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/vr_19907/src/transformers/models/beit/modeling_beit.py#L845",returnDescription:`
<p>A <a
  href="/docs/transformers/pr_19907/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/pr_19907/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/pr_19907/en/main_classes/output#transformers.modeling_outputs.ImageClassifierOutput"
>transformers.modeling_outputs.ImageClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ke=new yt({props:{$$slots:{default:[Sh]},$$scope:{ctx:F}}}),Ye=new Tt({props:{anchor:"transformers.BeitForImageClassification.forward.example",$$slots:{default:[Nh]},$$scope:{ctx:F}}}),_o=new Q({}),bo=new k({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/pr_19907/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/pr_19907/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/beit/modeling_beit.py#L1156"}}),xo=new k({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/pr_19907/en/model_doc/beit#transformers.BeitFeatureExtractor">BeitFeatureExtractor</a>. See
<a href="/docs/transformers/pr_19907/en/model_doc/beit#transformers.BeitFeatureExtractor.__call__">BeitFeatureExtractor.<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/pr_19907/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/vr_19907/src/transformers/models/beit/modeling_beit.py#L1200",returnDescription:`
<p>A <a
  href="/docs/transformers/pr_19907/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/pr_19907/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/pr_19907/en/main_classes/output#transformers.modeling_outputs.SemanticSegmenterOutput"
>transformers.modeling_outputs.SemanticSegmenterOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ze=new yt({props:{$$slots:{default:[Oh]},$$scope:{ctx:F}}}),et=new Tt({props:{anchor:"transformers.BeitForSemanticSegmentation.forward.example",$$slots:{default:[Dh]},$$scope:{ctx:F}}}),$o=new Q({}),yo=new k({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/pr_19907/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/pr_19907/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/pr_19907/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/pr_19907/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/beit/modeling_flax_beit.py#L749"}}),jo=new k({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/vr_19907/src/transformers/models/beit/modeling_flax_beit.py#L635",returnDescription:`
<p>A <a
  href="/docs/transformers/pr_19907/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/pr_19907/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>
`}}),ot=new yt({props:{$$slots:{default:[Vh]},$$scope:{ctx:F}}}),at=new Tt({props:{anchor:"transformers.FlaxBeitModel.__call__.example",$$slots:{default:[Wh]},$$scope:{ctx:F}}}),Po=new Q({}),Co=new k({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/pr_19907/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/pr_19907/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/pr_19907/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/pr_19907/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/beit/modeling_flax_beit.py#L833"}}),Do=new k({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/vr_19907/src/transformers/models/beit/modeling_flax_beit.py#L635",returnDescription:`
<p>A <a
  href="/docs/transformers/pr_19907/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/pr_19907/en/main_classes/output#transformers.modeling_flax_outputs.FlaxMaskedLMOutput"
>transformers.modeling_flax_outputs.FlaxMaskedLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),st=new yt({props:{$$slots:{default:[Rh]},$$scope:{ctx:F}}}),nt=new Tt({props:{anchor:"transformers.FlaxBeitForMaskedImageModeling.__call__.example",$$slots:{default:[Uh]},$$scope:{ctx:F}}}),Vo=new Q({}),Wo=new k({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/pr_19907/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/pr_19907/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/pr_19907/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/pr_19907/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/beit/modeling_flax_beit.py#L920"}}),Yo=new k({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/vr_19907/src/transformers/models/beit/modeling_flax_beit.py#L635",returnDescription:`
<p>A <a
  href="/docs/transformers/pr_19907/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/pr_19907/en/main_classes/output#transformers.modeling_flax_outputs.FlaxSequenceClassifierOutput"
>transformers.modeling_flax_outputs.FlaxSequenceClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),lt=new yt({props:{$$slots:{default:[Hh]},$$scope:{ctx:F}}}),dt=new Tt({props:{anchor:"transformers.FlaxBeitForImageClassification.__call__.example",$$slots:{default:[Jh]},$$scope:{ctx:F}}}),{c(){c=a("meta"),v=p(),g=a("h1"),f=a("a"),b=a("span"),w(l.$$.fragment),h=p(),E=a("span"),hn=n("BEiT"),is=p(),pe=a("h2"),Ae=a("a"),Da=a("span"),w(Et.$$.fragment),fn=p(),Va=a("span"),un=n("Overview"),ls=p(),W=a("p"),gn=n("The BEiT model was proposed in "),kt=a("a"),_n=n("BEiT: BERT Pre-Training of Image Transformers"),bn=n(` 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 `),Mt=a("a"),vn=n("original ViT paper"),wn=n(`), BEiT models are pre-trained to
predict visual tokens from the codebook of OpenAI\u2019s `),It=a("a"),xn=n("DALL-E model"),$n=n(` given masked
patches.`),ds=p(),ea=a("p"),yn=n("The abstract from the paper is the following:"),cs=p(),ta=a("p"),Wa=a("em"),Tn=n(`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%).`),ps=p(),oa=a("p"),Bn=n("Tips:"),ms=p(),C=a("ul"),M=a("li"),Fn=n(`BEiT models are regular Vision Transformers, but pre-trained in a self-supervised way rather than supervised. They
outperform both the `),aa=a("a"),En=n("original model (ViT)"),kn=n(" as well as "),ra=a("a"),Mn=n("Data-efficient Image Transformers (DeiT)"),In=n(` 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 `),jt=a("a"),jn=n("here"),Pn=n(` (you can just replace
`),sa=a("a"),Cn=n("ViTFeatureExtractor"),zn=n(" by "),na=a("a"),An=n("BeitFeatureExtractor"),qn=n(` and
`),ia=a("a"),Ln=n("ViTForImageClassification"),Sn=n(" by "),la=a("a"),Nn=n("BeitForImageClassification"),On=n(")."),Dn=p(),Pt=a("li"),Vn=n(`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 `),Ct=a("a"),Wn=n("here"),Rn=n("."),Un=p(),zt=a("li"),Hn=n(`As the BEiT models expect each image to be of the same size (resolution), one can use
`),da=a("a"),Jn=n("BeitFeatureExtractor"),Gn=n(" to resize (or rescale) and normalize images for the model."),Xn=p(),me=a("li"),Kn=n(`Both the patch resolution and image resolution used during pre-training or fine-tuning are reflected in the name of
each checkpoint. For example, `),Ra=a("code"),Yn=n("microsoft/beit-base-patch16-224"),Qn=n(` refers to a base-sized architecture with patch
resolution of 16x16 and fine-tuning resolution of 224x224. All checkpoints can be found on the `),At=a("a"),Zn=n("hub"),ei=n("."),ti=p(),he=a("li"),oi=n("The available checkpoints are either (1) pre-trained on "),qt=a("a"),ai=n("ImageNet-22k"),ri=n(` (a collection of
14 million images and 22k classes) only, (2) also fine-tuned on ImageNet-22k or (3) also fine-tuned on `),Lt=a("a"),si=n("ImageNet-1k"),ni=n(` (also referred to as ILSVRC 2012, a collection of 1.3 million
images and 1,000 classes).`),ii=p(),O=a("li"),li=n(`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 `),Ua=a("code"),di=n("use_relative_position_bias"),ci=n(` or the
`),Ha=a("code"),pi=n("use_relative_position_bias"),mi=n(" attribute of "),ca=a("a"),hi=n("BeitConfig"),fi=n(" to "),Ja=a("code"),ui=n("True"),gi=n(` in order to add
position embeddings.`),hs=p(),qe=a("img"),fs=p(),St=a("small"),_i=n("BEiT pre-training. Taken from the "),pa=a("a"),bi=n("original paper."),us=p(),R=a("p"),vi=n("This model was contributed by "),Nt=a("a"),wi=n("nielsr"),xi=n(`. The JAX/FLAX version of this model was
contributed by `),Ot=a("a"),$i=n("kamalkraj"),yi=n(". The original code can be found "),Dt=a("a"),Ti=n("here"),Bi=n("."),gs=p(),fe=a("h2"),Le=a("a"),Ga=a("span"),w(Vt.$$.fragment),Fi=p(),Xa=a("span"),Ei=n("BEiT specific outputs"),_s=p(),ue=a("div"),w(Wt.$$.fragment),ki=p(),Rt=a("p"),Mi=n("Class for outputs of "),ma=a("a"),Ii=n("BeitModel"),ji=n("."),bs=p(),ge=a("div"),w(Ut.$$.fragment),Pi=p(),Ht=a("p"),Ci=n("Class for outputs of "),ha=a("a"),zi=n("FlaxBeitModel"),Ai=n("."),vs=p(),_e=a("h2"),Se=a("a"),Ka=a("span"),w(Jt.$$.fragment),qi=p(),Ya=a("span"),Li=n("BeitConfig"),ws=p(),Z=a("div"),w(Gt.$$.fragment),Si=p(),be=a("p"),Ni=n("This is the configuration class to store the configuration of a "),fa=a("a"),Oi=n("BeitModel"),Di=n(`. 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
`),Xt=a("a"),Vi=n("microsoft/beit-base-patch16-224-pt22k"),Wi=n(" architecture."),Ri=p(),w(Ne.$$.fragment),xs=p(),ve=a("h2"),Oe=a("a"),Qa=a("span"),w(Kt.$$.fragment),Ui=p(),Za=a("span"),Hi=n("BeitFeatureExtractor"),$s=p(),A=a("div"),w(Yt.$$.fragment),Ji=p(),er=a("p"),Gi=n("Constructs a BEiT feature extractor."),Xi=p(),Qt=a("p"),Ki=n("This feature extractor inherits from "),ua=a("a"),Yi=n("FeatureExtractionMixin"),Qi=n(` which contains most of
the main methods. Users should refer to this superclass for more information regarding those methods.`),Zi=p(),ie=a("div"),w(Zt.$$.fragment),el=p(),tr=a("p"),tl=n("Main method to prepare for the model one or several image(s)."),ol=p(),w(De.$$.fragment),al=p(),Ve=a("div"),w(eo.$$.fragment),rl=p(),to=a("p"),sl=n("Converts the output of "),ga=a("a"),nl=n("BeitForSemanticSegmentation"),il=n(" into semantic segmentation maps. Only supports PyTorch."),ys=p(),we=a("h2"),We=a("a"),or=a("span"),w(oo.$$.fragment),ll=p(),ar=a("span"),dl=n("BeitModel"),Ts=p(),ee=a("div"),w(ao.$$.fragment),cl=p(),ro=a("p"),pl=n(`The bare Beit Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),so=a("a"),ml=n("torch.nn.Module"),hl=n(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),fl=p(),U=a("div"),w(no.$$.fragment),ul=p(),xe=a("p"),gl=n("The "),_a=a("a"),_l=n("BeitModel"),bl=n(" forward method, overrides the "),rr=a("code"),vl=n("__call__"),wl=n(" special method."),xl=p(),w(Re.$$.fragment),$l=p(),w(Ue.$$.fragment),Bs=p(),$e=a("h2"),He=a("a"),sr=a("span"),w(io.$$.fragment),yl=p(),nr=a("span"),Tl=n("BeitForMaskedImageModeling"),Fs=p(),te=a("div"),w(lo.$$.fragment),Bl=p(),oe=a("p"),Fl=n(`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 `),ba=a("a"),El=n("AutoModelForMaskedImageModeling"),kl=n(`, so you
will need to use `),va=a("a"),Ml=n("BeitForMaskedImageModeling"),Il=n(` directly if you wish to do masked image modeling with BEiT.
This model is a PyTorch `),co=a("a"),jl=n("torch.nn.Module"),Pl=n(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Cl=p(),H=a("div"),w(po.$$.fragment),zl=p(),ye=a("p"),Al=n("The "),wa=a("a"),ql=n("BeitForMaskedImageModeling"),Ll=n(" forward method, overrides the "),ir=a("code"),Sl=n("__call__"),Nl=n(" special method."),Ol=p(),w(Je.$$.fragment),Dl=p(),w(Ge.$$.fragment),Es=p(),Te=a("h2"),Xe=a("a"),lr=a("span"),w(mo.$$.fragment),Vl=p(),dr=a("span"),Wl=n("BeitForImageClassification"),ks=p(),D=a("div"),w(ho.$$.fragment),Rl=p(),cr=a("p"),Ul=n(`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.`),Hl=p(),fo=a("p"),Jl=n("This model is a PyTorch "),uo=a("a"),Gl=n("torch.nn.Module"),Xl=n(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Kl=p(),J=a("div"),w(go.$$.fragment),Yl=p(),Be=a("p"),Ql=n("The "),xa=a("a"),Zl=n("BeitForImageClassification"),ed=n(" forward method, overrides the "),pr=a("code"),td=n("__call__"),od=n(" special method."),ad=p(),w(Ke.$$.fragment),rd=p(),w(Ye.$$.fragment),Ms=p(),Fe=a("h2"),Qe=a("a"),mr=a("span"),w(_o.$$.fragment),sd=p(),hr=a("span"),nd=n("BeitForSemanticSegmentation"),Is=p(),V=a("div"),w(bo.$$.fragment),id=p(),fr=a("p"),ld=n("Beit Model transformer with a semantic segmentation head on top e.g. for ADE20k, CityScapes."),dd=p(),vo=a("p"),cd=n("This model is a PyTorch "),wo=a("a"),pd=n("torch.nn.Module"),md=n(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),hd=p(),G=a("div"),w(xo.$$.fragment),fd=p(),Ee=a("p"),ud=n("The "),$a=a("a"),gd=n("BeitForSemanticSegmentation"),_d=n(" forward method, overrides the "),ur=a("code"),bd=n("__call__"),vd=n(" special method."),wd=p(),w(Ze.$$.fragment),xd=p(),w(et.$$.fragment),js=p(),ke=a("h2"),tt=a("a"),gr=a("span"),w($o.$$.fragment),$d=p(),_r=a("span"),yd=n("FlaxBeitModel"),Ps=p(),I=a("div"),w(yo.$$.fragment),Td=p(),br=a("p"),Bd=n("The bare Beit Model transformer outputting raw hidden-states without any specific head on top."),Fd=p(),To=a("p"),Ed=n("This model inherits from "),ya=a("a"),kd=n("FlaxPreTrainedModel"),Md=n(`. 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)`),Id=p(),Bo=a("p"),jd=n("This model is also a Flax Linen "),Fo=a("a"),Pd=n("flax.linen.Module"),Cd=n(`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),zd=p(),vr=a("p"),Ad=n("Finally, this model supports inherent JAX features such as:"),qd=p(),ae=a("ul"),wr=a("li"),Eo=a("a"),Ld=n("Just-In-Time (JIT) compilation"),Sd=p(),xr=a("li"),ko=a("a"),Nd=n("Automatic Differentiation"),Od=p(),$r=a("li"),Mo=a("a"),Dd=n("Vectorization"),Vd=p(),yr=a("li"),Io=a("a"),Wd=n("Parallelization"),Rd=p(),X=a("div"),w(jo.$$.fragment),Ud=p(),Me=a("p"),Hd=n("The "),Tr=a("code"),Jd=n("FlaxBeitPreTrainedModel"),Gd=n(" forward method, overrides the "),Br=a("code"),Xd=n("__call__"),Kd=n(" special method."),Yd=p(),w(ot.$$.fragment),Qd=p(),w(at.$$.fragment),Cs=p(),Ie=a("h2"),rt=a("a"),Fr=a("span"),w(Po.$$.fragment),Zd=p(),Er=a("span"),ec=n("FlaxBeitForMaskedImageModeling"),zs=p(),j=a("div"),w(Co.$$.fragment),tc=p(),kr=a("p"),oc=n("Beit Model transformer with a \u2018language\u2019 modeling head on top (to predict visual tokens)."),ac=p(),zo=a("p"),rc=n("This model inherits from "),Ta=a("a"),sc=n("FlaxPreTrainedModel"),nc=n(`. 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)`),ic=p(),Ao=a("p"),lc=n("This model is also a Flax Linen "),qo=a("a"),dc=n("flax.linen.Module"),cc=n(`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),pc=p(),Mr=a("p"),mc=n("Finally, this model supports inherent JAX features such as:"),hc=p(),re=a("ul"),Ir=a("li"),Lo=a("a"),fc=n("Just-In-Time (JIT) compilation"),uc=p(),jr=a("li"),So=a("a"),gc=n("Automatic Differentiation"),_c=p(),Pr=a("li"),No=a("a"),bc=n("Vectorization"),vc=p(),Cr=a("li"),Oo=a("a"),wc=n("Parallelization"),xc=p(),q=a("div"),w(Do.$$.fragment),$c=p(),je=a("p"),yc=n("The "),zr=a("code"),Tc=n("FlaxBeitPreTrainedModel"),Bc=n(" forward method, overrides the "),Ar=a("code"),Fc=n("__call__"),Ec=n(" special method."),kc=p(),w(st.$$.fragment),Mc=p(),Pe=a("p"),Ic=n("bool_masked_pos ("),qr=a("code"),jc=n("numpy.ndarray"),Pc=n(" of shape "),Lr=a("code"),Cc=n("(batch_size, num_patches)"),zc=n(`):
Boolean masked positions. Indicates which patches are masked (1) and which aren\u2019t (0).`),Ac=p(),w(nt.$$.fragment),As=p(),Ce=a("h2"),it=a("a"),Sr=a("span"),w(Vo.$$.fragment),qc=p(),Nr=a("span"),Lc=n("FlaxBeitForImageClassification"),qs=p(),P=a("div"),w(Wo.$$.fragment),Sc=p(),Or=a("p"),Nc=n(`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.`),Oc=p(),Ro=a("p"),Dc=n("This model inherits from "),Ba=a("a"),Vc=n("FlaxPreTrainedModel"),Wc=n(`. 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)`),Rc=p(),Uo=a("p"),Uc=n("This model is also a Flax Linen "),Ho=a("a"),Hc=n("flax.linen.Module"),Jc=n(`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),Gc=p(),Dr=a("p"),Xc=n("Finally, this model supports inherent JAX features such as:"),Kc=p(),se=a("ul"),Vr=a("li"),Jo=a("a"),Yc=n("Just-In-Time (JIT) compilation"),Qc=p(),Wr=a("li"),Go=a("a"),Zc=n("Automatic Differentiation"),ep=p(),Rr=a("li"),Xo=a("a"),tp=n("Vectorization"),op=p(),Ur=a("li"),Ko=a("a"),ap=n("Parallelization"),rp=p(),K=a("div"),w(Yo.$$.fragment),sp=p(),ze=a("p"),np=n("The "),Hr=a("code"),ip=n("FlaxBeitPreTrainedModel"),lp=n(" forward method, overrides the "),Jr=a("code"),dp=n("__call__"),cp=n(" special method."),pp=p(),w(lt.$$.fragment),mp=p(),w(dt.$$.fragment),this.h()},l(o){const u=Mh('[data-svelte="svelte-1phssyn"]',document.head);c=r(u,"META",{name:!0,content:!0}),u.forEach(t),v=m(o),g=r(o,"H1",{class:!0});var Qo=s(g);f=r(Qo,"A",{id:!0,class:!0,href:!0});var Gr=s(f);b=r(Gr,"SPAN",{});var Xr=s(b);x(l.$$.fragment,Xr),Xr.forEach(t),Gr.forEach(t),h=m(Qo),E=r(Qo,"SPAN",{});var Kr=s(E);hn=i(Kr,"BEiT"),Kr.forEach(t),Qo.forEach(t),is=m(o),pe=r(o,"H2",{class:!0});var Zo=s(pe);Ae=r(Zo,"A",{id:!0,class:!0,href:!0});var Yr=s(Ae);Da=r(Yr,"SPAN",{});var Qr=s(Da);x(Et.$$.fragment,Qr),Qr.forEach(t),Yr.forEach(t),fn=m(Zo),Va=r(Zo,"SPAN",{});var Zr=s(Va);un=i(Zr,"Overview"),Zr.forEach(t),Zo.forEach(t),ls=m(o),W=r(o,"P",{});var ne=s(W);gn=i(ne,"The BEiT model was proposed in "),kt=r(ne,"A",{href:!0,rel:!0});var es=s(kt);_n=i(es,"BEiT: BERT Pre-Training of Image Transformers"),es.forEach(t),bn=i(ne,` 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 `),Mt=r(ne,"A",{href:!0,rel:!0});var ts=s(Mt);vn=i(ts,"original ViT paper"),ts.forEach(t),wn=i(ne,`), BEiT models are pre-trained to
predict visual tokens from the codebook of OpenAI\u2019s `),It=r(ne,"A",{href:!0,rel:!0});var os=s(It);xn=i(os,"DALL-E model"),os.forEach(t),$n=i(ne,` given masked
patches.`),ne.forEach(t),ds=m(o),ea=r(o,"P",{});var as=s(ea);yn=i(as,"The abstract from the paper is the following:"),as.forEach(t),cs=m(o),ta=r(o,"P",{});var rs=s(ta);Wa=r(rs,"EM",{});var ss=s(Wa);Tn=i(ss,`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%).`),ss.forEach(t),rs.forEach(t),ps=m(o),oa=r(o,"P",{});var ns=s(oa);Bn=i(ns,"Tips:"),ns.forEach(t),ms=m(o),C=r(o,"UL",{});var Y=s(C);M=r(Y,"LI",{});var z=s(M);Fn=i(z,`BEiT models are regular Vision Transformers, but pre-trained in a self-supervised way rather than supervised. They
outperform both the `),aa=r(z,"A",{href:!0});var up=s(aa);En=i(up,"original model (ViT)"),up.forEach(t),kn=i(z," as well as "),ra=r(z,"A",{href:!0});var gp=s(ra);Mn=i(gp,"Data-efficient Image Transformers (DeiT)"),gp.forEach(t),In=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 `),jt=r(z,"A",{href:!0,rel:!0});var _p=s(jt);jn=i(_p,"here"),_p.forEach(t),Pn=i(z,` (you can just replace
`),sa=r(z,"A",{href:!0});var bp=s(sa);Cn=i(bp,"ViTFeatureExtractor"),bp.forEach(t),zn=i(z," by "),na=r(z,"A",{href:!0});var vp=s(na);An=i(vp,"BeitFeatureExtractor"),vp.forEach(t),qn=i(z,` and
`),ia=r(z,"A",{href:!0});var wp=s(ia);Ln=i(wp,"ViTForImageClassification"),wp.forEach(t),Sn=i(z," by "),la=r(z,"A",{href:!0});var xp=s(la);Nn=i(xp,"BeitForImageClassification"),xp.forEach(t),On=i(z,")."),z.forEach(t),Dn=m(Y),Pt=r(Y,"LI",{});var Ss=s(Pt);Vn=i(Ss,`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 `),Ct=r(Ss,"A",{href:!0,rel:!0});var $p=s(Ct);Wn=i($p,"here"),$p.forEach(t),Rn=i(Ss,"."),Ss.forEach(t),Un=m(Y),zt=r(Y,"LI",{});var Ns=s(zt);Hn=i(Ns,`As the BEiT models expect each image to be of the same size (resolution), one can use
`),da=r(Ns,"A",{href:!0});var yp=s(da);Jn=i(yp,"BeitFeatureExtractor"),yp.forEach(t),Gn=i(Ns," to resize (or rescale) and normalize images for the model."),Ns.forEach(t),Xn=m(Y),me=r(Y,"LI",{});var Fa=s(me);Kn=i(Fa,`Both the patch resolution and image resolution used during pre-training or fine-tuning are reflected in the name of
each checkpoint. For example, `),Ra=r(Fa,"CODE",{});var Tp=s(Ra);Yn=i(Tp,"microsoft/beit-base-patch16-224"),Tp.forEach(t),Qn=i(Fa,` refers to a base-sized architecture with patch
resolution of 16x16 and fine-tuning resolution of 224x224. All checkpoints can be found on the `),At=r(Fa,"A",{href:!0,rel:!0});var Bp=s(At);Zn=i(Bp,"hub"),Bp.forEach(t),ei=i(Fa,"."),Fa.forEach(t),ti=m(Y),he=r(Y,"LI",{});var Ea=s(he);oi=i(Ea,"The available checkpoints are either (1) pre-trained on "),qt=r(Ea,"A",{href:!0,rel:!0});var Fp=s(qt);ai=i(Fp,"ImageNet-22k"),Fp.forEach(t),ri=i(Ea,` (a collection of
14 million images and 22k classes) only, (2) also fine-tuned on ImageNet-22k or (3) also fine-tuned on `),Lt=r(Ea,"A",{href:!0,rel:!0});var Ep=s(Lt);si=i(Ep,"ImageNet-1k"),Ep.forEach(t),ni=i(Ea,` (also referred to as ILSVRC 2012, a collection of 1.3 million
images and 1,000 classes).`),Ea.forEach(t),ii=m(Y),O=r(Y,"LI",{});var le=s(O);li=i(le,`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 `),Ua=r(le,"CODE",{});var kp=s(Ua);di=i(kp,"use_relative_position_bias"),kp.forEach(t),ci=i(le,` or the
`),Ha=r(le,"CODE",{});var Mp=s(Ha);pi=i(Mp,"use_relative_position_bias"),Mp.forEach(t),mi=i(le," attribute of "),ca=r(le,"A",{href:!0});var Ip=s(ca);hi=i(Ip,"BeitConfig"),Ip.forEach(t),fi=i(le," to "),Ja=r(le,"CODE",{});var jp=s(Ja);ui=i(jp,"True"),jp.forEach(t),gi=i(le,` in order to add
position embeddings.`),le.forEach(t),Y.forEach(t),hs=m(o),qe=r(o,"IMG",{src:!0,alt:!0,width:!0}),fs=m(o),St=r(o,"SMALL",{});var hp=s(St);_i=i(hp,"BEiT pre-training. Taken from the "),pa=r(hp,"A",{href:!0});var Pp=s(pa);bi=i(Pp,"original paper."),Pp.forEach(t),hp.forEach(t),us=m(o),R=r(o,"P",{});var ct=s(R);vi=i(ct,"This model was contributed by "),Nt=r(ct,"A",{href:!0,rel:!0});var Cp=s(Nt);wi=i(Cp,"nielsr"),Cp.forEach(t),xi=i(ct,`. The JAX/FLAX version of this model was
contributed by `),Ot=r(ct,"A",{href:!0,rel:!0});var zp=s(Ot);$i=i(zp,"kamalkraj"),zp.forEach(t),yi=i(ct,". The original code can be found "),Dt=r(ct,"A",{href:!0,rel:!0});var Ap=s(Dt);Ti=i(Ap,"here"),Ap.forEach(t),Bi=i(ct,"."),ct.forEach(t),gs=m(o),fe=r(o,"H2",{class:!0});var Os=s(fe);Le=r(Os,"A",{id:!0,class:!0,href:!0});var qp=s(Le);Ga=r(qp,"SPAN",{});var Lp=s(Ga);x(Vt.$$.fragment,Lp),Lp.forEach(t),qp.forEach(t),Fi=m(Os),Xa=r(Os,"SPAN",{});var Sp=s(Xa);Ei=i(Sp,"BEiT specific outputs"),Sp.forEach(t),Os.forEach(t),_s=m(o),ue=r(o,"DIV",{class:!0});var Ds=s(ue);x(Wt.$$.fragment,Ds),ki=m(Ds),Rt=r(Ds,"P",{});var Vs=s(Rt);Mi=i(Vs,"Class for outputs of "),ma=r(Vs,"A",{href:!0});var Np=s(ma);Ii=i(Np,"BeitModel"),Np.forEach(t),ji=i(Vs,"."),Vs.forEach(t),Ds.forEach(t),bs=m(o),ge=r(o,"DIV",{class:!0});var Ws=s(ge);x(Ut.$$.fragment,Ws),Pi=m(Ws),Ht=r(Ws,"P",{});var Rs=s(Ht);Ci=i(Rs,"Class for outputs of "),ha=r(Rs,"A",{href:!0});var Op=s(ha);zi=i(Op,"FlaxBeitModel"),Op.forEach(t),Ai=i(Rs,"."),Rs.forEach(t),Ws.forEach(t),vs=m(o),_e=r(o,"H2",{class:!0});var Us=s(_e);Se=r(Us,"A",{id:!0,class:!0,href:!0});var Dp=s(Se);Ka=r(Dp,"SPAN",{});var Vp=s(Ka);x(Jt.$$.fragment,Vp),Vp.forEach(t),Dp.forEach(t),qi=m(Us),Ya=r(Us,"SPAN",{});var Wp=s(Ya);Li=i(Wp,"BeitConfig"),Wp.forEach(t),Us.forEach(t),ws=m(o),Z=r(o,"DIV",{class:!0});var ka=s(Z);x(Gt.$$.fragment,ka),Si=m(ka),be=r(ka,"P",{});var Ma=s(be);Ni=i(Ma,"This is the configuration class to store the configuration of a "),fa=r(Ma,"A",{href:!0});var Rp=s(fa);Oi=i(Rp,"BeitModel"),Rp.forEach(t),Di=i(Ma,`. 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
`),Xt=r(Ma,"A",{href:!0,rel:!0});var Up=s(Xt);Vi=i(Up,"microsoft/beit-base-patch16-224-pt22k"),Up.forEach(t),Wi=i(Ma," architecture."),Ma.forEach(t),Ri=m(ka),x(Ne.$$.fragment,ka),ka.forEach(t),xs=m(o),ve=r(o,"H2",{class:!0});var Hs=s(ve);Oe=r(Hs,"A",{id:!0,class:!0,href:!0});var Hp=s(Oe);Qa=r(Hp,"SPAN",{});var Jp=s(Qa);x(Kt.$$.fragment,Jp),Jp.forEach(t),Hp.forEach(t),Ui=m(Hs),Za=r(Hs,"SPAN",{});var Gp=s(Za);Hi=i(Gp,"BeitFeatureExtractor"),Gp.forEach(t),Hs.forEach(t),$s=m(o),A=r(o,"DIV",{class:!0});var de=s(A);x(Yt.$$.fragment,de),Ji=m(de),er=r(de,"P",{});var Xp=s(er);Gi=i(Xp,"Constructs a BEiT feature extractor."),Xp.forEach(t),Xi=m(de),Qt=r(de,"P",{});var Js=s(Qt);Ki=i(Js,"This feature extractor inherits from "),ua=r(Js,"A",{href:!0});var Kp=s(ua);Yi=i(Kp,"FeatureExtractionMixin"),Kp.forEach(t),Qi=i(Js,` which contains most of
the main methods. Users should refer to this superclass for more information regarding those methods.`),Js.forEach(t),Zi=m(de),ie=r(de,"DIV",{class:!0});var Ia=s(ie);x(Zt.$$.fragment,Ia),el=m(Ia),tr=r(Ia,"P",{});var Yp=s(tr);tl=i(Yp,"Main method to prepare for the model one or several image(s)."),Yp.forEach(t),ol=m(Ia),x(De.$$.fragment,Ia),Ia.forEach(t),al=m(de),Ve=r(de,"DIV",{class:!0});var Gs=s(Ve);x(eo.$$.fragment,Gs),rl=m(Gs),to=r(Gs,"P",{});var Xs=s(to);sl=i(Xs,"Converts the output of "),ga=r(Xs,"A",{href:!0});var Qp=s(ga);nl=i(Qp,"BeitForSemanticSegmentation"),Qp.forEach(t),il=i(Xs," into semantic segmentation maps. Only supports PyTorch."),Xs.forEach(t),Gs.forEach(t),de.forEach(t),ys=m(o),we=r(o,"H2",{class:!0});var Ks=s(we);We=r(Ks,"A",{id:!0,class:!0,href:!0});var Zp=s(We);or=r(Zp,"SPAN",{});var em=s(or);x(oo.$$.fragment,em),em.forEach(t),Zp.forEach(t),ll=m(Ks),ar=r(Ks,"SPAN",{});var tm=s(ar);dl=i(tm,"BeitModel"),tm.forEach(t),Ks.forEach(t),Ts=m(o),ee=r(o,"DIV",{class:!0});var ja=s(ee);x(ao.$$.fragment,ja),cl=m(ja),ro=r(ja,"P",{});var Ys=s(ro);pl=i(Ys,`The bare Beit Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),so=r(Ys,"A",{href:!0,rel:!0});var om=s(so);ml=i(om,"torch.nn.Module"),om.forEach(t),hl=i(Ys,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Ys.forEach(t),fl=m(ja),U=r(ja,"DIV",{class:!0});var pt=s(U);x(no.$$.fragment,pt),ul=m(pt),xe=r(pt,"P",{});var Pa=s(xe);gl=i(Pa,"The "),_a=r(Pa,"A",{href:!0});var am=s(_a);_l=i(am,"BeitModel"),am.forEach(t),bl=i(Pa," forward method, overrides the "),rr=r(Pa,"CODE",{});var rm=s(rr);vl=i(rm,"__call__"),rm.forEach(t),wl=i(Pa," special method."),Pa.forEach(t),xl=m(pt),x(Re.$$.fragment,pt),$l=m(pt),x(Ue.$$.fragment,pt),pt.forEach(t),ja.forEach(t),Bs=m(o),$e=r(o,"H2",{class:!0});var Qs=s($e);He=r(Qs,"A",{id:!0,class:!0,href:!0});var sm=s(He);sr=r(sm,"SPAN",{});var nm=s(sr);x(io.$$.fragment,nm),nm.forEach(t),sm.forEach(t),yl=m(Qs),nr=r(Qs,"SPAN",{});var im=s(nr);Tl=i(im,"BeitForMaskedImageModeling"),im.forEach(t),Qs.forEach(t),Fs=m(o),te=r(o,"DIV",{class:!0});var Ca=s(te);x(lo.$$.fragment,Ca),Bl=m(Ca),oe=r(Ca,"P",{});var mt=s(oe);Fl=i(mt,`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 `),ba=r(mt,"A",{href:!0});var lm=s(ba);El=i(lm,"AutoModelForMaskedImageModeling"),lm.forEach(t),kl=i(mt,`, so you
will need to use `),va=r(mt,"A",{href:!0});var dm=s(va);Ml=i(dm,"BeitForMaskedImageModeling"),dm.forEach(t),Il=i(mt,` directly if you wish to do masked image modeling with BEiT.
This model is a PyTorch `),co=r(mt,"A",{href:!0,rel:!0});var cm=s(co);jl=i(cm,"torch.nn.Module"),cm.forEach(t),Pl=i(mt,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),mt.forEach(t),Cl=m(Ca),H=r(Ca,"DIV",{class:!0});var ht=s(H);x(po.$$.fragment,ht),zl=m(ht),ye=r(ht,"P",{});var za=s(ye);Al=i(za,"The "),wa=r(za,"A",{href:!0});var pm=s(wa);ql=i(pm,"BeitForMaskedImageModeling"),pm.forEach(t),Ll=i(za," forward method, overrides the "),ir=r(za,"CODE",{});var mm=s(ir);Sl=i(mm,"__call__"),mm.forEach(t),Nl=i(za," special method."),za.forEach(t),Ol=m(ht),x(Je.$$.fragment,ht),Dl=m(ht),x(Ge.$$.fragment,ht),ht.forEach(t),Ca.forEach(t),Es=m(o),Te=r(o,"H2",{class:!0});var Zs=s(Te);Xe=r(Zs,"A",{id:!0,class:!0,href:!0});var hm=s(Xe);lr=r(hm,"SPAN",{});var fm=s(lr);x(mo.$$.fragment,fm),fm.forEach(t),hm.forEach(t),Vl=m(Zs),dr=r(Zs,"SPAN",{});var um=s(dr);Wl=i(um,"BeitForImageClassification"),um.forEach(t),Zs.forEach(t),ks=m(o),D=r(o,"DIV",{class:!0});var ft=s(D);x(ho.$$.fragment,ft),Rl=m(ft),cr=r(ft,"P",{});var gm=s(cr);Ul=i(gm,`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.`),gm.forEach(t),Hl=m(ft),fo=r(ft,"P",{});var en=s(fo);Jl=i(en,"This model is a PyTorch "),uo=r(en,"A",{href:!0,rel:!0});var _m=s(uo);Gl=i(_m,"torch.nn.Module"),_m.forEach(t),Xl=i(en,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),en.forEach(t),Kl=m(ft),J=r(ft,"DIV",{class:!0});var ut=s(J);x(go.$$.fragment,ut),Yl=m(ut),Be=r(ut,"P",{});var Aa=s(Be);Ql=i(Aa,"The "),xa=r(Aa,"A",{href:!0});var bm=s(xa);Zl=i(bm,"BeitForImageClassification"),bm.forEach(t),ed=i(Aa," forward method, overrides the "),pr=r(Aa,"CODE",{});var vm=s(pr);td=i(vm,"__call__"),vm.forEach(t),od=i(Aa," special method."),Aa.forEach(t),ad=m(ut),x(Ke.$$.fragment,ut),rd=m(ut),x(Ye.$$.fragment,ut),ut.forEach(t),ft.forEach(t),Ms=m(o),Fe=r(o,"H2",{class:!0});var tn=s(Fe);Qe=r(tn,"A",{id:!0,class:!0,href:!0});var wm=s(Qe);mr=r(wm,"SPAN",{});var xm=s(mr);x(_o.$$.fragment,xm),xm.forEach(t),wm.forEach(t),sd=m(tn),hr=r(tn,"SPAN",{});var $m=s(hr);nd=i($m,"BeitForSemanticSegmentation"),$m.forEach(t),tn.forEach(t),Is=m(o),V=r(o,"DIV",{class:!0});var gt=s(V);x(bo.$$.fragment,gt),id=m(gt),fr=r(gt,"P",{});var ym=s(fr);ld=i(ym,"Beit Model transformer with a semantic segmentation head on top e.g. for ADE20k, CityScapes."),ym.forEach(t),dd=m(gt),vo=r(gt,"P",{});var on=s(vo);cd=i(on,"This model is a PyTorch "),wo=r(on,"A",{href:!0,rel:!0});var Tm=s(wo);pd=i(Tm,"torch.nn.Module"),Tm.forEach(t),md=i(on,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),on.forEach(t),hd=m(gt),G=r(gt,"DIV",{class:!0});var _t=s(G);x(xo.$$.fragment,_t),fd=m(_t),Ee=r(_t,"P",{});var qa=s(Ee);ud=i(qa,"The "),$a=r(qa,"A",{href:!0});var Bm=s($a);gd=i(Bm,"BeitForSemanticSegmentation"),Bm.forEach(t),_d=i(qa," forward method, overrides the "),ur=r(qa,"CODE",{});var Fm=s(ur);bd=i(Fm,"__call__"),Fm.forEach(t),vd=i(qa," special method."),qa.forEach(t),wd=m(_t),x(Ze.$$.fragment,_t),xd=m(_t),x(et.$$.fragment,_t),_t.forEach(t),gt.forEach(t),js=m(o),ke=r(o,"H2",{class:!0});var an=s(ke);tt=r(an,"A",{id:!0,class:!0,href:!0});var Em=s(tt);gr=r(Em,"SPAN",{});var km=s(gr);x($o.$$.fragment,km),km.forEach(t),Em.forEach(t),$d=m(an),_r=r(an,"SPAN",{});var Mm=s(_r);yd=i(Mm,"FlaxBeitModel"),Mm.forEach(t),an.forEach(t),Ps=m(o),I=r(o,"DIV",{class:!0});var L=s(I);x(yo.$$.fragment,L),Td=m(L),br=r(L,"P",{});var Im=s(br);Bd=i(Im,"The bare Beit Model transformer outputting raw hidden-states without any specific head on top."),Im.forEach(t),Fd=m(L),To=r(L,"P",{});var rn=s(To);Ed=i(rn,"This model inherits from "),ya=r(rn,"A",{href:!0});var jm=s(ya);kd=i(jm,"FlaxPreTrainedModel"),jm.forEach(t),Md=i(rn,`. 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)`),rn.forEach(t),Id=m(L),Bo=r(L,"P",{});var sn=s(Bo);jd=i(sn,"This model is also a Flax Linen "),Fo=r(sn,"A",{href:!0,rel:!0});var Pm=s(Fo);Pd=i(Pm,"flax.linen.Module"),Pm.forEach(t),Cd=i(sn,`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),sn.forEach(t),zd=m(L),vr=r(L,"P",{});var Cm=s(vr);Ad=i(Cm,"Finally, this model supports inherent JAX features such as:"),Cm.forEach(t),qd=m(L),ae=r(L,"UL",{});var bt=s(ae);wr=r(bt,"LI",{});var zm=s(wr);Eo=r(zm,"A",{href:!0,rel:!0});var Am=s(Eo);Ld=i(Am,"Just-In-Time (JIT) compilation"),Am.forEach(t),zm.forEach(t),Sd=m(bt),xr=r(bt,"LI",{});var qm=s(xr);ko=r(qm,"A",{href:!0,rel:!0});var Lm=s(ko);Nd=i(Lm,"Automatic Differentiation"),Lm.forEach(t),qm.forEach(t),Od=m(bt),$r=r(bt,"LI",{});var Sm=s($r);Mo=r(Sm,"A",{href:!0,rel:!0});var Nm=s(Mo);Dd=i(Nm,"Vectorization"),Nm.forEach(t),Sm.forEach(t),Vd=m(bt),yr=r(bt,"LI",{});var Om=s(yr);Io=r(Om,"A",{href:!0,rel:!0});var Dm=s(Io);Wd=i(Dm,"Parallelization"),Dm.forEach(t),Om.forEach(t),bt.forEach(t),Rd=m(L),X=r(L,"DIV",{class:!0});var vt=s(X);x(jo.$$.fragment,vt),Ud=m(vt),Me=r(vt,"P",{});var La=s(Me);Hd=i(La,"The "),Tr=r(La,"CODE",{});var Vm=s(Tr);Jd=i(Vm,"FlaxBeitPreTrainedModel"),Vm.forEach(t),Gd=i(La," forward method, overrides the "),Br=r(La,"CODE",{});var Wm=s(Br);Xd=i(Wm,"__call__"),Wm.forEach(t),Kd=i(La," special method."),La.forEach(t),Yd=m(vt),x(ot.$$.fragment,vt),Qd=m(vt),x(at.$$.fragment,vt),vt.forEach(t),L.forEach(t),Cs=m(o),Ie=r(o,"H2",{class:!0});var nn=s(Ie);rt=r(nn,"A",{id:!0,class:!0,href:!0});var Rm=s(rt);Fr=r(Rm,"SPAN",{});var Um=s(Fr);x(Po.$$.fragment,Um),Um.forEach(t),Rm.forEach(t),Zd=m(nn),Er=r(nn,"SPAN",{});var Hm=s(Er);ec=i(Hm,"FlaxBeitForMaskedImageModeling"),Hm.forEach(t),nn.forEach(t),zs=m(o),j=r(o,"DIV",{class:!0});var S=s(j);x(Co.$$.fragment,S),tc=m(S),kr=r(S,"P",{});var Jm=s(kr);oc=i(Jm,"Beit Model transformer with a \u2018language\u2019 modeling head on top (to predict visual tokens)."),Jm.forEach(t),ac=m(S),zo=r(S,"P",{});var ln=s(zo);rc=i(ln,"This model inherits from "),Ta=r(ln,"A",{href:!0});var Gm=s(Ta);sc=i(Gm,"FlaxPreTrainedModel"),Gm.forEach(t),nc=i(ln,`. 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)`),ln.forEach(t),ic=m(S),Ao=r(S,"P",{});var dn=s(Ao);lc=i(dn,"This model is also a Flax Linen "),qo=r(dn,"A",{href:!0,rel:!0});var Xm=s(qo);dc=i(Xm,"flax.linen.Module"),Xm.forEach(t),cc=i(dn,`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),dn.forEach(t),pc=m(S),Mr=r(S,"P",{});var Km=s(Mr);mc=i(Km,"Finally, this model supports inherent JAX features such as:"),Km.forEach(t),hc=m(S),re=r(S,"UL",{});var wt=s(re);Ir=r(wt,"LI",{});var Ym=s(Ir);Lo=r(Ym,"A",{href:!0,rel:!0});var Qm=s(Lo);fc=i(Qm,"Just-In-Time (JIT) compilation"),Qm.forEach(t),Ym.forEach(t),uc=m(wt),jr=r(wt,"LI",{});var Zm=s(jr);So=r(Zm,"A",{href:!0,rel:!0});var eh=s(So);gc=i(eh,"Automatic Differentiation"),eh.forEach(t),Zm.forEach(t),_c=m(wt),Pr=r(wt,"LI",{});var th=s(Pr);No=r(th,"A",{href:!0,rel:!0});var oh=s(No);bc=i(oh,"Vectorization"),oh.forEach(t),th.forEach(t),vc=m(wt),Cr=r(wt,"LI",{});var ah=s(Cr);Oo=r(ah,"A",{href:!0,rel:!0});var rh=s(Oo);wc=i(rh,"Parallelization"),rh.forEach(t),ah.forEach(t),wt.forEach(t),xc=m(S),q=r(S,"DIV",{class:!0});var ce=s(q);x(Do.$$.fragment,ce),$c=m(ce),je=r(ce,"P",{});var Sa=s(je);yc=i(Sa,"The "),zr=r(Sa,"CODE",{});var sh=s(zr);Tc=i(sh,"FlaxBeitPreTrainedModel"),sh.forEach(t),Bc=i(Sa," forward method, overrides the "),Ar=r(Sa,"CODE",{});var nh=s(Ar);Fc=i(nh,"__call__"),nh.forEach(t),Ec=i(Sa," special method."),Sa.forEach(t),kc=m(ce),x(st.$$.fragment,ce),Mc=m(ce),Pe=r(ce,"P",{});var Na=s(Pe);Ic=i(Na,"bool_masked_pos ("),qr=r(Na,"CODE",{});var ih=s(qr);jc=i(ih,"numpy.ndarray"),ih.forEach(t),Pc=i(Na," of shape "),Lr=r(Na,"CODE",{});var lh=s(Lr);Cc=i(lh,"(batch_size, num_patches)"),lh.forEach(t),zc=i(Na,`):
Boolean masked positions. Indicates which patches are masked (1) and which aren\u2019t (0).`),Na.forEach(t),Ac=m(ce),x(nt.$$.fragment,ce),ce.forEach(t),S.forEach(t),As=m(o),Ce=r(o,"H2",{class:!0});var cn=s(Ce);it=r(cn,"A",{id:!0,class:!0,href:!0});var dh=s(it);Sr=r(dh,"SPAN",{});var ch=s(Sr);x(Vo.$$.fragment,ch),ch.forEach(t),dh.forEach(t),qc=m(cn),Nr=r(cn,"SPAN",{});var ph=s(Nr);Lc=i(ph,"FlaxBeitForImageClassification"),ph.forEach(t),cn.forEach(t),qs=m(o),P=r(o,"DIV",{class:!0});var N=s(P);x(Wo.$$.fragment,N),Sc=m(N),Or=r(N,"P",{});var mh=s(Or);Nc=i(mh,`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.`),mh.forEach(t),Oc=m(N),Ro=r(N,"P",{});var pn=s(Ro);Dc=i(pn,"This model inherits from "),Ba=r(pn,"A",{href:!0});var hh=s(Ba);Vc=i(hh,"FlaxPreTrainedModel"),hh.forEach(t),Wc=i(pn,`. 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)`),pn.forEach(t),Rc=m(N),Uo=r(N,"P",{});var mn=s(Uo);Uc=i(mn,"This model is also a Flax Linen "),Ho=r(mn,"A",{href:!0,rel:!0});var fh=s(Ho);Hc=i(fh,"flax.linen.Module"),fh.forEach(t),Jc=i(mn,`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),mn.forEach(t),Gc=m(N),Dr=r(N,"P",{});var uh=s(Dr);Xc=i(uh,"Finally, this model supports inherent JAX features such as:"),uh.forEach(t),Kc=m(N),se=r(N,"UL",{});var xt=s(se);Vr=r(xt,"LI",{});var gh=s(Vr);Jo=r(gh,"A",{href:!0,rel:!0});var _h=s(Jo);Yc=i(_h,"Just-In-Time (JIT) compilation"),_h.forEach(t),gh.forEach(t),Qc=m(xt),Wr=r(xt,"LI",{});var bh=s(Wr);Go=r(bh,"A",{href:!0,rel:!0});var vh=s(Go);Zc=i(vh,"Automatic Differentiation"),vh.forEach(t),bh.forEach(t),ep=m(xt),Rr=r(xt,"LI",{});var wh=s(Rr);Xo=r(wh,"A",{href:!0,rel:!0});var xh=s(Xo);tp=i(xh,"Vectorization"),xh.forEach(t),wh.forEach(t),op=m(xt),Ur=r(xt,"LI",{});var $h=s(Ur);Ko=r($h,"A",{href:!0,rel:!0});var yh=s(Ko);ap=i(yh,"Parallelization"),yh.forEach(t),$h.forEach(t),xt.forEach(t),rp=m(N),K=r(N,"DIV",{class:!0});var $t=s(K);x(Yo.$$.fragment,$t),sp=m($t),ze=r($t,"P",{});var Oa=s(ze);np=i(Oa,"The "),Hr=r(Oa,"CODE",{});var Th=s(Hr);ip=i(Th,"FlaxBeitPreTrainedModel"),Th.forEach(t),lp=i(Oa," forward method, overrides the "),Jr=r(Oa,"CODE",{});var Bh=s(Jr);dp=i(Bh,"__call__"),Bh.forEach(t),cp=i(Oa," special method."),Oa.forEach(t),pp=m($t),x(lt.$$.fragment,$t),mp=m($t),x(dt.$$.fragment,$t),$t.forEach(t),N.forEach(t),this.h()},h(){d(c,"name","hf:doc:metadata"),d(c,"content",JSON.stringify(Xh)),d(f,"id","beit"),d(f,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(f,"href","#beit"),d(g,"class","relative group"),d(Ae,"id","overview"),d(Ae,"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(Ae,"href","#overview"),d(pe,"class","relative group"),d(kt,"href","https://arxiv.org/abs/2106.08254"),d(kt,"rel","nofollow"),d(Mt,"href","https://arxiv.org/abs/2010.11929"),d(Mt,"rel","nofollow"),d(It,"href","https://arxiv.org/abs/2102.12092"),d(It,"rel","nofollow"),d(aa,"href","vit"),d(ra,"href","deit"),d(jt,"href","https://github.com/NielsRogge/Transformers-Tutorials/tree/master/VisionTransformer"),d(jt,"rel","nofollow"),d(sa,"href","/docs/transformers/pr_19907/en/model_doc/vit#transformers.ViTFeatureExtractor"),d(na,"href","/docs/transformers/pr_19907/en/model_doc/beit#transformers.BeitFeatureExtractor"),d(ia,"href","/docs/transformers/pr_19907/en/model_doc/vit#transformers.ViTForImageClassification"),d(la,"href","/docs/transformers/pr_19907/en/model_doc/beit#transformers.BeitForImageClassification"),d(Ct,"href","https://github.com/NielsRogge/Transformers-Tutorials/tree/master/BEiT"),d(Ct,"rel","nofollow"),d(da,"href","/docs/transformers/pr_19907/en/model_doc/beit#transformers.BeitFeatureExtractor"),d(At,"href","https://huggingface.co/models?search=microsoft/beit"),d(At,"rel","nofollow"),d(qt,"href","http://www.image-net.org/"),d(qt,"rel","nofollow"),d(Lt,"href","http://www.image-net.org/challenges/LSVRC/2012/"),d(Lt,"rel","nofollow"),d(ca,"href","/docs/transformers/pr_19907/en/model_doc/beit#transformers.BeitConfig"),Ih(qe.src,fp="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/model_doc/beit_architecture.jpg")||d(qe,"src",fp),d(qe,"alt","drawing"),d(qe,"width","600"),d(pa,"href","https://arxiv.org/abs/2106.08254"),d(Nt,"href","https://huggingface.co/nielsr"),d(Nt,"rel","nofollow"),d(Ot,"href","https://huggingface.co/kamalkraj"),d(Ot,"rel","nofollow"),d(Dt,"href","https://github.com/microsoft/unilm/tree/master/beit"),d(Dt,"rel","nofollow"),d(Le,"id","transformers.models.beit.modeling_beit.BeitModelOutputWithPooling"),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.models.beit.modeling_beit.BeitModelOutputWithPooling"),d(fe,"class","relative group"),d(ma,"href","/docs/transformers/pr_19907/en/model_doc/beit#transformers.BeitModel"),d(ue,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ha,"href","/docs/transformers/pr_19907/en/model_doc/beit#transformers.FlaxBeitModel"),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(Se,"id","transformers.BeitConfig"),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.BeitConfig"),d(_e,"class","relative group"),d(fa,"href","/docs/transformers/pr_19907/en/model_doc/beit#transformers.BeitModel"),d(Xt,"href","https://huggingface.co/microsoft/beit-base-patch16-224-pt22k"),d(Xt,"rel","nofollow"),d(Z,"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,"id","transformers.BeitFeatureExtractor"),d(Oe,"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(Oe,"href","#transformers.BeitFeatureExtractor"),d(ve,"class","relative group"),d(ua,"href","/docs/transformers/pr_19907/en/internal/image_processing_utils#transformers.FeatureExtractionMixin"),d(ie,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ga,"href","/docs/transformers/pr_19907/en/model_doc/beit#transformers.BeitForSemanticSegmentation"),d(Ve,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(We,"id","transformers.BeitModel"),d(We,"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(We,"href","#transformers.BeitModel"),d(we,"class","relative group"),d(so,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(so,"rel","nofollow"),d(_a,"href","/docs/transformers/pr_19907/en/model_doc/beit#transformers.BeitModel"),d(U,"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(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($e,"class","relative group"),d(ba,"href","/docs/transformers/pr_19907/en/model_doc/auto#transformers.AutoModelForMaskedImageModeling"),d(va,"href","/docs/transformers/pr_19907/en/model_doc/beit#transformers.BeitForMaskedImageModeling"),d(co,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(co,"rel","nofollow"),d(wa,"href","/docs/transformers/pr_19907/en/model_doc/beit#transformers.BeitForMaskedImageModeling"),d(H,"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(Xe,"id","transformers.BeitForImageClassification"),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.BeitForImageClassification"),d(Te,"class","relative group"),d(uo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(uo,"rel","nofollow"),d(xa,"href","/docs/transformers/pr_19907/en/model_doc/beit#transformers.BeitForImageClassification"),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(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(Qe,"id","transformers.BeitForSemanticSegmentation"),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.BeitForSemanticSegmentation"),d(Fe,"class","relative group"),d(wo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(wo,"rel","nofollow"),d($a,"href","/docs/transformers/pr_19907/en/model_doc/beit#transformers.BeitForSemanticSegmentation"),d(G,"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(tt,"id","transformers.FlaxBeitModel"),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.FlaxBeitModel"),d(ke,"class","relative group"),d(ya,"href","/docs/transformers/pr_19907/en/main_classes/model#transformers.FlaxPreTrainedModel"),d(Fo,"href","https://flax.readthedocs.io/en/latest/flax.linen.html#module"),d(Fo,"rel","nofollow"),d(Eo,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),d(Eo,"rel","nofollow"),d(ko,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),d(ko,"rel","nofollow"),d(Mo,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),d(Mo,"rel","nofollow"),d(Io,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),d(Io,"rel","nofollow"),d(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(rt,"id","transformers.FlaxBeitForMaskedImageModeling"),d(rt,"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(rt,"href","#transformers.FlaxBeitForMaskedImageModeling"),d(Ie,"class","relative group"),d(Ta,"href","/docs/transformers/pr_19907/en/main_classes/model#transformers.FlaxPreTrainedModel"),d(qo,"href","https://flax.readthedocs.io/en/latest/flax.linen.html#module"),d(qo,"rel","nofollow"),d(Lo,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),d(Lo,"rel","nofollow"),d(So,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),d(So,"rel","nofollow"),d(No,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),d(No,"rel","nofollow"),d(Oo,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),d(Oo,"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(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(it,"id","transformers.FlaxBeitForImageClassification"),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.FlaxBeitForImageClassification"),d(Ce,"class","relative group"),d(Ba,"href","/docs/transformers/pr_19907/en/main_classes/model#transformers.FlaxPreTrainedModel"),d(Ho,"href","https://flax.readthedocs.io/en/latest/flax.linen.html#module"),d(Ho,"rel","nofollow"),d(Jo,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),d(Jo,"rel","nofollow"),d(Go,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),d(Go,"rel","nofollow"),d(Xo,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),d(Xo,"rel","nofollow"),d(Ko,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),d(Ko,"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(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(o,u){e(document.head,c),_(o,v,u),_(o,g,u),e(g,f),e(f,b),$(l,b,null),e(g,h),e(g,E),e(E,hn),_(o,is,u),_(o,pe,u),e(pe,Ae),e(Ae,Da),$(Et,Da,null),e(pe,fn),e(pe,Va),e(Va,un),_(o,ls,u),_(o,W,u),e(W,gn),e(W,kt),e(kt,_n),e(W,bn),e(W,Mt),e(Mt,vn),e(W,wn),e(W,It),e(It,xn),e(W,$n),_(o,ds,u),_(o,ea,u),e(ea,yn),_(o,cs,u),_(o,ta,u),e(ta,Wa),e(Wa,Tn),_(o,ps,u),_(o,oa,u),e(oa,Bn),_(o,ms,u),_(o,C,u),e(C,M),e(M,Fn),e(M,aa),e(aa,En),e(M,kn),e(M,ra),e(ra,Mn),e(M,In),e(M,jt),e(jt,jn),e(M,Pn),e(M,sa),e(sa,Cn),e(M,zn),e(M,na),e(na,An),e(M,qn),e(M,ia),e(ia,Ln),e(M,Sn),e(M,la),e(la,Nn),e(M,On),e(C,Dn),e(C,Pt),e(Pt,Vn),e(Pt,Ct),e(Ct,Wn),e(Pt,Rn),e(C,Un),e(C,zt),e(zt,Hn),e(zt,da),e(da,Jn),e(zt,Gn),e(C,Xn),e(C,me),e(me,Kn),e(me,Ra),e(Ra,Yn),e(me,Qn),e(me,At),e(At,Zn),e(me,ei),e(C,ti),e(C,he),e(he,oi),e(he,qt),e(qt,ai),e(he,ri),e(he,Lt),e(Lt,si),e(he,ni),e(C,ii),e(C,O),e(O,li),e(O,Ua),e(Ua,di),e(O,ci),e(O,Ha),e(Ha,pi),e(O,mi),e(O,ca),e(ca,hi),e(O,fi),e(O,Ja),e(Ja,ui),e(O,gi),_(o,hs,u),_(o,qe,u),_(o,fs,u),_(o,St,u),e(St,_i),e(St,pa),e(pa,bi),_(o,us,u),_(o,R,u),e(R,vi),e(R,Nt),e(Nt,wi),e(R,xi),e(R,Ot),e(Ot,$i),e(R,yi),e(R,Dt),e(Dt,Ti),e(R,Bi),_(o,gs,u),_(o,fe,u),e(fe,Le),e(Le,Ga),$(Vt,Ga,null),e(fe,Fi),e(fe,Xa),e(Xa,Ei),_(o,_s,u),_(o,ue,u),$(Wt,ue,null),e(ue,ki),e(ue,Rt),e(Rt,Mi),e(Rt,ma),e(ma,Ii),e(Rt,ji),_(o,bs,u),_(o,ge,u),$(Ut,ge,null),e(ge,Pi),e(ge,Ht),e(Ht,Ci),e(Ht,ha),e(ha,zi),e(Ht,Ai),_(o,vs,u),_(o,_e,u),e(_e,Se),e(Se,Ka),$(Jt,Ka,null),e(_e,qi),e(_e,Ya),e(Ya,Li),_(o,ws,u),_(o,Z,u),$(Gt,Z,null),e(Z,Si),e(Z,be),e(be,Ni),e(be,fa),e(fa,Oi),e(be,Di),e(be,Xt),e(Xt,Vi),e(be,Wi),e(Z,Ri),$(Ne,Z,null),_(o,xs,u),_(o,ve,u),e(ve,Oe),e(Oe,Qa),$(Kt,Qa,null),e(ve,Ui),e(ve,Za),e(Za,Hi),_(o,$s,u),_(o,A,u),$(Yt,A,null),e(A,Ji),e(A,er),e(er,Gi),e(A,Xi),e(A,Qt),e(Qt,Ki),e(Qt,ua),e(ua,Yi),e(Qt,Qi),e(A,Zi),e(A,ie),$(Zt,ie,null),e(ie,el),e(ie,tr),e(tr,tl),e(ie,ol),$(De,ie,null),e(A,al),e(A,Ve),$(eo,Ve,null),e(Ve,rl),e(Ve,to),e(to,sl),e(to,ga),e(ga,nl),e(to,il),_(o,ys,u),_(o,we,u),e(we,We),e(We,or),$(oo,or,null),e(we,ll),e(we,ar),e(ar,dl),_(o,Ts,u),_(o,ee,u),$(ao,ee,null),e(ee,cl),e(ee,ro),e(ro,pl),e(ro,so),e(so,ml),e(ro,hl),e(ee,fl),e(ee,U),$(no,U,null),e(U,ul),e(U,xe),e(xe,gl),e(xe,_a),e(_a,_l),e(xe,bl),e(xe,rr),e(rr,vl),e(xe,wl),e(U,xl),$(Re,U,null),e(U,$l),$(Ue,U,null),_(o,Bs,u),_(o,$e,u),e($e,He),e(He,sr),$(io,sr,null),e($e,yl),e($e,nr),e(nr,Tl),_(o,Fs,u),_(o,te,u),$(lo,te,null),e(te,Bl),e(te,oe),e(oe,Fl),e(oe,ba),e(ba,El),e(oe,kl),e(oe,va),e(va,Ml),e(oe,Il),e(oe,co),e(co,jl),e(oe,Pl),e(te,Cl),e(te,H),$(po,H,null),e(H,zl),e(H,ye),e(ye,Al),e(ye,wa),e(wa,ql),e(ye,Ll),e(ye,ir),e(ir,Sl),e(ye,Nl),e(H,Ol),$(Je,H,null),e(H,Dl),$(Ge,H,null),_(o,Es,u),_(o,Te,u),e(Te,Xe),e(Xe,lr),$(mo,lr,null),e(Te,Vl),e(Te,dr),e(dr,Wl),_(o,ks,u),_(o,D,u),$(ho,D,null),e(D,Rl),e(D,cr),e(cr,Ul),e(D,Hl),e(D,fo),e(fo,Jl),e(fo,uo),e(uo,Gl),e(fo,Xl),e(D,Kl),e(D,J),$(go,J,null),e(J,Yl),e(J,Be),e(Be,Ql),e(Be,xa),e(xa,Zl),e(Be,ed),e(Be,pr),e(pr,td),e(Be,od),e(J,ad),$(Ke,J,null),e(J,rd),$(Ye,J,null),_(o,Ms,u),_(o,Fe,u),e(Fe,Qe),e(Qe,mr),$(_o,mr,null),e(Fe,sd),e(Fe,hr),e(hr,nd),_(o,Is,u),_(o,V,u),$(bo,V,null),e(V,id),e(V,fr),e(fr,ld),e(V,dd),e(V,vo),e(vo,cd),e(vo,wo),e(wo,pd),e(vo,md),e(V,hd),e(V,G),$(xo,G,null),e(G,fd),e(G,Ee),e(Ee,ud),e(Ee,$a),e($a,gd),e(Ee,_d),e(Ee,ur),e(ur,bd),e(Ee,vd),e(G,wd),$(Ze,G,null),e(G,xd),$(et,G,null),_(o,js,u),_(o,ke,u),e(ke,tt),e(tt,gr),$($o,gr,null),e(ke,$d),e(ke,_r),e(_r,yd),_(o,Ps,u),_(o,I,u),$(yo,I,null),e(I,Td),e(I,br),e(br,Bd),e(I,Fd),e(I,To),e(To,Ed),e(To,ya),e(ya,kd),e(To,Md),e(I,Id),e(I,Bo),e(Bo,jd),e(Bo,Fo),e(Fo,Pd),e(Bo,Cd),e(I,zd),e(I,vr),e(vr,Ad),e(I,qd),e(I,ae),e(ae,wr),e(wr,Eo),e(Eo,Ld),e(ae,Sd),e(ae,xr),e(xr,ko),e(ko,Nd),e(ae,Od),e(ae,$r),e($r,Mo),e(Mo,Dd),e(ae,Vd),e(ae,yr),e(yr,Io),e(Io,Wd),e(I,Rd),e(I,X),$(jo,X,null),e(X,Ud),e(X,Me),e(Me,Hd),e(Me,Tr),e(Tr,Jd),e(Me,Gd),e(Me,Br),e(Br,Xd),e(Me,Kd),e(X,Yd),$(ot,X,null),e(X,Qd),$(at,X,null),_(o,Cs,u),_(o,Ie,u),e(Ie,rt),e(rt,Fr),$(Po,Fr,null),e(Ie,Zd),e(Ie,Er),e(Er,ec),_(o,zs,u),_(o,j,u),$(Co,j,null),e(j,tc),e(j,kr),e(kr,oc),e(j,ac),e(j,zo),e(zo,rc),e(zo,Ta),e(Ta,sc),e(zo,nc),e(j,ic),e(j,Ao),e(Ao,lc),e(Ao,qo),e(qo,dc),e(Ao,cc),e(j,pc),e(j,Mr),e(Mr,mc),e(j,hc),e(j,re),e(re,Ir),e(Ir,Lo),e(Lo,fc),e(re,uc),e(re,jr),e(jr,So),e(So,gc),e(re,_c),e(re,Pr),e(Pr,No),e(No,bc),e(re,vc),e(re,Cr),e(Cr,Oo),e(Oo,wc),e(j,xc),e(j,q),$(Do,q,null),e(q,$c),e(q,je),e(je,yc),e(je,zr),e(zr,Tc),e(je,Bc),e(je,Ar),e(Ar,Fc),e(je,Ec),e(q,kc),$(st,q,null),e(q,Mc),e(q,Pe),e(Pe,Ic),e(Pe,qr),e(qr,jc),e(Pe,Pc),e(Pe,Lr),e(Lr,Cc),e(Pe,zc),e(q,Ac),$(nt,q,null),_(o,As,u),_(o,Ce,u),e(Ce,it),e(it,Sr),$(Vo,Sr,null),e(Ce,qc),e(Ce,Nr),e(Nr,Lc),_(o,qs,u),_(o,P,u),$(Wo,P,null),e(P,Sc),e(P,Or),e(Or,Nc),e(P,Oc),e(P,Ro),e(Ro,Dc),e(Ro,Ba),e(Ba,Vc),e(Ro,Wc),e(P,Rc),e(P,Uo),e(Uo,Uc),e(Uo,Ho),e(Ho,Hc),e(Uo,Jc),e(P,Gc),e(P,Dr),e(Dr,Xc),e(P,Kc),e(P,se),e(se,Vr),e(Vr,Jo),e(Jo,Yc),e(se,Qc),e(se,Wr),e(Wr,Go),e(Go,Zc),e(se,ep),e(se,Rr),e(Rr,Xo),e(Xo,tp),e(se,op),e(se,Ur),e(Ur,Ko),e(Ko,ap),e(P,rp),e(P,K),$(Yo,K,null),e(K,sp),e(K,ze),e(ze,np),e(ze,Hr),e(Hr,ip),e(ze,lp),e(ze,Jr),e(Jr,dp),e(ze,cp),e(K,pp),$(lt,K,null),e(K,mp),$(dt,K,null),Ls=!0},p(o,[u]){const Qo={};u&2&&(Qo.$$scope={dirty:u,ctx:o}),Ne.$set(Qo);const Gr={};u&2&&(Gr.$$scope={dirty:u,ctx:o}),De.$set(Gr);const Xr={};u&2&&(Xr.$$scope={dirty:u,ctx:o}),Re.$set(Xr);const Kr={};u&2&&(Kr.$$scope={dirty:u,ctx:o}),Ue.$set(Kr);const Zo={};u&2&&(Zo.$$scope={dirty:u,ctx:o}),Je.$set(Zo);const Yr={};u&2&&(Yr.$$scope={dirty:u,ctx:o}),Ge.$set(Yr);const Qr={};u&2&&(Qr.$$scope={dirty:u,ctx:o}),Ke.$set(Qr);const Zr={};u&2&&(Zr.$$scope={dirty:u,ctx:o}),Ye.$set(Zr);const ne={};u&2&&(ne.$$scope={dirty:u,ctx:o}),Ze.$set(ne);const es={};u&2&&(es.$$scope={dirty:u,ctx:o}),et.$set(es);const ts={};u&2&&(ts.$$scope={dirty:u,ctx:o}),ot.$set(ts);const os={};u&2&&(os.$$scope={dirty:u,ctx:o}),at.$set(os);const as={};u&2&&(as.$$scope={dirty:u,ctx:o}),st.$set(as);const rs={};u&2&&(rs.$$scope={dirty:u,ctx:o}),nt.$set(rs);const ss={};u&2&&(ss.$$scope={dirty:u,ctx:o}),lt.$set(ss);const ns={};u&2&&(ns.$$scope={dirty:u,ctx:o}),dt.$set(ns)},i(o){Ls||(y(l.$$.fragment,o),y(Et.$$.fragment,o),y(Vt.$$.fragment,o),y(Wt.$$.fragment,o),y(Ut.$$.fragment,o),y(Jt.$$.fragment,o),y(Gt.$$.fragment,o),y(Ne.$$.fragment,o),y(Kt.$$.fragment,o),y(Yt.$$.fragment,o),y(Zt.$$.fragment,o),y(De.$$.fragment,o),y(eo.$$.fragment,o),y(oo.$$.fragment,o),y(ao.$$.fragment,o),y(no.$$.fragment,o),y(Re.$$.fragment,o),y(Ue.$$.fragment,o),y(io.$$.fragment,o),y(lo.$$.fragment,o),y(po.$$.fragment,o),y(Je.$$.fragment,o),y(Ge.$$.fragment,o),y(mo.$$.fragment,o),y(ho.$$.fragment,o),y(go.$$.fragment,o),y(Ke.$$.fragment,o),y(Ye.$$.fragment,o),y(_o.$$.fragment,o),y(bo.$$.fragment,o),y(xo.$$.fragment,o),y(Ze.$$.fragment,o),y(et.$$.fragment,o),y($o.$$.fragment,o),y(yo.$$.fragment,o),y(jo.$$.fragment,o),y(ot.$$.fragment,o),y(at.$$.fragment,o),y(Po.$$.fragment,o),y(Co.$$.fragment,o),y(Do.$$.fragment,o),y(st.$$.fragment,o),y(nt.$$.fragment,o),y(Vo.$$.fragment,o),y(Wo.$$.fragment,o),y(Yo.$$.fragment,o),y(lt.$$.fragment,o),y(dt.$$.fragment,o),Ls=!0)},o(o){T(l.$$.fragment,o),T(Et.$$.fragment,o),T(Vt.$$.fragment,o),T(Wt.$$.fragment,o),T(Ut.$$.fragment,o),T(Jt.$$.fragment,o),T(Gt.$$.fragment,o),T(Ne.$$.fragment,o),T(Kt.$$.fragment,o),T(Yt.$$.fragment,o),T(Zt.$$.fragment,o),T(De.$$.fragment,o),T(eo.$$.fragment,o),T(oo.$$.fragment,o),T(ao.$$.fragment,o),T(no.$$.fragment,o),T(Re.$$.fragment,o),T(Ue.$$.fragment,o),T(io.$$.fragment,o),T(lo.$$.fragment,o),T(po.$$.fragment,o),T(Je.$$.fragment,o),T(Ge.$$.fragment,o),T(mo.$$.fragment,o),T(ho.$$.fragment,o),T(go.$$.fragment,o),T(Ke.$$.fragment,o),T(Ye.$$.fragment,o),T(_o.$$.fragment,o),T(bo.$$.fragment,o),T(xo.$$.fragment,o),T(Ze.$$.fragment,o),T(et.$$.fragment,o),T($o.$$.fragment,o),T(yo.$$.fragment,o),T(jo.$$.fragment,o),T(ot.$$.fragment,o),T(at.$$.fragment,o),T(Po.$$.fragment,o),T(Co.$$.fragment,o),T(Do.$$.fragment,o),T(st.$$.fragment,o),T(nt.$$.fragment,o),T(Vo.$$.fragment,o),T(Wo.$$.fragment,o),T(Yo.$$.fragment,o),T(lt.$$.fragment,o),T(dt.$$.fragment,o),Ls=!1},d(o){t(c),o&&t(v),o&&t(g),B(l),o&&t(is),o&&t(pe),B(Et),o&&t(ls),o&&t(W),o&&t(ds),o&&t(ea),o&&t(cs),o&&t(ta),o&&t(ps),o&&t(oa),o&&t(ms),o&&t(C),o&&t(hs),o&&t(qe),o&&t(fs),o&&t(St),o&&t(us),o&&t(R),o&&t(gs),o&&t(fe),B(Vt),o&&t(_s),o&&t(ue),B(Wt),o&&t(bs),o&&t(ge),B(Ut),o&&t(vs),o&&t(_e),B(Jt),o&&t(ws),o&&t(Z),B(Gt),B(Ne),o&&t(xs),o&&t(ve),B(Kt),o&&t($s),o&&t(A),B(Yt),B(Zt),B(De),B(eo),o&&t(ys),o&&t(we),B(oo),o&&t(Ts),o&&t(ee),B(ao),B(no),B(Re),B(Ue),o&&t(Bs),o&&t($e),B(io),o&&t(Fs),o&&t(te),B(lo),B(po),B(Je),B(Ge),o&&t(Es),o&&t(Te),B(mo),o&&t(ks),o&&t(D),B(ho),B(go),B(Ke),B(Ye),o&&t(Ms),o&&t(Fe),B(_o),o&&t(Is),o&&t(V),B(bo),B(xo),B(Ze),B(et),o&&t(js),o&&t(ke),B($o),o&&t(Ps),o&&t(I),B(yo),B(jo),B(ot),B(at),o&&t(Cs),o&&t(Ie),B(Po),o&&t(zs),o&&t(j),B(Co),B(Do),B(st),B(nt),o&&t(As),o&&t(Ce),B(Vo),o&&t(qs),o&&t(P),B(Wo),B(Yo),B(lt),B(dt)}}}const Xh={local:"beit",sections:[{local:"overview",title:"Overview"},{local:"transformers.models.beit.modeling_beit.BeitModelOutputWithPooling",title:"BEiT specific outputs"},{local:"transformers.BeitConfig",title:"BeitConfig"},{local:"transformers.BeitFeatureExtractor",title:"BeitFeatureExtractor"},{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 Kh(F){return jh(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class af extends Fh{constructor(c){super();Eh(this,c,Kh,Gh,kh,{})}}export{af as default,Xh as metadata};
