import{S as Fa,i as qa,s as Ra,e as r,k as f,w as y,t as n,M as La,c as a,d as o,m as h,a as s,x as w,h as i,b as c,G as t,g as m,y as $,q as B,o as T,B as I,v as Da,L as Lr}from"../../chunks/vendor-hf-doc-builder.js";import{T as Ma}from"../../chunks/Tip-hf-doc-builder.js";import{D as Le}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Dr}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as De}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Rr}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";import{P as Sa}from"../../chunks/PipelineTag-hf-doc-builder.js";function Oa(C){let p,v,_,g,b;return g=new Dr({props:{code:`from transformers import BitConfig, BitModel

# Initializing a BiT bit-50 style configuration
configuration = BitConfig()

# Initializing a model (with random weights) from the bit-50 style configuration
model = BitModel(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> BitConfig, BitModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a BiT bit-50 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = BitConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model (with random weights) from the bit-50 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BitModel(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=r("p"),v=n("Example:"),_=f(),y(g.$$.fragment)},l(l){p=a(l,"P",{});var u=s(p);v=i(u,"Example:"),u.forEach(o),_=h(l),w(g.$$.fragment,l)},m(l,u){m(l,p,u),t(p,v),m(l,_,u),$(g,l,u),b=!0},p:Lr,i(l){b||(B(g.$$.fragment,l),b=!0)},o(l){T(g.$$.fragment,l),b=!1},d(l){l&&o(p),l&&o(_),I(g,l)}}}function Wa(C){let p,v,_,g,b;return{c(){p=r("p"),v=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=r("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=a(l,"P",{});var u=s(p);v=i(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a(u,"CODE",{});var A=s(_);g=i(A,"Module"),A.forEach(o),b=i(u,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),u.forEach(o)},m(l,u){m(l,p,u),t(p,v),t(p,_),t(_,g),t(p,b)},d(l){l&&o(p)}}}function Ua(C){let p,v,_,g,b;return g=new Dr({props:{code:`from transformers import AutoImageProcessor, BitModel
import torch
from datasets import load_dataset

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

image_processor = AutoImageProcessor.from_pretrained("google/bit-50")
model = BitModel.from_pretrained("google/bit-50")

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, BitModel
<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;google/bit-50&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BitModel.from_pretrained(<span class="hljs-string">&quot;google/bit-50&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">2048</span>, <span class="hljs-number">7</span>, <span class="hljs-number">7</span>]`}}),{c(){p=r("p"),v=n("Example:"),_=f(),y(g.$$.fragment)},l(l){p=a(l,"P",{});var u=s(p);v=i(u,"Example:"),u.forEach(o),_=h(l),w(g.$$.fragment,l)},m(l,u){m(l,p,u),t(p,v),m(l,_,u),$(g,l,u),b=!0},p:Lr,i(l){b||(B(g.$$.fragment,l),b=!0)},o(l){T(g.$$.fragment,l),b=!1},d(l){l&&o(p),l&&o(_),I(g,l)}}}function Va(C){let p,v,_,g,b;return{c(){p=r("p"),v=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=r("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=a(l,"P",{});var u=s(p);v=i(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a(u,"CODE",{});var A=s(_);g=i(A,"Module"),A.forEach(o),b=i(u,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),u.forEach(o)},m(l,u){m(l,p,u),t(p,v),t(p,_),t(_,g),t(p,b)},d(l){l&&o(p)}}}function Ha(C){let p,v,_,g,b;return g=new Dr({props:{code:`from transformers import AutoImageProcessor, BitForImageClassification
import torch
from datasets import load_dataset

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

image_processor = AutoImageProcessor.from_pretrained("google/bit-50")
model = BitForImageClassification.from_pretrained("google/bit-50")

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, BitForImageClassification
<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;google/bit-50&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BitForImageClassification.from_pretrained(<span class="hljs-string">&quot;google/bit-50&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])
tiger cat`}}),{c(){p=r("p"),v=n("Example:"),_=f(),y(g.$$.fragment)},l(l){p=a(l,"P",{});var u=s(p);v=i(u,"Example:"),u.forEach(o),_=h(l),w(g.$$.fragment,l)},m(l,u){m(l,p,u),t(p,v),m(l,_,u),$(g,l,u),b=!0},p:Lr,i(l){b||(B(g.$$.fragment,l),b=!0)},o(l){T(g.$$.fragment,l),b=!1},d(l){l&&o(p),l&&o(_),I(g,l)}}}function Ga(C){let p,v,_,g,b,l,u,A,no,At,q,J,dt,de,io,mt,lo,kt,N,co,me,mo,po,Se,fo,ho,jt,Oe,go,Nt,We,pt,uo,Mt,Ue,_o,Ft,Ve,R,bo,pe,vo,yo,fe,wo,$o,qt,M,Bo,he,To,Io,ge,Po,xo,Rt,L,Y,ft,ue,Co,ht,Eo,Lt,He,zo,Dt,_e,St,Ge,F,Je,Ao,ko,be,jo,No,ve,Mo,Fo,Ot,Ye,qo,Wt,D,X,gt,ye,Ro,ut,Lo,Ut,P,we,Do,S,So,Xe,Oo,Wo,$e,Uo,Vo,Ho,O,Go,Ke,Jo,Yo,Ze,Xo,Ko,Zo,K,Vt,W,Z,_t,Be,Qo,bt,er,Ht,k,Te,tr,vt,or,rr,Q,Ie,ar,yt,sr,Gt,U,ee,wt,Pe,nr,$t,ir,Jt,j,xe,lr,Ce,cr,Ee,dr,mr,pr,E,ze,fr,V,hr,Qe,gr,ur,Bt,_r,br,vr,te,yr,oe,Yt,H,re,Tt,Ae,wr,It,$r,Xt,x,ke,Br,Pt,Tr,Ir,je,Pr,Ne,xr,Cr,Er,z,Me,zr,G,Ar,et,kr,jr,xt,Nr,Mr,Fr,ae,qr,se,Kt;return l=new De({}),de=new De({}),ue=new De({}),_e=new Sa({props:{pipeline:"image-classification"}}),ye=new De({}),we=new Le({props:{name:"class transformers.BitConfig",anchor:"transformers.BitConfig",parameters:[{name:"num_channels",val:" = 3"},{name:"embedding_size",val:" = 64"},{name:"hidden_sizes",val:" = [256, 512, 1024, 2048]"},{name:"depths",val:" = [3, 4, 6, 3]"},{name:"layer_type",val:" = 'preactivation'"},{name:"hidden_act",val:" = 'relu'"},{name:"global_padding",val:" = None"},{name:"num_groups",val:" = 32"},{name:"drop_path_rate",val:" = 0.0"},{name:"embedding_dynamic_padding",val:" = False"},{name:"output_stride",val:" = 32"},{name:"width_factor",val:" = 1"},{name:"out_features",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.BitConfig.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.BitConfig.embedding_size",description:`<strong>embedding_size</strong> (<code>int</code>, <em>optional</em>, defaults to 64) &#x2014;
Dimensionality (hidden size) for the embedding layer.`,name:"embedding_size"},{anchor:"transformers.BitConfig.hidden_sizes",description:`<strong>hidden_sizes</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[256, 512, 1024, 2048]</code>) &#x2014;
Dimensionality (hidden size) at each stage.`,name:"hidden_sizes"},{anchor:"transformers.BitConfig.depths",description:`<strong>depths</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[3, 4, 6, 3]</code>) &#x2014;
Depth (number of layers) for each stage.`,name:"depths"},{anchor:"transformers.BitConfig.layer_type",description:`<strong>layer_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;preactivation&quot;</code>) &#x2014;
The layer to use, it can be either <code>&quot;preactivation&quot;</code> or <code>&quot;bottleneck&quot;</code>.`,name:"layer_type"},{anchor:"transformers.BitConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;relu&quot;</code>) &#x2014;
The non-linear activation function in each block. 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.BitConfig.global_padding",description:`<strong>global_padding</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Padding strategy to use for the convolutional layers. Can be either <code>&quot;valid&quot;</code>, <code>&quot;same&quot;</code>, or <code>None</code>.`,name:"global_padding"},{anchor:"transformers.BitConfig.num_groups",description:`<strong>num_groups</strong> (<code>int</code>, <em>optional</em>, defaults to <code>32</code>) &#x2014;
Number of groups used for the <code>BitGroupNormActivation</code> layers.`,name:"num_groups"},{anchor:"transformers.BitConfig.drop_path_rate",description:`<strong>drop_path_rate</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The drop path rate for the stochastic depth.`,name:"drop_path_rate"},{anchor:"transformers.BitConfig.embedding_dynamic_padding",description:`<strong>embedding_dynamic_padding</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to make use of dynamic padding for the embedding layer.`,name:"embedding_dynamic_padding"},{anchor:"transformers.BitConfig.output_stride",description:`<strong>output_stride</strong> (<code>int</code>, <em>optional</em>, defaults to 32) &#x2014;
The output stride of the model.`,name:"output_stride"},{anchor:"transformers.BitConfig.width_factor",description:`<strong>width_factor</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The width factor for the model.`,name:"width_factor"},{anchor:"transformers.BitConfig.out_features",description:`<strong>out_features</strong> (<code>List[str]</code>, <em>optional</em>) &#x2014;
If used as backbone, list of features to output. Can be any of <code>&quot;stem&quot;</code>, <code>&quot;stage1&quot;</code>, <code>&quot;stage2&quot;</code>, etc.
(depending on how many stages the model has). Will default to the last stage if unset.`,name:"out_features"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bit/configuration_bit.py#L28"}}),K=new Rr({props:{anchor:"transformers.BitConfig.example",$$slots:{default:[Oa]},$$scope:{ctx:C}}}),Be=new De({}),Te=new Le({props:{name:"class transformers.BitImageProcessor",anchor:"transformers.BitImageProcessor",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:"do_rescale",val:": bool = True"},{name:"rescale_factor",val:": typing.Union[int, float] = 0.00392156862745098"},{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_convert_rgb",val:": bool = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.BitImageProcessor.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
<code>do_resize</code> in the <code>preprocess</code> method.`,name:"do_resize"},{anchor:"transformers.BitImageProcessor.size",description:`<strong>size</strong> (<code>Dict[str, int]</code> <em>optional</em>, defaults to <code>{&quot;shortest_edge&quot; -- 224}</code>):
Size of the image after resizing. The shortest edge of the image is resized to size[&#x201C;shortest_edge&#x201D;], with
the longest edge resized to keep the input aspect ratio. Can be overridden by <code>size</code> in the <code>preprocess</code>
method.`,name:"size"},{anchor:"transformers.BitImageProcessor.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 <code>resample</code> in the <code>preprocess</code> method.`,name:"resample"},{anchor:"transformers.BitImageProcessor.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 to the specified <code>crop_size</code>. Can be overridden by <code>do_center_crop</code> in the
<code>preprocess</code> method.`,name:"do_center_crop"},{anchor:"transformers.BitImageProcessor.crop_size",description:`<strong>crop_size</strong> (<code>Dict[str, int]</code> <em>optional</em>, defaults to 224) &#x2014;
Size of the output image after applying <code>center_crop</code>. Can be overridden by <code>crop_size</code> in the <code>preprocess</code>
method.`,name:"crop_size"},{anchor:"transformers.BitImageProcessor.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 <code>do_rescale</code> in
the <code>preprocess</code> method.`,name:"do_rescale"},{anchor:"transformers.BitImageProcessor.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 <code>rescale_factor</code> in the <code>preprocess</code>
method.
do_normalize &#x2014;
Whether to normalize the image. Can be overridden by <code>do_normalize</code> in the <code>preprocess</code> method.`,name:"rescale_factor"},{anchor:"transformers.BitImageProcessor.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;
Mean to use if normalizing the image. This is a float or list of floats the length of the number of
channels in the image. Can be overridden by the <code>image_mean</code> parameter in the <code>preprocess</code> method.`,name:"image_mean"},{anchor:"transformers.BitImageProcessor.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;
Image standard deviation.`,name:"image_std"},{anchor:"transformers.BitImageProcessor.do_convert_rgb",description:`<strong>do_convert_rgb</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Standard deviation to use if normalizing the image. This is a float or list of floats the length of the
number of channels in the image. Can be overridden by the <code>image_std</code> parameter in the <code>preprocess</code> method.`,name:"do_convert_rgb"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bit/image_processing_bit.py#L52"}}),Ie=new Le({props:{name:"preprocess",anchor:"transformers.BitImageProcessor.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:"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:": 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_convert_rgb",val:": bool = None"},{name:"return_tensors",val:": typing.Union[transformers.utils.generic.TensorType, str, NoneType] = None"},{name:"data_format",val:": typing.Optional[transformers.image_utils.ChannelDimension] = <ChannelDimension.FIRST: 'channels_first'>"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.BitImageProcessor.preprocess.images",description:`<strong>images</strong> (<code>ImageInput</code>) &#x2014;
Image to preprocess.`,name:"images"},{anchor:"transformers.BitImageProcessor.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.BitImageProcessor.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. Shortest edge of the image is resized to size[&#x201C;shortest_edge&#x201D;], with
the longest edge resized to keep the input aspect ratio.`,name:"size"},{anchor:"transformers.BitImageProcessor.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.BitImageProcessor.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.BitImageProcessor.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 center crop. Only has an effect if <code>do_center_crop</code> is set to <code>True</code>.`,name:"crop_size"},{anchor:"transformers.BitImageProcessor.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.`,name:"do_rescale"},{anchor:"transformers.BitImageProcessor.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.BitImageProcessor.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.BitImageProcessor.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 to use for normalization. Only has an effect if <code>do_normalize</code> is set to <code>True</code>.`,name:"image_mean"},{anchor:"transformers.BitImageProcessor.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 to use for normalization. Only has an effect if <code>do_normalize</code> is set to
<code>True</code>.`,name:"image_std"},{anchor:"transformers.BitImageProcessor.preprocess.do_convert_rgb",description:`<strong>do_convert_rgb</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_convert_rgb</code>) &#x2014;
Whether to convert the image to RGB.`,name:"do_convert_rgb"},{anchor:"transformers.BitImageProcessor.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.BitImageProcessor.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>
<li>Unset: defaults to the channel dimension format of the input image.</li>
</ul>`,name:"data_format"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bit/image_processing_bit.py#L220"}}),Pe=new De({}),xe=new Le({props:{name:"class transformers.BitModel",anchor:"transformers.BitModel",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.BitModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/bit#transformers.BitConfig">BitConfig</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/main/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/main/src/transformers/models/bit/modeling_bit.py#L705"}}),ze=new Le({props:{name:"forward",anchor:"transformers.BitModel.forward",parameters:[{name:"pixel_values",val:": Tensor"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.BitModel.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/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/main/en/model_doc/poolformer#transformers.PoolFormerFeatureExtractor.__call__">BitImageProcessor.<strong>call</strong>()</a>
for details.`,name:"pixel_values"},{anchor:"transformers.BitModel.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.BitModel.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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bit/modeling_bit.py#L723",returnDescription:`
<p>A <code>transformers.modeling_outputs.BaseModelOutputWithPoolingAndNoAttention</code> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/bit#transformers.BitConfig"
>BitConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</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 Last layer hidden-state after a pooling operation on the spatial dimensions.</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, num_channels, height, width)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
</ul>
`,returnType:`
<p><code>transformers.modeling_outputs.BaseModelOutputWithPoolingAndNoAttention</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),te=new Ma({props:{$$slots:{default:[Wa]},$$scope:{ctx:C}}}),oe=new Rr({props:{anchor:"transformers.BitModel.forward.example",$$slots:{default:[Ua]},$$scope:{ctx:C}}}),Ae=new De({}),ke=new Le({props:{name:"class transformers.BitForImageClassification",anchor:"transformers.BitForImageClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.BitForImageClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/bit#transformers.BitConfig">BitConfig</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/main/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/main/src/transformers/models/bit/modeling_bit.py#L768"}}),Me=new Le({props:{name:"forward",anchor:"transformers.BitForImageClassification.forward",parameters:[{name:"pixel_values",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.BitForImageClassification.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/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/main/en/model_doc/poolformer#transformers.PoolFormerFeatureExtractor.__call__">BitImageProcessor.<strong>call</strong>()</a>
for details.`,name:"pixel_values"},{anchor:"transformers.BitForImageClassification.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.BitForImageClassification.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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.BitForImageClassification.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 &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bit/modeling_bit.py#L781",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.ImageClassifierOutputWithNoAttention"
>transformers.modeling_outputs.ImageClassifierOutputWithNoAttention</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/main/en/model_doc/bit#transformers.BitConfig"
>BitConfig</a>) and inputs.</p>
<ul>
<li><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.</li>
<li><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).</li>
<li><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each stage) of shape <code>(batch_size, num_channels, height, width)</code>. Hidden-states (also
called feature maps) of the model at the output of each stage.</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.ImageClassifierOutputWithNoAttention"
>transformers.modeling_outputs.ImageClassifierOutputWithNoAttention</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ae=new Ma({props:{$$slots:{default:[Va]},$$scope:{ctx:C}}}),se=new Rr({props:{anchor:"transformers.BitForImageClassification.forward.example",$$slots:{default:[Ha]},$$scope:{ctx:C}}}),{c(){p=r("meta"),v=f(),_=r("h1"),g=r("a"),b=r("span"),y(l.$$.fragment),u=f(),A=r("span"),no=n("Big Transfer (BiT)"),At=f(),q=r("h2"),J=r("a"),dt=r("span"),y(de.$$.fragment),io=f(),mt=r("span"),lo=n("Overview"),kt=f(),N=r("p"),co=n("The BiT model was proposed in "),me=r("a"),mo=n("Big Transfer (BiT): General Visual Representation Learning"),po=n(` by Alexander Kolesnikov, Lucas Beyer, Xiaohua Zhai, Joan Puigcerver, Jessica Yung, Sylvain Gelly, Neil Houlsby.
BiT is a simple recipe for scaling up pre-training of `),Se=r("a"),fo=n("ResNet"),ho=n("-like architectures (specifically, ResNetv2). The method results in significant improvements for transfer learning."),jt=f(),Oe=r("p"),go=n("The abstract from the paper is the following:"),Nt=f(),We=r("p"),pt=r("em"),uo=n("Transfer of pre-trained representations improves sample efficiency and simplifies hyperparameter tuning when training deep neural networks for vision. We revisit the paradigm of pre-training on large supervised datasets and fine-tuning the model on a target task. We scale up pre-training, and propose a simple recipe that we call Big Transfer (BiT). By combining a few carefully selected components, and transferring using a simple heuristic, we achieve strong performance on over 20 datasets. BiT performs well across a surprisingly wide range of data regimes \u2014 from 1 example per class to 1M total examples. BiT achieves 87.5% top-1 accuracy on ILSVRC-2012, 99.4% on CIFAR-10, and 76.3% on the 19 task Visual Task Adaptation Benchmark (VTAB). On small datasets, BiT attains 76.8% on ILSVRC-2012 with 10 examples per class, and 97.0% on CIFAR-10 with 10 examples per class. We conduct detailed analysis of the main components that lead to high transfer performance."),Mt=f(),Ue=r("p"),_o=n("Tips:"),Ft=f(),Ve=r("ul"),R=r("li"),bo=n("BiT models are equivalent to ResNetv2 in terms of architecture, except that: 1) all batch normalization layers are replaced by "),pe=r("a"),vo=n("group normalization"),yo=n(`,
2) `),fe=r("a"),wo=n("weight standardization"),$o=n(` is used for convolutional layers. The authors show that the combination of both is useful for training with large batch sizes, and has a significant
impact on transfer learning.`),qt=f(),M=r("p"),Bo=n("This model was contributed by "),he=r("a"),To=n("nielsr"),Io=n(`.
The original code can be found `),ge=r("a"),Po=n("here"),xo=n("."),Rt=f(),L=r("h2"),Y=r("a"),ft=r("span"),y(ue.$$.fragment),Co=f(),ht=r("span"),Eo=n("Resources"),Lt=f(),He=r("p"),zo=n("A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with BiT."),Dt=f(),y(_e.$$.fragment),St=f(),Ge=r("ul"),F=r("li"),Je=r("a"),Ao=n("BitForImageClassification"),ko=n(" is supported by this "),be=r("a"),jo=n("example script"),No=n(" and "),ve=r("a"),Mo=n("notebook"),Fo=n("."),Ot=f(),Ye=r("p"),qo=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."),Wt=f(),D=r("h2"),X=r("a"),gt=r("span"),y(ye.$$.fragment),Ro=f(),ut=r("span"),Lo=n("BitConfig"),Ut=f(),P=r("div"),y(we.$$.fragment),Do=f(),S=r("p"),So=n("This is the configuration class to store the configuration of a "),Xe=r("a"),Oo=n("BitModel"),Wo=n(`. It is used to instantiate an BiT
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 BiT
`),$e=r("a"),Uo=n("google/bit-50"),Vo=n(" architecture."),Ho=f(),O=r("p"),Go=n("Configuration objects inherit from "),Ke=r("a"),Jo=n("PretrainedConfig"),Yo=n(` and can be used to control the model outputs. Read the
documentation from `),Ze=r("a"),Xo=n("PretrainedConfig"),Ko=n(" for more information."),Zo=f(),y(K.$$.fragment),Vt=f(),W=r("h2"),Z=r("a"),_t=r("span"),y(Be.$$.fragment),Qo=f(),bt=r("span"),er=n("BitImageProcessor"),Ht=f(),k=r("div"),y(Te.$$.fragment),tr=f(),vt=r("p"),or=n("Constructs a BiT image processor."),rr=f(),Q=r("div"),y(Ie.$$.fragment),ar=f(),yt=r("p"),sr=n("Preprocess an image or batch of images."),Gt=f(),U=r("h2"),ee=r("a"),wt=r("span"),y(Pe.$$.fragment),nr=f(),$t=r("span"),ir=n("BitModel"),Jt=f(),j=r("div"),y(xe.$$.fragment),lr=f(),Ce=r("p"),cr=n(`The bare BiT model outputting raw features without any specific head on top.
This model is a PyTorch `),Ee=r("a"),dr=n("torch.nn.Module"),mr=n(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),pr=f(),E=r("div"),y(ze.$$.fragment),fr=f(),V=r("p"),hr=n("The "),Qe=r("a"),gr=n("BitModel"),ur=n(" forward method, overrides the "),Bt=r("code"),_r=n("__call__"),br=n(" special method."),vr=f(),y(te.$$.fragment),yr=f(),y(oe.$$.fragment),Yt=f(),H=r("h2"),re=r("a"),Tt=r("span"),y(Ae.$$.fragment),wr=f(),It=r("span"),$r=n("BitForImageClassification"),Xt=f(),x=r("div"),y(ke.$$.fragment),Br=f(),Pt=r("p"),Tr=n(`BiT Model with an image classification head on top (a linear layer on top of the pooled features), e.g. for
ImageNet.`),Ir=f(),je=r("p"),Pr=n("This model is a PyTorch "),Ne=r("a"),xr=n("torch.nn.Module"),Cr=n(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Er=f(),z=r("div"),y(Me.$$.fragment),zr=f(),G=r("p"),Ar=n("The "),et=r("a"),kr=n("BitForImageClassification"),jr=n(" forward method, overrides the "),xt=r("code"),Nr=n("__call__"),Mr=n(" special method."),Fr=f(),y(ae.$$.fragment),qr=f(),y(se.$$.fragment),this.h()},l(e){const d=La('[data-svelte="svelte-1phssyn"]',document.head);p=a(d,"META",{name:!0,content:!0}),d.forEach(o),v=h(e),_=a(e,"H1",{class:!0});var Fe=s(_);g=a(Fe,"A",{id:!0,class:!0,href:!0});var Ct=s(g);b=a(Ct,"SPAN",{});var Et=s(b);w(l.$$.fragment,Et),Et.forEach(o),Ct.forEach(o),u=h(Fe),A=a(Fe,"SPAN",{});var zt=s(A);no=i(zt,"Big Transfer (BiT)"),zt.forEach(o),Fe.forEach(o),At=h(e),q=a(e,"H2",{class:!0});var qe=s(q);J=a(qe,"A",{id:!0,class:!0,href:!0});var Sr=s(J);dt=a(Sr,"SPAN",{});var Or=s(dt);w(de.$$.fragment,Or),Or.forEach(o),Sr.forEach(o),io=h(qe),mt=a(qe,"SPAN",{});var Wr=s(mt);lo=i(Wr,"Overview"),Wr.forEach(o),qe.forEach(o),kt=h(e),N=a(e,"P",{});var tt=s(N);co=i(tt,"The BiT model was proposed in "),me=a(tt,"A",{href:!0,rel:!0});var Ur=s(me);mo=i(Ur,"Big Transfer (BiT): General Visual Representation Learning"),Ur.forEach(o),po=i(tt,` by Alexander Kolesnikov, Lucas Beyer, Xiaohua Zhai, Joan Puigcerver, Jessica Yung, Sylvain Gelly, Neil Houlsby.
BiT is a simple recipe for scaling up pre-training of `),Se=a(tt,"A",{href:!0});var Vr=s(Se);fo=i(Vr,"ResNet"),Vr.forEach(o),ho=i(tt,"-like architectures (specifically, ResNetv2). The method results in significant improvements for transfer learning."),tt.forEach(o),jt=h(e),Oe=a(e,"P",{});var Hr=s(Oe);go=i(Hr,"The abstract from the paper is the following:"),Hr.forEach(o),Nt=h(e),We=a(e,"P",{});var Gr=s(We);pt=a(Gr,"EM",{});var Jr=s(pt);uo=i(Jr,"Transfer of pre-trained representations improves sample efficiency and simplifies hyperparameter tuning when training deep neural networks for vision. We revisit the paradigm of pre-training on large supervised datasets and fine-tuning the model on a target task. We scale up pre-training, and propose a simple recipe that we call Big Transfer (BiT). By combining a few carefully selected components, and transferring using a simple heuristic, we achieve strong performance on over 20 datasets. BiT performs well across a surprisingly wide range of data regimes \u2014 from 1 example per class to 1M total examples. BiT achieves 87.5% top-1 accuracy on ILSVRC-2012, 99.4% on CIFAR-10, and 76.3% on the 19 task Visual Task Adaptation Benchmark (VTAB). On small datasets, BiT attains 76.8% on ILSVRC-2012 with 10 examples per class, and 97.0% on CIFAR-10 with 10 examples per class. We conduct detailed analysis of the main components that lead to high transfer performance."),Jr.forEach(o),Gr.forEach(o),Mt=h(e),Ue=a(e,"P",{});var Yr=s(Ue);_o=i(Yr,"Tips:"),Yr.forEach(o),Ft=h(e),Ve=a(e,"UL",{});var Xr=s(Ve);R=a(Xr,"LI",{});var ot=s(R);bo=i(ot,"BiT models are equivalent to ResNetv2 in terms of architecture, except that: 1) all batch normalization layers are replaced by "),pe=a(ot,"A",{href:!0,rel:!0});var Kr=s(pe);vo=i(Kr,"group normalization"),Kr.forEach(o),yo=i(ot,`,
2) `),fe=a(ot,"A",{href:!0,rel:!0});var Zr=s(fe);wo=i(Zr,"weight standardization"),Zr.forEach(o),$o=i(ot,` is used for convolutional layers. The authors show that the combination of both is useful for training with large batch sizes, and has a significant
impact on transfer learning.`),ot.forEach(o),Xr.forEach(o),qt=h(e),M=a(e,"P",{});var rt=s(M);Bo=i(rt,"This model was contributed by "),he=a(rt,"A",{href:!0,rel:!0});var Qr=s(he);To=i(Qr,"nielsr"),Qr.forEach(o),Io=i(rt,`.
The original code can be found `),ge=a(rt,"A",{href:!0,rel:!0});var ea=s(ge);Po=i(ea,"here"),ea.forEach(o),xo=i(rt,"."),rt.forEach(o),Rt=h(e),L=a(e,"H2",{class:!0});var Zt=s(L);Y=a(Zt,"A",{id:!0,class:!0,href:!0});var ta=s(Y);ft=a(ta,"SPAN",{});var oa=s(ft);w(ue.$$.fragment,oa),oa.forEach(o),ta.forEach(o),Co=h(Zt),ht=a(Zt,"SPAN",{});var ra=s(ht);Eo=i(ra,"Resources"),ra.forEach(o),Zt.forEach(o),Lt=h(e),He=a(e,"P",{});var aa=s(He);zo=i(aa,"A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with BiT."),aa.forEach(o),Dt=h(e),w(_e.$$.fragment,e),St=h(e),Ge=a(e,"UL",{});var sa=s(Ge);F=a(sa,"LI",{});var Re=s(F);Je=a(Re,"A",{href:!0});var na=s(Je);Ao=i(na,"BitForImageClassification"),na.forEach(o),ko=i(Re," is supported by this "),be=a(Re,"A",{href:!0,rel:!0});var ia=s(be);jo=i(ia,"example script"),ia.forEach(o),No=i(Re," and "),ve=a(Re,"A",{href:!0,rel:!0});var la=s(ve);Mo=i(la,"notebook"),la.forEach(o),Fo=i(Re,"."),Re.forEach(o),sa.forEach(o),Ot=h(e),Ye=a(e,"P",{});var ca=s(Ye);qo=i(ca,"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."),ca.forEach(o),Wt=h(e),D=a(e,"H2",{class:!0});var Qt=s(D);X=a(Qt,"A",{id:!0,class:!0,href:!0});var da=s(X);gt=a(da,"SPAN",{});var ma=s(gt);w(ye.$$.fragment,ma),ma.forEach(o),da.forEach(o),Ro=h(Qt),ut=a(Qt,"SPAN",{});var pa=s(ut);Lo=i(pa,"BitConfig"),pa.forEach(o),Qt.forEach(o),Ut=h(e),P=a(e,"DIV",{class:!0});var ne=s(P);w(we.$$.fragment,ne),Do=h(ne),S=a(ne,"P",{});var at=s(S);So=i(at,"This is the configuration class to store the configuration of a "),Xe=a(at,"A",{href:!0});var fa=s(Xe);Oo=i(fa,"BitModel"),fa.forEach(o),Wo=i(at,`. It is used to instantiate an BiT
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 BiT
`),$e=a(at,"A",{href:!0,rel:!0});var ha=s($e);Uo=i(ha,"google/bit-50"),ha.forEach(o),Vo=i(at," architecture."),at.forEach(o),Ho=h(ne),O=a(ne,"P",{});var st=s(O);Go=i(st,"Configuration objects inherit from "),Ke=a(st,"A",{href:!0});var ga=s(Ke);Jo=i(ga,"PretrainedConfig"),ga.forEach(o),Yo=i(st,` and can be used to control the model outputs. Read the
documentation from `),Ze=a(st,"A",{href:!0});var ua=s(Ze);Xo=i(ua,"PretrainedConfig"),ua.forEach(o),Ko=i(st," for more information."),st.forEach(o),Zo=h(ne),w(K.$$.fragment,ne),ne.forEach(o),Vt=h(e),W=a(e,"H2",{class:!0});var eo=s(W);Z=a(eo,"A",{id:!0,class:!0,href:!0});var _a=s(Z);_t=a(_a,"SPAN",{});var ba=s(_t);w(Be.$$.fragment,ba),ba.forEach(o),_a.forEach(o),Qo=h(eo),bt=a(eo,"SPAN",{});var va=s(bt);er=i(va,"BitImageProcessor"),va.forEach(o),eo.forEach(o),Ht=h(e),k=a(e,"DIV",{class:!0});var nt=s(k);w(Te.$$.fragment,nt),tr=h(nt),vt=a(nt,"P",{});var ya=s(vt);or=i(ya,"Constructs a BiT image processor."),ya.forEach(o),rr=h(nt),Q=a(nt,"DIV",{class:!0});var to=s(Q);w(Ie.$$.fragment,to),ar=h(to),yt=a(to,"P",{});var wa=s(yt);sr=i(wa,"Preprocess an image or batch of images."),wa.forEach(o),to.forEach(o),nt.forEach(o),Gt=h(e),U=a(e,"H2",{class:!0});var oo=s(U);ee=a(oo,"A",{id:!0,class:!0,href:!0});var $a=s(ee);wt=a($a,"SPAN",{});var Ba=s(wt);w(Pe.$$.fragment,Ba),Ba.forEach(o),$a.forEach(o),nr=h(oo),$t=a(oo,"SPAN",{});var Ta=s($t);ir=i(Ta,"BitModel"),Ta.forEach(o),oo.forEach(o),Jt=h(e),j=a(e,"DIV",{class:!0});var it=s(j);w(xe.$$.fragment,it),lr=h(it),Ce=a(it,"P",{});var ro=s(Ce);cr=i(ro,`The bare BiT model outputting raw features without any specific head on top.
This model is a PyTorch `),Ee=a(ro,"A",{href:!0,rel:!0});var Ia=s(Ee);dr=i(Ia,"torch.nn.Module"),Ia.forEach(o),mr=i(ro,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),ro.forEach(o),pr=h(it),E=a(it,"DIV",{class:!0});var ie=s(E);w(ze.$$.fragment,ie),fr=h(ie),V=a(ie,"P",{});var lt=s(V);hr=i(lt,"The "),Qe=a(lt,"A",{href:!0});var Pa=s(Qe);gr=i(Pa,"BitModel"),Pa.forEach(o),ur=i(lt," forward method, overrides the "),Bt=a(lt,"CODE",{});var xa=s(Bt);_r=i(xa,"__call__"),xa.forEach(o),br=i(lt," special method."),lt.forEach(o),vr=h(ie),w(te.$$.fragment,ie),yr=h(ie),w(oe.$$.fragment,ie),ie.forEach(o),it.forEach(o),Yt=h(e),H=a(e,"H2",{class:!0});var ao=s(H);re=a(ao,"A",{id:!0,class:!0,href:!0});var Ca=s(re);Tt=a(Ca,"SPAN",{});var Ea=s(Tt);w(Ae.$$.fragment,Ea),Ea.forEach(o),Ca.forEach(o),wr=h(ao),It=a(ao,"SPAN",{});var za=s(It);$r=i(za,"BitForImageClassification"),za.forEach(o),ao.forEach(o),Xt=h(e),x=a(e,"DIV",{class:!0});var le=s(x);w(ke.$$.fragment,le),Br=h(le),Pt=a(le,"P",{});var Aa=s(Pt);Tr=i(Aa,`BiT Model with an image classification head on top (a linear layer on top of the pooled features), e.g. for
ImageNet.`),Aa.forEach(o),Ir=h(le),je=a(le,"P",{});var so=s(je);Pr=i(so,"This model is a PyTorch "),Ne=a(so,"A",{href:!0,rel:!0});var ka=s(Ne);xr=i(ka,"torch.nn.Module"),ka.forEach(o),Cr=i(so,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),so.forEach(o),Er=h(le),z=a(le,"DIV",{class:!0});var ce=s(z);w(Me.$$.fragment,ce),zr=h(ce),G=a(ce,"P",{});var ct=s(G);Ar=i(ct,"The "),et=a(ct,"A",{href:!0});var ja=s(et);kr=i(ja,"BitForImageClassification"),ja.forEach(o),jr=i(ct," forward method, overrides the "),xt=a(ct,"CODE",{});var Na=s(xt);Nr=i(Na,"__call__"),Na.forEach(o),Mr=i(ct," special method."),ct.forEach(o),Fr=h(ce),w(ae.$$.fragment,ce),qr=h(ce),w(se.$$.fragment,ce),ce.forEach(o),le.forEach(o),this.h()},h(){c(p,"name","hf:doc:metadata"),c(p,"content",JSON.stringify(Ja)),c(g,"id","big-transfer-bit"),c(g,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(g,"href","#big-transfer-bit"),c(_,"class","relative group"),c(J,"id","overview"),c(J,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(J,"href","#overview"),c(q,"class","relative group"),c(me,"href","https://arxiv.org/abs/1912.11370"),c(me,"rel","nofollow"),c(Se,"href","resnet"),c(pe,"href","https://arxiv.org/abs/1803.08494"),c(pe,"rel","nofollow"),c(fe,"href","https://arxiv.org/abs/1903.10520"),c(fe,"rel","nofollow"),c(he,"href","https://huggingface.co/nielsr"),c(he,"rel","nofollow"),c(ge,"href","https://github.com/google-research/big_transfer"),c(ge,"rel","nofollow"),c(Y,"id","resources"),c(Y,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(Y,"href","#resources"),c(L,"class","relative group"),c(Je,"href","/docs/transformers/main/en/model_doc/bit#transformers.BitForImageClassification"),c(be,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/image-classification"),c(be,"rel","nofollow"),c(ve,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/image_classification.ipynb"),c(ve,"rel","nofollow"),c(X,"id","transformers.BitConfig"),c(X,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(X,"href","#transformers.BitConfig"),c(D,"class","relative group"),c(Xe,"href","/docs/transformers/main/en/model_doc/bit#transformers.BitModel"),c($e,"href","https://huggingface.co/google/bit-50"),c($e,"rel","nofollow"),c(Ke,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),c(Ze,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),c(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Z,"id","transformers.BitImageProcessor"),c(Z,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(Z,"href","#transformers.BitImageProcessor"),c(W,"class","relative group"),c(Q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(ee,"id","transformers.BitModel"),c(ee,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(ee,"href","#transformers.BitModel"),c(U,"class","relative group"),c(Ee,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(Ee,"rel","nofollow"),c(Qe,"href","/docs/transformers/main/en/model_doc/bit#transformers.BitModel"),c(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(re,"id","transformers.BitForImageClassification"),c(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"),c(re,"href","#transformers.BitForImageClassification"),c(H,"class","relative group"),c(Ne,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(Ne,"rel","nofollow"),c(et,"href","/docs/transformers/main/en/model_doc/bit#transformers.BitForImageClassification"),c(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,d){t(document.head,p),m(e,v,d),m(e,_,d),t(_,g),t(g,b),$(l,b,null),t(_,u),t(_,A),t(A,no),m(e,At,d),m(e,q,d),t(q,J),t(J,dt),$(de,dt,null),t(q,io),t(q,mt),t(mt,lo),m(e,kt,d),m(e,N,d),t(N,co),t(N,me),t(me,mo),t(N,po),t(N,Se),t(Se,fo),t(N,ho),m(e,jt,d),m(e,Oe,d),t(Oe,go),m(e,Nt,d),m(e,We,d),t(We,pt),t(pt,uo),m(e,Mt,d),m(e,Ue,d),t(Ue,_o),m(e,Ft,d),m(e,Ve,d),t(Ve,R),t(R,bo),t(R,pe),t(pe,vo),t(R,yo),t(R,fe),t(fe,wo),t(R,$o),m(e,qt,d),m(e,M,d),t(M,Bo),t(M,he),t(he,To),t(M,Io),t(M,ge),t(ge,Po),t(M,xo),m(e,Rt,d),m(e,L,d),t(L,Y),t(Y,ft),$(ue,ft,null),t(L,Co),t(L,ht),t(ht,Eo),m(e,Lt,d),m(e,He,d),t(He,zo),m(e,Dt,d),$(_e,e,d),m(e,St,d),m(e,Ge,d),t(Ge,F),t(F,Je),t(Je,Ao),t(F,ko),t(F,be),t(be,jo),t(F,No),t(F,ve),t(ve,Mo),t(F,Fo),m(e,Ot,d),m(e,Ye,d),t(Ye,qo),m(e,Wt,d),m(e,D,d),t(D,X),t(X,gt),$(ye,gt,null),t(D,Ro),t(D,ut),t(ut,Lo),m(e,Ut,d),m(e,P,d),$(we,P,null),t(P,Do),t(P,S),t(S,So),t(S,Xe),t(Xe,Oo),t(S,Wo),t(S,$e),t($e,Uo),t(S,Vo),t(P,Ho),t(P,O),t(O,Go),t(O,Ke),t(Ke,Jo),t(O,Yo),t(O,Ze),t(Ze,Xo),t(O,Ko),t(P,Zo),$(K,P,null),m(e,Vt,d),m(e,W,d),t(W,Z),t(Z,_t),$(Be,_t,null),t(W,Qo),t(W,bt),t(bt,er),m(e,Ht,d),m(e,k,d),$(Te,k,null),t(k,tr),t(k,vt),t(vt,or),t(k,rr),t(k,Q),$(Ie,Q,null),t(Q,ar),t(Q,yt),t(yt,sr),m(e,Gt,d),m(e,U,d),t(U,ee),t(ee,wt),$(Pe,wt,null),t(U,nr),t(U,$t),t($t,ir),m(e,Jt,d),m(e,j,d),$(xe,j,null),t(j,lr),t(j,Ce),t(Ce,cr),t(Ce,Ee),t(Ee,dr),t(Ce,mr),t(j,pr),t(j,E),$(ze,E,null),t(E,fr),t(E,V),t(V,hr),t(V,Qe),t(Qe,gr),t(V,ur),t(V,Bt),t(Bt,_r),t(V,br),t(E,vr),$(te,E,null),t(E,yr),$(oe,E,null),m(e,Yt,d),m(e,H,d),t(H,re),t(re,Tt),$(Ae,Tt,null),t(H,wr),t(H,It),t(It,$r),m(e,Xt,d),m(e,x,d),$(ke,x,null),t(x,Br),t(x,Pt),t(Pt,Tr),t(x,Ir),t(x,je),t(je,Pr),t(je,Ne),t(Ne,xr),t(je,Cr),t(x,Er),t(x,z),$(Me,z,null),t(z,zr),t(z,G),t(G,Ar),t(G,et),t(et,kr),t(G,jr),t(G,xt),t(xt,Nr),t(G,Mr),t(z,Fr),$(ae,z,null),t(z,qr),$(se,z,null),Kt=!0},p(e,[d]){const Fe={};d&2&&(Fe.$$scope={dirty:d,ctx:e}),K.$set(Fe);const Ct={};d&2&&(Ct.$$scope={dirty:d,ctx:e}),te.$set(Ct);const Et={};d&2&&(Et.$$scope={dirty:d,ctx:e}),oe.$set(Et);const zt={};d&2&&(zt.$$scope={dirty:d,ctx:e}),ae.$set(zt);const qe={};d&2&&(qe.$$scope={dirty:d,ctx:e}),se.$set(qe)},i(e){Kt||(B(l.$$.fragment,e),B(de.$$.fragment,e),B(ue.$$.fragment,e),B(_e.$$.fragment,e),B(ye.$$.fragment,e),B(we.$$.fragment,e),B(K.$$.fragment,e),B(Be.$$.fragment,e),B(Te.$$.fragment,e),B(Ie.$$.fragment,e),B(Pe.$$.fragment,e),B(xe.$$.fragment,e),B(ze.$$.fragment,e),B(te.$$.fragment,e),B(oe.$$.fragment,e),B(Ae.$$.fragment,e),B(ke.$$.fragment,e),B(Me.$$.fragment,e),B(ae.$$.fragment,e),B(se.$$.fragment,e),Kt=!0)},o(e){T(l.$$.fragment,e),T(de.$$.fragment,e),T(ue.$$.fragment,e),T(_e.$$.fragment,e),T(ye.$$.fragment,e),T(we.$$.fragment,e),T(K.$$.fragment,e),T(Be.$$.fragment,e),T(Te.$$.fragment,e),T(Ie.$$.fragment,e),T(Pe.$$.fragment,e),T(xe.$$.fragment,e),T(ze.$$.fragment,e),T(te.$$.fragment,e),T(oe.$$.fragment,e),T(Ae.$$.fragment,e),T(ke.$$.fragment,e),T(Me.$$.fragment,e),T(ae.$$.fragment,e),T(se.$$.fragment,e),Kt=!1},d(e){o(p),e&&o(v),e&&o(_),I(l),e&&o(At),e&&o(q),I(de),e&&o(kt),e&&o(N),e&&o(jt),e&&o(Oe),e&&o(Nt),e&&o(We),e&&o(Mt),e&&o(Ue),e&&o(Ft),e&&o(Ve),e&&o(qt),e&&o(M),e&&o(Rt),e&&o(L),I(ue),e&&o(Lt),e&&o(He),e&&o(Dt),I(_e,e),e&&o(St),e&&o(Ge),e&&o(Ot),e&&o(Ye),e&&o(Wt),e&&o(D),I(ye),e&&o(Ut),e&&o(P),I(we),I(K),e&&o(Vt),e&&o(W),I(Be),e&&o(Ht),e&&o(k),I(Te),I(Ie),e&&o(Gt),e&&o(U),I(Pe),e&&o(Jt),e&&o(j),I(xe),I(ze),I(te),I(oe),e&&o(Yt),e&&o(H),I(Ae),e&&o(Xt),e&&o(x),I(ke),I(Me),I(ae),I(se)}}}const Ja={local:"big-transfer-bit",sections:[{local:"overview",title:"Overview"},{local:"resources",title:"Resources"},{local:"transformers.BitConfig",title:"BitConfig"},{local:"transformers.BitImageProcessor",title:"BitImageProcessor"},{local:"transformers.BitModel",title:"BitModel"},{local:"transformers.BitForImageClassification",title:"BitForImageClassification"}],title:"Big Transfer (BiT)"};function Ya(C){return Da(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class rs extends Fa{constructor(p){super();qa(this,p,Ya,Ga,Ra,{})}}export{rs as default,Ja as metadata};
