import{S as lh,i as dh,s as ch,e as n,k as l,w as b,t as a,M as mh,c as s,d as t,m as d,a as r,x,h as i,b as m,G as e,g as u,y as w,q as y,o as k,B as L,v as hh,L as mr}from"../../chunks/vendor-hf-doc-builder.js";import{T as En}from"../../chunks/Tip-hf-doc-builder.js";import{D as A}from"../../chunks/Docstring-hf-doc-builder.js";import{C as hr}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as Be}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as cr}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function uh(O){let h,$,g,_,T;return _=new hr({props:{code:`0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1
| first sequence    | second sequence |`,highlighted:`0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1 1
| first sequence    | second sequence |`}}),{c(){h=n("p"),$=a("sequence pair mask has the following format:"),g=l(),b(_.$$.fragment)},l(c){h=s(c,"P",{});var f=r(h);$=i(f,"sequence pair mask has the following format:"),f.forEach(t),g=d(c),x(_.$$.fragment,c)},m(c,f){u(c,h,f),e(h,$),u(c,g,f),w(_,c,f),T=!0},p:mr,i(c){T||(y(_.$$.fragment,c),T=!0)},o(c){k(_.$$.fragment,c),T=!1},d(c){c&&t(h),c&&t(g),L(_,c)}}}function ph(O){let h,$,g,_,T;return _=new hr({props:{code:`0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1
| first sequence    | second sequence |`,highlighted:`0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1 1
| first sequence    | second sequence |`}}),{c(){h=n("p"),$=a("sequence pair mask has the following format:"),g=l(),b(_.$$.fragment)},l(c){h=s(c,"P",{});var f=r(h);$=i(f,"sequence pair mask has the following format:"),f.forEach(t),g=d(c),x(_.$$.fragment,c)},m(c,f){u(c,h,f),e(h,$),u(c,g,f),w(_,c,f),T=!0},p:mr,i(c){T||(y(_.$$.fragment,c),T=!0)},o(c){k(_.$$.fragment,c),T=!1},d(c){c&&t(h),c&&t(g),L(_,c)}}}function fh(O){let h,$,g,_,T;return{c(){h=n("p"),$=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n("code"),_=a("Module"),T=a(`
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(c){h=s(c,"P",{});var f=r(h);$=i(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s(f,"CODE",{});var E=r(g);_=i(E,"Module"),E.forEach(t),T=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(t)},m(c,f){u(c,h,f),e(h,$),e(h,g),e(g,_),e(h,T)},d(c){c&&t(h)}}}function gh(O){let h,$,g,_,T;return _=new hr({props:{code:`from transformers import AutoTokenizer, LxmertModel
import torch

tokenizer = AutoTokenizer.from_pretrained("unc-nlp/lxmert-base-uncased")
model = LxmertModel.from_pretrained("unc-nlp/lxmert-base-uncased")

inputs = tokenizer("Hello, my dog is cute", return_tensors="pt")
outputs = model(**inputs)

last_hidden_states = outputs.last_hidden_state`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, LxmertModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;unc-nlp/lxmert-base-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = LxmertModel.from_pretrained(<span class="hljs-string">&quot;unc-nlp/lxmert-base-uncased&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state`}}),{c(){h=n("p"),$=a("Example:"),g=l(),b(_.$$.fragment)},l(c){h=s(c,"P",{});var f=r(h);$=i(f,"Example:"),f.forEach(t),g=d(c),x(_.$$.fragment,c)},m(c,f){u(c,h,f),e(h,$),u(c,g,f),w(_,c,f),T=!0},p:mr,i(c){T||(y(_.$$.fragment,c),T=!0)},o(c){k(_.$$.fragment,c),T=!1},d(c){c&&t(h),c&&t(g),L(_,c)}}}function _h(O){let h,$,g,_,T;return{c(){h=n("p"),$=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n("code"),_=a("Module"),T=a(`
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(c){h=s(c,"P",{});var f=r(h);$=i(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s(f,"CODE",{});var E=r(g);_=i(E,"Module"),E.forEach(t),T=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(t)},m(c,f){u(c,h,f),e(h,$),e(h,g),e(g,_),e(h,T)},d(c){c&&t(h)}}}function vh(O){let h,$,g,_,T;return{c(){h=n("p"),$=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n("code"),_=a("Module"),T=a(`
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(c){h=s(c,"P",{});var f=r(h);$=i(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s(f,"CODE",{});var E=r(g);_=i(E,"Module"),E.forEach(t),T=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(t)},m(c,f){u(c,h,f),e(h,$),e(h,g),e(g,_),e(h,T)},d(c){c&&t(h)}}}function Th(O){let h,$,g,_,T;return _=new hr({props:{code:`from transformers import AutoTokenizer, LxmertForQuestionAnswering
import torch

tokenizer = AutoTokenizer.from_pretrained("unc-nlp/lxmert-base-uncased")
model = LxmertForQuestionAnswering.from_pretrained("unc-nlp/lxmert-base-uncased")

question, text = "Who was Jim Henson?", "Jim Henson was a nice puppet"

inputs = tokenizer(question, text, return_tensors="pt")
with torch.no_grad():
    outputs = model(**inputs)

answer_start_index = outputs.start_logits.argmax()
answer_end_index = outputs.end_logits.argmax()

predict_answer_tokens = inputs.input_ids[0, answer_start_index : answer_end_index + 1]

# target is "nice puppet"
target_start_index = torch.tensor([14])
target_end_index = torch.tensor([15])

outputs = model(**inputs, start_positions=target_start_index, end_positions=target_end_index)
loss = outputs.loss`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, LxmertForQuestionAnswering
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;unc-nlp/lxmert-base-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = LxmertForQuestionAnswering.from_pretrained(<span class="hljs-string">&quot;unc-nlp/lxmert-base-uncased&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>question, text = <span class="hljs-string">&quot;Who was Jim Henson?&quot;</span>, <span class="hljs-string">&quot;Jim Henson was a nice puppet&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(question, text, 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>answer_start_index = outputs.start_logits.argmax()
<span class="hljs-meta">&gt;&gt;&gt; </span>answer_end_index = outputs.end_logits.argmax()

<span class="hljs-meta">&gt;&gt;&gt; </span>predict_answer_tokens = inputs.input_ids[<span class="hljs-number">0</span>, answer_start_index : answer_end_index + <span class="hljs-number">1</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># target is &quot;nice puppet&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>target_start_index = torch.tensor([<span class="hljs-number">14</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>target_end_index = torch.tensor([<span class="hljs-number">15</span>])

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs, start_positions=target_start_index, end_positions=target_end_index)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = outputs.loss`}}),{c(){h=n("p"),$=a("Example:"),g=l(),b(_.$$.fragment)},l(c){h=s(c,"P",{});var f=r(h);$=i(f,"Example:"),f.forEach(t),g=d(c),x(_.$$.fragment,c)},m(c,f){u(c,h,f),e(h,$),u(c,g,f),w(_,c,f),T=!0},p:mr,i(c){T||(y(_.$$.fragment,c),T=!0)},o(c){k(_.$$.fragment,c),T=!1},d(c){c&&t(h),c&&t(g),L(_,c)}}}function bh(O){let h,$,g,_,T,c,f,E,Xe,ze,j,oe,ae,F,He,H,Ue,Ee,R,Ke,ie,le,Ge,qe,V,Je,Me,B,we,Ye,ve,M,D,Pe,N,ye,Ze,de,ke,et,I,Le,ce,Oe,X,me,he,tt,U,ue,pe,ot,Te,P,ne,S,fe,nt;return{c(){h=n("p"),$=a("TensorFlow models and layers in "),g=n("code"),_=a("transformers"),T=a(" accept two formats as input:"),c=l(),f=n("ul"),E=n("li"),Xe=a("having all inputs as keyword arguments (like PyTorch models), or"),ze=l(),j=n("li"),oe=a("having all inputs as a list, tuple or dict in the first positional argument."),ae=l(),F=n("p"),He=a(`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),H=n("code"),Ue=a("model.fit()"),Ee=a(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),R=n("code"),Ke=a("model.fit()"),ie=a(` supports! If, however, you want to use the second
format outside of Keras methods like `),le=n("code"),Ge=a("fit()"),qe=a(" and "),V=n("code"),Je=a("predict()"),Me=a(`, such as when creating your own layers or models with
the Keras `),B=n("code"),we=a("Functional"),Ye=a(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),ve=l(),M=n("ul"),D=n("li"),Pe=a("a single Tensor with "),N=n("code"),ye=a("input_ids"),Ze=a(" only and nothing else: "),de=n("code"),ke=a("model(input_ids)"),et=l(),I=n("li"),Le=a(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),ce=n("code"),Oe=a("model([input_ids, attention_mask])"),X=a(" or "),me=n("code"),he=a("model([input_ids, attention_mask, token_type_ids])"),tt=l(),U=n("li"),ue=a(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),pe=n("code"),ot=a('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),Te=l(),P=n("p"),ne=a(`Note that when creating models and layers with
`),S=n("a"),fe=a("subclassing"),nt=a(` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),this.h()},l(v){h=s(v,"P",{});var z=r(h);$=i(z,"TensorFlow models and layers in "),g=s(z,"CODE",{});var at=r(g);_=i(at,"transformers"),at.forEach(t),T=i(z," accept two formats as input:"),z.forEach(t),c=d(v),f=s(v,"UL",{});var se=r(f);E=s(se,"LI",{});var st=r(E);Xe=i(st,"having all inputs as keyword arguments (like PyTorch models), or"),st.forEach(t),ze=d(se),j=s(se,"LI",{});var Ae=r(j);oe=i(Ae,"having all inputs as a list, tuple or dict in the first positional argument."),Ae.forEach(t),se.forEach(t),ae=d(v),F=s(v,"P",{});var q=r(F);He=i(q,`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),H=s(q,"CODE",{});var it=r(H);Ue=i(it,"model.fit()"),it.forEach(t),Ee=i(q,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),R=s(q,"CODE",{});var ge=r(R);Ke=i(ge,"model.fit()"),ge.forEach(t),ie=i(q,` supports! If, however, you want to use the second
format outside of Keras methods like `),le=s(q,"CODE",{});var be=r(le);Ge=i(be,"fit()"),be.forEach(t),qe=i(q," and "),V=s(q,"CODE",{});var rt=r(V);Je=i(rt,"predict()"),rt.forEach(t),Me=i(q,`, such as when creating your own layers or models with
the Keras `),B=s(q,"CODE",{});var $e=r(B);we=i($e,"Functional"),$e.forEach(t),Ye=i(q,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),q.forEach(t),ve=d(v),M=s(v,"UL",{});var K=r(M);D=s(K,"LI",{});var G=r(D);Pe=i(G,"a single Tensor with "),N=s(G,"CODE",{});var pt=r(N);ye=i(pt,"input_ids"),pt.forEach(t),Ze=i(G," only and nothing else: "),de=s(G,"CODE",{});var lt=r(de);ke=i(lt,"model(input_ids)"),lt.forEach(t),G.forEach(t),et=d(K),I=s(K,"LI",{});var C=r(I);Le=i(C,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),ce=s(C,"CODE",{});var Fe=r(ce);Oe=i(Fe,"model([input_ids, attention_mask])"),Fe.forEach(t),X=i(C," or "),me=s(C,"CODE",{});var ft=r(me);he=i(ft,"model([input_ids, attention_mask, token_type_ids])"),ft.forEach(t),C.forEach(t),tt=d(K),U=s(K,"LI",{});var Q=r(U);ue=i(Q,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),pe=s(Q,"CODE",{});var gt=r(pe);ot=i(gt,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),gt.forEach(t),Q.forEach(t),K.forEach(t),Te=d(v),P=s(v,"P",{});var re=r(P);ne=i(re,`Note that when creating models and layers with
`),S=s(re,"A",{href:!0,rel:!0});var _t=r(S);fe=i(_t,"subclassing"),_t.forEach(t),nt=i(re,` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),re.forEach(t),this.h()},h(){m(S,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),m(S,"rel","nofollow")},m(v,z){u(v,h,z),e(h,$),e(h,g),e(g,_),e(h,T),u(v,c,z),u(v,f,z),e(f,E),e(E,Xe),e(f,ze),e(f,j),e(j,oe),u(v,ae,z),u(v,F,z),e(F,He),e(F,H),e(H,Ue),e(F,Ee),e(F,R),e(R,Ke),e(F,ie),e(F,le),e(le,Ge),e(F,qe),e(F,V),e(V,Je),e(F,Me),e(F,B),e(B,we),e(F,Ye),u(v,ve,z),u(v,M,z),e(M,D),e(D,Pe),e(D,N),e(N,ye),e(D,Ze),e(D,de),e(de,ke),e(M,et),e(M,I),e(I,Le),e(I,ce),e(ce,Oe),e(I,X),e(I,me),e(me,he),e(M,tt),e(M,U),e(U,ue),e(U,pe),e(pe,ot),u(v,Te,z),u(v,P,z),e(P,ne),e(P,S),e(S,fe),e(P,nt)},d(v){v&&t(h),v&&t(c),v&&t(f),v&&t(ae),v&&t(F),v&&t(ve),v&&t(M),v&&t(Te),v&&t(P)}}}function xh(O){let h,$,g,_,T;return{c(){h=n("p"),$=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n("code"),_=a("Module"),T=a(`
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(c){h=s(c,"P",{});var f=r(h);$=i(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s(f,"CODE",{});var E=r(g);_=i(E,"Module"),E.forEach(t),T=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(t)},m(c,f){u(c,h,f),e(h,$),e(h,g),e(g,_),e(h,T)},d(c){c&&t(h)}}}function wh(O){let h,$,g,_,T;return _=new hr({props:{code:`from transformers import AutoTokenizer, TFLxmertModel
import tensorflow as tf

tokenizer = AutoTokenizer.from_pretrained("unc-nlp/lxmert-base-uncased")
model = TFLxmertModel.from_pretrained("unc-nlp/lxmert-base-uncased")

inputs = tokenizer("Hello, my dog is cute", return_tensors="tf")
outputs = model(inputs)

last_hidden_states = outputs.last_hidden_state`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, TFLxmertModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;unc-nlp/lxmert-base-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFLxmertModel.from_pretrained(<span class="hljs-string">&quot;unc-nlp/lxmert-base-uncased&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state`}}),{c(){h=n("p"),$=a("Example:"),g=l(),b(_.$$.fragment)},l(c){h=s(c,"P",{});var f=r(h);$=i(f,"Example:"),f.forEach(t),g=d(c),x(_.$$.fragment,c)},m(c,f){u(c,h,f),e(h,$),u(c,g,f),w(_,c,f),T=!0},p:mr,i(c){T||(y(_.$$.fragment,c),T=!0)},o(c){k(_.$$.fragment,c),T=!1},d(c){c&&t(h),c&&t(g),L(_,c)}}}function yh(O){let h,$,g,_,T,c,f,E,Xe,ze,j,oe,ae,F,He,H,Ue,Ee,R,Ke,ie,le,Ge,qe,V,Je,Me,B,we,Ye,ve,M,D,Pe,N,ye,Ze,de,ke,et,I,Le,ce,Oe,X,me,he,tt,U,ue,pe,ot,Te,P,ne,S,fe,nt;return{c(){h=n("p"),$=a("TensorFlow models and layers in "),g=n("code"),_=a("transformers"),T=a(" accept two formats as input:"),c=l(),f=n("ul"),E=n("li"),Xe=a("having all inputs as keyword arguments (like PyTorch models), or"),ze=l(),j=n("li"),oe=a("having all inputs as a list, tuple or dict in the first positional argument."),ae=l(),F=n("p"),He=a(`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),H=n("code"),Ue=a("model.fit()"),Ee=a(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),R=n("code"),Ke=a("model.fit()"),ie=a(` supports! If, however, you want to use the second
format outside of Keras methods like `),le=n("code"),Ge=a("fit()"),qe=a(" and "),V=n("code"),Je=a("predict()"),Me=a(`, such as when creating your own layers or models with
the Keras `),B=n("code"),we=a("Functional"),Ye=a(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),ve=l(),M=n("ul"),D=n("li"),Pe=a("a single Tensor with "),N=n("code"),ye=a("input_ids"),Ze=a(" only and nothing else: "),de=n("code"),ke=a("model(input_ids)"),et=l(),I=n("li"),Le=a(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),ce=n("code"),Oe=a("model([input_ids, attention_mask])"),X=a(" or "),me=n("code"),he=a("model([input_ids, attention_mask, token_type_ids])"),tt=l(),U=n("li"),ue=a(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),pe=n("code"),ot=a('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),Te=l(),P=n("p"),ne=a(`Note that when creating models and layers with
`),S=n("a"),fe=a("subclassing"),nt=a(` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),this.h()},l(v){h=s(v,"P",{});var z=r(h);$=i(z,"TensorFlow models and layers in "),g=s(z,"CODE",{});var at=r(g);_=i(at,"transformers"),at.forEach(t),T=i(z," accept two formats as input:"),z.forEach(t),c=d(v),f=s(v,"UL",{});var se=r(f);E=s(se,"LI",{});var st=r(E);Xe=i(st,"having all inputs as keyword arguments (like PyTorch models), or"),st.forEach(t),ze=d(se),j=s(se,"LI",{});var Ae=r(j);oe=i(Ae,"having all inputs as a list, tuple or dict in the first positional argument."),Ae.forEach(t),se.forEach(t),ae=d(v),F=s(v,"P",{});var q=r(F);He=i(q,`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),H=s(q,"CODE",{});var it=r(H);Ue=i(it,"model.fit()"),it.forEach(t),Ee=i(q,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),R=s(q,"CODE",{});var ge=r(R);Ke=i(ge,"model.fit()"),ge.forEach(t),ie=i(q,` supports! If, however, you want to use the second
format outside of Keras methods like `),le=s(q,"CODE",{});var be=r(le);Ge=i(be,"fit()"),be.forEach(t),qe=i(q," and "),V=s(q,"CODE",{});var rt=r(V);Je=i(rt,"predict()"),rt.forEach(t),Me=i(q,`, such as when creating your own layers or models with
the Keras `),B=s(q,"CODE",{});var $e=r(B);we=i($e,"Functional"),$e.forEach(t),Ye=i(q,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),q.forEach(t),ve=d(v),M=s(v,"UL",{});var K=r(M);D=s(K,"LI",{});var G=r(D);Pe=i(G,"a single Tensor with "),N=s(G,"CODE",{});var pt=r(N);ye=i(pt,"input_ids"),pt.forEach(t),Ze=i(G," only and nothing else: "),de=s(G,"CODE",{});var lt=r(de);ke=i(lt,"model(input_ids)"),lt.forEach(t),G.forEach(t),et=d(K),I=s(K,"LI",{});var C=r(I);Le=i(C,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),ce=s(C,"CODE",{});var Fe=r(ce);Oe=i(Fe,"model([input_ids, attention_mask])"),Fe.forEach(t),X=i(C," or "),me=s(C,"CODE",{});var ft=r(me);he=i(ft,"model([input_ids, attention_mask, token_type_ids])"),ft.forEach(t),C.forEach(t),tt=d(K),U=s(K,"LI",{});var Q=r(U);ue=i(Q,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),pe=s(Q,"CODE",{});var gt=r(pe);ot=i(gt,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),gt.forEach(t),Q.forEach(t),K.forEach(t),Te=d(v),P=s(v,"P",{});var re=r(P);ne=i(re,`Note that when creating models and layers with
`),S=s(re,"A",{href:!0,rel:!0});var _t=r(S);fe=i(_t,"subclassing"),_t.forEach(t),nt=i(re,` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),re.forEach(t),this.h()},h(){m(S,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),m(S,"rel","nofollow")},m(v,z){u(v,h,z),e(h,$),e(h,g),e(g,_),e(h,T),u(v,c,z),u(v,f,z),e(f,E),e(E,Xe),e(f,ze),e(f,j),e(j,oe),u(v,ae,z),u(v,F,z),e(F,He),e(F,H),e(H,Ue),e(F,Ee),e(F,R),e(R,Ke),e(F,ie),e(F,le),e(le,Ge),e(F,qe),e(F,V),e(V,Je),e(F,Me),e(F,B),e(B,we),e(F,Ye),u(v,ve,z),u(v,M,z),e(M,D),e(D,Pe),e(D,N),e(N,ye),e(D,Ze),e(D,de),e(de,ke),e(M,et),e(M,I),e(I,Le),e(I,ce),e(ce,Oe),e(I,X),e(I,me),e(me,he),e(M,tt),e(M,U),e(U,ue),e(U,pe),e(pe,ot),u(v,Te,z),u(v,P,z),e(P,ne),e(P,S),e(S,fe),e(P,nt)},d(v){v&&t(h),v&&t(c),v&&t(f),v&&t(ae),v&&t(F),v&&t(ve),v&&t(M),v&&t(Te),v&&t(P)}}}function kh(O){let h,$,g,_,T;return{c(){h=n("p"),$=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n("code"),_=a("Module"),T=a(`
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(c){h=s(c,"P",{});var f=r(h);$=i(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s(f,"CODE",{});var E=r(g);_=i(E,"Module"),E.forEach(t),T=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(t)},m(c,f){u(c,h,f),e(h,$),e(h,g),e(g,_),e(h,T)},d(c){c&&t(h)}}}function Lh(O){let h,$,g,_,T,c,f,E,Xe,ze,j,oe,ae,F,He,H,Ue,Ee,R,Ke,ie,le,Ge,qe,V,Je,Me,B,we,Ye,ve,M,D,Pe,N,ye,Ze,de,ke,et,I,Le,ce,Oe,X,me,he,tt,U,ue,pe,ot,Te,P,ne,S,fe,nt,v,z,at,se,st,Ae,q,it,ge,be,rt,$e,K,G,pt,lt,C,Fe,ft,Q,gt,re,_t,ba,qn,xa,wa,po,ya,ka,La,vt,$a,Mn,Fa,za,Pn,Ea,qa,ur,Tt,It,ms,fo,Ma,hs,Pa,pr,W,go,Oa,us,Aa,Ca,_o,Na,On,ja,Da,Ia,dt,vo,Sa,ps,Ra,Qa,To,An,Wa,fs,Va,Ba,Cn,Xa,gs,Ha,Ua,St,bo,Ka,_s,Ga,Ja,Ce,xo,Ya,vs,Za,ei,Rt,ti,bt,oi,Ts,ni,si,bs,ri,ai,ii,Qt,wo,li,yo,di,xs,ci,mi,fr,xt,Wt,ws,ko,hi,ys,ui,gr,_e,Lo,pi,$o,fi,ks,gi,_i,vi,Fo,Ti,Nn,bi,xi,wi,ct,zo,yi,Ls,ki,Li,Eo,jn,$i,$s,Fi,zi,Dn,Ei,Fs,qi,Mi,Ne,qo,Pi,zs,Oi,Ai,Vt,Ci,wt,Ni,Es,ji,Di,qs,Ii,Si,_r,yt,Bt,Ms,Mo,Ri,Ps,Qi,vr,kt,Po,Wi,Os,Vi,Tr,Lt,Oo,Bi,Ao,Xi,In,Hi,Ui,br,$t,Co,Ki,No,Gi,Sn,Ji,Yi,xr,Ft,jo,Zi,As,el,wr,zt,Do,tl,Io,ol,Rn,nl,sl,yr,Et,Xt,Cs,So,rl,Ns,al,kr,J,Ro,il,js,ll,dl,Qo,cl,Wo,ml,hl,ul,Vo,pl,Qn,fl,gl,_l,Bo,vl,Xo,Tl,bl,xl,je,Ho,wl,qt,yl,Wn,kl,Ll,Ds,$l,Fl,zl,Ht,El,Ut,Lr,Mt,Kt,Is,Uo,ql,Ss,Ml,$r,Y,Ko,Pl,Rs,Ol,Al,Go,Cl,Jo,Nl,jl,Dl,Yo,Il,Vn,Sl,Rl,Ql,Zo,Wl,en,Vl,Bl,Xl,mt,tn,Hl,Pt,Ul,Bn,Kl,Gl,Qs,Jl,Yl,Zl,Gt,Fr,Ot,Jt,Ws,on,ed,Vs,td,zr,Z,nn,od,Bs,nd,sd,sn,rd,rn,ad,id,ld,an,dd,Xn,cd,md,hd,ln,ud,dn,pd,fd,gd,De,cn,_d,At,vd,Hn,Td,bd,Xs,xd,wd,yd,Yt,kd,Zt,Er,Ct,eo,Hs,mn,Ld,Us,$d,qr,ee,hn,Fd,Ks,zd,Ed,un,qd,pn,Md,Pd,Od,fn,Ad,gn,Cd,Nd,jd,to,Dd,Ie,_n,Id,Nt,Sd,Un,Rd,Qd,Gs,Wd,Vd,Bd,oo,Xd,no,Mr,jt,so,Js,vn,Hd,Ys,Ud,Pr,te,Tn,Kd,bn,Gd,Zs,Jd,Yd,Zd,xn,ec,wn,tc,oc,nc,yn,sc,kn,rc,ac,ic,ro,lc,ht,Ln,dc,Dt,cc,Kn,mc,hc,er,uc,pc,fc,ao,Or;return c=new Be({}),F=new Be({}),fe=new Be({}),$e=new Be({}),Fe=new A({props:{name:"class transformers.LxmertConfig",anchor:"transformers.LxmertConfig",parameters:[{name:"vocab_size",val:" = 30522"},{name:"hidden_size",val:" = 768"},{name:"num_attention_heads",val:" = 12"},{name:"num_qa_labels",val:" = 9500"},{name:"num_object_labels",val:" = 1600"},{name:"num_attr_labels",val:" = 400"},{name:"intermediate_size",val:" = 3072"},{name:"hidden_act",val:" = 'gelu'"},{name:"hidden_dropout_prob",val:" = 0.1"},{name:"attention_probs_dropout_prob",val:" = 0.1"},{name:"max_position_embeddings",val:" = 512"},{name:"type_vocab_size",val:" = 2"},{name:"initializer_range",val:" = 0.02"},{name:"layer_norm_eps",val:" = 1e-12"},{name:"l_layers",val:" = 9"},{name:"x_layers",val:" = 5"},{name:"r_layers",val:" = 5"},{name:"visual_feat_dim",val:" = 2048"},{name:"visual_pos_dim",val:" = 4"},{name:"visual_loss_normalizer",val:" = 6.67"},{name:"task_matched",val:" = True"},{name:"task_mask_lm",val:" = True"},{name:"task_obj_predict",val:" = True"},{name:"task_qa",val:" = True"},{name:"visual_obj_loss",val:" = True"},{name:"visual_attr_loss",val:" = True"},{name:"visual_feat_loss",val:" = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.LxmertConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 30522) &#x2014;
Vocabulary size of the LXMERT model. Defines the number of different tokens that can be represented by the
<code>inputs_ids</code> passed when calling <a href="/docs/transformers/v4.27.1/en/model_doc/lxmert#transformers.LxmertModel">LxmertModel</a> or <a href="/docs/transformers/v4.27.1/en/model_doc/lxmert#transformers.TFLxmertModel">TFLxmertModel</a>.`,name:"vocab_size"},{anchor:"transformers.LxmertConfig.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.LxmertConfig.r_layers",description:`<strong>r_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 5) &#x2014;
Number of hidden layers in the Transformer visual encoder.`,name:"r_layers"},{anchor:"transformers.LxmertConfig.l_layers",description:`<strong>l_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 9) &#x2014;
Number of hidden layers in the Transformer language encoder.`,name:"l_layers"},{anchor:"transformers.LxmertConfig.x_layers",description:`<strong>x_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 5) &#x2014;
Number of hidden layers in the Transformer cross modality encoder.`,name:"x_layers"},{anchor:"transformers.LxmertConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 5) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"num_attention_heads"},{anchor:"transformers.LxmertConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 3072) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (often named feed-forward) layer in the Transformer encoder.`,name:"intermediate_size"},{anchor:"transformers.LxmertConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>Callable</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;silu&quot;</code> and <code>&quot;gelu_new&quot;</code> are supported.`,name:"hidden_act"},{anchor:"transformers.LxmertConfig.hidden_dropout_prob",description:`<strong>hidden_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout probability for all fully connected layers in the embeddings, encoder, and pooler.`,name:"hidden_dropout_prob"},{anchor:"transformers.LxmertConfig.attention_probs_dropout_prob",description:`<strong>attention_probs_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout ratio for the attention probabilities.`,name:"attention_probs_dropout_prob"},{anchor:"transformers.LxmertConfig.max_position_embeddings",description:`<strong>max_position_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
The maximum sequence length that this model might ever be used with. Typically set this to something large
just in case (e.g., 512 or 1024 or 2048).`,name:"max_position_embeddings"},{anchor:"transformers.LxmertConfig.type_vocab_size",description:`<strong>type_vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014;
The vocabulary size of the <em>token_type_ids</em> passed into <a href="/docs/transformers/v4.27.1/en/model_doc/bert#transformers.BertModel">BertModel</a>.`,name:"type_vocab_size"},{anchor:"transformers.LxmertConfig.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.LxmertConfig.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.LxmertConfig.visual_feat_dim",description:`<strong>visual_feat_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 2048) &#x2014;
This represents the last dimension of the pooled-object features used as input for the model, representing
the size of each object feature itself.`,name:"visual_feat_dim"},{anchor:"transformers.LxmertConfig.visual_pos_dim",description:`<strong>visual_pos_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 4) &#x2014;
This represents the number of spacial features that are mixed into the visual features. The default is set
to 4 because most commonly this will represent the location of a bounding box. i.e., (x, y, width, height)`,name:"visual_pos_dim"},{anchor:"transformers.LxmertConfig.visual_loss_normalizer",description:`<strong>visual_loss_normalizer</strong> (<code>float</code>, <em>optional</em>, defaults to 1/15) &#x2014;
This represents the scaling factor in which each visual loss is multiplied by if during pretraining, one
decided to train with multiple vision-based loss objectives.`,name:"visual_loss_normalizer"},{anchor:"transformers.LxmertConfig.num_qa_labels",description:`<strong>num_qa_labels</strong> (<code>int</code>, <em>optional</em>, defaults to 9500) &#x2014;
This represents the total number of different question answering (QA) labels there are. If using more than
one dataset with QA, the user will need to account for the total number of labels that all of the datasets
have in total.`,name:"num_qa_labels"},{anchor:"transformers.LxmertConfig.num_object_labels",description:`<strong>num_object_labels</strong> (<code>int</code>, <em>optional</em>, defaults to 1600) &#x2014;
This represents the total number of semantically unique objects that lxmert will be able to classify a
pooled-object feature as belonging too.`,name:"num_object_labels"},{anchor:"transformers.LxmertConfig.num_attr_labels",description:`<strong>num_attr_labels</strong> (<code>int</code>, <em>optional</em>, defaults to 400) &#x2014;
This represents the total number of semantically unique attributes that lxmert will be able to classify a
pooled-object feature as possessing.`,name:"num_attr_labels"},{anchor:"transformers.LxmertConfig.task_matched",description:`<strong>task_matched</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
This task is used for sentence-image matching. If the sentence correctly describes the image the label will
be 1. If the sentence does not correctly describe the image, the label will be 0.`,name:"task_matched"},{anchor:"transformers.LxmertConfig.task_mask_lm",description:`<strong>task_mask_lm</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to add masked language modeling (as used in pretraining models such as BERT) to the loss
objective.`,name:"task_mask_lm"},{anchor:"transformers.LxmertConfig.task_obj_predict",description:`<strong>task_obj_predict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to add object prediction, attribute prediction and feature regression to the loss objective.`,name:"task_obj_predict"},{anchor:"transformers.LxmertConfig.task_qa",description:`<strong>task_qa</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to add the question-answering loss to the objective`,name:"task_qa"},{anchor:"transformers.LxmertConfig.visual_obj_loss",description:`<strong>visual_obj_loss</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to calculate the object-prediction loss objective`,name:"visual_obj_loss"},{anchor:"transformers.LxmertConfig.visual_attr_loss",description:`<strong>visual_attr_loss</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to calculate the attribute-prediction loss objective`,name:"visual_attr_loss"},{anchor:"transformers.LxmertConfig.visual_feat_loss",description:`<strong>visual_feat_loss</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to calculate the feature-regression loss objective`,name:"visual_feat_loss"},{anchor:"transformers.LxmertConfig.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the model should return the attentions from the vision, language, and cross-modality layers
should be returned.`,name:"output_attentions"},{anchor:"transformers.LxmertConfig.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the model should return the hidden states from the vision, language, and cross-modality
layers should be returned.`,name:"output_hidden_states"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/lxmert/configuration_lxmert.py#L29"}}),fo=new Be({}),go=new A({props:{name:"class transformers.LxmertTokenizer",anchor:"transformers.LxmertTokenizer",parameters:[{name:"vocab_file",val:""},{name:"do_lower_case",val:" = True"},{name:"do_basic_tokenize",val:" = True"},{name:"never_split",val:" = None"},{name:"unk_token",val:" = '[UNK]'"},{name:"sep_token",val:" = '[SEP]'"},{name:"pad_token",val:" = '[PAD]'"},{name:"cls_token",val:" = '[CLS]'"},{name:"mask_token",val:" = '[MASK]'"},{name:"tokenize_chinese_chars",val:" = True"},{name:"strip_accents",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.LxmertTokenizer.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
File containing the vocabulary.`,name:"vocab_file"},{anchor:"transformers.LxmertTokenizer.do_lower_case",description:`<strong>do_lower_case</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to lowercase the input when tokenizing.`,name:"do_lower_case"},{anchor:"transformers.LxmertTokenizer.do_basic_tokenize",description:`<strong>do_basic_tokenize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to do basic tokenization before WordPiece.`,name:"do_basic_tokenize"},{anchor:"transformers.LxmertTokenizer.never_split",description:`<strong>never_split</strong> (<code>Iterable</code>, <em>optional</em>) &#x2014;
Collection of tokens which will never be split during tokenization. Only has an effect when
<code>do_basic_tokenize=True</code>`,name:"never_split"},{anchor:"transformers.LxmertTokenizer.unk_token",description:`<strong>unk_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[UNK]&quot;</code>) &#x2014;
The unknown token. A token that is not in the vocabulary cannot be converted to an ID and is set to be this
token instead.`,name:"unk_token"},{anchor:"transformers.LxmertTokenizer.sep_token",description:`<strong>sep_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[SEP]&quot;</code>) &#x2014;
The separator token, which is used when building a sequence from multiple sequences, e.g. two sequences for
sequence classification or for a text and a question for question answering. It is also used as the last
token of a sequence built with special tokens.`,name:"sep_token"},{anchor:"transformers.LxmertTokenizer.pad_token",description:`<strong>pad_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[PAD]&quot;</code>) &#x2014;
The token used for padding, for example when batching sequences of different lengths.`,name:"pad_token"},{anchor:"transformers.LxmertTokenizer.cls_token",description:`<strong>cls_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[CLS]&quot;</code>) &#x2014;
The classifier token which is used when doing sequence classification (classification of the whole sequence
instead of per-token classification). It is the first token of the sequence when built with special tokens.`,name:"cls_token"},{anchor:"transformers.LxmertTokenizer.mask_token",description:`<strong>mask_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[MASK]&quot;</code>) &#x2014;
The token used for masking values. This is the token used when training this model with masked language
modeling. This is the token which the model will try to predict.`,name:"mask_token"},{anchor:"transformers.LxmertTokenizer.tokenize_chinese_chars",description:`<strong>tokenize_chinese_chars</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to tokenize Chinese characters.</p>
<p>This should likely be deactivated for Japanese (see this
<a href="https://github.com/huggingface/transformers/issues/328" rel="nofollow">issue</a>).`,name:"tokenize_chinese_chars"},{anchor:"transformers.LxmertTokenizer.strip_accents",description:`<strong>strip_accents</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to strip all accents. If this option is not specified, then it will be determined by the
value for <code>lowercase</code> (as in the original Lxmert).`,name:"strip_accents"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/lxmert/tokenization_lxmert.py#L67"}}),vo=new A({props:{name:"build_inputs_with_special_tokens",anchor:"transformers.LxmertTokenizer.build_inputs_with_special_tokens",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"}],parametersDescription:[{anchor:"transformers.LxmertTokenizer.build_inputs_with_special_tokens.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs to which the special tokens will be added.`,name:"token_ids_0"},{anchor:"transformers.LxmertTokenizer.build_inputs_with_special_tokens.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/lxmert/tokenization_lxmert.py#L197",returnDescription:`
<p>List of <a href="../glossary#input-ids">input IDs</a> with the appropriate special tokens.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),bo=new A({props:{name:"convert_tokens_to_string",anchor:"transformers.LxmertTokenizer.convert_tokens_to_string",parameters:[{name:"tokens",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/lxmert/tokenization_lxmert.py#L192"}}),xo=new A({props:{name:"create_token_type_ids_from_sequences",anchor:"transformers.LxmertTokenizer.create_token_type_ids_from_sequences",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"}],parametersDescription:[{anchor:"transformers.LxmertTokenizer.create_token_type_ids_from_sequences.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs.`,name:"token_ids_0"},{anchor:"transformers.LxmertTokenizer.create_token_type_ids_from_sequences.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/lxmert/tokenization_lxmert.py#L250",returnDescription:`
<p>List of <a href="../glossary#token-type-ids">token type IDs</a> according to the given sequence(s).</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),Rt=new cr({props:{anchor:"transformers.LxmertTokenizer.create_token_type_ids_from_sequences.example",$$slots:{default:[uh]},$$scope:{ctx:O}}}),wo=new A({props:{name:"get_special_tokens_mask",anchor:"transformers.LxmertTokenizer.get_special_tokens_mask",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"},{name:"already_has_special_tokens",val:": bool = False"}],parametersDescription:[{anchor:"transformers.LxmertTokenizer.get_special_tokens_mask.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs.`,name:"token_ids_0"},{anchor:"transformers.LxmertTokenizer.get_special_tokens_mask.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"},{anchor:"transformers.LxmertTokenizer.get_special_tokens_mask.already_has_special_tokens",description:`<strong>already_has_special_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the token list is already formatted with special tokens for the model.`,name:"already_has_special_tokens"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/lxmert/tokenization_lxmert.py#L222",returnDescription:`
<p>A list of integers in the range [0, 1]: 1 for a special token, 0 for a sequence token.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),ko=new Be({}),Lo=new A({props:{name:"class transformers.LxmertTokenizerFast",anchor:"transformers.LxmertTokenizerFast",parameters:[{name:"vocab_file",val:" = None"},{name:"tokenizer_file",val:" = None"},{name:"do_lower_case",val:" = True"},{name:"unk_token",val:" = '[UNK]'"},{name:"sep_token",val:" = '[SEP]'"},{name:"pad_token",val:" = '[PAD]'"},{name:"cls_token",val:" = '[CLS]'"},{name:"mask_token",val:" = '[MASK]'"},{name:"tokenize_chinese_chars",val:" = True"},{name:"strip_accents",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.LxmertTokenizerFast.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
File containing the vocabulary.`,name:"vocab_file"},{anchor:"transformers.LxmertTokenizerFast.do_lower_case",description:`<strong>do_lower_case</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to lowercase the input when tokenizing.`,name:"do_lower_case"},{anchor:"transformers.LxmertTokenizerFast.unk_token",description:`<strong>unk_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[UNK]&quot;</code>) &#x2014;
The unknown token. A token that is not in the vocabulary cannot be converted to an ID and is set to be this
token instead.`,name:"unk_token"},{anchor:"transformers.LxmertTokenizerFast.sep_token",description:`<strong>sep_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[SEP]&quot;</code>) &#x2014;
The separator token, which is used when building a sequence from multiple sequences, e.g. two sequences for
sequence classification or for a text and a question for question answering. It is also used as the last
token of a sequence built with special tokens.`,name:"sep_token"},{anchor:"transformers.LxmertTokenizerFast.pad_token",description:`<strong>pad_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[PAD]&quot;</code>) &#x2014;
The token used for padding, for example when batching sequences of different lengths.`,name:"pad_token"},{anchor:"transformers.LxmertTokenizerFast.cls_token",description:`<strong>cls_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[CLS]&quot;</code>) &#x2014;
The classifier token which is used when doing sequence classification (classification of the whole sequence
instead of per-token classification). It is the first token of the sequence when built with special tokens.`,name:"cls_token"},{anchor:"transformers.LxmertTokenizerFast.mask_token",description:`<strong>mask_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[MASK]&quot;</code>) &#x2014;
The token used for masking values. This is the token used when training this model with masked language
modeling. This is the token which the model will try to predict.`,name:"mask_token"},{anchor:"transformers.LxmertTokenizerFast.clean_text",description:`<strong>clean_text</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to clean the text before tokenization by removing any control characters and replacing all
whitespaces by the classic one.`,name:"clean_text"},{anchor:"transformers.LxmertTokenizerFast.tokenize_chinese_chars",description:`<strong>tokenize_chinese_chars</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to tokenize Chinese characters. This should likely be deactivated for Japanese (see <a href="https://github.com/huggingface/transformers/issues/328" rel="nofollow">this
issue</a>).`,name:"tokenize_chinese_chars"},{anchor:"transformers.LxmertTokenizerFast.strip_accents",description:`<strong>strip_accents</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to strip all accents. If this option is not specified, then it will be determined by the
value for <code>lowercase</code> (as in the original Lxmert).`,name:"strip_accents"},{anchor:"transformers.LxmertTokenizerFast.wordpieces_prefix",description:`<strong>wordpieces_prefix</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;##&quot;</code>) &#x2014;
The prefix for subwords.`,name:"wordpieces_prefix"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/lxmert/tokenization_lxmert_fast.py#L48"}}),zo=new A({props:{name:"build_inputs_with_special_tokens",anchor:"transformers.LxmertTokenizerFast.build_inputs_with_special_tokens",parameters:[{name:"token_ids_0",val:""},{name:"token_ids_1",val:" = None"}],parametersDescription:[{anchor:"transformers.LxmertTokenizerFast.build_inputs_with_special_tokens.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs to which the special tokens will be added.`,name:"token_ids_0"},{anchor:"transformers.LxmertTokenizerFast.build_inputs_with_special_tokens.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/lxmert/tokenization_lxmert_fast.py#L136",returnDescription:`
<p>List of <a href="../glossary#input-ids">input IDs</a> with the appropriate special tokens.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),qo=new A({props:{name:"create_token_type_ids_from_sequences",anchor:"transformers.LxmertTokenizerFast.create_token_type_ids_from_sequences",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"}],parametersDescription:[{anchor:"transformers.LxmertTokenizerFast.create_token_type_ids_from_sequences.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs.`,name:"token_ids_0"},{anchor:"transformers.LxmertTokenizerFast.create_token_type_ids_from_sequences.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/lxmert/tokenization_lxmert_fast.py#L160",returnDescription:`
<p>List of <a href="../glossary#token-type-ids">token type IDs</a> according to the given sequence(s).</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),Vt=new cr({props:{anchor:"transformers.LxmertTokenizerFast.create_token_type_ids_from_sequences.example",$$slots:{default:[ph]},$$scope:{ctx:O}}}),Mo=new Be({}),Po=new A({props:{name:"class transformers.models.lxmert.modeling_lxmert.LxmertModelOutput",anchor:"transformers.models.lxmert.modeling_lxmert.LxmertModelOutput",parameters:[{name:"language_output",val:": typing.Optional[torch.FloatTensor] = None"},{name:"vision_output",val:": typing.Optional[torch.FloatTensor] = None"},{name:"pooled_output",val:": typing.Optional[torch.FloatTensor] = None"},{name:"language_hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"vision_hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"language_attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"vision_attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"cross_encoder_attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"}],parametersDescription:[{anchor:"transformers.models.lxmert.modeling_lxmert.LxmertModelOutput.language_output",description:`<strong>language_output</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 language encoder.`,name:"language_output"},{anchor:"transformers.models.lxmert.modeling_lxmert.LxmertModelOutput.vision_output",description:`<strong>vision_output</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 visual encoder.`,name:"vision_output"},{anchor:"transformers.models.lxmert.modeling_lxmert.LxmertModelOutput.pooled_output",description:`<strong>pooled_output</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, hidden_size)</code>) &#x2014;
Last layer hidden-state of the first token of the sequence (classification, CLS, token) further processed
by a Linear layer and a Tanh activation function. The Linear`,name:"pooled_output"},{anchor:"transformers.models.lxmert.modeling_lxmert.LxmertModelOutput.language_hidden_states",description:`<strong>language_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 input features + one for the output of each cross-modality layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.`,name:"language_hidden_states"},{anchor:"transformers.models.lxmert.modeling_lxmert.LxmertModelOutput.vision_hidden_states",description:`<strong>vision_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 input features + one for the output of each cross-modality layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.`,name:"vision_hidden_states"},{anchor:"transformers.models.lxmert.modeling_lxmert.LxmertModelOutput.language_attentions",description:`<strong>language_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>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.`,name:"language_attentions"},{anchor:"transformers.models.lxmert.modeling_lxmert.LxmertModelOutput.vision_attentions",description:`<strong>vision_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>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.`,name:"vision_attentions"},{anchor:"transformers.models.lxmert.modeling_lxmert.LxmertModelOutput.cross_encoder_attentions",description:`<strong>cross_encoder_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>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.`,name:"cross_encoder_attentions"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/lxmert/modeling_lxmert.py#L60"}}),Oo=new A({props:{name:"class transformers.models.lxmert.modeling_lxmert.LxmertForPreTrainingOutput",anchor:"transformers.models.lxmert.modeling_lxmert.LxmertForPreTrainingOutput",parameters:[{name:"loss",val:": typing.Optional[torch.FloatTensor] = None"},{name:"prediction_logits",val:": typing.Optional[torch.FloatTensor] = None"},{name:"cross_relationship_score",val:": typing.Optional[torch.FloatTensor] = None"},{name:"question_answering_score",val:": typing.Optional[torch.FloatTensor] = None"},{name:"language_hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"vision_hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"language_attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"vision_attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"cross_encoder_attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"}],parametersDescription:[{anchor:"transformers.models.lxmert.modeling_lxmert.LxmertForPreTrainingOutput.loss",description:`<strong>loss</strong> (<em>optional</em>, returned when <code>labels</code> is provided, <code>torch.FloatTensor</code> of shape <code>(1,)</code>) &#x2014;
Total loss as the sum of the masked language modeling loss and the next sequence prediction
(classification) loss.`,name:"loss"},{anchor:"transformers.models.lxmert.modeling_lxmert.LxmertForPreTrainingOutput.prediction_logits",description:`<strong>prediction_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) &#x2014;
Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).
cross_relationship_score &#x2014; (<code>torch.FloatTensor</code> of shape <code>(batch_size, 2)</code>):
Prediction scores of the textual matching objective (classification) head (scores of True/False
continuation before SoftMax).
question_answering_score &#x2014; (<code>torch.FloatTensor</code> of shape <code>(batch_size, n_qa_answers)</code>):
Prediction scores of question answering objective (classification).`,name:"prediction_logits"},{anchor:"transformers.models.lxmert.modeling_lxmert.LxmertForPreTrainingOutput.language_hidden_states",description:`<strong>language_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 input features + one for the output of each cross-modality layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.`,name:"language_hidden_states"},{anchor:"transformers.models.lxmert.modeling_lxmert.LxmertForPreTrainingOutput.vision_hidden_states",description:`<strong>vision_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 input features + one for the output of each cross-modality layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.`,name:"vision_hidden_states"},{anchor:"transformers.models.lxmert.modeling_lxmert.LxmertForPreTrainingOutput.language_attentions",description:`<strong>language_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>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.`,name:"language_attentions"},{anchor:"transformers.models.lxmert.modeling_lxmert.LxmertForPreTrainingOutput.vision_attentions",description:`<strong>vision_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>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.`,name:"vision_attentions"},{anchor:"transformers.models.lxmert.modeling_lxmert.LxmertForPreTrainingOutput.cross_encoder_attentions",description:`<strong>cross_encoder_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>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.`,name:"cross_encoder_attentions"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/lxmert/modeling_lxmert.py#L146"}}),Co=new A({props:{name:"class transformers.models.lxmert.modeling_lxmert.LxmertForQuestionAnsweringOutput",anchor:"transformers.models.lxmert.modeling_lxmert.LxmertForQuestionAnsweringOutput",parameters:[{name:"loss",val:": typing.Optional[torch.FloatTensor] = None"},{name:"question_answering_score",val:": typing.Optional[torch.FloatTensor] = None"},{name:"language_hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"vision_hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"language_attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"vision_attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"cross_encoder_attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"}],parametersDescription:[{anchor:"transformers.models.lxmert.modeling_lxmert.LxmertForQuestionAnsweringOutput.loss",description:`<strong>loss</strong> (<em>optional</em>, returned when <code>labels</code> is provided, <code>torch.FloatTensor</code> of shape <code>(1,)</code>) &#x2014;
Total loss as the sum of the masked language modeling loss and the next sequence prediction
(classification) loss.k.
question_answering_score &#x2014; (<code>torch.FloatTensor</code> of shape <code>(batch_size, n_qa_answers)</code>, <em>optional</em>):
Prediction scores of question answering objective (classification).`,name:"loss"},{anchor:"transformers.models.lxmert.modeling_lxmert.LxmertForQuestionAnsweringOutput.language_hidden_states",description:`<strong>language_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 input features + one for the output of each cross-modality layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.`,name:"language_hidden_states"},{anchor:"transformers.models.lxmert.modeling_lxmert.LxmertForQuestionAnsweringOutput.vision_hidden_states",description:`<strong>vision_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 input features + one for the output of each cross-modality layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.`,name:"vision_hidden_states"},{anchor:"transformers.models.lxmert.modeling_lxmert.LxmertForQuestionAnsweringOutput.language_attentions",description:`<strong>language_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>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.`,name:"language_attentions"},{anchor:"transformers.models.lxmert.modeling_lxmert.LxmertForQuestionAnsweringOutput.vision_attentions",description:`<strong>vision_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>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.`,name:"vision_attentions"},{anchor:"transformers.models.lxmert.modeling_lxmert.LxmertForQuestionAnsweringOutput.cross_encoder_attentions",description:`<strong>cross_encoder_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>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.`,name:"cross_encoder_attentions"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/lxmert/modeling_lxmert.py#L106"}}),jo=new A({props:{name:"class transformers.models.lxmert.modeling_tf_lxmert.TFLxmertModelOutput",anchor:"transformers.models.lxmert.modeling_tf_lxmert.TFLxmertModelOutput",parameters:[{name:"language_output",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"vision_output",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"pooled_output",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"language_hidden_states",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"},{name:"vision_hidden_states",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"},{name:"language_attentions",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"},{name:"vision_attentions",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"},{name:"cross_encoder_attentions",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"}],parametersDescription:[{anchor:"transformers.models.lxmert.modeling_tf_lxmert.TFLxmertModelOutput.language_output",description:`<strong>language_output</strong> (<code>tf.Tensor</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 language encoder.`,name:"language_output"},{anchor:"transformers.models.lxmert.modeling_tf_lxmert.TFLxmertModelOutput.vision_output",description:`<strong>vision_output</strong> (<code>tf.Tensor</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 visual encoder.`,name:"vision_output"},{anchor:"transformers.models.lxmert.modeling_tf_lxmert.TFLxmertModelOutput.pooled_output",description:`<strong>pooled_output</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, hidden_size)</code>) &#x2014;
Last layer hidden-state of the first token of the sequence (classification, CLS, token) further processed
by a Linear layer and a Tanh activation function. The Linear`,name:"pooled_output"},{anchor:"transformers.models.lxmert.modeling_tf_lxmert.TFLxmertModelOutput.language_hidden_states",description:`<strong>language_hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for input features + one for the output of each cross-modality layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.`,name:"language_hidden_states"},{anchor:"transformers.models.lxmert.modeling_tf_lxmert.TFLxmertModelOutput.vision_hidden_states",description:`<strong>vision_hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for input features + one for the output of each cross-modality layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.`,name:"vision_hidden_states"},{anchor:"transformers.models.lxmert.modeling_tf_lxmert.TFLxmertModelOutput.language_attentions",description:`<strong>language_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.`,name:"language_attentions"},{anchor:"transformers.models.lxmert.modeling_tf_lxmert.TFLxmertModelOutput.vision_attentions",description:`<strong>vision_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.`,name:"vision_attentions"},{anchor:"transformers.models.lxmert.modeling_tf_lxmert.TFLxmertModelOutput.cross_encoder_attentions",description:`<strong>cross_encoder_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.`,name:"cross_encoder_attentions"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/lxmert/modeling_tf_lxmert.py#L58"}}),Do=new A({props:{name:"class transformers.models.lxmert.modeling_tf_lxmert.TFLxmertForPreTrainingOutput",anchor:"transformers.models.lxmert.modeling_tf_lxmert.TFLxmertForPreTrainingOutput",parameters:[{name:"loss",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"prediction_logits",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"cross_relationship_score",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"question_answering_score",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"language_hidden_states",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"},{name:"vision_hidden_states",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"},{name:"language_attentions",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"},{name:"vision_attentions",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"},{name:"cross_encoder_attentions",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"}],parametersDescription:[{anchor:"transformers.models.lxmert.modeling_tf_lxmert.TFLxmertForPreTrainingOutput.loss",description:`<strong>loss</strong> (<em>optional</em>, returned when <code>labels</code> is provided, <code>tf.Tensor</code> of shape <code>(1,)</code>) &#x2014;
Total loss as the sum of the masked language modeling loss and the next sequence prediction
(classification) loss.`,name:"loss"},{anchor:"transformers.models.lxmert.modeling_tf_lxmert.TFLxmertForPreTrainingOutput.prediction_logits",description:`<strong>prediction_logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) &#x2014;
Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).
cross_relationship_score &#x2014; (<code>tf.Tensor</code> of shape <code>(batch_size, 2)</code>):
Prediction scores of the textual matching objective (classification) head (scores of True/False
continuation before SoftMax).
question_answering_score &#x2014; (<code>tf.Tensor</code> of shape <code>(batch_size, n_qa_answers)</code>):
Prediction scores of question answering objective (classification).`,name:"prediction_logits"},{anchor:"transformers.models.lxmert.modeling_tf_lxmert.TFLxmertForPreTrainingOutput.language_hidden_states",description:`<strong>language_hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for input features + one for the output of each cross-modality layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.`,name:"language_hidden_states"},{anchor:"transformers.models.lxmert.modeling_tf_lxmert.TFLxmertForPreTrainingOutput.vision_hidden_states",description:`<strong>vision_hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for input features + one for the output of each cross-modality layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.`,name:"vision_hidden_states"},{anchor:"transformers.models.lxmert.modeling_tf_lxmert.TFLxmertForPreTrainingOutput.language_attentions",description:`<strong>language_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.`,name:"language_attentions"},{anchor:"transformers.models.lxmert.modeling_tf_lxmert.TFLxmertForPreTrainingOutput.vision_attentions",description:`<strong>vision_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.`,name:"vision_attentions"},{anchor:"transformers.models.lxmert.modeling_tf_lxmert.TFLxmertForPreTrainingOutput.cross_encoder_attentions",description:`<strong>cross_encoder_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.`,name:"cross_encoder_attentions"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/lxmert/modeling_tf_lxmert.py#L104"}}),So=new Be({}),Ro=new A({props:{name:"class transformers.LxmertModel",anchor:"transformers.LxmertModel",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.LxmertModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/lxmert#transformers.LxmertConfig">LxmertConfig</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/lxmert/modeling_lxmert.py#L883"}}),Ho=new A({props:{name:"forward",anchor:"transformers.LxmertModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"visual_feats",val:": typing.Optional[torch.FloatTensor] = None"},{name:"visual_pos",val:": typing.Optional[torch.FloatTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"visual_attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.LxmertModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>
visual_feats &#x2014; (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_visual_features, visual_feat_dim)</code>):
This input represents visual features. They ROI pooled object features from bounding boxes using a
faster-RCNN model)</p>
<p>These are currently not provided by the transformers library.
visual_pos &#x2014; (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_visual_features, visual_pos_dim)</code>):
This input represents spacial features corresponding to their relative (via index) visual features. The
pre-trained LXMERT model expects these spacial features to be normalized bounding boxes on a scale of 0 to</p>
<ol>
<li></li>
</ol>
<p>These are currently not provided by the transformers library.`,name:"input_ids"},{anchor:"transformers.LxmertModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.LxmertModel.forward.visual_attention_mask",description:`<strong>visual_attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"visual_attention_mask"},{anchor:"transformers.LxmertModel.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.LxmertModel.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.LxmertModel.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.LxmertModel.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.LxmertModel.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/lxmert/modeling_lxmert.py#L898",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/model_doc/lxmert#transformers.models.lxmert.modeling_lxmert.LxmertModelOutput"
>transformers.models.lxmert.modeling_lxmert.LxmertModelOutput</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/lxmert#transformers.LxmertConfig"
>LxmertConfig</a>) and inputs.</p>
<ul>
<li><strong>language_output</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 language encoder.</li>
<li><strong>vision_output</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 visual encoder.</li>
<li><strong>pooled_output</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, hidden_size)</code>) \u2014 Last layer hidden-state of the first token of the sequence (classification, CLS, token) further processed
by a Linear layer and a Tanh activation function. The Linear</li>
<li><strong>language_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 input features + one for the output of each cross-modality layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</li>
<li><strong>vision_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 input features + one for the output of each cross-modality layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</li>
<li><strong>language_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.</li>
<li><strong>vision_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.</li>
<li><strong>cross_encoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/en/model_doc/lxmert#transformers.models.lxmert.modeling_lxmert.LxmertModelOutput"
>transformers.models.lxmert.modeling_lxmert.LxmertModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ht=new En({props:{$$slots:{default:[fh]},$$scope:{ctx:O}}}),Ut=new cr({props:{anchor:"transformers.LxmertModel.forward.example",$$slots:{default:[gh]},$$scope:{ctx:O}}}),Uo=new Be({}),Ko=new A({props:{name:"class transformers.LxmertForPreTraining",anchor:"transformers.LxmertForPreTraining",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.LxmertForPreTraining.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/lxmert#transformers.LxmertConfig">LxmertConfig</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/lxmert/modeling_lxmert.py#L1020"}}),tn=new A({props:{name:"forward",anchor:"transformers.LxmertForPreTraining.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"visual_feats",val:": typing.Optional[torch.FloatTensor] = None"},{name:"visual_pos",val:": typing.Optional[torch.FloatTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"visual_attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"obj_labels",val:": typing.Union[typing.Dict[str, typing.Tuple[torch.FloatTensor, torch.FloatTensor]], NoneType] = None"},{name:"matched_label",val:": typing.Optional[torch.LongTensor] = None"},{name:"ans",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"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.LxmertForPreTraining.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>
visual_feats &#x2014; (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_visual_features, visual_feat_dim)</code>):
This input represents visual features. They ROI pooled object features from bounding boxes using a
faster-RCNN model)</p>
<p>These are currently not provided by the transformers library.
visual_pos &#x2014; (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_visual_features, visual_pos_dim)</code>):
This input represents spacial features corresponding to their relative (via index) visual features. The
pre-trained LXMERT model expects these spacial features to be normalized bounding boxes on a scale of 0 to</p>
<ol>
<li></li>
</ol>
<p>These are currently not provided by the transformers library.`,name:"input_ids"},{anchor:"transformers.LxmertForPreTraining.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.LxmertForPreTraining.forward.visual_attention_mask",description:`<strong>visual_attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"visual_attention_mask"},{anchor:"transformers.LxmertForPreTraining.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.LxmertForPreTraining.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.LxmertForPreTraining.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.LxmertForPreTraining.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.LxmertForPreTraining.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.LxmertForPreTraining.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the masked language modeling loss. Indices should be in <code>[-100, 0, ..., config.vocab_size]</code> (see <code>input_ids</code> docstring) Tokens with indices set to <code>-100</code> are ignored (masked), the
loss is only computed for the tokens with labels in <code>[0, ..., config.vocab_size]</code>
obj_labels &#x2014; (<code>Dict[Str: Tuple[Torch.FloatTensor, Torch.FloatTensor]]</code>, <em>optional</em>):
each key is named after each one of the visual losses and each element of the tuple is of the shape
<code>(batch_size, num_features)</code> and <code>(batch_size, num_features, visual_feature_dim)</code> for each the label id and
the label score respectively`,name:"labels"},{anchor:"transformers.LxmertForPreTraining.forward.matched_label",description:`<strong>matched_label</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the whether or not the text input matches the image (classification) loss. Input
should be a sequence pair (see <code>input_ids</code> docstring) Indices should be in <code>[0, 1]</code>:</p>
<ul>
<li>0 indicates that the sentence does not match the image,</li>
<li>1 indicates that the sentence does match the image.</li>
</ul>`,name:"matched_label"},{anchor:"transformers.LxmertForPreTraining.forward.ans",description:`<strong>ans</strong> (<code>Torch.Tensor</code> of shape <code>(batch_size)</code>, <em>optional</em>) &#x2014;
a one hot representation hof the correct answer <em>optional</em>`,name:"ans"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/lxmert/modeling_lxmert.py#L1149",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/model_doc/lxmert#transformers.models.lxmert.modeling_lxmert.LxmertForPreTrainingOutput"
>transformers.models.lxmert.modeling_lxmert.LxmertForPreTrainingOutput</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/lxmert#transformers.LxmertConfig"
>LxmertConfig</a>) and inputs.</p>
<ul>
<li><strong>loss</strong> (<em>optional</em>, returned when <code>labels</code> is provided, <code>torch.FloatTensor</code> of shape <code>(1,)</code>) \u2014 Total loss as the sum of the masked language modeling loss and the next sequence prediction
(classification) loss.</li>
<li><strong>prediction_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).</li>
<li><strong>cross_relationship_score:</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, 2)</code>) \u2014 Prediction scores of the textual matching objective (classification) head (scores of True/False
continuation before SoftMax).</li>
<li><strong>question_answering_score:</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, n_qa_answers)</code>) \u2014 Prediction scores of question answering objective (classification).</li>
<li><strong>language_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 input features + one for the output of each cross-modality layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</li>
<li><strong>vision_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 input features + one for the output of each cross-modality layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</li>
<li><strong>language_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.</li>
<li><strong>vision_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.</li>
<li><strong>cross_encoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/en/model_doc/lxmert#transformers.models.lxmert.modeling_lxmert.LxmertForPreTrainingOutput"
>transformers.models.lxmert.modeling_lxmert.LxmertForPreTrainingOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Gt=new En({props:{$$slots:{default:[_h]},$$scope:{ctx:O}}}),on=new Be({}),nn=new A({props:{name:"class transformers.LxmertForQuestionAnswering",anchor:"transformers.LxmertForQuestionAnswering",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.LxmertForQuestionAnswering.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/lxmert#transformers.LxmertConfig">LxmertConfig</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/lxmert/modeling_lxmert.py#L1288"}}),cn=new A({props:{name:"forward",anchor:"transformers.LxmertForQuestionAnswering.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"visual_feats",val:": typing.Optional[torch.FloatTensor] = None"},{name:"visual_pos",val:": typing.Optional[torch.FloatTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"visual_attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = 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.LxmertForQuestionAnswering.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>
visual_feats &#x2014; (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_visual_features, visual_feat_dim)</code>):
This input represents visual features. They ROI pooled object features from bounding boxes using a
faster-RCNN model)</p>
<p>These are currently not provided by the transformers library.
visual_pos &#x2014; (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_visual_features, visual_pos_dim)</code>):
This input represents spacial features corresponding to their relative (via index) visual features. The
pre-trained LXMERT model expects these spacial features to be normalized bounding boxes on a scale of 0 to</p>
<ol>
<li></li>
</ol>
<p>These are currently not provided by the transformers library.`,name:"input_ids"},{anchor:"transformers.LxmertForQuestionAnswering.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.LxmertForQuestionAnswering.forward.visual_attention_mask",description:`<strong>visual_attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"visual_attention_mask"},{anchor:"transformers.LxmertForQuestionAnswering.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.LxmertForQuestionAnswering.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.LxmertForQuestionAnswering.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.LxmertForQuestionAnswering.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.LxmertForQuestionAnswering.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.</p>
<p>labels &#x2014; (<code>Torch.Tensor</code> of shape <code>(batch_size)</code>, <em>optional</em>):
A one-hot representation of the correct answer`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/lxmert/modeling_lxmert.py#L1380",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/model_doc/lxmert#transformers.models.lxmert.modeling_lxmert.LxmertForQuestionAnsweringOutput"
>transformers.models.lxmert.modeling_lxmert.LxmertForQuestionAnsweringOutput</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/lxmert#transformers.LxmertConfig"
>LxmertConfig</a>) and inputs.</p>
<ul>
<li><strong>loss</strong> (<em>optional</em>, returned when <code>labels</code> is provided, <code>torch.FloatTensor</code> of shape <code>(1,)</code>) \u2014 Total loss as the sum of the masked language modeling loss and the next sequence prediction
(classification) loss.k.</li>
<li><strong>question_answering_score:</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, n_qa_answers)</code>, <em>optional</em>) \u2014 Prediction scores of question answering objective (classification).</li>
<li><strong>language_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 input features + one for the output of each cross-modality layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</li>
<li><strong>vision_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 input features + one for the output of each cross-modality layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</li>
<li><strong>language_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.</li>
<li><strong>vision_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.</li>
<li><strong>cross_encoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/en/model_doc/lxmert#transformers.models.lxmert.modeling_lxmert.LxmertForQuestionAnsweringOutput"
>transformers.models.lxmert.modeling_lxmert.LxmertForQuestionAnsweringOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Yt=new En({props:{$$slots:{default:[vh]},$$scope:{ctx:O}}}),Zt=new cr({props:{anchor:"transformers.LxmertForQuestionAnswering.forward.example",$$slots:{default:[Th]},$$scope:{ctx:O}}}),mn=new Be({}),hn=new A({props:{name:"class transformers.TFLxmertModel",anchor:"transformers.TFLxmertModel",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFLxmertModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/lxmert#transformers.LxmertConfig">LxmertConfig</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/lxmert/modeling_tf_lxmert.py#L943"}}),to=new En({props:{$$slots:{default:[bh]},$$scope:{ctx:O}}}),_n=new A({props:{name:"call",anchor:"transformers.TFLxmertModel.call",parameters:[{name:"input_ids",val:": typing.Union[typing.List[tensorflow.python.framework.ops.Tensor], typing.List[numpy.ndarray], typing.List[keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, keras.engine.keras_tensor.KerasTensor, NoneType] = None"},{name:"visual_feats",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"visual_pos",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"attention_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"visual_attention_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"token_type_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"inputs_embeds",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"training",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TFLxmertModel.call.input_ids",description:`<strong>input_ids</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>
visual_feats &#x2014; (<code>tf.Tensor</code> of shape <code>(batch_size, num_visual_features, visual_feat_dim)</code>):
This input represents visual features. They ROI pooled object features from bounding boxes using a
faster-RCNN model)</p>
<p>These are currently not provided by the transformers library.
visual_pos &#x2014; (<code>tf.Tensor</code> of shape <code>(batch_size, num_visual_features, visual_feat_dim)</code>):
This input represents spacial features corresponding to their relative (via index) visual features. The
pre-trained LXMERT model expects these spacial features to be normalized bounding boxes on a scale of 0 to</p>
<ol>
<li></li>
</ol>
<p>These are currently not provided by the transformers library.`,name:"input_ids"},{anchor:"transformers.TFLxmertModel.call.attention_mask",description:`<strong>attention_mask</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.TFLxmertModel.call.visual_attention_mask",description:`<strong>visual_attention_mask</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
MMask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"visual_attention_mask"},{anchor:"transformers.TFLxmertModel.call.token_type_ids",description:`<strong>token_type_ids</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.TFLxmertModel.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.TFLxmertModel.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFLxmertModel.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFLxmertModel.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFLxmertModel.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/lxmert/modeling_tf_lxmert.py#L948",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/model_doc/lxmert#transformers.models.lxmert.modeling_tf_lxmert.TFLxmertModelOutput"
>transformers.models.lxmert.modeling_tf_lxmert.TFLxmertModelOutput</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/v4.27.1/en/model_doc/lxmert#transformers.LxmertConfig"
>LxmertConfig</a>) and inputs.</p>
<ul>
<li><strong>language_output</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the language encoder.</li>
<li><strong>vision_output</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the visual encoder.</li>
<li><strong>pooled_output</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, hidden_size)</code>) \u2014 Last layer hidden-state of the first token of the sequence (classification, CLS, token) further processed
by a Linear layer and a Tanh activation function. The Linear</li>
<li><strong>language_hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for input features + one for the output of each cross-modality layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</li>
<li><strong>vision_hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for input features + one for the output of each cross-modality layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</li>
<li><strong>language_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.</li>
<li><strong>vision_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.</li>
<li><strong>cross_encoder_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/en/model_doc/lxmert#transformers.models.lxmert.modeling_tf_lxmert.TFLxmertModelOutput"
>transformers.models.lxmert.modeling_tf_lxmert.TFLxmertModelOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),oo=new En({props:{$$slots:{default:[xh]},$$scope:{ctx:O}}}),no=new cr({props:{anchor:"transformers.TFLxmertModel.call.example",$$slots:{default:[wh]},$$scope:{ctx:O}}}),vn=new Be({}),Tn=new A({props:{name:"class transformers.TFLxmertForPreTraining",anchor:"transformers.TFLxmertForPreTraining",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFLxmertForPreTraining.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/lxmert#transformers.LxmertConfig">LxmertConfig</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/lxmert/modeling_tf_lxmert.py#L1183"}}),ro=new En({props:{$$slots:{default:[yh]},$$scope:{ctx:O}}}),Ln=new A({props:{name:"call",anchor:"transformers.TFLxmertForPreTraining.call",parameters:[{name:"input_ids",val:" = None"},{name:"visual_feats",val:" = None"},{name:"visual_pos",val:" = None"},{name:"attention_mask",val:" = None"},{name:"visual_attention_mask",val:" = None"},{name:"token_type_ids",val:" = None"},{name:"inputs_embeds",val:" = None"},{name:"masked_lm_labels",val:" = None"},{name:"obj_labels",val:" = None"},{name:"matched_label",val:" = None"},{name:"ans",val:" = None"},{name:"output_attentions",val:" = None"},{name:"output_hidden_states",val:" = None"},{name:"return_dict",val:" = None"},{name:"training",val:" = False"}],parametersDescription:[{anchor:"transformers.TFLxmertForPreTraining.call.input_ids",description:`<strong>input_ids</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>
visual_feats &#x2014; (<code>tf.Tensor</code> of shape <code>(batch_size, num_visual_features, visual_feat_dim)</code>):
This input represents visual features. They ROI pooled object features from bounding boxes using a
faster-RCNN model)</p>
<p>These are currently not provided by the transformers library.
visual_pos &#x2014; (<code>tf.Tensor</code> of shape <code>(batch_size, num_visual_features, visual_feat_dim)</code>):
This input represents spacial features corresponding to their relative (via index) visual features. The
pre-trained LXMERT model expects these spacial features to be normalized bounding boxes on a scale of 0 to</p>
<ol>
<li></li>
</ol>
<p>These are currently not provided by the transformers library.`,name:"input_ids"},{anchor:"transformers.TFLxmertForPreTraining.call.attention_mask",description:`<strong>attention_mask</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.TFLxmertForPreTraining.call.visual_attention_mask",description:`<strong>visual_attention_mask</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
MMask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"visual_attention_mask"},{anchor:"transformers.TFLxmertForPreTraining.call.token_type_ids",description:`<strong>token_type_ids</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.TFLxmertForPreTraining.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.TFLxmertForPreTraining.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFLxmertForPreTraining.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFLxmertForPreTraining.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFLxmertForPreTraining.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"},{anchor:"transformers.TFLxmertForPreTraining.call.masked_lm_labels",description:`<strong>masked_lm_labels</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the masked language modeling loss. Indices should be in <code>[-100, 0, ..., config.vocab_size]</code> (see <code>input_ids</code> docstring) Tokens with indices set to <code>-100</code> are ignored (masked), the
loss is only computed for the tokens with labels in <code>[0, ..., config.vocab_size]</code>
obj_labels &#x2014; (<code>Dict[Str: Tuple[tf.Tensor, tf.Tensor]]</code>, <em>optional</em>, defaults to <code>None</code>):
each key is named after each one of the visual losses and each element of the tuple is of the shape
<code>(batch_size, num_features)</code> and <code>(batch_size, num_features, visual_feature_dim)</code> for each the label id and
the label score respectively`,name:"masked_lm_labels"},{anchor:"transformers.TFLxmertForPreTraining.call.matched_label",description:`<strong>matched_label</strong> (<code>tf.Tensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the whether or not the text input matches the image (classification) loss. Input
should be a sequence pair (see <code>input_ids</code> docstring) Indices should be in <code>[0, 1]</code>:</p>
<ul>
<li>0 indicates that the sentence does not match the image,</li>
<li>1 indicates that the sentence does match the image.</li>
</ul>`,name:"matched_label"},{anchor:"transformers.TFLxmertForPreTraining.call.ans",description:`<strong>ans</strong> (<code>Torch.Tensor</code> of shape <code>(batch_size)</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
a one hot representation hof the correct answer <em>optional</em>`,name:"ans"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/lxmert/modeling_tf_lxmert.py#L1283",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/model_doc/lxmert#transformers.models.lxmert.modeling_tf_lxmert.TFLxmertForPreTrainingOutput"
>transformers.models.lxmert.modeling_tf_lxmert.TFLxmertForPreTrainingOutput</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/v4.27.1/en/model_doc/lxmert#transformers.LxmertConfig"
>LxmertConfig</a>) and inputs.</p>
<ul>
<li><strong>loss</strong> (<em>optional</em>, returned when <code>labels</code> is provided, <code>tf.Tensor</code> of shape <code>(1,)</code>) \u2014 Total loss as the sum of the masked language modeling loss and the next sequence prediction
(classification) loss.</li>
<li><strong>prediction_logits</strong> (<code>tf.Tensor</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).</li>
<li><strong>cross_relationship_score:</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, 2)</code>) \u2014 Prediction scores of the textual matching objective (classification) head (scores of True/False
continuation before SoftMax).</li>
<li><strong>question_answering_score:</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, n_qa_answers)</code>) \u2014 Prediction scores of question answering objective (classification).</li>
<li><strong>language_hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for input features + one for the output of each cross-modality layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</li>
<li><strong>vision_hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for input features + one for the output of each cross-modality layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</li>
<li><strong>language_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.</li>
<li><strong>vision_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.</li>
<li><strong>cross_encoder_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/en/model_doc/lxmert#transformers.models.lxmert.modeling_tf_lxmert.TFLxmertForPreTrainingOutput"
>transformers.models.lxmert.modeling_tf_lxmert.TFLxmertForPreTrainingOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),ao=new En({props:{$$slots:{default:[kh]},$$scope:{ctx:O}}}),{c(){h=n("meta"),$=l(),g=n("h1"),_=n("a"),T=n("span"),b(c.$$.fragment),f=l(),E=n("span"),Xe=a("LXMERT"),ze=l(),j=n("h2"),oe=n("a"),ae=n("span"),b(F.$$.fragment),He=l(),H=n("span"),Ue=a("Overview"),Ee=l(),R=n("p"),Ke=a("The LXMERT model was proposed in "),ie=n("a"),le=a("LXMERT: Learning Cross-Modality Encoder Representations from Transformers"),Ge=a(` by Hao Tan & Mohit Bansal. It is a series of bidirectional transformer encoders
(one for the vision modality, one for the language modality, and then one to fuse both modalities) pretrained using a
combination of masked language modeling, visual-language text alignment, ROI-feature regression, masked
visual-attribute modeling, masked visual-object modeling, and visual-question answering objectives. The pretraining
consists of multiple multi-modal datasets: MSCOCO, Visual-Genome + Visual-Genome Question Answering, VQA 2.0, and GQA.`),qe=l(),V=n("p"),Je=a("The abstract from the paper is the following:"),Me=l(),B=n("p"),we=n("em"),Ye=a(`Vision-and-language reasoning requires an understanding of visual concepts, language semantics, and, most importantly,
the alignment and relationships between these two modalities. We thus propose the LXMERT (Learning Cross-Modality
Encoder Representations from Transformers) framework to learn these vision-and-language connections. In LXMERT, we
build a large-scale Transformer model that consists of three encoders: an object relationship encoder, a language
encoder, and a cross-modality encoder. Next, to endow our model with the capability of connecting vision and language
semantics, we pre-train the model with large amounts of image-and-sentence pairs, via five diverse representative
pretraining tasks: masked language modeling, masked object prediction (feature regression and label classification),
cross-modality matching, and image question answering. These tasks help in learning both intra-modality and
cross-modality relationships. After fine-tuning from our pretrained parameters, our model achieves the state-of-the-art
results on two visual question answering datasets (i.e., VQA and GQA). We also show the generalizability of our
pretrained cross-modality model by adapting it to a challenging visual-reasoning task, NLVR, and improve the previous
best result by 22% absolute (54% to 76%). Lastly, we demonstrate detailed ablation studies to prove that both our novel
model components and pretraining strategies significantly contribute to our strong results; and also present several
attention visualizations for the different encoders`),ve=l(),M=n("p"),D=a("Tips:"),Pe=l(),N=n("ul"),ye=n("li"),Ze=a(`Bounding boxes are not necessary to be used in the visual feature embeddings, any kind of visual-spacial features
will work.`),de=l(),ke=n("li"),et=a(`Both the language hidden states and the visual hidden states that LXMERT outputs are passed through the
cross-modality layer, so they contain information from both modalities. To access a modality that only attends to
itself, select the vision/language hidden states from the first input in the tuple.`),I=l(),Le=n("li"),ce=a(`The bidirectional cross-modality encoder attention only returns attention values when the language modality is used
as the input and the vision modality is used as the context vector. Further, while the cross-modality encoder
contains self-attention for each respective modality and cross-attention, only the cross attention is returned and
both self attention outputs are disregarded.`),Oe=l(),X=n("p"),me=a("This model was contributed by "),he=n("a"),tt=a("eltoto1219"),U=a(". The original code can be found "),ue=n("a"),pe=a("here"),ot=a("."),Te=l(),P=n("h2"),ne=n("a"),S=n("span"),b(fe.$$.fragment),nt=l(),v=n("span"),z=a("Documentation resources"),at=l(),se=n("ul"),st=n("li"),Ae=n("a"),q=a("Question answering task guide"),it=l(),ge=n("h2"),be=n("a"),rt=n("span"),b($e.$$.fragment),K=l(),G=n("span"),pt=a("LxmertConfig"),lt=l(),C=n("div"),b(Fe.$$.fragment),ft=l(),Q=n("p"),gt=a("This is the configuration class to store the configuration of a "),re=n("a"),_t=a("LxmertModel"),ba=a(" or a "),qn=n("a"),xa=a("TFLxmertModel"),wa=a(`. It is used
to instantiate a LXMERT 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 Lxmert
`),po=n("a"),ya=a("unc-nlp/lxmert-base-uncased"),ka=a(" architecture."),La=l(),vt=n("p"),$a=a("Configuration objects inherit from "),Mn=n("a"),Fa=a("PretrainedConfig"),za=a(` and can be used to control the model outputs. Read the
documentation from `),Pn=n("a"),Ea=a("PretrainedConfig"),qa=a(" for more information."),ur=l(),Tt=n("h2"),It=n("a"),ms=n("span"),b(fo.$$.fragment),Ma=l(),hs=n("span"),Pa=a("LxmertTokenizer"),pr=l(),W=n("div"),b(go.$$.fragment),Oa=l(),us=n("p"),Aa=a("Construct a Lxmert tokenizer. Based on WordPiece."),Ca=l(),_o=n("p"),Na=a("This tokenizer inherits from "),On=n("a"),ja=a("PreTrainedTokenizer"),Da=a(` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),Ia=l(),dt=n("div"),b(vo.$$.fragment),Sa=l(),ps=n("p"),Ra=a(`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. A Lxmert sequence has the following format:`),Qa=l(),To=n("ul"),An=n("li"),Wa=a("single sequence: "),fs=n("code"),Va=a("[CLS] X [SEP]"),Ba=l(),Cn=n("li"),Xa=a("pair of sequences: "),gs=n("code"),Ha=a("[CLS] A [SEP] B [SEP]"),Ua=l(),St=n("div"),b(bo.$$.fragment),Ka=l(),_s=n("p"),Ga=a("Converts a sequence of tokens (string) in a single string."),Ja=l(),Ce=n("div"),b(xo.$$.fragment),Ya=l(),vs=n("p"),Za=a("Create a mask from the two sequences passed to be used in a sequence-pair classification task. A Lxmert"),ei=l(),b(Rt.$$.fragment),ti=l(),bt=n("p"),oi=a("If "),Ts=n("code"),ni=a("token_ids_1"),si=a(" is "),bs=n("code"),ri=a("None"),ai=a(", this method only returns the first portion of the mask (0s)."),ii=l(),Qt=n("div"),b(wo.$$.fragment),li=l(),yo=n("p"),di=a(`Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),xs=n("code"),ci=a("prepare_for_model"),mi=a(" method."),fr=l(),xt=n("h2"),Wt=n("a"),ws=n("span"),b(ko.$$.fragment),hi=l(),ys=n("span"),ui=a("LxmertTokenizerFast"),gr=l(),_e=n("div"),b(Lo.$$.fragment),pi=l(),$o=n("p"),fi=a("Construct a \u201Cfast\u201D Lxmert tokenizer (backed by HuggingFace\u2019s "),ks=n("em"),gi=a("tokenizers"),_i=a(" library). Based on WordPiece."),vi=l(),Fo=n("p"),Ti=a("This tokenizer inherits from "),Nn=n("a"),bi=a("PreTrainedTokenizerFast"),xi=a(` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),wi=l(),ct=n("div"),b(zo.$$.fragment),yi=l(),Ls=n("p"),ki=a(`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. A Lxmert sequence has the following format:`),Li=l(),Eo=n("ul"),jn=n("li"),$i=a("single sequence: "),$s=n("code"),Fi=a("[CLS] X [SEP]"),zi=l(),Dn=n("li"),Ei=a("pair of sequences: "),Fs=n("code"),qi=a("[CLS] A [SEP] B [SEP]"),Mi=l(),Ne=n("div"),b(qo.$$.fragment),Pi=l(),zs=n("p"),Oi=a("Create a mask from the two sequences passed to be used in a sequence-pair classification task. A Lxmert"),Ai=l(),b(Vt.$$.fragment),Ci=l(),wt=n("p"),Ni=a("If "),Es=n("code"),ji=a("token_ids_1"),Di=a(" is "),qs=n("code"),Ii=a("None"),Si=a(", this method only returns the first portion of the mask (0s)."),_r=l(),yt=n("h2"),Bt=n("a"),Ms=n("span"),b(Mo.$$.fragment),Ri=l(),Ps=n("span"),Qi=a("Lxmert specific outputs"),vr=l(),kt=n("div"),b(Po.$$.fragment),Wi=l(),Os=n("p"),Vi=a(`Lxmert\u2019s outputs that contain the last hidden states, pooled outputs, and attention probabilities for the language,
visual, and, cross-modality encoders. (note: the visual encoder in Lxmert is referred to as the \u201Crelation-ship\u201D
encoder\u201D)`),Tr=l(),Lt=n("div"),b(Oo.$$.fragment),Bi=l(),Ao=n("p"),Xi=a("Output type of "),In=n("a"),Hi=a("LxmertForPreTraining"),Ui=a("."),br=l(),$t=n("div"),b(Co.$$.fragment),Ki=l(),No=n("p"),Gi=a("Output type of "),Sn=n("a"),Ji=a("LxmertForQuestionAnswering"),Yi=a("."),xr=l(),Ft=n("div"),b(jo.$$.fragment),Zi=l(),As=n("p"),el=a(`Lxmert\u2019s outputs that contain the last hidden states, pooled outputs, and attention probabilities for the language,
visual, and, cross-modality encoders. (note: the visual encoder in Lxmert is referred to as the \u201Crelation-ship\u201D
encoder\u201D)`),wr=l(),zt=n("div"),b(Do.$$.fragment),tl=l(),Io=n("p"),ol=a("Output type of "),Rn=n("a"),nl=a("LxmertForPreTraining"),sl=a("."),yr=l(),Et=n("h2"),Xt=n("a"),Cs=n("span"),b(So.$$.fragment),rl=l(),Ns=n("span"),al=a("LxmertModel"),kr=l(),J=n("div"),b(Ro.$$.fragment),il=l(),js=n("p"),ll=a("The bare Lxmert Model transformer outputting raw hidden-states without any specific head on top."),dl=l(),Qo=n("p"),cl=a("The LXMERT model was proposed in "),Wo=n("a"),ml=a(`LXMERT: Learning Cross-Modality Encoder Representations from
Transformers`),hl=a(` by Hao Tan and Mohit Bansal. It\u2019s a vision and language transformer
model, pretrained on a variety of multi-modal datasets comprising of GQA, VQAv2.0, MSCOCO captions, and Visual
genome, using a combination of masked language modeling, region of interest feature regression, cross entropy loss
for question answering attribute prediction, and object tag prediction.`),ul=l(),Vo=n("p"),pl=a("This model inherits from "),Qn=n("a"),fl=a("PreTrainedModel"),gl=a(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),_l=l(),Bo=n("p"),vl=a("This model is also a PyTorch "),Xo=n("a"),Tl=a("torch.nn.Module"),bl=a(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),xl=l(),je=n("div"),b(Ho.$$.fragment),wl=l(),qt=n("p"),yl=a("The "),Wn=n("a"),kl=a("LxmertModel"),Ll=a(" forward method, overrides the "),Ds=n("code"),$l=a("__call__"),Fl=a(" special method."),zl=l(),b(Ht.$$.fragment),El=l(),b(Ut.$$.fragment),Lr=l(),Mt=n("h2"),Kt=n("a"),Is=n("span"),b(Uo.$$.fragment),ql=l(),Ss=n("span"),Ml=a("LxmertForPreTraining"),$r=l(),Y=n("div"),b(Ko.$$.fragment),Pl=l(),Rs=n("p"),Ol=a("Lxmert Model with a specified pretraining head on top."),Al=l(),Go=n("p"),Cl=a("The LXMERT model was proposed in "),Jo=n("a"),Nl=a(`LXMERT: Learning Cross-Modality Encoder Representations from
Transformers`),jl=a(` by Hao Tan and Mohit Bansal. It\u2019s a vision and language transformer
model, pretrained on a variety of multi-modal datasets comprising of GQA, VQAv2.0, MSCOCO captions, and Visual
genome, using a combination of masked language modeling, region of interest feature regression, cross entropy loss
for question answering attribute prediction, and object tag prediction.`),Dl=l(),Yo=n("p"),Il=a("This model inherits from "),Vn=n("a"),Sl=a("PreTrainedModel"),Rl=a(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Ql=l(),Zo=n("p"),Wl=a("This model is also a PyTorch "),en=n("a"),Vl=a("torch.nn.Module"),Bl=a(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Xl=l(),mt=n("div"),b(tn.$$.fragment),Hl=l(),Pt=n("p"),Ul=a("The "),Bn=n("a"),Kl=a("LxmertForPreTraining"),Gl=a(" forward method, overrides the "),Qs=n("code"),Jl=a("__call__"),Yl=a(" special method."),Zl=l(),b(Gt.$$.fragment),Fr=l(),Ot=n("h2"),Jt=n("a"),Ws=n("span"),b(on.$$.fragment),ed=l(),Vs=n("span"),td=a("LxmertForQuestionAnswering"),zr=l(),Z=n("div"),b(nn.$$.fragment),od=l(),Bs=n("p"),nd=a("Lxmert Model with a visual-answering head on top for downstream QA tasks"),sd=l(),sn=n("p"),rd=a("The LXMERT model was proposed in "),rn=n("a"),ad=a(`LXMERT: Learning Cross-Modality Encoder Representations from
Transformers`),id=a(` by Hao Tan and Mohit Bansal. It\u2019s a vision and language transformer
model, pretrained on a variety of multi-modal datasets comprising of GQA, VQAv2.0, MSCOCO captions, and Visual
genome, using a combination of masked language modeling, region of interest feature regression, cross entropy loss
for question answering attribute prediction, and object tag prediction.`),ld=l(),an=n("p"),dd=a("This model inherits from "),Xn=n("a"),cd=a("PreTrainedModel"),md=a(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),hd=l(),ln=n("p"),ud=a("This model is also a PyTorch "),dn=n("a"),pd=a("torch.nn.Module"),fd=a(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),gd=l(),De=n("div"),b(cn.$$.fragment),_d=l(),At=n("p"),vd=a("The "),Hn=n("a"),Td=a("LxmertForQuestionAnswering"),bd=a(" forward method, overrides the "),Xs=n("code"),xd=a("__call__"),wd=a(" special method."),yd=l(),b(Yt.$$.fragment),kd=l(),b(Zt.$$.fragment),Er=l(),Ct=n("h2"),eo=n("a"),Hs=n("span"),b(mn.$$.fragment),Ld=l(),Us=n("span"),$d=a("TFLxmertModel"),qr=l(),ee=n("div"),b(hn.$$.fragment),Fd=l(),Ks=n("p"),zd=a("The bare Lxmert Model transformer outputting raw hidden-states without any specific head on top."),Ed=l(),un=n("p"),qd=a("The LXMERT model was proposed in "),pn=n("a"),Md=a(`LXMERT: Learning Cross-Modality Encoder Representations from
Transformers`),Pd=a(` by Hao Tan and Mohit Bansal. It\u2019s a vision and language transformer
model, pre-trained on a variety of multi-modal datasets comprising of GQA, VQAv2.0, MCSCOCO captions, and Visual
genome, using a combination of masked language modeling, region of interest feature regression, cross entropy loss
for question answering attribute prediction, and object tag prediction.`),Od=l(),fn=n("p"),Ad=a("This model is also a "),gn=n("a"),Cd=a("tf.keras.Model"),Nd=a(` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),jd=l(),b(to.$$.fragment),Dd=l(),Ie=n("div"),b(_n.$$.fragment),Id=l(),Nt=n("p"),Sd=a("The "),Un=n("a"),Rd=a("TFLxmertModel"),Qd=a(" forward method, overrides the "),Gs=n("code"),Wd=a("__call__"),Vd=a(" special method."),Bd=l(),b(oo.$$.fragment),Xd=l(),b(no.$$.fragment),Mr=l(),jt=n("h2"),so=n("a"),Js=n("span"),b(vn.$$.fragment),Hd=l(),Ys=n("span"),Ud=a("TFLxmertForPreTraining"),Pr=l(),te=n("div"),b(Tn.$$.fragment),Kd=l(),bn=n("p"),Gd=a("Lxmert Model with a "),Zs=n("code"),Jd=a("language modeling"),Yd=a(" head on top."),Zd=l(),xn=n("p"),ec=a("The LXMERT model was proposed in "),wn=n("a"),tc=a(`LXMERT: Learning Cross-Modality Encoder Representations from
Transformers`),oc=a(` by Hao Tan and Mohit Bansal. It\u2019s a vision and language transformer
model, pre-trained on a variety of multi-modal datasets comprising of GQA, VQAv2.0, MCSCOCO captions, and Visual
genome, using a combination of masked language modeling, region of interest feature regression, cross entropy loss
for question answering attribute prediction, and object tag prediction.`),nc=l(),yn=n("p"),sc=a("This model is also a "),kn=n("a"),rc=a("tf.keras.Model"),ac=a(` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),ic=l(),b(ro.$$.fragment),lc=l(),ht=n("div"),b(Ln.$$.fragment),dc=l(),Dt=n("p"),cc=a("The "),Kn=n("a"),mc=a("TFLxmertForPreTraining"),hc=a(" forward method, overrides the "),er=n("code"),uc=a("__call__"),pc=a(" special method."),fc=l(),b(ao.$$.fragment),this.h()},l(o){const p=mh('[data-svelte="svelte-1phssyn"]',document.head);h=s(p,"META",{name:!0,content:!0}),p.forEach(t),$=d(o),g=s(o,"H1",{class:!0});var $n=r(g);_=s($n,"A",{id:!0,class:!0,href:!0});var tr=r(_);T=s(tr,"SPAN",{});var or=r(T);x(c.$$.fragment,or),or.forEach(t),tr.forEach(t),f=d($n),E=s($n,"SPAN",{});var nr=r(E);Xe=i(nr,"LXMERT"),nr.forEach(t),$n.forEach(t),ze=d(o),j=s(o,"H2",{class:!0});var Fn=r(j);oe=s(Fn,"A",{id:!0,class:!0,href:!0});var sr=r(oe);ae=s(sr,"SPAN",{});var rr=r(ae);x(F.$$.fragment,rr),rr.forEach(t),sr.forEach(t),He=d(Fn),H=s(Fn,"SPAN",{});var ar=r(H);Ue=i(ar,"Overview"),ar.forEach(t),Fn.forEach(t),Ee=d(o),R=s(o,"P",{});var zn=r(R);Ke=i(zn,"The LXMERT model was proposed in "),ie=s(zn,"A",{href:!0,rel:!0});var ir=r(ie);le=i(ir,"LXMERT: Learning Cross-Modality Encoder Representations from Transformers"),ir.forEach(t),Ge=i(zn,` by Hao Tan & Mohit Bansal. It is a series of bidirectional transformer encoders
(one for the vision modality, one for the language modality, and then one to fuse both modalities) pretrained using a
combination of masked language modeling, visual-language text alignment, ROI-feature regression, masked
visual-attribute modeling, masked visual-object modeling, and visual-question answering objectives. The pretraining
consists of multiple multi-modal datasets: MSCOCO, Visual-Genome + Visual-Genome Question Answering, VQA 2.0, and GQA.`),zn.forEach(t),qe=d(o),V=s(o,"P",{});var lr=r(V);Je=i(lr,"The abstract from the paper is the following:"),lr.forEach(t),Me=d(o),B=s(o,"P",{});var dr=r(B);we=s(dr,"EM",{});var bc=r(we);Ye=i(bc,`Vision-and-language reasoning requires an understanding of visual concepts, language semantics, and, most importantly,
the alignment and relationships between these two modalities. We thus propose the LXMERT (Learning Cross-Modality
Encoder Representations from Transformers) framework to learn these vision-and-language connections. In LXMERT, we
build a large-scale Transformer model that consists of three encoders: an object relationship encoder, a language
encoder, and a cross-modality encoder. Next, to endow our model with the capability of connecting vision and language
semantics, we pre-train the model with large amounts of image-and-sentence pairs, via five diverse representative
pretraining tasks: masked language modeling, masked object prediction (feature regression and label classification),
cross-modality matching, and image question answering. These tasks help in learning both intra-modality and
cross-modality relationships. After fine-tuning from our pretrained parameters, our model achieves the state-of-the-art
results on two visual question answering datasets (i.e., VQA and GQA). We also show the generalizability of our
pretrained cross-modality model by adapting it to a challenging visual-reasoning task, NLVR, and improve the previous
best result by 22% absolute (54% to 76%). Lastly, we demonstrate detailed ablation studies to prove that both our novel
model components and pretraining strategies significantly contribute to our strong results; and also present several
attention visualizations for the different encoders`),bc.forEach(t),dr.forEach(t),ve=d(o),M=s(o,"P",{});var xc=r(M);D=i(xc,"Tips:"),xc.forEach(t),Pe=d(o),N=s(o,"UL",{});var Gn=r(N);ye=s(Gn,"LI",{});var wc=r(ye);Ze=i(wc,`Bounding boxes are not necessary to be used in the visual feature embeddings, any kind of visual-spacial features
will work.`),wc.forEach(t),de=d(Gn),ke=s(Gn,"LI",{});var yc=r(ke);et=i(yc,`Both the language hidden states and the visual hidden states that LXMERT outputs are passed through the
cross-modality layer, so they contain information from both modalities. To access a modality that only attends to
itself, select the vision/language hidden states from the first input in the tuple.`),yc.forEach(t),I=d(Gn),Le=s(Gn,"LI",{});var kc=r(Le);ce=i(kc,`The bidirectional cross-modality encoder attention only returns attention values when the language modality is used
as the input and the vision modality is used as the context vector. Further, while the cross-modality encoder
contains self-attention for each respective modality and cross-attention, only the cross attention is returned and
both self attention outputs are disregarded.`),kc.forEach(t),Gn.forEach(t),Oe=d(o),X=s(o,"P",{});var Jn=r(X);me=i(Jn,"This model was contributed by "),he=s(Jn,"A",{href:!0,rel:!0});var Lc=r(he);tt=i(Lc,"eltoto1219"),Lc.forEach(t),U=i(Jn,". The original code can be found "),ue=s(Jn,"A",{href:!0,rel:!0});var $c=r(ue);pe=i($c,"here"),$c.forEach(t),ot=i(Jn,"."),Jn.forEach(t),Te=d(o),P=s(o,"H2",{class:!0});var Ar=r(P);ne=s(Ar,"A",{id:!0,class:!0,href:!0});var Fc=r(ne);S=s(Fc,"SPAN",{});var zc=r(S);x(fe.$$.fragment,zc),zc.forEach(t),Fc.forEach(t),nt=d(Ar),v=s(Ar,"SPAN",{});var Ec=r(v);z=i(Ec,"Documentation resources"),Ec.forEach(t),Ar.forEach(t),at=d(o),se=s(o,"UL",{});var qc=r(se);st=s(qc,"LI",{});var Mc=r(st);Ae=s(Mc,"A",{href:!0});var Pc=r(Ae);q=i(Pc,"Question answering task guide"),Pc.forEach(t),Mc.forEach(t),qc.forEach(t),it=d(o),ge=s(o,"H2",{class:!0});var Cr=r(ge);be=s(Cr,"A",{id:!0,class:!0,href:!0});var Oc=r(be);rt=s(Oc,"SPAN",{});var Ac=r(rt);x($e.$$.fragment,Ac),Ac.forEach(t),Oc.forEach(t),K=d(Cr),G=s(Cr,"SPAN",{});var Cc=r(G);pt=i(Cc,"LxmertConfig"),Cc.forEach(t),Cr.forEach(t),lt=d(o),C=s(o,"DIV",{class:!0});var Yn=r(C);x(Fe.$$.fragment,Yn),ft=d(Yn),Q=s(Yn,"P",{});var io=r(Q);gt=i(io,"This is the configuration class to store the configuration of a "),re=s(io,"A",{href:!0});var Nc=r(re);_t=i(Nc,"LxmertModel"),Nc.forEach(t),ba=i(io," or a "),qn=s(io,"A",{href:!0});var jc=r(qn);xa=i(jc,"TFLxmertModel"),jc.forEach(t),wa=i(io,`. It is used
to instantiate a LXMERT 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 Lxmert
`),po=s(io,"A",{href:!0,rel:!0});var Dc=r(po);ya=i(Dc,"unc-nlp/lxmert-base-uncased"),Dc.forEach(t),ka=i(io," architecture."),io.forEach(t),La=d(Yn),vt=s(Yn,"P",{});var Zn=r(vt);$a=i(Zn,"Configuration objects inherit from "),Mn=s(Zn,"A",{href:!0});var Ic=r(Mn);Fa=i(Ic,"PretrainedConfig"),Ic.forEach(t),za=i(Zn,` and can be used to control the model outputs. Read the
documentation from `),Pn=s(Zn,"A",{href:!0});var Sc=r(Pn);Ea=i(Sc,"PretrainedConfig"),Sc.forEach(t),qa=i(Zn," for more information."),Zn.forEach(t),Yn.forEach(t),ur=d(o),Tt=s(o,"H2",{class:!0});var Nr=r(Tt);It=s(Nr,"A",{id:!0,class:!0,href:!0});var Rc=r(It);ms=s(Rc,"SPAN",{});var Qc=r(ms);x(fo.$$.fragment,Qc),Qc.forEach(t),Rc.forEach(t),Ma=d(Nr),hs=s(Nr,"SPAN",{});var Wc=r(hs);Pa=i(Wc,"LxmertTokenizer"),Wc.forEach(t),Nr.forEach(t),pr=d(o),W=s(o,"DIV",{class:!0});var xe=r(W);x(go.$$.fragment,xe),Oa=d(xe),us=s(xe,"P",{});var Vc=r(us);Aa=i(Vc,"Construct a Lxmert tokenizer. Based on WordPiece."),Vc.forEach(t),Ca=d(xe),_o=s(xe,"P",{});var jr=r(_o);Na=i(jr,"This tokenizer inherits from "),On=s(jr,"A",{href:!0});var Bc=r(On);ja=i(Bc,"PreTrainedTokenizer"),Bc.forEach(t),Da=i(jr,` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),jr.forEach(t),Ia=d(xe),dt=s(xe,"DIV",{class:!0});var es=r(dt);x(vo.$$.fragment,es),Sa=d(es),ps=s(es,"P",{});var Xc=r(ps);Ra=i(Xc,`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. A Lxmert sequence has the following format:`),Xc.forEach(t),Qa=d(es),To=s(es,"UL",{});var Dr=r(To);An=s(Dr,"LI",{});var gc=r(An);Wa=i(gc,"single sequence: "),fs=s(gc,"CODE",{});var Hc=r(fs);Va=i(Hc,"[CLS] X [SEP]"),Hc.forEach(t),gc.forEach(t),Ba=d(Dr),Cn=s(Dr,"LI",{});var _c=r(Cn);Xa=i(_c,"pair of sequences: "),gs=s(_c,"CODE",{});var Uc=r(gs);Ha=i(Uc,"[CLS] A [SEP] B [SEP]"),Uc.forEach(t),_c.forEach(t),Dr.forEach(t),es.forEach(t),Ua=d(xe),St=s(xe,"DIV",{class:!0});var Ir=r(St);x(bo.$$.fragment,Ir),Ka=d(Ir),_s=s(Ir,"P",{});var Kc=r(_s);Ga=i(Kc,"Converts a sequence of tokens (string) in a single string."),Kc.forEach(t),Ir.forEach(t),Ja=d(xe),Ce=s(xe,"DIV",{class:!0});var lo=r(Ce);x(xo.$$.fragment,lo),Ya=d(lo),vs=s(lo,"P",{});var Gc=r(vs);Za=i(Gc,"Create a mask from the two sequences passed to be used in a sequence-pair classification task. A Lxmert"),Gc.forEach(t),ei=d(lo),x(Rt.$$.fragment,lo),ti=d(lo),bt=s(lo,"P",{});var ts=r(bt);oi=i(ts,"If "),Ts=s(ts,"CODE",{});var Jc=r(Ts);ni=i(Jc,"token_ids_1"),Jc.forEach(t),si=i(ts," is "),bs=s(ts,"CODE",{});var Yc=r(bs);ri=i(Yc,"None"),Yc.forEach(t),ai=i(ts,", this method only returns the first portion of the mask (0s)."),ts.forEach(t),lo.forEach(t),ii=d(xe),Qt=s(xe,"DIV",{class:!0});var Sr=r(Qt);x(wo.$$.fragment,Sr),li=d(Sr),yo=s(Sr,"P",{});var Rr=r(yo);di=i(Rr,`Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),xs=s(Rr,"CODE",{});var Zc=r(xs);ci=i(Zc,"prepare_for_model"),Zc.forEach(t),mi=i(Rr," method."),Rr.forEach(t),Sr.forEach(t),xe.forEach(t),fr=d(o),xt=s(o,"H2",{class:!0});var Qr=r(xt);Wt=s(Qr,"A",{id:!0,class:!0,href:!0});var em=r(Wt);ws=s(em,"SPAN",{});var tm=r(ws);x(ko.$$.fragment,tm),tm.forEach(t),em.forEach(t),hi=d(Qr),ys=s(Qr,"SPAN",{});var om=r(ys);ui=i(om,"LxmertTokenizerFast"),om.forEach(t),Qr.forEach(t),gr=d(o),_e=s(o,"DIV",{class:!0});var ut=r(_e);x(Lo.$$.fragment,ut),pi=d(ut),$o=s(ut,"P",{});var Wr=r($o);fi=i(Wr,"Construct a \u201Cfast\u201D Lxmert tokenizer (backed by HuggingFace\u2019s "),ks=s(Wr,"EM",{});var nm=r(ks);gi=i(nm,"tokenizers"),nm.forEach(t),_i=i(Wr," library). Based on WordPiece."),Wr.forEach(t),vi=d(ut),Fo=s(ut,"P",{});var Vr=r(Fo);Ti=i(Vr,"This tokenizer inherits from "),Nn=s(Vr,"A",{href:!0});var sm=r(Nn);bi=i(sm,"PreTrainedTokenizerFast"),sm.forEach(t),xi=i(Vr,` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),Vr.forEach(t),wi=d(ut),ct=s(ut,"DIV",{class:!0});var os=r(ct);x(zo.$$.fragment,os),yi=d(os),Ls=s(os,"P",{});var rm=r(Ls);ki=i(rm,`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. A Lxmert sequence has the following format:`),rm.forEach(t),Li=d(os),Eo=s(os,"UL",{});var Br=r(Eo);jn=s(Br,"LI",{});var vc=r(jn);$i=i(vc,"single sequence: "),$s=s(vc,"CODE",{});var am=r($s);Fi=i(am,"[CLS] X [SEP]"),am.forEach(t),vc.forEach(t),zi=d(Br),Dn=s(Br,"LI",{});var Tc=r(Dn);Ei=i(Tc,"pair of sequences: "),Fs=s(Tc,"CODE",{});var im=r(Fs);qi=i(im,"[CLS] A [SEP] B [SEP]"),im.forEach(t),Tc.forEach(t),Br.forEach(t),os.forEach(t),Mi=d(ut),Ne=s(ut,"DIV",{class:!0});var co=r(Ne);x(qo.$$.fragment,co),Pi=d(co),zs=s(co,"P",{});var lm=r(zs);Oi=i(lm,"Create a mask from the two sequences passed to be used in a sequence-pair classification task. A Lxmert"),lm.forEach(t),Ai=d(co),x(Vt.$$.fragment,co),Ci=d(co),wt=s(co,"P",{});var ns=r(wt);Ni=i(ns,"If "),Es=s(ns,"CODE",{});var dm=r(Es);ji=i(dm,"token_ids_1"),dm.forEach(t),Di=i(ns," is "),qs=s(ns,"CODE",{});var cm=r(qs);Ii=i(cm,"None"),cm.forEach(t),Si=i(ns,", this method only returns the first portion of the mask (0s)."),ns.forEach(t),co.forEach(t),ut.forEach(t),_r=d(o),yt=s(o,"H2",{class:!0});var Xr=r(yt);Bt=s(Xr,"A",{id:!0,class:!0,href:!0});var mm=r(Bt);Ms=s(mm,"SPAN",{});var hm=r(Ms);x(Mo.$$.fragment,hm),hm.forEach(t),mm.forEach(t),Ri=d(Xr),Ps=s(Xr,"SPAN",{});var um=r(Ps);Qi=i(um,"Lxmert specific outputs"),um.forEach(t),Xr.forEach(t),vr=d(o),kt=s(o,"DIV",{class:!0});var Hr=r(kt);x(Po.$$.fragment,Hr),Wi=d(Hr),Os=s(Hr,"P",{});var pm=r(Os);Vi=i(pm,`Lxmert\u2019s outputs that contain the last hidden states, pooled outputs, and attention probabilities for the language,
visual, and, cross-modality encoders. (note: the visual encoder in Lxmert is referred to as the \u201Crelation-ship\u201D
encoder\u201D)`),pm.forEach(t),Hr.forEach(t),Tr=d(o),Lt=s(o,"DIV",{class:!0});var Ur=r(Lt);x(Oo.$$.fragment,Ur),Bi=d(Ur),Ao=s(Ur,"P",{});var Kr=r(Ao);Xi=i(Kr,"Output type of "),In=s(Kr,"A",{href:!0});var fm=r(In);Hi=i(fm,"LxmertForPreTraining"),fm.forEach(t),Ui=i(Kr,"."),Kr.forEach(t),Ur.forEach(t),br=d(o),$t=s(o,"DIV",{class:!0});var Gr=r($t);x(Co.$$.fragment,Gr),Ki=d(Gr),No=s(Gr,"P",{});var Jr=r(No);Gi=i(Jr,"Output type of "),Sn=s(Jr,"A",{href:!0});var gm=r(Sn);Ji=i(gm,"LxmertForQuestionAnswering"),gm.forEach(t),Yi=i(Jr,"."),Jr.forEach(t),Gr.forEach(t),xr=d(o),Ft=s(o,"DIV",{class:!0});var Yr=r(Ft);x(jo.$$.fragment,Yr),Zi=d(Yr),As=s(Yr,"P",{});var _m=r(As);el=i(_m,`Lxmert\u2019s outputs that contain the last hidden states, pooled outputs, and attention probabilities for the language,
visual, and, cross-modality encoders. (note: the visual encoder in Lxmert is referred to as the \u201Crelation-ship\u201D
encoder\u201D)`),_m.forEach(t),Yr.forEach(t),wr=d(o),zt=s(o,"DIV",{class:!0});var Zr=r(zt);x(Do.$$.fragment,Zr),tl=d(Zr),Io=s(Zr,"P",{});var ea=r(Io);ol=i(ea,"Output type of "),Rn=s(ea,"A",{href:!0});var vm=r(Rn);nl=i(vm,"LxmertForPreTraining"),vm.forEach(t),sl=i(ea,"."),ea.forEach(t),Zr.forEach(t),yr=d(o),Et=s(o,"H2",{class:!0});var ta=r(Et);Xt=s(ta,"A",{id:!0,class:!0,href:!0});var Tm=r(Xt);Cs=s(Tm,"SPAN",{});var bm=r(Cs);x(So.$$.fragment,bm),bm.forEach(t),Tm.forEach(t),rl=d(ta),Ns=s(ta,"SPAN",{});var xm=r(Ns);al=i(xm,"LxmertModel"),xm.forEach(t),ta.forEach(t),kr=d(o),J=s(o,"DIV",{class:!0});var Se=r(J);x(Ro.$$.fragment,Se),il=d(Se),js=s(Se,"P",{});var wm=r(js);ll=i(wm,"The bare Lxmert Model transformer outputting raw hidden-states without any specific head on top."),wm.forEach(t),dl=d(Se),Qo=s(Se,"P",{});var oa=r(Qo);cl=i(oa,"The LXMERT model was proposed in "),Wo=s(oa,"A",{href:!0,rel:!0});var ym=r(Wo);ml=i(ym,`LXMERT: Learning Cross-Modality Encoder Representations from
Transformers`),ym.forEach(t),hl=i(oa,` by Hao Tan and Mohit Bansal. It\u2019s a vision and language transformer
model, pretrained on a variety of multi-modal datasets comprising of GQA, VQAv2.0, MSCOCO captions, and Visual
genome, using a combination of masked language modeling, region of interest feature regression, cross entropy loss
for question answering attribute prediction, and object tag prediction.`),oa.forEach(t),ul=d(Se),Vo=s(Se,"P",{});var na=r(Vo);pl=i(na,"This model inherits from "),Qn=s(na,"A",{href:!0});var km=r(Qn);fl=i(km,"PreTrainedModel"),km.forEach(t),gl=i(na,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),na.forEach(t),_l=d(Se),Bo=s(Se,"P",{});var sa=r(Bo);vl=i(sa,"This model is also a PyTorch "),Xo=s(sa,"A",{href:!0,rel:!0});var Lm=r(Xo);Tl=i(Lm,"torch.nn.Module"),Lm.forEach(t),bl=i(sa,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),sa.forEach(t),xl=d(Se),je=s(Se,"DIV",{class:!0});var mo=r(je);x(Ho.$$.fragment,mo),wl=d(mo),qt=s(mo,"P",{});var ss=r(qt);yl=i(ss,"The "),Wn=s(ss,"A",{href:!0});var $m=r(Wn);kl=i($m,"LxmertModel"),$m.forEach(t),Ll=i(ss," forward method, overrides the "),Ds=s(ss,"CODE",{});var Fm=r(Ds);$l=i(Fm,"__call__"),Fm.forEach(t),Fl=i(ss," special method."),ss.forEach(t),zl=d(mo),x(Ht.$$.fragment,mo),El=d(mo),x(Ut.$$.fragment,mo),mo.forEach(t),Se.forEach(t),Lr=d(o),Mt=s(o,"H2",{class:!0});var ra=r(Mt);Kt=s(ra,"A",{id:!0,class:!0,href:!0});var zm=r(Kt);Is=s(zm,"SPAN",{});var Em=r(Is);x(Uo.$$.fragment,Em),Em.forEach(t),zm.forEach(t),ql=d(ra),Ss=s(ra,"SPAN",{});var qm=r(Ss);Ml=i(qm,"LxmertForPreTraining"),qm.forEach(t),ra.forEach(t),$r=d(o),Y=s(o,"DIV",{class:!0});var Re=r(Y);x(Ko.$$.fragment,Re),Pl=d(Re),Rs=s(Re,"P",{});var Mm=r(Rs);Ol=i(Mm,"Lxmert Model with a specified pretraining head on top."),Mm.forEach(t),Al=d(Re),Go=s(Re,"P",{});var aa=r(Go);Cl=i(aa,"The LXMERT model was proposed in "),Jo=s(aa,"A",{href:!0,rel:!0});var Pm=r(Jo);Nl=i(Pm,`LXMERT: Learning Cross-Modality Encoder Representations from
Transformers`),Pm.forEach(t),jl=i(aa,` by Hao Tan and Mohit Bansal. It\u2019s a vision and language transformer
model, pretrained on a variety of multi-modal datasets comprising of GQA, VQAv2.0, MSCOCO captions, and Visual
genome, using a combination of masked language modeling, region of interest feature regression, cross entropy loss
for question answering attribute prediction, and object tag prediction.`),aa.forEach(t),Dl=d(Re),Yo=s(Re,"P",{});var ia=r(Yo);Il=i(ia,"This model inherits from "),Vn=s(ia,"A",{href:!0});var Om=r(Vn);Sl=i(Om,"PreTrainedModel"),Om.forEach(t),Rl=i(ia,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),ia.forEach(t),Ql=d(Re),Zo=s(Re,"P",{});var la=r(Zo);Wl=i(la,"This model is also a PyTorch "),en=s(la,"A",{href:!0,rel:!0});var Am=r(en);Vl=i(Am,"torch.nn.Module"),Am.forEach(t),Bl=i(la,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),la.forEach(t),Xl=d(Re),mt=s(Re,"DIV",{class:!0});var rs=r(mt);x(tn.$$.fragment,rs),Hl=d(rs),Pt=s(rs,"P",{});var as=r(Pt);Ul=i(as,"The "),Bn=s(as,"A",{href:!0});var Cm=r(Bn);Kl=i(Cm,"LxmertForPreTraining"),Cm.forEach(t),Gl=i(as," forward method, overrides the "),Qs=s(as,"CODE",{});var Nm=r(Qs);Jl=i(Nm,"__call__"),Nm.forEach(t),Yl=i(as," special method."),as.forEach(t),Zl=d(rs),x(Gt.$$.fragment,rs),rs.forEach(t),Re.forEach(t),Fr=d(o),Ot=s(o,"H2",{class:!0});var da=r(Ot);Jt=s(da,"A",{id:!0,class:!0,href:!0});var jm=r(Jt);Ws=s(jm,"SPAN",{});var Dm=r(Ws);x(on.$$.fragment,Dm),Dm.forEach(t),jm.forEach(t),ed=d(da),Vs=s(da,"SPAN",{});var Im=r(Vs);td=i(Im,"LxmertForQuestionAnswering"),Im.forEach(t),da.forEach(t),zr=d(o),Z=s(o,"DIV",{class:!0});var Qe=r(Z);x(nn.$$.fragment,Qe),od=d(Qe),Bs=s(Qe,"P",{});var Sm=r(Bs);nd=i(Sm,"Lxmert Model with a visual-answering head on top for downstream QA tasks"),Sm.forEach(t),sd=d(Qe),sn=s(Qe,"P",{});var ca=r(sn);rd=i(ca,"The LXMERT model was proposed in "),rn=s(ca,"A",{href:!0,rel:!0});var Rm=r(rn);ad=i(Rm,`LXMERT: Learning Cross-Modality Encoder Representations from
Transformers`),Rm.forEach(t),id=i(ca,` by Hao Tan and Mohit Bansal. It\u2019s a vision and language transformer
model, pretrained on a variety of multi-modal datasets comprising of GQA, VQAv2.0, MSCOCO captions, and Visual
genome, using a combination of masked language modeling, region of interest feature regression, cross entropy loss
for question answering attribute prediction, and object tag prediction.`),ca.forEach(t),ld=d(Qe),an=s(Qe,"P",{});var ma=r(an);dd=i(ma,"This model inherits from "),Xn=s(ma,"A",{href:!0});var Qm=r(Xn);cd=i(Qm,"PreTrainedModel"),Qm.forEach(t),md=i(ma,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),ma.forEach(t),hd=d(Qe),ln=s(Qe,"P",{});var ha=r(ln);ud=i(ha,"This model is also a PyTorch "),dn=s(ha,"A",{href:!0,rel:!0});var Wm=r(dn);pd=i(Wm,"torch.nn.Module"),Wm.forEach(t),fd=i(ha,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),ha.forEach(t),gd=d(Qe),De=s(Qe,"DIV",{class:!0});var ho=r(De);x(cn.$$.fragment,ho),_d=d(ho),At=s(ho,"P",{});var is=r(At);vd=i(is,"The "),Hn=s(is,"A",{href:!0});var Vm=r(Hn);Td=i(Vm,"LxmertForQuestionAnswering"),Vm.forEach(t),bd=i(is," forward method, overrides the "),Xs=s(is,"CODE",{});var Bm=r(Xs);xd=i(Bm,"__call__"),Bm.forEach(t),wd=i(is," special method."),is.forEach(t),yd=d(ho),x(Yt.$$.fragment,ho),kd=d(ho),x(Zt.$$.fragment,ho),ho.forEach(t),Qe.forEach(t),Er=d(o),Ct=s(o,"H2",{class:!0});var ua=r(Ct);eo=s(ua,"A",{id:!0,class:!0,href:!0});var Xm=r(eo);Hs=s(Xm,"SPAN",{});var Hm=r(Hs);x(mn.$$.fragment,Hm),Hm.forEach(t),Xm.forEach(t),Ld=d(ua),Us=s(ua,"SPAN",{});var Um=r(Us);$d=i(Um,"TFLxmertModel"),Um.forEach(t),ua.forEach(t),qr=d(o),ee=s(o,"DIV",{class:!0});var We=r(ee);x(hn.$$.fragment,We),Fd=d(We),Ks=s(We,"P",{});var Km=r(Ks);zd=i(Km,"The bare Lxmert Model transformer outputting raw hidden-states without any specific head on top."),Km.forEach(t),Ed=d(We),un=s(We,"P",{});var pa=r(un);qd=i(pa,"The LXMERT model was proposed in "),pn=s(pa,"A",{href:!0,rel:!0});var Gm=r(pn);Md=i(Gm,`LXMERT: Learning Cross-Modality Encoder Representations from
Transformers`),Gm.forEach(t),Pd=i(pa,` by Hao Tan and Mohit Bansal. It\u2019s a vision and language transformer
model, pre-trained on a variety of multi-modal datasets comprising of GQA, VQAv2.0, MCSCOCO captions, and Visual
genome, using a combination of masked language modeling, region of interest feature regression, cross entropy loss
for question answering attribute prediction, and object tag prediction.`),pa.forEach(t),Od=d(We),fn=s(We,"P",{});var fa=r(fn);Ad=i(fa,"This model is also a "),gn=s(fa,"A",{href:!0,rel:!0});var Jm=r(gn);Cd=i(Jm,"tf.keras.Model"),Jm.forEach(t),Nd=i(fa,` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),fa.forEach(t),jd=d(We),x(to.$$.fragment,We),Dd=d(We),Ie=s(We,"DIV",{class:!0});var uo=r(Ie);x(_n.$$.fragment,uo),Id=d(uo),Nt=s(uo,"P",{});var ls=r(Nt);Sd=i(ls,"The "),Un=s(ls,"A",{href:!0});var Ym=r(Un);Rd=i(Ym,"TFLxmertModel"),Ym.forEach(t),Qd=i(ls," forward method, overrides the "),Gs=s(ls,"CODE",{});var Zm=r(Gs);Wd=i(Zm,"__call__"),Zm.forEach(t),Vd=i(ls," special method."),ls.forEach(t),Bd=d(uo),x(oo.$$.fragment,uo),Xd=d(uo),x(no.$$.fragment,uo),uo.forEach(t),We.forEach(t),Mr=d(o),jt=s(o,"H2",{class:!0});var ga=r(jt);so=s(ga,"A",{id:!0,class:!0,href:!0});var eh=r(so);Js=s(eh,"SPAN",{});var th=r(Js);x(vn.$$.fragment,th),th.forEach(t),eh.forEach(t),Hd=d(ga),Ys=s(ga,"SPAN",{});var oh=r(Ys);Ud=i(oh,"TFLxmertForPreTraining"),oh.forEach(t),ga.forEach(t),Pr=d(o),te=s(o,"DIV",{class:!0});var Ve=r(te);x(Tn.$$.fragment,Ve),Kd=d(Ve),bn=s(Ve,"P",{});var _a=r(bn);Gd=i(_a,"Lxmert Model with a "),Zs=s(_a,"CODE",{});var nh=r(Zs);Jd=i(nh,"language modeling"),nh.forEach(t),Yd=i(_a," head on top."),_a.forEach(t),Zd=d(Ve),xn=s(Ve,"P",{});var va=r(xn);ec=i(va,"The LXMERT model was proposed in "),wn=s(va,"A",{href:!0,rel:!0});var sh=r(wn);tc=i(sh,`LXMERT: Learning Cross-Modality Encoder Representations from
Transformers`),sh.forEach(t),oc=i(va,` by Hao Tan and Mohit Bansal. It\u2019s a vision and language transformer
model, pre-trained on a variety of multi-modal datasets comprising of GQA, VQAv2.0, MCSCOCO captions, and Visual
genome, using a combination of masked language modeling, region of interest feature regression, cross entropy loss
for question answering attribute prediction, and object tag prediction.`),va.forEach(t),nc=d(Ve),yn=s(Ve,"P",{});var Ta=r(yn);sc=i(Ta,"This model is also a "),kn=s(Ta,"A",{href:!0,rel:!0});var rh=r(kn);rc=i(rh,"tf.keras.Model"),rh.forEach(t),ac=i(Ta,` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),Ta.forEach(t),ic=d(Ve),x(ro.$$.fragment,Ve),lc=d(Ve),ht=s(Ve,"DIV",{class:!0});var ds=r(ht);x(Ln.$$.fragment,ds),dc=d(ds),Dt=s(ds,"P",{});var cs=r(Dt);cc=i(cs,"The "),Kn=s(cs,"A",{href:!0});var ah=r(Kn);mc=i(ah,"TFLxmertForPreTraining"),ah.forEach(t),hc=i(cs," forward method, overrides the "),er=s(cs,"CODE",{});var ih=r(er);uc=i(ih,"__call__"),ih.forEach(t),pc=i(cs," special method."),cs.forEach(t),fc=d(ds),x(ao.$$.fragment,ds),ds.forEach(t),Ve.forEach(t),this.h()},h(){m(h,"name","hf:doc:metadata"),m(h,"content",JSON.stringify($h)),m(_,"id","lxmert"),m(_,"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"),m(_,"href","#lxmert"),m(g,"class","relative group"),m(oe,"id","overview"),m(oe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(oe,"href","#overview"),m(j,"class","relative group"),m(ie,"href","https://arxiv.org/abs/1908.07490"),m(ie,"rel","nofollow"),m(he,"href","https://huggingface.co/eltoto1219"),m(he,"rel","nofollow"),m(ue,"href","https://github.com/airsplay/lxmert"),m(ue,"rel","nofollow"),m(ne,"id","documentation-resources"),m(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"),m(ne,"href","#documentation-resources"),m(P,"class","relative group"),m(Ae,"href","./tasks/question_answering"),m(be,"id","transformers.LxmertConfig"),m(be,"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"),m(be,"href","#transformers.LxmertConfig"),m(ge,"class","relative group"),m(re,"href","/docs/transformers/v4.27.1/en/model_doc/lxmert#transformers.LxmertModel"),m(qn,"href","/docs/transformers/v4.27.1/en/model_doc/lxmert#transformers.TFLxmertModel"),m(po,"href","https://huggingface.co/unc-nlp/lxmert-base-uncased"),m(po,"rel","nofollow"),m(Mn,"href","/docs/transformers/v4.27.1/en/main_classes/configuration#transformers.PretrainedConfig"),m(Pn,"href","/docs/transformers/v4.27.1/en/main_classes/configuration#transformers.PretrainedConfig"),m(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(It,"id","transformers.LxmertTokenizer"),m(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"),m(It,"href","#transformers.LxmertTokenizer"),m(Tt,"class","relative group"),m(On,"href","/docs/transformers/v4.27.1/en/main_classes/tokenizer#transformers.PreTrainedTokenizer"),m(dt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(St,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Ce,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Qt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Wt,"id","transformers.LxmertTokenizerFast"),m(Wt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(Wt,"href","#transformers.LxmertTokenizerFast"),m(xt,"class","relative group"),m(Nn,"href","/docs/transformers/v4.27.1/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast"),m(ct,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Ne,"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,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Bt,"id","transformers.models.lxmert.modeling_lxmert.LxmertModelOutput"),m(Bt,"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"),m(Bt,"href","#transformers.models.lxmert.modeling_lxmert.LxmertModelOutput"),m(yt,"class","relative group"),m(kt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(In,"href","/docs/transformers/v4.27.1/en/model_doc/lxmert#transformers.LxmertForPreTraining"),m(Lt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Sn,"href","/docs/transformers/v4.27.1/en/model_doc/lxmert#transformers.LxmertForQuestionAnswering"),m($t,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Ft,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Rn,"href","/docs/transformers/v4.27.1/en/model_doc/lxmert#transformers.LxmertForPreTraining"),m(zt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Xt,"id","transformers.LxmertModel"),m(Xt,"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"),m(Xt,"href","#transformers.LxmertModel"),m(Et,"class","relative group"),m(Wo,"href","https://arxiv.org/abs/1908.07490"),m(Wo,"rel","nofollow"),m(Qn,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel"),m(Xo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),m(Xo,"rel","nofollow"),m(Wn,"href","/docs/transformers/v4.27.1/en/model_doc/lxmert#transformers.LxmertModel"),m(je,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(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(Kt,"id","transformers.LxmertForPreTraining"),m(Kt,"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"),m(Kt,"href","#transformers.LxmertForPreTraining"),m(Mt,"class","relative group"),m(Jo,"href","https://arxiv.org/abs/1908.07490"),m(Jo,"rel","nofollow"),m(Vn,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel"),m(en,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),m(en,"rel","nofollow"),m(Bn,"href","/docs/transformers/v4.27.1/en/model_doc/lxmert#transformers.LxmertForPreTraining"),m(mt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Jt,"id","transformers.LxmertForQuestionAnswering"),m(Jt,"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"),m(Jt,"href","#transformers.LxmertForQuestionAnswering"),m(Ot,"class","relative group"),m(rn,"href","https://arxiv.org/abs/1908.07490"),m(rn,"rel","nofollow"),m(Xn,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel"),m(dn,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),m(dn,"rel","nofollow"),m(Hn,"href","/docs/transformers/v4.27.1/en/model_doc/lxmert#transformers.LxmertForQuestionAnswering"),m(De,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(eo,"id","transformers.TFLxmertModel"),m(eo,"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"),m(eo,"href","#transformers.TFLxmertModel"),m(Ct,"class","relative group"),m(pn,"href","https://arxiv.org/abs/1908.07490"),m(pn,"rel","nofollow"),m(gn,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),m(gn,"rel","nofollow"),m(Un,"href","/docs/transformers/v4.27.1/en/model_doc/lxmert#transformers.TFLxmertModel"),m(Ie,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(ee,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(so,"id","transformers.TFLxmertForPreTraining"),m(so,"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"),m(so,"href","#transformers.TFLxmertForPreTraining"),m(jt,"class","relative group"),m(wn,"href","https://arxiv.org/abs/1908.07490"),m(wn,"rel","nofollow"),m(kn,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),m(kn,"rel","nofollow"),m(Kn,"href","/docs/transformers/v4.27.1/en/model_doc/lxmert#transformers.TFLxmertForPreTraining"),m(ht,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(te,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(o,p){e(document.head,h),u(o,$,p),u(o,g,p),e(g,_),e(_,T),w(c,T,null),e(g,f),e(g,E),e(E,Xe),u(o,ze,p),u(o,j,p),e(j,oe),e(oe,ae),w(F,ae,null),e(j,He),e(j,H),e(H,Ue),u(o,Ee,p),u(o,R,p),e(R,Ke),e(R,ie),e(ie,le),e(R,Ge),u(o,qe,p),u(o,V,p),e(V,Je),u(o,Me,p),u(o,B,p),e(B,we),e(we,Ye),u(o,ve,p),u(o,M,p),e(M,D),u(o,Pe,p),u(o,N,p),e(N,ye),e(ye,Ze),e(N,de),e(N,ke),e(ke,et),e(N,I),e(N,Le),e(Le,ce),u(o,Oe,p),u(o,X,p),e(X,me),e(X,he),e(he,tt),e(X,U),e(X,ue),e(ue,pe),e(X,ot),u(o,Te,p),u(o,P,p),e(P,ne),e(ne,S),w(fe,S,null),e(P,nt),e(P,v),e(v,z),u(o,at,p),u(o,se,p),e(se,st),e(st,Ae),e(Ae,q),u(o,it,p),u(o,ge,p),e(ge,be),e(be,rt),w($e,rt,null),e(ge,K),e(ge,G),e(G,pt),u(o,lt,p),u(o,C,p),w(Fe,C,null),e(C,ft),e(C,Q),e(Q,gt),e(Q,re),e(re,_t),e(Q,ba),e(Q,qn),e(qn,xa),e(Q,wa),e(Q,po),e(po,ya),e(Q,ka),e(C,La),e(C,vt),e(vt,$a),e(vt,Mn),e(Mn,Fa),e(vt,za),e(vt,Pn),e(Pn,Ea),e(vt,qa),u(o,ur,p),u(o,Tt,p),e(Tt,It),e(It,ms),w(fo,ms,null),e(Tt,Ma),e(Tt,hs),e(hs,Pa),u(o,pr,p),u(o,W,p),w(go,W,null),e(W,Oa),e(W,us),e(us,Aa),e(W,Ca),e(W,_o),e(_o,Na),e(_o,On),e(On,ja),e(_o,Da),e(W,Ia),e(W,dt),w(vo,dt,null),e(dt,Sa),e(dt,ps),e(ps,Ra),e(dt,Qa),e(dt,To),e(To,An),e(An,Wa),e(An,fs),e(fs,Va),e(To,Ba),e(To,Cn),e(Cn,Xa),e(Cn,gs),e(gs,Ha),e(W,Ua),e(W,St),w(bo,St,null),e(St,Ka),e(St,_s),e(_s,Ga),e(W,Ja),e(W,Ce),w(xo,Ce,null),e(Ce,Ya),e(Ce,vs),e(vs,Za),e(Ce,ei),w(Rt,Ce,null),e(Ce,ti),e(Ce,bt),e(bt,oi),e(bt,Ts),e(Ts,ni),e(bt,si),e(bt,bs),e(bs,ri),e(bt,ai),e(W,ii),e(W,Qt),w(wo,Qt,null),e(Qt,li),e(Qt,yo),e(yo,di),e(yo,xs),e(xs,ci),e(yo,mi),u(o,fr,p),u(o,xt,p),e(xt,Wt),e(Wt,ws),w(ko,ws,null),e(xt,hi),e(xt,ys),e(ys,ui),u(o,gr,p),u(o,_e,p),w(Lo,_e,null),e(_e,pi),e(_e,$o),e($o,fi),e($o,ks),e(ks,gi),e($o,_i),e(_e,vi),e(_e,Fo),e(Fo,Ti),e(Fo,Nn),e(Nn,bi),e(Fo,xi),e(_e,wi),e(_e,ct),w(zo,ct,null),e(ct,yi),e(ct,Ls),e(Ls,ki),e(ct,Li),e(ct,Eo),e(Eo,jn),e(jn,$i),e(jn,$s),e($s,Fi),e(Eo,zi),e(Eo,Dn),e(Dn,Ei),e(Dn,Fs),e(Fs,qi),e(_e,Mi),e(_e,Ne),w(qo,Ne,null),e(Ne,Pi),e(Ne,zs),e(zs,Oi),e(Ne,Ai),w(Vt,Ne,null),e(Ne,Ci),e(Ne,wt),e(wt,Ni),e(wt,Es),e(Es,ji),e(wt,Di),e(wt,qs),e(qs,Ii),e(wt,Si),u(o,_r,p),u(o,yt,p),e(yt,Bt),e(Bt,Ms),w(Mo,Ms,null),e(yt,Ri),e(yt,Ps),e(Ps,Qi),u(o,vr,p),u(o,kt,p),w(Po,kt,null),e(kt,Wi),e(kt,Os),e(Os,Vi),u(o,Tr,p),u(o,Lt,p),w(Oo,Lt,null),e(Lt,Bi),e(Lt,Ao),e(Ao,Xi),e(Ao,In),e(In,Hi),e(Ao,Ui),u(o,br,p),u(o,$t,p),w(Co,$t,null),e($t,Ki),e($t,No),e(No,Gi),e(No,Sn),e(Sn,Ji),e(No,Yi),u(o,xr,p),u(o,Ft,p),w(jo,Ft,null),e(Ft,Zi),e(Ft,As),e(As,el),u(o,wr,p),u(o,zt,p),w(Do,zt,null),e(zt,tl),e(zt,Io),e(Io,ol),e(Io,Rn),e(Rn,nl),e(Io,sl),u(o,yr,p),u(o,Et,p),e(Et,Xt),e(Xt,Cs),w(So,Cs,null),e(Et,rl),e(Et,Ns),e(Ns,al),u(o,kr,p),u(o,J,p),w(Ro,J,null),e(J,il),e(J,js),e(js,ll),e(J,dl),e(J,Qo),e(Qo,cl),e(Qo,Wo),e(Wo,ml),e(Qo,hl),e(J,ul),e(J,Vo),e(Vo,pl),e(Vo,Qn),e(Qn,fl),e(Vo,gl),e(J,_l),e(J,Bo),e(Bo,vl),e(Bo,Xo),e(Xo,Tl),e(Bo,bl),e(J,xl),e(J,je),w(Ho,je,null),e(je,wl),e(je,qt),e(qt,yl),e(qt,Wn),e(Wn,kl),e(qt,Ll),e(qt,Ds),e(Ds,$l),e(qt,Fl),e(je,zl),w(Ht,je,null),e(je,El),w(Ut,je,null),u(o,Lr,p),u(o,Mt,p),e(Mt,Kt),e(Kt,Is),w(Uo,Is,null),e(Mt,ql),e(Mt,Ss),e(Ss,Ml),u(o,$r,p),u(o,Y,p),w(Ko,Y,null),e(Y,Pl),e(Y,Rs),e(Rs,Ol),e(Y,Al),e(Y,Go),e(Go,Cl),e(Go,Jo),e(Jo,Nl),e(Go,jl),e(Y,Dl),e(Y,Yo),e(Yo,Il),e(Yo,Vn),e(Vn,Sl),e(Yo,Rl),e(Y,Ql),e(Y,Zo),e(Zo,Wl),e(Zo,en),e(en,Vl),e(Zo,Bl),e(Y,Xl),e(Y,mt),w(tn,mt,null),e(mt,Hl),e(mt,Pt),e(Pt,Ul),e(Pt,Bn),e(Bn,Kl),e(Pt,Gl),e(Pt,Qs),e(Qs,Jl),e(Pt,Yl),e(mt,Zl),w(Gt,mt,null),u(o,Fr,p),u(o,Ot,p),e(Ot,Jt),e(Jt,Ws),w(on,Ws,null),e(Ot,ed),e(Ot,Vs),e(Vs,td),u(o,zr,p),u(o,Z,p),w(nn,Z,null),e(Z,od),e(Z,Bs),e(Bs,nd),e(Z,sd),e(Z,sn),e(sn,rd),e(sn,rn),e(rn,ad),e(sn,id),e(Z,ld),e(Z,an),e(an,dd),e(an,Xn),e(Xn,cd),e(an,md),e(Z,hd),e(Z,ln),e(ln,ud),e(ln,dn),e(dn,pd),e(ln,fd),e(Z,gd),e(Z,De),w(cn,De,null),e(De,_d),e(De,At),e(At,vd),e(At,Hn),e(Hn,Td),e(At,bd),e(At,Xs),e(Xs,xd),e(At,wd),e(De,yd),w(Yt,De,null),e(De,kd),w(Zt,De,null),u(o,Er,p),u(o,Ct,p),e(Ct,eo),e(eo,Hs),w(mn,Hs,null),e(Ct,Ld),e(Ct,Us),e(Us,$d),u(o,qr,p),u(o,ee,p),w(hn,ee,null),e(ee,Fd),e(ee,Ks),e(Ks,zd),e(ee,Ed),e(ee,un),e(un,qd),e(un,pn),e(pn,Md),e(un,Pd),e(ee,Od),e(ee,fn),e(fn,Ad),e(fn,gn),e(gn,Cd),e(fn,Nd),e(ee,jd),w(to,ee,null),e(ee,Dd),e(ee,Ie),w(_n,Ie,null),e(Ie,Id),e(Ie,Nt),e(Nt,Sd),e(Nt,Un),e(Un,Rd),e(Nt,Qd),e(Nt,Gs),e(Gs,Wd),e(Nt,Vd),e(Ie,Bd),w(oo,Ie,null),e(Ie,Xd),w(no,Ie,null),u(o,Mr,p),u(o,jt,p),e(jt,so),e(so,Js),w(vn,Js,null),e(jt,Hd),e(jt,Ys),e(Ys,Ud),u(o,Pr,p),u(o,te,p),w(Tn,te,null),e(te,Kd),e(te,bn),e(bn,Gd),e(bn,Zs),e(Zs,Jd),e(bn,Yd),e(te,Zd),e(te,xn),e(xn,ec),e(xn,wn),e(wn,tc),e(xn,oc),e(te,nc),e(te,yn),e(yn,sc),e(yn,kn),e(kn,rc),e(yn,ac),e(te,ic),w(ro,te,null),e(te,lc),e(te,ht),w(Ln,ht,null),e(ht,dc),e(ht,Dt),e(Dt,cc),e(Dt,Kn),e(Kn,mc),e(Dt,hc),e(Dt,er),e(er,uc),e(Dt,pc),e(ht,fc),w(ao,ht,null),Or=!0},p(o,[p]){const $n={};p&2&&($n.$$scope={dirty:p,ctx:o}),Rt.$set($n);const tr={};p&2&&(tr.$$scope={dirty:p,ctx:o}),Vt.$set(tr);const or={};p&2&&(or.$$scope={dirty:p,ctx:o}),Ht.$set(or);const nr={};p&2&&(nr.$$scope={dirty:p,ctx:o}),Ut.$set(nr);const Fn={};p&2&&(Fn.$$scope={dirty:p,ctx:o}),Gt.$set(Fn);const sr={};p&2&&(sr.$$scope={dirty:p,ctx:o}),Yt.$set(sr);const rr={};p&2&&(rr.$$scope={dirty:p,ctx:o}),Zt.$set(rr);const ar={};p&2&&(ar.$$scope={dirty:p,ctx:o}),to.$set(ar);const zn={};p&2&&(zn.$$scope={dirty:p,ctx:o}),oo.$set(zn);const ir={};p&2&&(ir.$$scope={dirty:p,ctx:o}),no.$set(ir);const lr={};p&2&&(lr.$$scope={dirty:p,ctx:o}),ro.$set(lr);const dr={};p&2&&(dr.$$scope={dirty:p,ctx:o}),ao.$set(dr)},i(o){Or||(y(c.$$.fragment,o),y(F.$$.fragment,o),y(fe.$$.fragment,o),y($e.$$.fragment,o),y(Fe.$$.fragment,o),y(fo.$$.fragment,o),y(go.$$.fragment,o),y(vo.$$.fragment,o),y(bo.$$.fragment,o),y(xo.$$.fragment,o),y(Rt.$$.fragment,o),y(wo.$$.fragment,o),y(ko.$$.fragment,o),y(Lo.$$.fragment,o),y(zo.$$.fragment,o),y(qo.$$.fragment,o),y(Vt.$$.fragment,o),y(Mo.$$.fragment,o),y(Po.$$.fragment,o),y(Oo.$$.fragment,o),y(Co.$$.fragment,o),y(jo.$$.fragment,o),y(Do.$$.fragment,o),y(So.$$.fragment,o),y(Ro.$$.fragment,o),y(Ho.$$.fragment,o),y(Ht.$$.fragment,o),y(Ut.$$.fragment,o),y(Uo.$$.fragment,o),y(Ko.$$.fragment,o),y(tn.$$.fragment,o),y(Gt.$$.fragment,o),y(on.$$.fragment,o),y(nn.$$.fragment,o),y(cn.$$.fragment,o),y(Yt.$$.fragment,o),y(Zt.$$.fragment,o),y(mn.$$.fragment,o),y(hn.$$.fragment,o),y(to.$$.fragment,o),y(_n.$$.fragment,o),y(oo.$$.fragment,o),y(no.$$.fragment,o),y(vn.$$.fragment,o),y(Tn.$$.fragment,o),y(ro.$$.fragment,o),y(Ln.$$.fragment,o),y(ao.$$.fragment,o),Or=!0)},o(o){k(c.$$.fragment,o),k(F.$$.fragment,o),k(fe.$$.fragment,o),k($e.$$.fragment,o),k(Fe.$$.fragment,o),k(fo.$$.fragment,o),k(go.$$.fragment,o),k(vo.$$.fragment,o),k(bo.$$.fragment,o),k(xo.$$.fragment,o),k(Rt.$$.fragment,o),k(wo.$$.fragment,o),k(ko.$$.fragment,o),k(Lo.$$.fragment,o),k(zo.$$.fragment,o),k(qo.$$.fragment,o),k(Vt.$$.fragment,o),k(Mo.$$.fragment,o),k(Po.$$.fragment,o),k(Oo.$$.fragment,o),k(Co.$$.fragment,o),k(jo.$$.fragment,o),k(Do.$$.fragment,o),k(So.$$.fragment,o),k(Ro.$$.fragment,o),k(Ho.$$.fragment,o),k(Ht.$$.fragment,o),k(Ut.$$.fragment,o),k(Uo.$$.fragment,o),k(Ko.$$.fragment,o),k(tn.$$.fragment,o),k(Gt.$$.fragment,o),k(on.$$.fragment,o),k(nn.$$.fragment,o),k(cn.$$.fragment,o),k(Yt.$$.fragment,o),k(Zt.$$.fragment,o),k(mn.$$.fragment,o),k(hn.$$.fragment,o),k(to.$$.fragment,o),k(_n.$$.fragment,o),k(oo.$$.fragment,o),k(no.$$.fragment,o),k(vn.$$.fragment,o),k(Tn.$$.fragment,o),k(ro.$$.fragment,o),k(Ln.$$.fragment,o),k(ao.$$.fragment,o),Or=!1},d(o){t(h),o&&t($),o&&t(g),L(c),o&&t(ze),o&&t(j),L(F),o&&t(Ee),o&&t(R),o&&t(qe),o&&t(V),o&&t(Me),o&&t(B),o&&t(ve),o&&t(M),o&&t(Pe),o&&t(N),o&&t(Oe),o&&t(X),o&&t(Te),o&&t(P),L(fe),o&&t(at),o&&t(se),o&&t(it),o&&t(ge),L($e),o&&t(lt),o&&t(C),L(Fe),o&&t(ur),o&&t(Tt),L(fo),o&&t(pr),o&&t(W),L(go),L(vo),L(bo),L(xo),L(Rt),L(wo),o&&t(fr),o&&t(xt),L(ko),o&&t(gr),o&&t(_e),L(Lo),L(zo),L(qo),L(Vt),o&&t(_r),o&&t(yt),L(Mo),o&&t(vr),o&&t(kt),L(Po),o&&t(Tr),o&&t(Lt),L(Oo),o&&t(br),o&&t($t),L(Co),o&&t(xr),o&&t(Ft),L(jo),o&&t(wr),o&&t(zt),L(Do),o&&t(yr),o&&t(Et),L(So),o&&t(kr),o&&t(J),L(Ro),L(Ho),L(Ht),L(Ut),o&&t(Lr),o&&t(Mt),L(Uo),o&&t($r),o&&t(Y),L(Ko),L(tn),L(Gt),o&&t(Fr),o&&t(Ot),L(on),o&&t(zr),o&&t(Z),L(nn),L(cn),L(Yt),L(Zt),o&&t(Er),o&&t(Ct),L(mn),o&&t(qr),o&&t(ee),L(hn),L(to),L(_n),L(oo),L(no),o&&t(Mr),o&&t(jt),L(vn),o&&t(Pr),o&&t(te),L(Tn),L(ro),L(Ln),L(ao)}}}const $h={local:"lxmert",sections:[{local:"overview",title:"Overview"},{local:"documentation-resources",title:"Documentation resources"},{local:"transformers.LxmertConfig",title:"LxmertConfig"},{local:"transformers.LxmertTokenizer",title:"LxmertTokenizer"},{local:"transformers.LxmertTokenizerFast",title:"LxmertTokenizerFast"},{local:"transformers.models.lxmert.modeling_lxmert.LxmertModelOutput",title:"Lxmert specific outputs"},{local:"transformers.LxmertModel",title:"LxmertModel"},{local:"transformers.LxmertForPreTraining",title:"LxmertForPreTraining"},{local:"transformers.LxmertForQuestionAnswering",title:"LxmertForQuestionAnswering"},{local:"transformers.TFLxmertModel",title:"TFLxmertModel"},{local:"transformers.TFLxmertForPreTraining",title:"TFLxmertForPreTraining"}],title:"LXMERT"};function Fh(O){return hh(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ah extends lh{constructor(h){super();dh(this,h,Fh,Lh,ch,{})}}export{Ah as default,$h as metadata};
