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 C}from"../../chunks/Docstring-hf-doc-builder.js";import{C as hr}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as Ue}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as cr}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function uh(A){let h,$,g,_,v;return _=new hr({props:{code:"MCUyMDAlMjAwJTIwMCUyMDAlMjAwJTIwMCUyMDAlMjAwJTIwMCUyMDAlMjAxJTIwMSUyMDElMjAxJTIwMSUyMDElMjAxJTIwMSUyMDElMEElN0MlMjBmaXJzdCUyMHNlcXVlbmNlJTIwJTIwJTIwJTIwJTdDJTIwc2Vjb25kJTIwc2VxdWVuY2UlMjAlN0M=",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),v=!0},p:mr,i(c){v||(y(_.$$.fragment,c),v=!0)},o(c){k(_.$$.fragment,c),v=!1},d(c){c&&t(h),c&&t(g),L(_,c)}}}function ph(A){let h,$,g,_,v;return _=new hr({props:{code:"MCUyMDAlMjAwJTIwMCUyMDAlMjAwJTIwMCUyMDAlMjAwJTIwMCUyMDAlMjAxJTIwMSUyMDElMjAxJTIwMSUyMDElMjAxJTIwMSUyMDElMEElN0MlMjBmaXJzdCUyMHNlcXVlbmNlJTIwJTIwJTIwJTIwJTdDJTIwc2Vjb25kJTIwc2VxdWVuY2UlMjAlN0M=",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),v=!0},p:mr,i(c){v||(y(_.$$.fragment,c),v=!0)},o(c){k(_.$$.fragment,c),v=!1},d(c){c&&t(h),c&&t(g),L(_,c)}}}function fh(A){let h,$,g,_,v;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"),v=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),v=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,v)},d(c){c&&t(h)}}}function gh(A){let h,$,g,_,v;return _=new hr({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBMeG1lcnRNb2RlbCUwQWltcG9ydCUyMHRvcmNoJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIydW5jLW5scCUyRmx4bWVydC1iYXNlLXVuY2FzZWQlMjIpJTBBbW9kZWwlMjAlM0QlMjBMeG1lcnRNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIydW5jLW5scCUyRmx4bWVydC1iYXNlLXVuY2FzZWQlMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKCUyMkhlbGxvJTJDJTIwbXklMjBkb2clMjBpcyUyMGN1dGUlMjIlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEElMEFsYXN0X2hpZGRlbl9zdGF0ZXMlMjAlM0QlMjBvdXRwdXRzLmxhc3RfaGlkZGVuX3N0YXRl",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),v=!0},p:mr,i(c){v||(y(_.$$.fragment,c),v=!0)},o(c){k(_.$$.fragment,c),v=!1},d(c){c&&t(h),c&&t(g),L(_,c)}}}function _h(A){let h,$,g,_,v;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"),v=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),v=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,v)},d(c){c&&t(h)}}}function Th(A){let h,$,g,_,v;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"),v=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),v=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,v)},d(c){c&&t(h)}}}function vh(A){let h,$,g,_,v;return _=new hr({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBMeG1lcnRGb3JRdWVzdGlvbkFuc3dlcmluZyUwQWltcG9ydCUyMHRvcmNoJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIydW5jLW5scCUyRmx4bWVydC1iYXNlLXVuY2FzZWQlMjIpJTBBbW9kZWwlMjAlM0QlMjBMeG1lcnRGb3JRdWVzdGlvbkFuc3dlcmluZy5mcm9tX3ByZXRyYWluZWQoJTIydW5jLW5scCUyRmx4bWVydC1iYXNlLXVuY2FzZWQlMjIpJTBBJTBBcXVlc3Rpb24lMkMlMjB0ZXh0JTIwJTNEJTIwJTIyV2hvJTIwd2FzJTIwSmltJTIwSGVuc29uJTNGJTIyJTJDJTIwJTIySmltJTIwSGVuc29uJTIwd2FzJTIwYSUyMG5pY2UlMjBwdXBwZXQlMjIlMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIocXVlc3Rpb24lMkMlMjB0ZXh0JTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEF3aXRoJTIwdG9yY2gubm9fZ3JhZCgpJTNBJTBBJTIwJTIwJTIwJTIwb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQSUwQWFuc3dlcl9zdGFydF9pbmRleCUyMCUzRCUyMG91dHB1dHMuc3RhcnRfbG9naXRzLmFyZ21heCgpJTBBYW5zd2VyX2VuZF9pbmRleCUyMCUzRCUyMG91dHB1dHMuZW5kX2xvZ2l0cy5hcmdtYXgoKSUwQSUwQXByZWRpY3RfYW5zd2VyX3Rva2VucyUyMCUzRCUyMGlucHV0cy5pbnB1dF9pZHMlNUIwJTJDJTIwYW5zd2VyX3N0YXJ0X2luZGV4JTIwJTNBJTIwYW5zd2VyX2VuZF9pbmRleCUyMCUyQiUyMDElNUQlMEElMEElMjMlMjB0YXJnZXQlMjBpcyUyMCUyMm5pY2UlMjBwdXBwZXQlMjIlMEF0YXJnZXRfc3RhcnRfaW5kZXglMjAlM0QlMjB0b3JjaC50ZW5zb3IoJTVCMTQlNUQpJTBBdGFyZ2V0X2VuZF9pbmRleCUyMCUzRCUyMHRvcmNoLnRlbnNvciglNUIxNSU1RCklMEElMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMlMkMlMjBzdGFydF9wb3NpdGlvbnMlM0R0YXJnZXRfc3RhcnRfaW5kZXglMkMlMjBlbmRfcG9zaXRpb25zJTNEdGFyZ2V0X2VuZF9pbmRleCklMEFsb3NzJTIwJTNEJTIwb3V0cHV0cy5sb3Nz",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),v=!0},p:mr,i(c){v||(y(_.$$.fragment,c),v=!0)},o(c){k(_.$$.fragment,c),v=!1},d(c){c&&t(h),c&&t(g),L(_,c)}}}function bh(A){let h,$,g,_,v,c,f,E,Ve,Me,I,oe,ae,F,Qe,Q,Be,Ee,J,Ge,ie,le,Ze,ze,X,He,qe,U,we,Ye,Te,q,j,Pe,N,ye,Ke,de,ke,et,D,Le,ce,Ae,V,me,he,tt,B,ue,pe,ot,ve,P,ne,R,fe,nt;return{c(){h=n("p"),$=a("TensorFlow models and layers in "),g=n("code"),_=a("transformers"),v=a(" accept two formats as input:"),c=l(),f=n("ul"),E=n("li"),Ve=a("having all inputs as keyword arguments (like PyTorch models), or"),Me=l(),I=n("li"),oe=a("having all inputs as a list, tuple or dict in the first positional argument."),ae=l(),F=n("p"),Qe=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 `),Q=n("code"),Be=a("model.fit()"),Ee=a(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),J=n("code"),Ge=a("model.fit()"),ie=a(` supports! If, however, you want to use the second
format outside of Keras methods like `),le=n("code"),Ze=a("fit()"),ze=a(" and "),X=n("code"),He=a("predict()"),qe=a(`, such as when creating your own layers or models with
the Keras `),U=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:`),Te=l(),q=n("ul"),j=n("li"),Pe=a("a single Tensor with "),N=n("code"),ye=a("input_ids"),Ke=a(" only and nothing else: "),de=n("code"),ke=a("model(input_ids)"),et=l(),D=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"),Ae=a("model([input_ids, attention_mask])"),V=a(" or "),me=n("code"),he=a("model([input_ids, attention_mask, token_type_ids])"),tt=l(),B=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})'),ve=l(),P=n("p"),ne=a(`Note that when creating models and layers with
`),R=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(T){h=s(T,"P",{});var M=r(h);$=i(M,"TensorFlow models and layers in "),g=s(M,"CODE",{});var at=r(g);_=i(at,"transformers"),at.forEach(t),v=i(M," accept two formats as input:"),M.forEach(t),c=d(T),f=s(T,"UL",{});var se=r(f);E=s(se,"LI",{});var st=r(E);Ve=i(st,"having all inputs as keyword arguments (like PyTorch models), or"),st.forEach(t),Me=d(se),I=s(se,"LI",{});var Ce=r(I);oe=i(Ce,"having all inputs as a list, tuple or dict in the first positional argument."),Ce.forEach(t),se.forEach(t),ae=d(T),F=s(T,"P",{});var z=r(F);Qe=i(z,`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 `),Q=s(z,"CODE",{});var it=r(Q);Be=i(it,"model.fit()"),it.forEach(t),Ee=i(z,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),J=s(z,"CODE",{});var ge=r(J);Ge=i(ge,"model.fit()"),ge.forEach(t),ie=i(z,` supports! If, however, you want to use the second
format outside of Keras methods like `),le=s(z,"CODE",{});var be=r(le);Ze=i(be,"fit()"),be.forEach(t),ze=i(z," and "),X=s(z,"CODE",{});var rt=r(X);He=i(rt,"predict()"),rt.forEach(t),qe=i(z,`, such as when creating your own layers or models with
the Keras `),U=s(z,"CODE",{});var $e=r(U);we=i($e,"Functional"),$e.forEach(t),Ye=i(z,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),z.forEach(t),Te=d(T),q=s(T,"UL",{});var G=r(q);j=s(G,"LI",{});var Z=r(j);Pe=i(Z,"a single Tensor with "),N=s(Z,"CODE",{});var pt=r(N);ye=i(pt,"input_ids"),pt.forEach(t),Ke=i(Z," only and nothing else: "),de=s(Z,"CODE",{});var lt=r(de);ke=i(lt,"model(input_ids)"),lt.forEach(t),Z.forEach(t),et=d(G),D=s(G,"LI",{});var O=r(D);Le=i(O,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),ce=s(O,"CODE",{});var Fe=r(ce);Ae=i(Fe,"model([input_ids, attention_mask])"),Fe.forEach(t),V=i(O," or "),me=s(O,"CODE",{});var ft=r(me);he=i(ft,"model([input_ids, attention_mask, token_type_ids])"),ft.forEach(t),O.forEach(t),tt=d(G),B=s(G,"LI",{});var S=r(B);ue=i(S,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),pe=s(S,"CODE",{});var gt=r(pe);ot=i(gt,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),gt.forEach(t),S.forEach(t),G.forEach(t),ve=d(T),P=s(T,"P",{});var re=r(P);ne=i(re,`Note that when creating models and layers with
`),R=s(re,"A",{href:!0,rel:!0});var _t=r(R);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(R,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),m(R,"rel","nofollow")},m(T,M){u(T,h,M),e(h,$),e(h,g),e(g,_),e(h,v),u(T,c,M),u(T,f,M),e(f,E),e(E,Ve),e(f,Me),e(f,I),e(I,oe),u(T,ae,M),u(T,F,M),e(F,Qe),e(F,Q),e(Q,Be),e(F,Ee),e(F,J),e(J,Ge),e(F,ie),e(F,le),e(le,Ze),e(F,ze),e(F,X),e(X,He),e(F,qe),e(F,U),e(U,we),e(F,Ye),u(T,Te,M),u(T,q,M),e(q,j),e(j,Pe),e(j,N),e(N,ye),e(j,Ke),e(j,de),e(de,ke),e(q,et),e(q,D),e(D,Le),e(D,ce),e(ce,Ae),e(D,V),e(D,me),e(me,he),e(q,tt),e(q,B),e(B,ue),e(B,pe),e(pe,ot),u(T,ve,M),u(T,P,M),e(P,ne),e(P,R),e(R,fe),e(P,nt)},d(T){T&&t(h),T&&t(c),T&&t(f),T&&t(ae),T&&t(F),T&&t(Te),T&&t(q),T&&t(ve),T&&t(P)}}}function xh(A){let h,$,g,_,v;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"),v=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),v=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,v)},d(c){c&&t(h)}}}function wh(A){let h,$,g,_,v;return _=new hr({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBURkx4bWVydE1vZGVsJTBBaW1wb3J0JTIwdGVuc29yZmxvdyUyMGFzJTIwdGYlMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJ1bmMtbmxwJTJGbHhtZXJ0LWJhc2UtdW5jYXNlZCUyMiklMEFtb2RlbCUyMCUzRCUyMFRGTHhtZXJ0TW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMnVuYy1ubHAlMkZseG1lcnQtYmFzZS11bmNhc2VkJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplciglMjJIZWxsbyUyQyUyMG15JTIwZG9nJTIwaXMlMjBjdXRlJTIyJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJ0ZiUyMiklMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoaW5wdXRzKSUwQSUwQWxhc3RfaGlkZGVuX3N0YXRlcyUyMCUzRCUyMG91dHB1dHMubGFzdF9oaWRkZW5fc3RhdGU=",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),v=!0},p:mr,i(c){v||(y(_.$$.fragment,c),v=!0)},o(c){k(_.$$.fragment,c),v=!1},d(c){c&&t(h),c&&t(g),L(_,c)}}}function yh(A){let h,$,g,_,v,c,f,E,Ve,Me,I,oe,ae,F,Qe,Q,Be,Ee,J,Ge,ie,le,Ze,ze,X,He,qe,U,we,Ye,Te,q,j,Pe,N,ye,Ke,de,ke,et,D,Le,ce,Ae,V,me,he,tt,B,ue,pe,ot,ve,P,ne,R,fe,nt;return{c(){h=n("p"),$=a("TensorFlow models and layers in "),g=n("code"),_=a("transformers"),v=a(" accept two formats as input:"),c=l(),f=n("ul"),E=n("li"),Ve=a("having all inputs as keyword arguments (like PyTorch models), or"),Me=l(),I=n("li"),oe=a("having all inputs as a list, tuple or dict in the first positional argument."),ae=l(),F=n("p"),Qe=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 `),Q=n("code"),Be=a("model.fit()"),Ee=a(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),J=n("code"),Ge=a("model.fit()"),ie=a(` supports! If, however, you want to use the second
format outside of Keras methods like `),le=n("code"),Ze=a("fit()"),ze=a(" and "),X=n("code"),He=a("predict()"),qe=a(`, such as when creating your own layers or models with
the Keras `),U=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:`),Te=l(),q=n("ul"),j=n("li"),Pe=a("a single Tensor with "),N=n("code"),ye=a("input_ids"),Ke=a(" only and nothing else: "),de=n("code"),ke=a("model(input_ids)"),et=l(),D=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"),Ae=a("model([input_ids, attention_mask])"),V=a(" or "),me=n("code"),he=a("model([input_ids, attention_mask, token_type_ids])"),tt=l(),B=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})'),ve=l(),P=n("p"),ne=a(`Note that when creating models and layers with
`),R=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(T){h=s(T,"P",{});var M=r(h);$=i(M,"TensorFlow models and layers in "),g=s(M,"CODE",{});var at=r(g);_=i(at,"transformers"),at.forEach(t),v=i(M," accept two formats as input:"),M.forEach(t),c=d(T),f=s(T,"UL",{});var se=r(f);E=s(se,"LI",{});var st=r(E);Ve=i(st,"having all inputs as keyword arguments (like PyTorch models), or"),st.forEach(t),Me=d(se),I=s(se,"LI",{});var Ce=r(I);oe=i(Ce,"having all inputs as a list, tuple or dict in the first positional argument."),Ce.forEach(t),se.forEach(t),ae=d(T),F=s(T,"P",{});var z=r(F);Qe=i(z,`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 `),Q=s(z,"CODE",{});var it=r(Q);Be=i(it,"model.fit()"),it.forEach(t),Ee=i(z,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),J=s(z,"CODE",{});var ge=r(J);Ge=i(ge,"model.fit()"),ge.forEach(t),ie=i(z,` supports! If, however, you want to use the second
format outside of Keras methods like `),le=s(z,"CODE",{});var be=r(le);Ze=i(be,"fit()"),be.forEach(t),ze=i(z," and "),X=s(z,"CODE",{});var rt=r(X);He=i(rt,"predict()"),rt.forEach(t),qe=i(z,`, such as when creating your own layers or models with
the Keras `),U=s(z,"CODE",{});var $e=r(U);we=i($e,"Functional"),$e.forEach(t),Ye=i(z,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),z.forEach(t),Te=d(T),q=s(T,"UL",{});var G=r(q);j=s(G,"LI",{});var Z=r(j);Pe=i(Z,"a single Tensor with "),N=s(Z,"CODE",{});var pt=r(N);ye=i(pt,"input_ids"),pt.forEach(t),Ke=i(Z," only and nothing else: "),de=s(Z,"CODE",{});var lt=r(de);ke=i(lt,"model(input_ids)"),lt.forEach(t),Z.forEach(t),et=d(G),D=s(G,"LI",{});var O=r(D);Le=i(O,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),ce=s(O,"CODE",{});var Fe=r(ce);Ae=i(Fe,"model([input_ids, attention_mask])"),Fe.forEach(t),V=i(O," or "),me=s(O,"CODE",{});var ft=r(me);he=i(ft,"model([input_ids, attention_mask, token_type_ids])"),ft.forEach(t),O.forEach(t),tt=d(G),B=s(G,"LI",{});var S=r(B);ue=i(S,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),pe=s(S,"CODE",{});var gt=r(pe);ot=i(gt,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),gt.forEach(t),S.forEach(t),G.forEach(t),ve=d(T),P=s(T,"P",{});var re=r(P);ne=i(re,`Note that when creating models and layers with
`),R=s(re,"A",{href:!0,rel:!0});var _t=r(R);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(R,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),m(R,"rel","nofollow")},m(T,M){u(T,h,M),e(h,$),e(h,g),e(g,_),e(h,v),u(T,c,M),u(T,f,M),e(f,E),e(E,Ve),e(f,Me),e(f,I),e(I,oe),u(T,ae,M),u(T,F,M),e(F,Qe),e(F,Q),e(Q,Be),e(F,Ee),e(F,J),e(J,Ge),e(F,ie),e(F,le),e(le,Ze),e(F,ze),e(F,X),e(X,He),e(F,qe),e(F,U),e(U,we),e(F,Ye),u(T,Te,M),u(T,q,M),e(q,j),e(j,Pe),e(j,N),e(N,ye),e(j,Ke),e(j,de),e(de,ke),e(q,et),e(q,D),e(D,Le),e(D,ce),e(ce,Ae),e(D,V),e(D,me),e(me,he),e(q,tt),e(q,B),e(B,ue),e(B,pe),e(pe,ot),u(T,ve,M),u(T,P,M),e(P,ne),e(P,R),e(R,fe),e(P,nt)},d(T){T&&t(h),T&&t(c),T&&t(f),T&&t(ae),T&&t(F),T&&t(Te),T&&t(q),T&&t(ve),T&&t(P)}}}function kh(A){let h,$,g,_,v;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"),v=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),v=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,v)},d(c){c&&t(h)}}}function Lh(A){let h,$,g,_,v,c,f,E,Ve,Me,I,oe,ae,F,Qe,Q,Be,Ee,J,Ge,ie,le,Ze,ze,X,He,qe,U,we,Ye,Te,q,j,Pe,N,ye,Ke,de,ke,et,D,Le,ce,Ae,V,me,he,tt,B,ue,pe,ot,ve,P,ne,R,fe,nt,T,M,at,se,st,Ce,z,it,ge,be,rt,$e,G,Z,pt,lt,O,Fe,ft,S,gt,re,_t,ba,zn,xa,wa,po,ya,ka,La,Tt,$a,qn,Fa,Ma,Pn,Ea,za,ur,vt,Dt,ms,fo,qa,hs,Pa,pr,W,go,Aa,us,Ca,Oa,_o,Na,An,Ia,ja,Da,dt,To,Ra,ps,Ja,Sa,vo,Cn,Wa,fs,Xa,Ua,On,Va,gs,Qa,Ba,Rt,bo,Ga,_s,Za,Ha,Oe,xo,Ya,Ts,Ka,ei,Jt,ti,bt,oi,vs,ni,si,bs,ri,ai,ii,St,wo,li,yo,di,xs,ci,mi,fr,xt,Wt,ws,ko,hi,ys,ui,gr,_e,Lo,pi,$o,fi,ks,gi,_i,Ti,Fo,vi,Nn,bi,xi,wi,ct,Mo,yi,Ls,ki,Li,Eo,In,$i,$s,Fi,Mi,jn,Ei,Fs,zi,qi,Ne,zo,Pi,Ms,Ai,Ci,Xt,Oi,wt,Ni,Es,Ii,ji,zs,Di,Ri,_r,yt,Ut,qs,qo,Ji,Ps,Si,Tr,kt,Po,Wi,As,Xi,vr,Lt,Ao,Ui,Co,Vi,Dn,Qi,Bi,br,$t,Oo,Gi,No,Zi,Rn,Hi,Yi,xr,Ft,Io,Ki,Cs,el,wr,Mt,jo,tl,Do,ol,Jn,nl,sl,yr,Et,Vt,Os,Ro,rl,Ns,al,kr,H,Jo,il,Is,ll,dl,So,cl,Wo,ml,hl,ul,Xo,pl,Sn,fl,gl,_l,Uo,Tl,Vo,vl,bl,xl,Ie,Qo,wl,zt,yl,Wn,kl,Ll,js,$l,Fl,Ml,Qt,El,Bt,Lr,qt,Gt,Ds,Bo,zl,Rs,ql,$r,Y,Go,Pl,Js,Al,Cl,Zo,Ol,Ho,Nl,Il,jl,Yo,Dl,Xn,Rl,Jl,Sl,Ko,Wl,en,Xl,Ul,Vl,mt,tn,Ql,Pt,Bl,Un,Gl,Zl,Ss,Hl,Yl,Kl,Zt,Fr,At,Ht,Ws,on,ed,Xs,td,Mr,K,nn,od,Us,nd,sd,sn,rd,rn,ad,id,ld,an,dd,Vn,cd,md,hd,ln,ud,dn,pd,fd,gd,je,cn,_d,Ct,Td,Qn,vd,bd,Vs,xd,wd,yd,Yt,kd,Kt,Er,Ot,eo,Qs,mn,Ld,Bs,$d,zr,ee,hn,Fd,Gs,Md,Ed,un,zd,pn,qd,Pd,Ad,fn,Cd,gn,Od,Nd,Id,to,jd,De,_n,Dd,Nt,Rd,Bn,Jd,Sd,Zs,Wd,Xd,Ud,oo,Vd,no,qr,It,so,Hs,Tn,Qd,Ys,Bd,Pr,te,vn,Gd,bn,Zd,Ks,Hd,Yd,Kd,xn,ec,wn,tc,oc,nc,yn,sc,kn,rc,ac,ic,ro,lc,ht,Ln,dc,jt,cc,Gn,mc,hc,er,uc,pc,fc,ao,Ar;return c=new Ue({}),F=new Ue({}),fe=new Ue({}),$e=new Ue({}),Fe=new C({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/main/en/model_doc/lxmert#transformers.LxmertModel">LxmertModel</a> or <a href="/docs/transformers/main/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/main/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/main/src/transformers/models/lxmert/configuration_lxmert.py#L29"}}),fo=new Ue({}),go=new C({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/main/src/transformers/models/lxmert/tokenization_lxmert.py#L67"}}),To=new C({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/main/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 C({props:{name:"convert_tokens_to_string",anchor:"transformers.LxmertTokenizer.convert_tokens_to_string",parameters:[{name:"tokens",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/lxmert/tokenization_lxmert.py#L192"}}),xo=new C({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/main/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>
`}}),Jt=new cr({props:{anchor:"transformers.LxmertTokenizer.create_token_type_ids_from_sequences.example",$$slots:{default:[uh]},$$scope:{ctx:A}}}),wo=new C({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/main/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 Ue({}),Lo=new C({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/main/src/transformers/models/lxmert/tokenization_lxmert_fast.py#L48"}}),Mo=new C({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/main/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>
`}}),zo=new C({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/main/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>
`}}),Xt=new cr({props:{anchor:"transformers.LxmertTokenizerFast.create_token_type_ids_from_sequences.example",$$slots:{default:[ph]},$$scope:{ctx:A}}}),qo=new Ue({}),Po=new C({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/main/src/transformers/models/lxmert/modeling_lxmert.py#L60"}}),Ao=new C({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).`,name:"prediction_logits"},{anchor:"transformers.models.lxmert.modeling_lxmert.LxmertForPreTrainingOutput.cross_relationship_score",description:`<strong>cross_relationship_score</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, 2)</code>) &#x2014;
Prediction scores of the textual matching objective (classification) head (scores of True/False
continuation before SoftMax).`,name:"cross_relationship_score"},{anchor:"transformers.models.lxmert.modeling_lxmert.LxmertForPreTrainingOutput.question_answering_score",description:`<strong>question_answering_score</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, n_qa_answers)</code>) &#x2014;
Prediction scores of question answering objective (classification).`,name:"question_answering_score"},{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/main/src/transformers/models/lxmert/modeling_lxmert.py#L146"}}),Oo=new C({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.`,name:"loss"},{anchor:"transformers.models.lxmert.modeling_lxmert.LxmertForQuestionAnsweringOutput.question_answering_score",description:`<strong>question_answering_score</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, n_qa_answers)</code>, <em>optional</em>) &#x2014;
Prediction scores of question answering objective (classification).`,name:"question_answering_score"},{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/main/src/transformers/models/lxmert/modeling_lxmert.py#L106"}}),Io=new C({props:{name:"class transformers.models.lxmert.modeling_tf_lxmert.TFLxmertModelOutput",anchor:"transformers.models.lxmert.modeling_tf_lxmert.TFLxmertModelOutput",parameters:[{name:"language_output",val:": tf.Tensor | None = None"},{name:"vision_output",val:": tf.Tensor | None = None"},{name:"pooled_output",val:": tf.Tensor | None = None"},{name:"language_hidden_states",val:": Tuple[tf.Tensor] | None = None"},{name:"vision_hidden_states",val:": Tuple[tf.Tensor] | None = None"},{name:"language_attentions",val:": Tuple[tf.Tensor] | None = None"},{name:"vision_attentions",val:": Tuple[tf.Tensor] | None = None"},{name:"cross_encoder_attentions",val:": Tuple[tf.Tensor] | None = 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/main/src/transformers/models/lxmert/modeling_tf_lxmert.py#L61"}}),jo=new C({props:{name:"class transformers.models.lxmert.modeling_tf_lxmert.TFLxmertForPreTrainingOutput",anchor:"transformers.models.lxmert.modeling_tf_lxmert.TFLxmertForPreTrainingOutput",parameters:[{name:"loss",val:": tf.Tensor | None = None"},{name:"prediction_logits",val:": tf.Tensor | None = None"},{name:"cross_relationship_score",val:": tf.Tensor | None = None"},{name:"question_answering_score",val:": tf.Tensor | None = None"},{name:"language_hidden_states",val:": Tuple[tf.Tensor] | None = None"},{name:"vision_hidden_states",val:": Tuple[tf.Tensor] | None = None"},{name:"language_attentions",val:": Tuple[tf.Tensor] | None = None"},{name:"vision_attentions",val:": Tuple[tf.Tensor] | None = None"},{name:"cross_encoder_attentions",val:": Tuple[tf.Tensor] | None = 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).`,name:"prediction_logits"},{anchor:"transformers.models.lxmert.modeling_tf_lxmert.TFLxmertForPreTrainingOutput.cross_relationship_score",description:`<strong>cross_relationship_score</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, 2)</code>) &#x2014;
Prediction scores of the textual matching objective (classification) head (scores of True/False
continuation before SoftMax).`,name:"cross_relationship_score"},{anchor:"transformers.models.lxmert.modeling_tf_lxmert.TFLxmertForPreTrainingOutput.question_answering_score",description:`<strong>question_answering_score</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, n_qa_answers)</code>) &#x2014;
Prediction scores of question answering objective (classification).`,name:"question_answering_score"},{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/main/src/transformers/models/lxmert/modeling_tf_lxmert.py#L107"}}),Ro=new Ue({}),Jo=new C({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/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/lxmert/modeling_lxmert.py#L883"}}),Qo=new C({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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/model_doc/perceiver#transformers.PerceiverTokenizer.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.LxmertModel.forward.visual_feats",description:`<strong>visual_feats</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_visual_features, visual_feat_dim)</code>) &#x2014;
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.`,name:"visual_feats"},{anchor:"transformers.LxmertModel.forward.visual_pos",description:`<strong>visual_pos</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_visual_features, visual_pos_dim)</code>) &#x2014;
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:"visual_pos"},{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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/lxmert/modeling_lxmert.py#L898",returnDescription:`
<p>A <a
  href="/docs/transformers/main/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/main/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/main/en/model_doc/lxmert#transformers.models.lxmert.modeling_lxmert.LxmertModelOutput"
>transformers.models.lxmert.modeling_lxmert.LxmertModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Qt=new En({props:{$$slots:{default:[fh]},$$scope:{ctx:A}}}),Bt=new cr({props:{anchor:"transformers.LxmertModel.forward.example",$$slots:{default:[gh]},$$scope:{ctx:A}}}),Bo=new Ue({}),Go=new C({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/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/lxmert/modeling_lxmert.py#L1021"}}),tn=new C({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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/model_doc/perceiver#transformers.PerceiverTokenizer.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.LxmertForPreTraining.forward.visual_feats",description:`<strong>visual_feats</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_visual_features, visual_feat_dim)</code>) &#x2014;
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.`,name:"visual_feats"},{anchor:"transformers.LxmertForPreTraining.forward.visual_pos",description:`<strong>visual_pos</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_visual_features, visual_pos_dim)</code>) &#x2014;
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:"visual_pos"},{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/main/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>`,name:"labels"},{anchor:"transformers.LxmertForPreTraining.forward.obj_labels",description:`<strong>obj_labels</strong> (<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:"obj_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/main/src/transformers/models/lxmert/modeling_lxmert.py#L1150",returnDescription:`
<p>A <a
  href="/docs/transformers/main/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/main/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/main/en/model_doc/lxmert#transformers.models.lxmert.modeling_lxmert.LxmertForPreTrainingOutput"
>transformers.models.lxmert.modeling_lxmert.LxmertForPreTrainingOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Zt=new En({props:{$$slots:{default:[_h]},$$scope:{ctx:A}}}),on=new Ue({}),nn=new C({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/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/lxmert/modeling_lxmert.py#L1289"}}),cn=new C({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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/model_doc/perceiver#transformers.PerceiverTokenizer.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.LxmertForQuestionAnswering.forward.visual_feats",description:`<strong>visual_feats</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_visual_features, visual_feat_dim)</code>) &#x2014;
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.`,name:"visual_feats"},{anchor:"transformers.LxmertForQuestionAnswering.forward.visual_pos",description:`<strong>visual_pos</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_visual_features, visual_pos_dim)</code>) &#x2014;
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:"visual_pos"},{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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.LxmertForQuestionAnswering.forward.labels",description:`<strong>labels</strong> (<code>Torch.Tensor</code> of shape <code>(batch_size)</code>, <em>optional</em>) &#x2014;
A one-hot representation of the correct answer`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/lxmert/modeling_lxmert.py#L1381",returnDescription:`
<p>A <a
  href="/docs/transformers/main/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/main/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/main/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:[Th]},$$scope:{ctx:A}}}),Kt=new cr({props:{anchor:"transformers.LxmertForQuestionAnswering.forward.example",$$slots:{default:[vh]},$$scope:{ctx:A}}}),mn=new Ue({}),hn=new C({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/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/lxmert/modeling_tf_lxmert.py#L927"}}),to=new En({props:{$$slots:{default:[bh]},$$scope:{ctx:A}}}),_n=new C({props:{name:"call",anchor:"transformers.TFLxmertModel.call",parameters:[{name:"input_ids",val:": TFModelInputType | None = None"},{name:"visual_feats",val:": tf.Tensor | None = None"},{name:"visual_pos",val:": tf.Tensor | None = None"},{name:"attention_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"visual_attention_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"token_type_ids",val:": np.ndarray | tf.Tensor | None = None"},{name:"inputs_embeds",val:": np.ndarray | tf.Tensor | None = None"},{name:"output_attentions",val:": Optional[bool] = None"},{name:"output_hidden_states",val:": Optional[bool] = None"},{name:"return_dict",val:": 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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/model_doc/perceiver#transformers.PerceiverTokenizer.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFLxmertModel.call.visual_feats",description:`<strong>visual_feats</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, num_visual_features, visual_feat_dim)</code>) &#x2014;
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.`,name:"visual_feats"},{anchor:"transformers.TFLxmertModel.call.visual_pos",description:`<strong>visual_pos</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, num_visual_features, visual_feat_dim)</code>) &#x2014;
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:"visual_pos"},{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/main/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/main/src/transformers/models/lxmert/modeling_tf_lxmert.py#L932",returnDescription:`
<p>A <a
  href="/docs/transformers/main/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/main/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/main/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:A}}}),no=new cr({props:{anchor:"transformers.TFLxmertModel.call.example",$$slots:{default:[wh]},$$scope:{ctx:A}}}),Tn=new Ue({}),vn=new C({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/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/lxmert/modeling_tf_lxmert.py#L1149"}}),ro=new En({props:{$$slots:{default:[yh]},$$scope:{ctx:A}}}),Ln=new C({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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/model_doc/perceiver#transformers.PerceiverTokenizer.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFLxmertForPreTraining.call.visual_feats",description:`<strong>visual_feats</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, num_visual_features, visual_feat_dim)</code>) &#x2014;
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.`,name:"visual_feats"},{anchor:"transformers.TFLxmertForPreTraining.call.visual_pos",description:`<strong>visual_pos</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, num_visual_features, visual_feat_dim)</code>) &#x2014;
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:"visual_pos"},{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/main/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>`,name:"masked_lm_labels"},{anchor:"transformers.TFLxmertForPreTraining.call.obj_labels",description:`<strong>obj_labels</strong> (<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:"obj_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/main/src/transformers/models/lxmert/modeling_tf_lxmert.py#L1249",returnDescription:`
<p>A <a
  href="/docs/transformers/main/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/main/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/main/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:A}}}),{c(){h=n("meta"),$=l(),g=n("h1"),_=n("a"),v=n("span"),b(c.$$.fragment),f=l(),E=n("span"),Ve=a("LXMERT"),Me=l(),I=n("h2"),oe=n("a"),ae=n("span"),b(F.$$.fragment),Qe=l(),Q=n("span"),Be=a("Overview"),Ee=l(),J=n("p"),Ge=a("The LXMERT model was proposed in "),ie=n("a"),le=a("LXMERT: Learning Cross-Modality Encoder Representations from Transformers"),Ze=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.`),ze=l(),X=n("p"),He=a("The abstract from the paper is the following:"),qe=l(),U=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`),Te=l(),q=n("p"),j=a("Tips:"),Pe=l(),N=n("ul"),ye=n("li"),Ke=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.`),D=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.`),Ae=l(),V=n("p"),me=a("This model was contributed by "),he=n("a"),tt=a("eltoto1219"),B=a(". The original code can be found "),ue=n("a"),pe=a("here"),ot=a("."),ve=l(),P=n("h2"),ne=n("a"),R=n("span"),b(fe.$$.fragment),nt=l(),T=n("span"),M=a("Documentation resources"),at=l(),se=n("ul"),st=n("li"),Ce=n("a"),z=a("Question answering task guide"),it=l(),ge=n("h2"),be=n("a"),rt=n("span"),b($e.$$.fragment),G=l(),Z=n("span"),pt=a("LxmertConfig"),lt=l(),O=n("div"),b(Fe.$$.fragment),ft=l(),S=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 "),zn=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(),Tt=n("p"),$a=a("Configuration objects inherit from "),qn=n("a"),Fa=a("PretrainedConfig"),Ma=a(` and can be used to control the model outputs. Read the
documentation from `),Pn=n("a"),Ea=a("PretrainedConfig"),za=a(" for more information."),ur=l(),vt=n("h2"),Dt=n("a"),ms=n("span"),b(fo.$$.fragment),qa=l(),hs=n("span"),Pa=a("LxmertTokenizer"),pr=l(),W=n("div"),b(go.$$.fragment),Aa=l(),us=n("p"),Ca=a("Construct a Lxmert tokenizer. Based on WordPiece."),Oa=l(),_o=n("p"),Na=a("This tokenizer inherits from "),An=n("a"),Ia=a("PreTrainedTokenizer"),ja=a(` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),Da=l(),dt=n("div"),b(To.$$.fragment),Ra=l(),ps=n("p"),Ja=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:`),Sa=l(),vo=n("ul"),Cn=n("li"),Wa=a("single sequence: "),fs=n("code"),Xa=a("[CLS] X [SEP]"),Ua=l(),On=n("li"),Va=a("pair of sequences: "),gs=n("code"),Qa=a("[CLS] A [SEP] B [SEP]"),Ba=l(),Rt=n("div"),b(bo.$$.fragment),Ga=l(),_s=n("p"),Za=a("Converts a sequence of tokens (string) in a single string."),Ha=l(),Oe=n("div"),b(xo.$$.fragment),Ya=l(),Ts=n("p"),Ka=a("Create a mask from the two sequences passed to be used in a sequence-pair classification task. A Lxmert"),ei=l(),b(Jt.$$.fragment),ti=l(),bt=n("p"),oi=a("If "),vs=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(),St=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."),Ti=l(),Fo=n("p"),vi=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(Mo.$$.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"),In=n("li"),$i=a("single sequence: "),$s=n("code"),Fi=a("[CLS] X [SEP]"),Mi=l(),jn=n("li"),Ei=a("pair of sequences: "),Fs=n("code"),zi=a("[CLS] A [SEP] B [SEP]"),qi=l(),Ne=n("div"),b(zo.$$.fragment),Pi=l(),Ms=n("p"),Ai=a("Create a mask from the two sequences passed to be used in a sequence-pair classification task. A Lxmert"),Ci=l(),b(Xt.$$.fragment),Oi=l(),wt=n("p"),Ni=a("If "),Es=n("code"),Ii=a("token_ids_1"),ji=a(" is "),zs=n("code"),Di=a("None"),Ri=a(", this method only returns the first portion of the mask (0s)."),_r=l(),yt=n("h2"),Ut=n("a"),qs=n("span"),b(qo.$$.fragment),Ji=l(),Ps=n("span"),Si=a("Lxmert specific outputs"),Tr=l(),kt=n("div"),b(Po.$$.fragment),Wi=l(),As=n("p"),Xi=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)`),vr=l(),Lt=n("div"),b(Ao.$$.fragment),Ui=l(),Co=n("p"),Vi=a("Output type of "),Dn=n("a"),Qi=a("LxmertForPreTraining"),Bi=a("."),br=l(),$t=n("div"),b(Oo.$$.fragment),Gi=l(),No=n("p"),Zi=a("Output type of "),Rn=n("a"),Hi=a("LxmertForQuestionAnswering"),Yi=a("."),xr=l(),Ft=n("div"),b(Io.$$.fragment),Ki=l(),Cs=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(),Mt=n("div"),b(jo.$$.fragment),tl=l(),Do=n("p"),ol=a("Output type of "),Jn=n("a"),nl=a("LxmertForPreTraining"),sl=a("."),yr=l(),Et=n("h2"),Vt=n("a"),Os=n("span"),b(Ro.$$.fragment),rl=l(),Ns=n("span"),al=a("LxmertModel"),kr=l(),H=n("div"),b(Jo.$$.fragment),il=l(),Is=n("p"),ll=a("The bare Lxmert Model transformer outputting raw hidden-states without any specific head on top."),dl=l(),So=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(),Xo=n("p"),pl=a("This model inherits from "),Sn=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(),Uo=n("p"),Tl=a("This model is also a PyTorch "),Vo=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(),Ie=n("div"),b(Qo.$$.fragment),wl=l(),zt=n("p"),yl=a("The "),Wn=n("a"),kl=a("LxmertModel"),Ll=a(" forward method, overrides the "),js=n("code"),$l=a("__call__"),Fl=a(" special method."),Ml=l(),b(Qt.$$.fragment),El=l(),b(Bt.$$.fragment),Lr=l(),qt=n("h2"),Gt=n("a"),Ds=n("span"),b(Bo.$$.fragment),zl=l(),Rs=n("span"),ql=a("LxmertForPreTraining"),$r=l(),Y=n("div"),b(Go.$$.fragment),Pl=l(),Js=n("p"),Al=a("Lxmert Model with a specified pretraining head on top."),Cl=l(),Zo=n("p"),Ol=a("The LXMERT model was proposed in "),Ho=n("a"),Nl=a(`LXMERT: Learning Cross-Modality Encoder Representations from
Transformers`),Il=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.`),jl=l(),Yo=n("p"),Dl=a("This model inherits from "),Xn=n("a"),Rl=a("PreTrainedModel"),Jl=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.)`),Sl=l(),Ko=n("p"),Wl=a("This model is also a PyTorch "),en=n("a"),Xl=a("torch.nn.Module"),Ul=a(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Vl=l(),mt=n("div"),b(tn.$$.fragment),Ql=l(),Pt=n("p"),Bl=a("The "),Un=n("a"),Gl=a("LxmertForPreTraining"),Zl=a(" forward method, overrides the "),Ss=n("code"),Hl=a("__call__"),Yl=a(" special method."),Kl=l(),b(Zt.$$.fragment),Fr=l(),At=n("h2"),Ht=n("a"),Ws=n("span"),b(on.$$.fragment),ed=l(),Xs=n("span"),td=a("LxmertForQuestionAnswering"),Mr=l(),K=n("div"),b(nn.$$.fragment),od=l(),Us=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 "),Vn=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(),je=n("div"),b(cn.$$.fragment),_d=l(),Ct=n("p"),Td=a("The "),Qn=n("a"),vd=a("LxmertForQuestionAnswering"),bd=a(" forward method, overrides the "),Vs=n("code"),xd=a("__call__"),wd=a(" special method."),yd=l(),b(Yt.$$.fragment),kd=l(),b(Kt.$$.fragment),Er=l(),Ot=n("h2"),eo=n("a"),Qs=n("span"),b(mn.$$.fragment),Ld=l(),Bs=n("span"),$d=a("TFLxmertModel"),zr=l(),ee=n("div"),b(hn.$$.fragment),Fd=l(),Gs=n("p"),Md=a("The bare Lxmert Model transformer outputting raw hidden-states without any specific head on top."),Ed=l(),un=n("p"),zd=a("The LXMERT model was proposed in "),pn=n("a"),qd=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.`),Ad=l(),fn=n("p"),Cd=a("This model is also a "),gn=n("a"),Od=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.`),Id=l(),b(to.$$.fragment),jd=l(),De=n("div"),b(_n.$$.fragment),Dd=l(),Nt=n("p"),Rd=a("The "),Bn=n("a"),Jd=a("TFLxmertModel"),Sd=a(" forward method, overrides the "),Zs=n("code"),Wd=a("__call__"),Xd=a(" special method."),Ud=l(),b(oo.$$.fragment),Vd=l(),b(no.$$.fragment),qr=l(),It=n("h2"),so=n("a"),Hs=n("span"),b(Tn.$$.fragment),Qd=l(),Ys=n("span"),Bd=a("TFLxmertForPreTraining"),Pr=l(),te=n("div"),b(vn.$$.fragment),Gd=l(),bn=n("p"),Zd=a("Lxmert Model with a "),Ks=n("code"),Hd=a("language modeling"),Yd=a(" head on top."),Kd=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(),jt=n("p"),cc=a("The "),Gn=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(_);v=s(tr,"SPAN",{});var or=r(v);x(c.$$.fragment,or),or.forEach(t),tr.forEach(t),f=d($n),E=s($n,"SPAN",{});var nr=r(E);Ve=i(nr,"LXMERT"),nr.forEach(t),$n.forEach(t),Me=d(o),I=s(o,"H2",{class:!0});var Fn=r(I);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),Qe=d(Fn),Q=s(Fn,"SPAN",{});var ar=r(Q);Be=i(ar,"Overview"),ar.forEach(t),Fn.forEach(t),Ee=d(o),J=s(o,"P",{});var Mn=r(J);Ge=i(Mn,"The LXMERT model was proposed in "),ie=s(Mn,"A",{href:!0,rel:!0});var ir=r(ie);le=i(ir,"LXMERT: Learning Cross-Modality Encoder Representations from Transformers"),ir.forEach(t),Ze=i(Mn,` 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.`),Mn.forEach(t),ze=d(o),X=s(o,"P",{});var lr=r(X);He=i(lr,"The abstract from the paper is the following:"),lr.forEach(t),qe=d(o),U=s(o,"P",{});var dr=r(U);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),Te=d(o),q=s(o,"P",{});var xc=r(q);j=i(xc,"Tips:"),xc.forEach(t),Pe=d(o),N=s(o,"UL",{});var Zn=r(N);ye=s(Zn,"LI",{});var wc=r(ye);Ke=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(Zn),ke=s(Zn,"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),D=d(Zn),Le=s(Zn,"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),Zn.forEach(t),Ae=d(o),V=s(o,"P",{});var Hn=r(V);me=i(Hn,"This model was contributed by "),he=s(Hn,"A",{href:!0,rel:!0});var Lc=r(he);tt=i(Lc,"eltoto1219"),Lc.forEach(t),B=i(Hn,". The original code can be found "),ue=s(Hn,"A",{href:!0,rel:!0});var $c=r(ue);pe=i($c,"here"),$c.forEach(t),ot=i(Hn,"."),Hn.forEach(t),ve=d(o),P=s(o,"H2",{class:!0});var Cr=r(P);ne=s(Cr,"A",{id:!0,class:!0,href:!0});var Fc=r(ne);R=s(Fc,"SPAN",{});var Mc=r(R);x(fe.$$.fragment,Mc),Mc.forEach(t),Fc.forEach(t),nt=d(Cr),T=s(Cr,"SPAN",{});var Ec=r(T);M=i(Ec,"Documentation resources"),Ec.forEach(t),Cr.forEach(t),at=d(o),se=s(o,"UL",{});var zc=r(se);st=s(zc,"LI",{});var qc=r(st);Ce=s(qc,"A",{href:!0});var Pc=r(Ce);z=i(Pc,"Question answering task guide"),Pc.forEach(t),qc.forEach(t),zc.forEach(t),it=d(o),ge=s(o,"H2",{class:!0});var Or=r(ge);be=s(Or,"A",{id:!0,class:!0,href:!0});var Ac=r(be);rt=s(Ac,"SPAN",{});var Cc=r(rt);x($e.$$.fragment,Cc),Cc.forEach(t),Ac.forEach(t),G=d(Or),Z=s(Or,"SPAN",{});var Oc=r(Z);pt=i(Oc,"LxmertConfig"),Oc.forEach(t),Or.forEach(t),lt=d(o),O=s(o,"DIV",{class:!0});var Yn=r(O);x(Fe.$$.fragment,Yn),ft=d(Yn),S=s(Yn,"P",{});var io=r(S);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 "),zn=s(io,"A",{href:!0});var Ic=r(zn);xa=i(Ic,"TFLxmertModel"),Ic.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 jc=r(po);ya=i(jc,"unc-nlp/lxmert-base-uncased"),jc.forEach(t),ka=i(io," architecture."),io.forEach(t),La=d(Yn),Tt=s(Yn,"P",{});var Kn=r(Tt);$a=i(Kn,"Configuration objects inherit from "),qn=s(Kn,"A",{href:!0});var Dc=r(qn);Fa=i(Dc,"PretrainedConfig"),Dc.forEach(t),Ma=i(Kn,` and can be used to control the model outputs. Read the
documentation from `),Pn=s(Kn,"A",{href:!0});var Rc=r(Pn);Ea=i(Rc,"PretrainedConfig"),Rc.forEach(t),za=i(Kn," for more information."),Kn.forEach(t),Yn.forEach(t),ur=d(o),vt=s(o,"H2",{class:!0});var Nr=r(vt);Dt=s(Nr,"A",{id:!0,class:!0,href:!0});var Jc=r(Dt);ms=s(Jc,"SPAN",{});var Sc=r(ms);x(fo.$$.fragment,Sc),Sc.forEach(t),Jc.forEach(t),qa=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),Aa=d(xe),us=s(xe,"P",{});var Xc=r(us);Ca=i(Xc,"Construct a Lxmert tokenizer. Based on WordPiece."),Xc.forEach(t),Oa=d(xe),_o=s(xe,"P",{});var Ir=r(_o);Na=i(Ir,"This tokenizer inherits from "),An=s(Ir,"A",{href:!0});var Uc=r(An);Ia=i(Uc,"PreTrainedTokenizer"),Uc.forEach(t),ja=i(Ir,` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),Ir.forEach(t),Da=d(xe),dt=s(xe,"DIV",{class:!0});var es=r(dt);x(To.$$.fragment,es),Ra=d(es),ps=s(es,"P",{});var Vc=r(ps);Ja=i(Vc,`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:`),Vc.forEach(t),Sa=d(es),vo=s(es,"UL",{});var jr=r(vo);Cn=s(jr,"LI",{});var gc=r(Cn);Wa=i(gc,"single sequence: "),fs=s(gc,"CODE",{});var Qc=r(fs);Xa=i(Qc,"[CLS] X [SEP]"),Qc.forEach(t),gc.forEach(t),Ua=d(jr),On=s(jr,"LI",{});var _c=r(On);Va=i(_c,"pair of sequences: "),gs=s(_c,"CODE",{});var Bc=r(gs);Qa=i(Bc,"[CLS] A [SEP] B [SEP]"),Bc.forEach(t),_c.forEach(t),jr.forEach(t),es.forEach(t),Ba=d(xe),Rt=s(xe,"DIV",{class:!0});var Dr=r(Rt);x(bo.$$.fragment,Dr),Ga=d(Dr),_s=s(Dr,"P",{});var Gc=r(_s);Za=i(Gc,"Converts a sequence of tokens (string) in a single string."),Gc.forEach(t),Dr.forEach(t),Ha=d(xe),Oe=s(xe,"DIV",{class:!0});var lo=r(Oe);x(xo.$$.fragment,lo),Ya=d(lo),Ts=s(lo,"P",{});var Zc=r(Ts);Ka=i(Zc,"Create a mask from the two sequences passed to be used in a sequence-pair classification task. A Lxmert"),Zc.forEach(t),ei=d(lo),x(Jt.$$.fragment,lo),ti=d(lo),bt=s(lo,"P",{});var ts=r(bt);oi=i(ts,"If "),vs=s(ts,"CODE",{});var Hc=r(vs);ni=i(Hc,"token_ids_1"),Hc.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),St=s(xe,"DIV",{class:!0});var Rr=r(St);x(wo.$$.fragment,Rr),li=d(Rr),yo=s(Rr,"P",{});var Jr=r(yo);di=i(Jr,`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(Jr,"CODE",{});var Kc=r(xs);ci=i(Kc,"prepare_for_model"),Kc.forEach(t),mi=i(Jr," method."),Jr.forEach(t),Rr.forEach(t),xe.forEach(t),fr=d(o),xt=s(o,"H2",{class:!0});var Sr=r(xt);Wt=s(Sr,"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(Sr),ys=s(Sr,"SPAN",{});var om=r(ys);ui=i(om,"LxmertTokenizerFast"),om.forEach(t),Sr.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),Ti=d(ut),Fo=s(ut,"P",{});var Xr=r(Fo);vi=i(Xr,"This tokenizer inherits from "),Nn=s(Xr,"A",{href:!0});var sm=r(Nn);bi=i(sm,"PreTrainedTokenizerFast"),sm.forEach(t),xi=i(Xr,` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),Xr.forEach(t),wi=d(ut),ct=s(ut,"DIV",{class:!0});var os=r(ct);x(Mo.$$.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 Ur=r(Eo);In=s(Ur,"LI",{});var Tc=r(In);$i=i(Tc,"single sequence: "),$s=s(Tc,"CODE",{});var am=r($s);Fi=i(am,"[CLS] X [SEP]"),am.forEach(t),Tc.forEach(t),Mi=d(Ur),jn=s(Ur,"LI",{});var vc=r(jn);Ei=i(vc,"pair of sequences: "),Fs=s(vc,"CODE",{});var im=r(Fs);zi=i(im,"[CLS] A [SEP] B [SEP]"),im.forEach(t),vc.forEach(t),Ur.forEach(t),os.forEach(t),qi=d(ut),Ne=s(ut,"DIV",{class:!0});var co=r(Ne);x(zo.$$.fragment,co),Pi=d(co),Ms=s(co,"P",{});var lm=r(Ms);Ai=i(lm,"Create a mask from the two sequences passed to be used in a sequence-pair classification task. A Lxmert"),lm.forEach(t),Ci=d(co),x(Xt.$$.fragment,co),Oi=d(co),wt=s(co,"P",{});var ns=r(wt);Ni=i(ns,"If "),Es=s(ns,"CODE",{});var dm=r(Es);Ii=i(dm,"token_ids_1"),dm.forEach(t),ji=i(ns," is "),zs=s(ns,"CODE",{});var cm=r(zs);Di=i(cm,"None"),cm.forEach(t),Ri=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 Vr=r(yt);Ut=s(Vr,"A",{id:!0,class:!0,href:!0});var mm=r(Ut);qs=s(mm,"SPAN",{});var hm=r(qs);x(qo.$$.fragment,hm),hm.forEach(t),mm.forEach(t),Ji=d(Vr),Ps=s(Vr,"SPAN",{});var um=r(Ps);Si=i(um,"Lxmert specific outputs"),um.forEach(t),Vr.forEach(t),Tr=d(o),kt=s(o,"DIV",{class:!0});var Qr=r(kt);x(Po.$$.fragment,Qr),Wi=d(Qr),As=s(Qr,"P",{});var pm=r(As);Xi=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),Qr.forEach(t),vr=d(o),Lt=s(o,"DIV",{class:!0});var Br=r(Lt);x(Ao.$$.fragment,Br),Ui=d(Br),Co=s(Br,"P",{});var Gr=r(Co);Vi=i(Gr,"Output type of "),Dn=s(Gr,"A",{href:!0});var fm=r(Dn);Qi=i(fm,"LxmertForPreTraining"),fm.forEach(t),Bi=i(Gr,"."),Gr.forEach(t),Br.forEach(t),br=d(o),$t=s(o,"DIV",{class:!0});var Zr=r($t);x(Oo.$$.fragment,Zr),Gi=d(Zr),No=s(Zr,"P",{});var Hr=r(No);Zi=i(Hr,"Output type of "),Rn=s(Hr,"A",{href:!0});var gm=r(Rn);Hi=i(gm,"LxmertForQuestionAnswering"),gm.forEach(t),Yi=i(Hr,"."),Hr.forEach(t),Zr.forEach(t),xr=d(o),Ft=s(o,"DIV",{class:!0});var Yr=r(Ft);x(Io.$$.fragment,Yr),Ki=d(Yr),Cs=s(Yr,"P",{});var _m=r(Cs);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),Mt=s(o,"DIV",{class:!0});var Kr=r(Mt);x(jo.$$.fragment,Kr),tl=d(Kr),Do=s(Kr,"P",{});var ea=r(Do);ol=i(ea,"Output type of "),Jn=s(ea,"A",{href:!0});var Tm=r(Jn);nl=i(Tm,"LxmertForPreTraining"),Tm.forEach(t),sl=i(ea,"."),ea.forEach(t),Kr.forEach(t),yr=d(o),Et=s(o,"H2",{class:!0});var ta=r(Et);Vt=s(ta,"A",{id:!0,class:!0,href:!0});var vm=r(Vt);Os=s(vm,"SPAN",{});var bm=r(Os);x(Ro.$$.fragment,bm),bm.forEach(t),vm.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),H=s(o,"DIV",{class:!0});var Re=r(H);x(Jo.$$.fragment,Re),il=d(Re),Is=s(Re,"P",{});var wm=r(Is);ll=i(wm,"The bare Lxmert Model transformer outputting raw hidden-states without any specific head on top."),wm.forEach(t),dl=d(Re),So=s(Re,"P",{});var oa=r(So);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(Re),Xo=s(Re,"P",{});var na=r(Xo);pl=i(na,"This model inherits from "),Sn=s(na,"A",{href:!0});var km=r(Sn);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(Re),Uo=s(Re,"P",{});var sa=r(Uo);Tl=i(sa,"This model is also a PyTorch "),Vo=s(sa,"A",{href:!0,rel:!0});var Lm=r(Vo);vl=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(Re),Ie=s(Re,"DIV",{class:!0});var mo=r(Ie);x(Qo.$$.fragment,mo),wl=d(mo),zt=s(mo,"P",{});var ss=r(zt);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 "),js=s(ss,"CODE",{});var Fm=r(js);$l=i(Fm,"__call__"),Fm.forEach(t),Fl=i(ss," special method."),ss.forEach(t),Ml=d(mo),x(Qt.$$.fragment,mo),El=d(mo),x(Bt.$$.fragment,mo),mo.forEach(t),Re.forEach(t),Lr=d(o),qt=s(o,"H2",{class:!0});var ra=r(qt);Gt=s(ra,"A",{id:!0,class:!0,href:!0});var Mm=r(Gt);Ds=s(Mm,"SPAN",{});var Em=r(Ds);x(Bo.$$.fragment,Em),Em.forEach(t),Mm.forEach(t),zl=d(ra),Rs=s(ra,"SPAN",{});var zm=r(Rs);ql=i(zm,"LxmertForPreTraining"),zm.forEach(t),ra.forEach(t),$r=d(o),Y=s(o,"DIV",{class:!0});var Je=r(Y);x(Go.$$.fragment,Je),Pl=d(Je),Js=s(Je,"P",{});var qm=r(Js);Al=i(qm,"Lxmert Model with a specified pretraining head on top."),qm.forEach(t),Cl=d(Je),Zo=s(Je,"P",{});var aa=r(Zo);Ol=i(aa,"The LXMERT model was proposed in "),Ho=s(aa,"A",{href:!0,rel:!0});var Pm=r(Ho);Nl=i(Pm,`LXMERT: Learning Cross-Modality Encoder Representations from
Transformers`),Pm.forEach(t),Il=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),jl=d(Je),Yo=s(Je,"P",{});var ia=r(Yo);Dl=i(ia,"This model inherits from "),Xn=s(ia,"A",{href:!0});var Am=r(Xn);Rl=i(Am,"PreTrainedModel"),Am.forEach(t),Jl=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),Sl=d(Je),Ko=s(Je,"P",{});var la=r(Ko);Wl=i(la,"This model is also a PyTorch "),en=s(la,"A",{href:!0,rel:!0});var Cm=r(en);Xl=i(Cm,"torch.nn.Module"),Cm.forEach(t),Ul=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),Vl=d(Je),mt=s(Je,"DIV",{class:!0});var rs=r(mt);x(tn.$$.fragment,rs),Ql=d(rs),Pt=s(rs,"P",{});var as=r(Pt);Bl=i(as,"The "),Un=s(as,"A",{href:!0});var Om=r(Un);Gl=i(Om,"LxmertForPreTraining"),Om.forEach(t),Zl=i(as," forward method, overrides the "),Ss=s(as,"CODE",{});var Nm=r(Ss);Hl=i(Nm,"__call__"),Nm.forEach(t),Yl=i(as," special method."),as.forEach(t),Kl=d(rs),x(Zt.$$.fragment,rs),rs.forEach(t),Je.forEach(t),Fr=d(o),At=s(o,"H2",{class:!0});var da=r(At);Ht=s(da,"A",{id:!0,class:!0,href:!0});var Im=r(Ht);Ws=s(Im,"SPAN",{});var jm=r(Ws);x(on.$$.fragment,jm),jm.forEach(t),Im.forEach(t),ed=d(da),Xs=s(da,"SPAN",{});var Dm=r(Xs);td=i(Dm,"LxmertForQuestionAnswering"),Dm.forEach(t),da.forEach(t),Mr=d(o),K=s(o,"DIV",{class:!0});var Se=r(K);x(nn.$$.fragment,Se),od=d(Se),Us=s(Se,"P",{});var Rm=r(Us);nd=i(Rm,"Lxmert Model with a visual-answering head on top for downstream QA tasks"),Rm.forEach(t),sd=d(Se),sn=s(Se,"P",{});var ca=r(sn);rd=i(ca,"The LXMERT model was proposed in "),rn=s(ca,"A",{href:!0,rel:!0});var Jm=r(rn);ad=i(Jm,`LXMERT: Learning Cross-Modality Encoder Representations from
Transformers`),Jm.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(Se),an=s(Se,"P",{});var ma=r(an);dd=i(ma,"This model inherits from "),Vn=s(ma,"A",{href:!0});var Sm=r(Vn);cd=i(Sm,"PreTrainedModel"),Sm.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(Se),ln=s(Se,"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(Se),je=s(Se,"DIV",{class:!0});var ho=r(je);x(cn.$$.fragment,ho),_d=d(ho),Ct=s(ho,"P",{});var is=r(Ct);Td=i(is,"The "),Qn=s(is,"A",{href:!0});var Xm=r(Qn);vd=i(Xm,"LxmertForQuestionAnswering"),Xm.forEach(t),bd=i(is," forward method, overrides the "),Vs=s(is,"CODE",{});var Um=r(Vs);xd=i(Um,"__call__"),Um.forEach(t),wd=i(is," special method."),is.forEach(t),yd=d(ho),x(Yt.$$.fragment,ho),kd=d(ho),x(Kt.$$.fragment,ho),ho.forEach(t),Se.forEach(t),Er=d(o),Ot=s(o,"H2",{class:!0});var ua=r(Ot);eo=s(ua,"A",{id:!0,class:!0,href:!0});var Vm=r(eo);Qs=s(Vm,"SPAN",{});var Qm=r(Qs);x(mn.$$.fragment,Qm),Qm.forEach(t),Vm.forEach(t),Ld=d(ua),Bs=s(ua,"SPAN",{});var Bm=r(Bs);$d=i(Bm,"TFLxmertModel"),Bm.forEach(t),ua.forEach(t),zr=d(o),ee=s(o,"DIV",{class:!0});var We=r(ee);x(hn.$$.fragment,We),Fd=d(We),Gs=s(We,"P",{});var Gm=r(Gs);Md=i(Gm,"The bare Lxmert Model transformer outputting raw hidden-states without any specific head on top."),Gm.forEach(t),Ed=d(We),un=s(We,"P",{});var pa=r(un);zd=i(pa,"The LXMERT model was proposed in "),pn=s(pa,"A",{href:!0,rel:!0});var Zm=r(pn);qd=i(Zm,`LXMERT: Learning Cross-Modality Encoder Representations from
Transformers`),Zm.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),Ad=d(We),fn=s(We,"P",{});var fa=r(fn);Cd=i(fa,"This model is also a "),gn=s(fa,"A",{href:!0,rel:!0});var Hm=r(gn);Od=i(Hm,"tf.keras.Model"),Hm.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),Id=d(We),x(to.$$.fragment,We),jd=d(We),De=s(We,"DIV",{class:!0});var uo=r(De);x(_n.$$.fragment,uo),Dd=d(uo),Nt=s(uo,"P",{});var ls=r(Nt);Rd=i(ls,"The "),Bn=s(ls,"A",{href:!0});var Ym=r(Bn);Jd=i(Ym,"TFLxmertModel"),Ym.forEach(t),Sd=i(ls," forward method, overrides the "),Zs=s(ls,"CODE",{});var Km=r(Zs);Wd=i(Km,"__call__"),Km.forEach(t),Xd=i(ls," special method."),ls.forEach(t),Ud=d(uo),x(oo.$$.fragment,uo),Vd=d(uo),x(no.$$.fragment,uo),uo.forEach(t),We.forEach(t),qr=d(o),It=s(o,"H2",{class:!0});var ga=r(It);so=s(ga,"A",{id:!0,class:!0,href:!0});var eh=r(so);Hs=s(eh,"SPAN",{});var th=r(Hs);x(Tn.$$.fragment,th),th.forEach(t),eh.forEach(t),Qd=d(ga),Ys=s(ga,"SPAN",{});var oh=r(Ys);Bd=i(oh,"TFLxmertForPreTraining"),oh.forEach(t),ga.forEach(t),Pr=d(o),te=s(o,"DIV",{class:!0});var Xe=r(te);x(vn.$$.fragment,Xe),Gd=d(Xe),bn=s(Xe,"P",{});var _a=r(bn);Zd=i(_a,"Lxmert Model with a "),Ks=s(_a,"CODE",{});var nh=r(Ks);Hd=i(nh,"language modeling"),nh.forEach(t),Yd=i(_a," head on top."),_a.forEach(t),Kd=d(Xe),xn=s(Xe,"P",{});var Ta=r(xn);ec=i(Ta,"The LXMERT model was proposed in "),wn=s(Ta,"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(Ta,` 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.`),Ta.forEach(t),nc=d(Xe),yn=s(Xe,"P",{});var va=r(yn);sc=i(va,"This model is also a "),kn=s(va,"A",{href:!0,rel:!0});var rh=r(kn);rc=i(rh,"tf.keras.Model"),rh.forEach(t),ac=i(va,` 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.`),va.forEach(t),ic=d(Xe),x(ro.$$.fragment,Xe),lc=d(Xe),ht=s(Xe,"DIV",{class:!0});var ds=r(ht);x(Ln.$$.fragment,ds),dc=d(ds),jt=s(ds,"P",{});var cs=r(jt);cc=i(cs,"The "),Gn=s(cs,"A",{href:!0});var ah=r(Gn);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),Xe.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(I,"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(Ce,"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/main/en/model_doc/lxmert#transformers.LxmertModel"),m(zn,"href","/docs/transformers/main/en/model_doc/lxmert#transformers.TFLxmertModel"),m(po,"href","https://huggingface.co/unc-nlp/lxmert-base-uncased"),m(po,"rel","nofollow"),m(qn,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),m(Pn,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),m(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Dt,"id","transformers.LxmertTokenizer"),m(Dt,"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(Dt,"href","#transformers.LxmertTokenizer"),m(vt,"class","relative group"),m(An,"href","/docs/transformers/main/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(Rt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Oe,"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(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/main/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(Ut,"id","transformers.models.lxmert.modeling_lxmert.LxmertModelOutput"),m(Ut,"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(Ut,"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(Dn,"href","/docs/transformers/main/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(Rn,"href","/docs/transformers/main/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(Jn,"href","/docs/transformers/main/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(Vt,"id","transformers.LxmertModel"),m(Vt,"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(Vt,"href","#transformers.LxmertModel"),m(Et,"class","relative group"),m(Wo,"href","https://arxiv.org/abs/1908.07490"),m(Wo,"rel","nofollow"),m(Sn,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),m(Vo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),m(Vo,"rel","nofollow"),m(Wn,"href","/docs/transformers/main/en/model_doc/lxmert#transformers.LxmertModel"),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(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Gt,"id","transformers.LxmertForPreTraining"),m(Gt,"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(Gt,"href","#transformers.LxmertForPreTraining"),m(qt,"class","relative group"),m(Ho,"href","https://arxiv.org/abs/1908.07490"),m(Ho,"rel","nofollow"),m(Xn,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),m(en,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),m(en,"rel","nofollow"),m(Un,"href","/docs/transformers/main/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(Ht,"id","transformers.LxmertForQuestionAnswering"),m(Ht,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(Ht,"href","#transformers.LxmertForQuestionAnswering"),m(At,"class","relative group"),m(rn,"href","https://arxiv.org/abs/1908.07490"),m(rn,"rel","nofollow"),m(Vn,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),m(dn,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),m(dn,"rel","nofollow"),m(Qn,"href","/docs/transformers/main/en/model_doc/lxmert#transformers.LxmertForQuestionAnswering"),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(K,"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(Ot,"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(Bn,"href","/docs/transformers/main/en/model_doc/lxmert#transformers.TFLxmertModel"),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(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(It,"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(Gn,"href","/docs/transformers/main/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(_,v),w(c,v,null),e(g,f),e(g,E),e(E,Ve),u(o,Me,p),u(o,I,p),e(I,oe),e(oe,ae),w(F,ae,null),e(I,Qe),e(I,Q),e(Q,Be),u(o,Ee,p),u(o,J,p),e(J,Ge),e(J,ie),e(ie,le),e(J,Ze),u(o,ze,p),u(o,X,p),e(X,He),u(o,qe,p),u(o,U,p),e(U,we),e(we,Ye),u(o,Te,p),u(o,q,p),e(q,j),u(o,Pe,p),u(o,N,p),e(N,ye),e(ye,Ke),e(N,de),e(N,ke),e(ke,et),e(N,D),e(N,Le),e(Le,ce),u(o,Ae,p),u(o,V,p),e(V,me),e(V,he),e(he,tt),e(V,B),e(V,ue),e(ue,pe),e(V,ot),u(o,ve,p),u(o,P,p),e(P,ne),e(ne,R),w(fe,R,null),e(P,nt),e(P,T),e(T,M),u(o,at,p),u(o,se,p),e(se,st),e(st,Ce),e(Ce,z),u(o,it,p),u(o,ge,p),e(ge,be),e(be,rt),w($e,rt,null),e(ge,G),e(ge,Z),e(Z,pt),u(o,lt,p),u(o,O,p),w(Fe,O,null),e(O,ft),e(O,S),e(S,gt),e(S,re),e(re,_t),e(S,ba),e(S,zn),e(zn,xa),e(S,wa),e(S,po),e(po,ya),e(S,ka),e(O,La),e(O,Tt),e(Tt,$a),e(Tt,qn),e(qn,Fa),e(Tt,Ma),e(Tt,Pn),e(Pn,Ea),e(Tt,za),u(o,ur,p),u(o,vt,p),e(vt,Dt),e(Dt,ms),w(fo,ms,null),e(vt,qa),e(vt,hs),e(hs,Pa),u(o,pr,p),u(o,W,p),w(go,W,null),e(W,Aa),e(W,us),e(us,Ca),e(W,Oa),e(W,_o),e(_o,Na),e(_o,An),e(An,Ia),e(_o,ja),e(W,Da),e(W,dt),w(To,dt,null),e(dt,Ra),e(dt,ps),e(ps,Ja),e(dt,Sa),e(dt,vo),e(vo,Cn),e(Cn,Wa),e(Cn,fs),e(fs,Xa),e(vo,Ua),e(vo,On),e(On,Va),e(On,gs),e(gs,Qa),e(W,Ba),e(W,Rt),w(bo,Rt,null),e(Rt,Ga),e(Rt,_s),e(_s,Za),e(W,Ha),e(W,Oe),w(xo,Oe,null),e(Oe,Ya),e(Oe,Ts),e(Ts,Ka),e(Oe,ei),w(Jt,Oe,null),e(Oe,ti),e(Oe,bt),e(bt,oi),e(bt,vs),e(vs,ni),e(bt,si),e(bt,bs),e(bs,ri),e(bt,ai),e(W,ii),e(W,St),w(wo,St,null),e(St,li),e(St,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,Ti),e(_e,Fo),e(Fo,vi),e(Fo,Nn),e(Nn,bi),e(Fo,xi),e(_e,wi),e(_e,ct),w(Mo,ct,null),e(ct,yi),e(ct,Ls),e(Ls,ki),e(ct,Li),e(ct,Eo),e(Eo,In),e(In,$i),e(In,$s),e($s,Fi),e(Eo,Mi),e(Eo,jn),e(jn,Ei),e(jn,Fs),e(Fs,zi),e(_e,qi),e(_e,Ne),w(zo,Ne,null),e(Ne,Pi),e(Ne,Ms),e(Ms,Ai),e(Ne,Ci),w(Xt,Ne,null),e(Ne,Oi),e(Ne,wt),e(wt,Ni),e(wt,Es),e(Es,Ii),e(wt,ji),e(wt,zs),e(zs,Di),e(wt,Ri),u(o,_r,p),u(o,yt,p),e(yt,Ut),e(Ut,qs),w(qo,qs,null),e(yt,Ji),e(yt,Ps),e(Ps,Si),u(o,Tr,p),u(o,kt,p),w(Po,kt,null),e(kt,Wi),e(kt,As),e(As,Xi),u(o,vr,p),u(o,Lt,p),w(Ao,Lt,null),e(Lt,Ui),e(Lt,Co),e(Co,Vi),e(Co,Dn),e(Dn,Qi),e(Co,Bi),u(o,br,p),u(o,$t,p),w(Oo,$t,null),e($t,Gi),e($t,No),e(No,Zi),e(No,Rn),e(Rn,Hi),e(No,Yi),u(o,xr,p),u(o,Ft,p),w(Io,Ft,null),e(Ft,Ki),e(Ft,Cs),e(Cs,el),u(o,wr,p),u(o,Mt,p),w(jo,Mt,null),e(Mt,tl),e(Mt,Do),e(Do,ol),e(Do,Jn),e(Jn,nl),e(Do,sl),u(o,yr,p),u(o,Et,p),e(Et,Vt),e(Vt,Os),w(Ro,Os,null),e(Et,rl),e(Et,Ns),e(Ns,al),u(o,kr,p),u(o,H,p),w(Jo,H,null),e(H,il),e(H,Is),e(Is,ll),e(H,dl),e(H,So),e(So,cl),e(So,Wo),e(Wo,ml),e(So,hl),e(H,ul),e(H,Xo),e(Xo,pl),e(Xo,Sn),e(Sn,fl),e(Xo,gl),e(H,_l),e(H,Uo),e(Uo,Tl),e(Uo,Vo),e(Vo,vl),e(Uo,bl),e(H,xl),e(H,Ie),w(Qo,Ie,null),e(Ie,wl),e(Ie,zt),e(zt,yl),e(zt,Wn),e(Wn,kl),e(zt,Ll),e(zt,js),e(js,$l),e(zt,Fl),e(Ie,Ml),w(Qt,Ie,null),e(Ie,El),w(Bt,Ie,null),u(o,Lr,p),u(o,qt,p),e(qt,Gt),e(Gt,Ds),w(Bo,Ds,null),e(qt,zl),e(qt,Rs),e(Rs,ql),u(o,$r,p),u(o,Y,p),w(Go,Y,null),e(Y,Pl),e(Y,Js),e(Js,Al),e(Y,Cl),e(Y,Zo),e(Zo,Ol),e(Zo,Ho),e(Ho,Nl),e(Zo,Il),e(Y,jl),e(Y,Yo),e(Yo,Dl),e(Yo,Xn),e(Xn,Rl),e(Yo,Jl),e(Y,Sl),e(Y,Ko),e(Ko,Wl),e(Ko,en),e(en,Xl),e(Ko,Ul),e(Y,Vl),e(Y,mt),w(tn,mt,null),e(mt,Ql),e(mt,Pt),e(Pt,Bl),e(Pt,Un),e(Un,Gl),e(Pt,Zl),e(Pt,Ss),e(Ss,Hl),e(Pt,Yl),e(mt,Kl),w(Zt,mt,null),u(o,Fr,p),u(o,At,p),e(At,Ht),e(Ht,Ws),w(on,Ws,null),e(At,ed),e(At,Xs),e(Xs,td),u(o,Mr,p),u(o,K,p),w(nn,K,null),e(K,od),e(K,Us),e(Us,nd),e(K,sd),e(K,sn),e(sn,rd),e(sn,rn),e(rn,ad),e(sn,id),e(K,ld),e(K,an),e(an,dd),e(an,Vn),e(Vn,cd),e(an,md),e(K,hd),e(K,ln),e(ln,ud),e(ln,dn),e(dn,pd),e(ln,fd),e(K,gd),e(K,je),w(cn,je,null),e(je,_d),e(je,Ct),e(Ct,Td),e(Ct,Qn),e(Qn,vd),e(Ct,bd),e(Ct,Vs),e(Vs,xd),e(Ct,wd),e(je,yd),w(Yt,je,null),e(je,kd),w(Kt,je,null),u(o,Er,p),u(o,Ot,p),e(Ot,eo),e(eo,Qs),w(mn,Qs,null),e(Ot,Ld),e(Ot,Bs),e(Bs,$d),u(o,zr,p),u(o,ee,p),w(hn,ee,null),e(ee,Fd),e(ee,Gs),e(Gs,Md),e(ee,Ed),e(ee,un),e(un,zd),e(un,pn),e(pn,qd),e(un,Pd),e(ee,Ad),e(ee,fn),e(fn,Cd),e(fn,gn),e(gn,Od),e(fn,Nd),e(ee,Id),w(to,ee,null),e(ee,jd),e(ee,De),w(_n,De,null),e(De,Dd),e(De,Nt),e(Nt,Rd),e(Nt,Bn),e(Bn,Jd),e(Nt,Sd),e(Nt,Zs),e(Zs,Wd),e(Nt,Xd),e(De,Ud),w(oo,De,null),e(De,Vd),w(no,De,null),u(o,qr,p),u(o,It,p),e(It,so),e(so,Hs),w(Tn,Hs,null),e(It,Qd),e(It,Ys),e(Ys,Bd),u(o,Pr,p),u(o,te,p),w(vn,te,null),e(te,Gd),e(te,bn),e(bn,Zd),e(bn,Ks),e(Ks,Hd),e(bn,Yd),e(te,Kd),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,jt),e(jt,cc),e(jt,Gn),e(Gn,mc),e(jt,hc),e(jt,er),e(er,uc),e(jt,pc),e(ht,fc),w(ao,ht,null),Ar=!0},p(o,[p]){const $n={};p&2&&($n.$$scope={dirty:p,ctx:o}),Jt.$set($n);const tr={};p&2&&(tr.$$scope={dirty:p,ctx:o}),Xt.$set(tr);const or={};p&2&&(or.$$scope={dirty:p,ctx:o}),Qt.$set(or);const nr={};p&2&&(nr.$$scope={dirty:p,ctx:o}),Bt.$set(nr);const Fn={};p&2&&(Fn.$$scope={dirty:p,ctx:o}),Zt.$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}),Kt.$set(rr);const ar={};p&2&&(ar.$$scope={dirty:p,ctx:o}),to.$set(ar);const Mn={};p&2&&(Mn.$$scope={dirty:p,ctx:o}),oo.$set(Mn);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){Ar||(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(To.$$.fragment,o),y(bo.$$.fragment,o),y(xo.$$.fragment,o),y(Jt.$$.fragment,o),y(wo.$$.fragment,o),y(ko.$$.fragment,o),y(Lo.$$.fragment,o),y(Mo.$$.fragment,o),y(zo.$$.fragment,o),y(Xt.$$.fragment,o),y(qo.$$.fragment,o),y(Po.$$.fragment,o),y(Ao.$$.fragment,o),y(Oo.$$.fragment,o),y(Io.$$.fragment,o),y(jo.$$.fragment,o),y(Ro.$$.fragment,o),y(Jo.$$.fragment,o),y(Qo.$$.fragment,o),y(Qt.$$.fragment,o),y(Bt.$$.fragment,o),y(Bo.$$.fragment,o),y(Go.$$.fragment,o),y(tn.$$.fragment,o),y(Zt.$$.fragment,o),y(on.$$.fragment,o),y(nn.$$.fragment,o),y(cn.$$.fragment,o),y(Yt.$$.fragment,o),y(Kt.$$.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(Tn.$$.fragment,o),y(vn.$$.fragment,o),y(ro.$$.fragment,o),y(Ln.$$.fragment,o),y(ao.$$.fragment,o),Ar=!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(To.$$.fragment,o),k(bo.$$.fragment,o),k(xo.$$.fragment,o),k(Jt.$$.fragment,o),k(wo.$$.fragment,o),k(ko.$$.fragment,o),k(Lo.$$.fragment,o),k(Mo.$$.fragment,o),k(zo.$$.fragment,o),k(Xt.$$.fragment,o),k(qo.$$.fragment,o),k(Po.$$.fragment,o),k(Ao.$$.fragment,o),k(Oo.$$.fragment,o),k(Io.$$.fragment,o),k(jo.$$.fragment,o),k(Ro.$$.fragment,o),k(Jo.$$.fragment,o),k(Qo.$$.fragment,o),k(Qt.$$.fragment,o),k(Bt.$$.fragment,o),k(Bo.$$.fragment,o),k(Go.$$.fragment,o),k(tn.$$.fragment,o),k(Zt.$$.fragment,o),k(on.$$.fragment,o),k(nn.$$.fragment,o),k(cn.$$.fragment,o),k(Yt.$$.fragment,o),k(Kt.$$.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(Tn.$$.fragment,o),k(vn.$$.fragment,o),k(ro.$$.fragment,o),k(Ln.$$.fragment,o),k(ao.$$.fragment,o),Ar=!1},d(o){t(h),o&&t($),o&&t(g),L(c),o&&t(Me),o&&t(I),L(F),o&&t(Ee),o&&t(J),o&&t(ze),o&&t(X),o&&t(qe),o&&t(U),o&&t(Te),o&&t(q),o&&t(Pe),o&&t(N),o&&t(Ae),o&&t(V),o&&t(ve),o&&t(P),L(fe),o&&t(at),o&&t(se),o&&t(it),o&&t(ge),L($e),o&&t(lt),o&&t(O),L(Fe),o&&t(ur),o&&t(vt),L(fo),o&&t(pr),o&&t(W),L(go),L(To),L(bo),L(xo),L(Jt),L(wo),o&&t(fr),o&&t(xt),L(ko),o&&t(gr),o&&t(_e),L(Lo),L(Mo),L(zo),L(Xt),o&&t(_r),o&&t(yt),L(qo),o&&t(Tr),o&&t(kt),L(Po),o&&t(vr),o&&t(Lt),L(Ao),o&&t(br),o&&t($t),L(Oo),o&&t(xr),o&&t(Ft),L(Io),o&&t(wr),o&&t(Mt),L(jo),o&&t(yr),o&&t(Et),L(Ro),o&&t(kr),o&&t(H),L(Jo),L(Qo),L(Qt),L(Bt),o&&t(Lr),o&&t(qt),L(Bo),o&&t($r),o&&t(Y),L(Go),L(tn),L(Zt),o&&t(Fr),o&&t(At),L(on),o&&t(Mr),o&&t(K),L(nn),L(cn),L(Yt),L(Kt),o&&t(Er),o&&t(Ot),L(mn),o&&t(zr),o&&t(ee),L(hn),L(to),L(_n),L(oo),L(no),o&&t(qr),o&&t(It),L(Tn),o&&t(Pr),o&&t(te),L(vn),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(A){return hh(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ch extends lh{constructor(h){super();dh(this,h,Fh,Lh,ch,{})}}export{Ch as default,$h as metadata};
