import{S as tu,i as ou,s as au,e as a,k as c,w,t as n,M as su,c as s,d as o,m,a as r,x as y,h as i,b as d,N as ru,G as e,g as u,y as $,q as x,o as T,B,v as nu,L as Pt}from"../../chunks/vendor-hf-doc-builder.js";import{T as ua}from"../../chunks/Tip-hf-doc-builder.js";import{D as I}from"../../chunks/Docstring-hf-doc-builder.js";import{C as jt}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as L}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Mt}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";import{P as iu}from"../../chunks/PipelineTag-hf-doc-builder.js";function lu(k){let p,v,_,g,b;return g=new jt({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(){p=a("p"),v=n("Example:"),_=c(),w(g.$$.fragment)},l(l){p=s(l,"P",{});var f=r(p);v=i(f,"Example:"),f.forEach(o),_=m(l),y(g.$$.fragment,l)},m(l,f){u(l,p,f),e(p,v),u(l,_,f),$(g,l,f),b=!0},p:Pt,i(l){b||(x(g.$$.fragment,l),b=!0)},o(l){T(g.$$.fragment,l),b=!1},d(l){l&&o(p),l&&o(_),B(g,l)}}}function du(k){let p,v,_,g,b;return{c(){p=a("p"),v=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a("code"),g=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){p=s(l,"P",{});var f=r(p);v=i(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=s(f,"CODE",{});var E=r(_);g=i(E,"Module"),E.forEach(o),b=i(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(o)},m(l,f){u(l,p,f),e(p,v),e(p,_),e(_,g),e(p,b)},d(l){l&&o(p)}}}function cu(k){let p,v,_,g,b;return g=new jt({props:{code:`from transformers import AutoImageProcessor, BeitModel
import torch
from datasets import load_dataset

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

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

inputs = image_processor(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> AutoImageProcessor, BeitModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset

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

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

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

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

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

image_processor = AutoImageProcessor.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 = image_processor(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> AutoImageProcessor, BeitForMaskedImageModeling
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests

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

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

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

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

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

image_processor = AutoImageProcessor.from_pretrained("microsoft/beit-base-patch16-224")
model = BeitForImageClassification.from_pretrained("microsoft/beit-base-patch16-224")

inputs = image_processor(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> AutoImageProcessor, BeitForImageClassification
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset

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

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

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

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

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

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

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

inputs = image_processor(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> AutoImageProcessor, BeitForSemanticSegmentation
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests

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

<span class="hljs-meta">&gt;&gt;&gt; </span>image_processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">&quot;microsoft/beit-base-finetuned-ade-640-640&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BeitForSemanticSegmentation.from_pretrained(<span class="hljs-string">&quot;microsoft/beit-base-finetuned-ade-640-640&quot;</span>)

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

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

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

inputs = image_processor(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> AutoImageProcessor, FlaxBeitModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests

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

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

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

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

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

inputs = image_processor(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> AutoImageProcessor, BeitForMaskedImageModeling
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests

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

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

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

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

image_processor = AutoImageProcessor.from_pretrained("microsoft/beit-base-patch16-224")
model = FlaxBeitForImageClassification.from_pretrained("microsoft/beit-base-patch16-224")

inputs = image_processor(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> AutoImageProcessor, FlaxBeitForImageClassification
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests

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

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

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