import{S as lu,i as du,s as cu,e as n,k as l,w as b,t as a,M as mu,c as s,d as t,m as d,a as r,x,h as i,b as m,G as e,g as h,y as w,q as y,o as k,B as L,v as uu,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 ur}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as Ve}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as cr}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function hu(A){let u,$,g,_,T;return _=new ur({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(){u=n("p"),$=a("sequence pair mask has the following format:"),g=l(),b(_.$$.fragment)},l(c){u=s(c,"P",{});var f=r(u);$=i(f,"sequence pair mask has the following format:"),f.forEach(t),g=d(c),x(_.$$.fragment,c)},m(c,f){h(c,u,f),e(u,$),h(c,g,f),w(_,c,f),T=!0},p:mr,i(c){T||(y(_.$$.fragment,c),T=!0)},o(c){k(_.$$.fragment,c),T=!1},d(c){c&&t(u),c&&t(g),L(_,c)}}}function pu(A){let u,$,g,_,T;return _=new ur({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(){u=n("p"),$=a("sequence pair mask has the following format:"),g=l(),b(_.$$.fragment)},l(c){u=s(c,"P",{});var f=r(u);$=i(f,"sequence pair mask has the following format:"),f.forEach(t),g=d(c),x(_.$$.fragment,c)},m(c,f){h(c,u,f),e(u,$),h(c,g,f),w(_,c,f),T=!0},p:mr,i(c){T||(y(_.$$.fragment,c),T=!0)},o(c){k(_.$$.fragment,c),T=!1},d(c){c&&t(u),c&&t(g),L(_,c)}}}function fu(A){let u,$,g,_,T;return{c(){u=n("p"),$=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n("code"),_=a("Module"),T=a(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(c){u=s(c,"P",{});var f=r(u);$=i(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s(f,"CODE",{});var E=r(g);_=i(E,"Module"),E.forEach(t),T=i(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(t)},m(c,f){h(c,u,f),e(u,$),e(u,g),e(g,_),e(u,T)},d(c){c&&t(u)}}}function gu(A){let u,$,g,_,T;return _=new ur({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(){u=n("p"),$=a("Example:"),g=l(),b(_.$$.fragment)},l(c){u=s(c,"P",{});var f=r(u);$=i(f,"Example:"),f.forEach(t),g=d(c),x(_.$$.fragment,c)},m(c,f){h(c,u,f),e(u,$),h(c,g,f),w(_,c,f),T=!0},p:mr,i(c){T||(y(_.$$.fragment,c),T=!0)},o(c){k(_.$$.fragment,c),T=!1},d(c){c&&t(u),c&&t(g),L(_,c)}}}function _u(A){let u,$,g,_,T;return{c(){u=n("p"),$=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n("code"),_=a("Module"),T=a(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(c){u=s(c,"P",{});var f=r(u);$=i(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s(f,"CODE",{});var E=r(g);_=i(E,"Module"),E.forEach(t),T=i(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(t)},m(c,f){h(c,u,f),e(u,$),e(u,g),e(g,_),e(u,T)},d(c){c&&t(u)}}}function vu(A){let u,$,g,_,T;return{c(){u=n("p"),$=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n("code"),_=a("Module"),T=a(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(c){u=s(c,"P",{});var f=r(u);$=i(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s(f,"CODE",{});var E=r(g);_=i(E,"Module"),E.forEach(t),T=i(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(t)},m(c,f){h(c,u,f),e(u,$),e(u,g),e(g,_),e(u,T)},d(c){c&&t(u)}}}function Tu(A){let u,$,g,_,T;return _=new ur({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(){u=n("p"),$=a("Example:"),g=l(),b(_.$$.fragment)},l(c){u=s(c,"P",{});var f=r(u);$=i(f,"Example:"),f.forEach(t),g=d(c),x(_.$$.fragment,c)},m(c,f){h(c,u,f),e(u,$),h(c,g,f),w(_,c,f),T=!0},p:mr,i(c){T||(y(_.$$.fragment,c),T=!0)},o(c){k(_.$$.fragment,c),T=!1},d(c){c&&t(u),c&&t(g),L(_,c)}}}function bu(A){let u,$,g,_,T,c,f,E,Ue,Fe,I,oe,ae,M,Be,B,Qe,Ee,W,Ge,ie,le,Ze,ze,X,He,qe,V,we,Ye,ve,q,j,Pe,N,ye,Ke,de,ke,et,D,Le,ce,Ae,U,me,ue,tt,Q,he,pe,ot,Te,P,ne,R,fe,nt;return{c(){u=n("p"),$=a("TensorFlow models and layers in "),g=n("code"),_=a("transformers"),T=a(" accept two formats as input:"),c=l(),f=n("ul"),E=n("li"),Ue=a("having all inputs as keyword arguments (like PyTorch models), or"),Fe=l(),I=n("li"),oe=a("having all inputs as a list, tuple or dict in the first positional argument."),ae=l(),M=n("p"),Be=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 `),B=n("code"),Qe=a("model.fit()"),Ee=a(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),W=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 `),V=n("code"),we=a("Functional"),Ye=a(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),ve=l(),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])"),U=a(" or "),me=n("code"),ue=a("model([input_ids, attention_mask, token_type_ids])"),tt=l(),Q=n("li"),he=a(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),pe=n("code"),ot=a('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),Te=l(),P=n("p"),ne=a(`Note that when creating models and layers with
`),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(v){u=s(v,"P",{});var F=r(u);$=i(F,"TensorFlow models and layers in "),g=s(F,"CODE",{});var at=r(g);_=i(at,"transformers"),at.forEach(t),T=i(F," accept two formats as input:"),F.forEach(t),c=d(v),f=s(v,"UL",{});var se=r(f);E=s(se,"LI",{});var st=r(E);Ue=i(st,"having all inputs as keyword arguments (like PyTorch models), or"),st.forEach(t),Fe=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(v),M=s(v,"P",{});var z=r(M);Be=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 `),B=s(z,"CODE",{});var it=r(B);Qe=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 `),W=s(z,"CODE",{});var ge=r(W);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 `),V=s(z,"CODE",{});var $e=r(V);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),ve=d(v),q=s(v,"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 Me=r(ce);Ae=i(Me,"model([input_ids, attention_mask])"),Me.forEach(t),U=i(O," or "),me=s(O,"CODE",{});var ft=r(me);ue=i(ft,"model([input_ids, attention_mask, token_type_ids])"),ft.forEach(t),O.forEach(t),tt=d(G),Q=s(G,"LI",{});var J=r(Q);he=i(J,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),pe=s(J,"CODE",{});var gt=r(pe);ot=i(gt,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),gt.forEach(t),J.forEach(t),G.forEach(t),Te=d(v),P=s(v,"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(v,F){h(v,u,F),e(u,$),e(u,g),e(g,_),e(u,T),h(v,c,F),h(v,f,F),e(f,E),e(E,Ue),e(f,Fe),e(f,I),e(I,oe),h(v,ae,F),h(v,M,F),e(M,Be),e(M,B),e(B,Qe),e(M,Ee),e(M,W),e(W,Ge),e(M,ie),e(M,le),e(le,Ze),e(M,ze),e(M,X),e(X,He),e(M,qe),e(M,V),e(V,we),e(M,Ye),h(v,ve,F),h(v,q,F),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,U),e(D,me),e(me,ue),e(q,tt),e(q,Q),e(Q,he),e(Q,pe),e(pe,ot),h(v,Te,F),h(v,P,F),e(P,ne),e(P,R),e(R,fe),e(P,nt)},d(v){v&&t(u),v&&t(c),v&&t(f),v&&t(ae),v&&t(M),v&&t(ve),v&&t(q),v&&t(Te),v&&t(P)}}}function xu(A){let u,$,g,_,T;return{c(){u=n("p"),$=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n("code"),_=a("Module"),T=a(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(c){u=s(c,"P",{});var f=r(u);$=i(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s(f,"CODE",{});var E=r(g);_=i(E,"Module"),E.forEach(t),T=i(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(t)},m(c,f){h(c,u,f),e(u,$),e(u,g),e(g,_),e(u,T)},d(c){c&&t(u)}}}function wu(A){let u,$,g,_,T;return _=new ur({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(){u=n("p"),$=a("Example:"),g=l(),b(_.$$.fragment)},l(c){u=s(c,"P",{});var f=r(u);$=i(f,"Example:"),f.forEach(t),g=d(c),x(_.$$.fragment,c)},m(c,f){h(c,u,f),e(u,$),h(c,g,f),w(_,c,f),T=!0},p:mr,i(c){T||(y(_.$$.fragment,c),T=!0)},o(c){k(_.$$.fragment,c),T=!1},d(c){c&&t(u),c&&t(g),L(_,c)}}}function yu(A){let u,$,g,_,T,c,f,E,Ue,Fe,I,oe,ae,M,Be,B,Qe,Ee,W,Ge,ie,le,Ze,ze,X,He,qe,V,we,Ye,ve,q,j,Pe,N,ye,Ke,de,ke,et,D,Le,ce,Ae,U,me,ue,tt,Q,he,pe,ot,Te,P,ne,R,fe,nt;return{c(){u=n("p"),$=a("TensorFlow models and layers in "),g=n("code"),_=a("transformers"),T=a(" accept two formats as input:"),c=l(),f=n("ul"),E=n("li"),Ue=a("having all inputs as keyword arguments (like PyTorch models), or"),Fe=l(),I=n("li"),oe=a("having all inputs as a list, tuple or dict in the first positional argument."),ae=l(),M=n("p"),Be=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 `),B=n("code"),Qe=a("model.fit()"),Ee=a(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),W=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 `),V=n("code"),we=a("Functional"),Ye=a(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),ve=l(),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])"),U=a(" or "),me=n("code"),ue=a("model([input_ids, attention_mask, token_type_ids])"),tt=l(),Q=n("li"),he=a(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),pe=n("code"),ot=a('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),Te=l(),P=n("p"),ne=a(`Note that when creating models and layers with
`),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(v){u=s(v,"P",{});var F=r(u);$=i(F,"TensorFlow models and layers in "),g=s(F,"CODE",{});var at=r(g);_=i(at,"transformers"),at.forEach(t),T=i(F," accept two formats as input:"),F.forEach(t),c=d(v),f=s(v,"UL",{});var se=r(f);E=s(se,"LI",{});var st=r(E);Ue=i(st,"having all inputs as keyword arguments (like PyTorch models), or"),st.forEach(t),Fe=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(v),M=s(v,"P",{});var z=r(M);Be=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 `),B=s(z,"CODE",{});var it=r(B);Qe=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 `),W=s(z,"CODE",{});var ge=r(W);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 `),V=s(z,"CODE",{});var $e=r(V);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),ve=d(v),q=s(v,"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 Me=r(ce);Ae=i(Me,"model([input_ids, attention_mask])"),Me.forEach(t),U=i(O," or "),me=s(O,"CODE",{});var ft=r(me);ue=i(ft,"model([input_ids, attention_mask, token_type_ids])"),ft.forEach(t),O.forEach(t),tt=d(G),Q=s(G,"LI",{});var J=r(Q);he=i(J,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),pe=s(J,"CODE",{});var gt=r(pe);ot=i(gt,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),gt.forEach(t),J.forEach(t),G.forEach(t),Te=d(v),P=s(v,"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(v,F){h(v,u,F),e(u,$),e(u,g),e(g,_),e(u,T),h(v,c,F),h(v,f,F),e(f,E),e(E,Ue),e(f,Fe),e(f,I),e(I,oe),h(v,ae,F),h(v,M,F),e(M,Be),e(M,B),e(B,Qe),e(M,Ee),e(M,W),e(W,Ge),e(M,ie),e(M,le),e(le,Ze),e(M,ze),e(M,X),e(X,He),e(M,qe),e(M,V),e(V,we),e(M,Ye),h(v,ve,F),h(v,q,F),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,U),e(D,me),e(me,ue),e(q,tt),e(q,Q),e(Q,he),e(Q,pe),e(pe,ot),h(v,Te,F),h(v,P,F),e(P,ne),e(P,R),e(R,fe),e(P,nt)},d(v){v&&t(u),v&&t(c),v&&t(f),v&&t(ae),v&&t(M),v&&t(ve),v&&t(q),v&&t(Te),v&&t(P)}}}function ku(A){let u,$,g,_,T;return{c(){u=n("p"),$=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n("code"),_=a("Module"),T=a(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(c){u=s(c,"P",{});var f=r(u);$=i(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s(f,"CODE",{});var E=r(g);_=i(E,"Module"),E.forEach(t),T=i(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(t)},m(c,f){h(c,u,f),e(u,$),e(u,g),e(g,_),e(u,T)},d(c){c&&t(u)}}}function Lu(A){let u,$,g,_,T,c,f,E,Ue,Fe,I,oe,ae,M,Be,B,Qe,Ee,W,Ge,ie,le,Ze,ze,X,He,qe,V,we,Ye,ve,q,j,Pe,N,ye,Ke,de,ke,et,D,Le,ce,Ae,U,me,ue,tt,Q,he,pe,ot,Te,P,ne,R,fe,nt,v,F,at,se,st,Ce,z,it,ge,be,rt,$e,G,Z,pt,lt,O,Me,ft,J,gt,re,_t,ba,zn,xa,wa,po,ya,ka,La,vt,$a,qn,Ma,Fa,Pn,Ea,za,hr,Tt,Dt,ms,fo,qa,us,Pa,pr,S,go,Aa,hs,Ca,Oa,_o,Na,An,Ia,ja,Da,dt,vo,Ra,ps,Wa,Ja,To,Cn,Sa,fs,Xa,Va,On,Ua,gs,Ba,Qa,Rt,bo,Ga,_s,Za,Ha,Oe,xo,Ya,vs,Ka,ei,Wt,ti,bt,oi,Ts,ni,si,bs,ri,ai,ii,Jt,wo,li,yo,di,xs,ci,mi,fr,xt,St,ws,ko,ui,ys,hi,gr,_e,Lo,pi,$o,fi,ks,gi,_i,vi,Mo,Ti,Nn,bi,xi,wi,ct,Fo,yi,Ls,ki,Li,Eo,In,$i,$s,Mi,Fi,jn,Ei,Ms,zi,qi,Ne,zo,Pi,Fs,Ai,Ci,Xt,Oi,wt,Ni,Es,Ii,ji,zs,Di,Ri,_r,yt,Vt,qs,qo,Wi,Ps,Ji,vr,kt,Po,Si,As,Xi,Tr,Lt,Ao,Vi,Co,Ui,Dn,Bi,Qi,br,$t,Oo,Gi,No,Zi,Rn,Hi,Yi,xr,Mt,Io,Ki,Cs,el,wr,Ft,jo,tl,Do,ol,Wn,nl,sl,yr,Et,Ut,Os,Ro,rl,Ns,al,kr,H,Wo,il,Is,ll,dl,Jo,cl,So,ml,ul,hl,Xo,pl,Jn,fl,gl,_l,Vo,vl,Uo,Tl,bl,xl,Ie,Bo,wl,zt,yl,Sn,kl,Ll,js,$l,Ml,Fl,Bt,El,Qt,Lr,qt,Gt,Ds,Qo,zl,Rs,ql,$r,Y,Go,Pl,Ws,Al,Cl,Zo,Ol,Ho,Nl,Il,jl,Yo,Dl,Xn,Rl,Wl,Jl,Ko,Sl,en,Xl,Vl,Ul,mt,tn,Bl,Pt,Ql,Vn,Gl,Zl,Js,Hl,Yl,Kl,Zt,Mr,At,Ht,Ss,on,ed,Xs,td,Fr,K,nn,od,Vs,nd,sd,sn,rd,rn,ad,id,ld,an,dd,Un,cd,md,ud,ln,hd,dn,pd,fd,gd,je,cn,_d,Ct,vd,Bn,Td,bd,Us,xd,wd,yd,Yt,kd,Kt,Er,Ot,eo,Bs,mn,Ld,Qs,$d,zr,ee,un,Md,Gs,Fd,Ed,hn,zd,pn,qd,Pd,Ad,fn,Cd,gn,Od,Nd,Id,to,jd,De,_n,Dd,Nt,Rd,Qn,Wd,Jd,Zs,Sd,Xd,Vd,oo,Ud,no,qr,It,so,Hs,vn,Bd,Ys,Qd,Pr,te,Tn,Gd,bn,Zd,Ks,Hd,Yd,Kd,xn,ec,wn,tc,oc,nc,yn,sc,kn,rc,ac,ic,ro,lc,ut,Ln,dc,jt,cc,Gn,mc,uc,er,hc,pc,fc,ao,Ar;return c=new Ve({}),M=new Ve({}),fe=new Ve({}),$e=new Ve({}),Me=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/v4.31.0/en/model_doc/lxmert#transformers.LxmertModel">LxmertModel</a> or <a href="/docs/transformers/v4.31.0/en/model_doc/lxmert#transformers.TFLxmertModel">TFLxmertModel</a>.`,name:"vocab_size"},{anchor:"transformers.LxmertConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 768) &#x2014;
Dimensionality of the encoder layers and the pooler layer.`,name:"hidden_size"},{anchor:"transformers.LxmertConfig.r_layers",description:`<strong>r_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 5) &#x2014;
Number of hidden layers in the Transformer visual encoder.`,name:"r_layers"},{anchor:"transformers.LxmertConfig.l_layers",description:`<strong>l_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 9) &#x2014;
Number of hidden layers in the Transformer language encoder.`,name:"l_layers"},{anchor:"transformers.LxmertConfig.x_layers",description:`<strong>x_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 5) &#x2014;
Number of hidden layers in the Transformer cross modality encoder.`,name:"x_layers"},{anchor:"transformers.LxmertConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 5) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"num_attention_heads"},{anchor:"transformers.LxmertConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 3072) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (often named feed-forward) layer in the Transformer encoder.`,name:"intermediate_size"},{anchor:"transformers.LxmertConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>Callable</code>, <em>optional</em>, defaults to <code>&quot;gelu&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the encoder and pooler. If string, <code>&quot;gelu&quot;</code>,
<code>&quot;relu&quot;</code>, <code>&quot;silu&quot;</code> and <code>&quot;gelu_new&quot;</code> are supported.`,name:"hidden_act"},{anchor:"transformers.LxmertConfig.hidden_dropout_prob",description:`<strong>hidden_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout probability for all fully connected layers in the embeddings, encoder, and pooler.`,name:"hidden_dropout_prob"},{anchor:"transformers.LxmertConfig.attention_probs_dropout_prob",description:`<strong>attention_probs_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout ratio for the attention probabilities.`,name:"attention_probs_dropout_prob"},{anchor:"transformers.LxmertConfig.max_position_embeddings",description:`<strong>max_position_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
The maximum sequence length that this model might ever be used with. Typically set this to something large
just in case (e.g., 512 or 1024 or 2048).`,name:"max_position_embeddings"},{anchor:"transformers.LxmertConfig.type_vocab_size",description:`<strong>type_vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014;
The vocabulary size of the <em>token_type_ids</em> passed into <a href="/docs/transformers/v4.31.0/en/model_doc/bert#transformers.BertModel">BertModel</a>.`,name:"type_vocab_size"},{anchor:"transformers.LxmertConfig.initializer_range",description:`<strong>initializer_range</strong> (<code>float</code>, <em>optional</em>, defaults to 0.02) &#x2014;
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.`,name:"initializer_range"},{anchor:"transformers.LxmertConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-12) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.LxmertConfig.visual_feat_dim",description:`<strong>visual_feat_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 2048) &#x2014;
This represents the last dimension of the pooled-object features used as input for the model, representing
the size of each object feature itself.`,name:"visual_feat_dim"},{anchor:"transformers.LxmertConfig.visual_pos_dim",description:`<strong>visual_pos_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 4) &#x2014;
This represents the number of spacial features that are mixed into the visual features. The default is set
to 4 because most commonly this will represent the location of a bounding box. i.e., (x, y, width, height)`,name:"visual_pos_dim"},{anchor:"transformers.LxmertConfig.visual_loss_normalizer",description:`<strong>visual_loss_normalizer</strong> (<code>float</code>, <em>optional</em>, defaults to 1/15) &#x2014;
This represents the scaling factor in which each visual loss is multiplied by if during pretraining, one
decided to train with multiple vision-based loss objectives.`,name:"visual_loss_normalizer"},{anchor:"transformers.LxmertConfig.num_qa_labels",description:`<strong>num_qa_labels</strong> (<code>int</code>, <em>optional</em>, defaults to 9500) &#x2014;
This represents the total number of different question answering (QA) labels there are. If using more than
one dataset with QA, the user will need to account for the total number of labels that all of the datasets
have in total.`,name:"num_qa_labels"},{anchor:"transformers.LxmertConfig.num_object_labels",description:`<strong>num_object_labels</strong> (<code>int</code>, <em>optional</em>, defaults to 1600) &#x2014;
This represents the total number of semantically unique objects that lxmert will be able to classify a
pooled-object feature as belonging too.`,name:"num_object_labels"},{anchor:"transformers.LxmertConfig.num_attr_labels",description:`<strong>num_attr_labels</strong> (<code>int</code>, <em>optional</em>, defaults to 400) &#x2014;
This represents the total number of semantically unique attributes that lxmert will be able to classify a
pooled-object feature as possessing.`,name:"num_attr_labels"},{anchor:"transformers.LxmertConfig.task_matched",description:`<strong>task_matched</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
This task is used for sentence-image matching. If the sentence correctly describes the image the label will
be 1. If the sentence does not correctly describe the image, the label will be 0.`,name:"task_matched"},{anchor:"transformers.LxmertConfig.task_mask_lm",description:`<strong>task_mask_lm</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to add masked language modeling (as used in pretraining models such as BERT) to the loss
objective.`,name:"task_mask_lm"},{anchor:"transformers.LxmertConfig.task_obj_predict",description:`<strong>task_obj_predict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to add object prediction, attribute prediction and feature regression to the loss objective.`,name:"task_obj_predict"},{anchor:"transformers.LxmertConfig.task_qa",description:`<strong>task_qa</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to add the question-answering loss to the objective`,name:"task_qa"},{anchor:"transformers.LxmertConfig.visual_obj_loss",description:`<strong>visual_obj_loss</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to calculate the object-prediction loss objective`,name:"visual_obj_loss"},{anchor:"transformers.LxmertConfig.visual_attr_loss",description:`<strong>visual_attr_loss</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to calculate the attribute-prediction loss objective`,name:"visual_attr_loss"},{anchor:"transformers.LxmertConfig.visual_feat_loss",description:`<strong>visual_feat_loss</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to calculate the feature-regression loss objective`,name:"visual_feat_loss"},{anchor:"transformers.LxmertConfig.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the model should return the attentions from the vision, language, and cross-modality layers
should be returned.`,name:"output_attentions"},{anchor:"transformers.LxmertConfig.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the model should return the hidden states from the vision, language, and cross-modality
layers should be returned.`,name:"output_hidden_states"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/lxmert/configuration_lxmert.py#L29"}}),fo=new Ve({}),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/v4.31.0/src/transformers/models/lxmert/tokenization_lxmert.py#L67"}}),vo=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/v4.31.0/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/v4.31.0/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/v4.31.0/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>
`}}),Wt=new cr({props:{anchor:"transformers.LxmertTokenizer.create_token_type_ids_from_sequences.example",$$slots:{default:[hu]},$$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/v4.31.0/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 Ve({}),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/v4.31.0/src/transformers/models/lxmert/tokenization_lxmert_fast.py#L48"}}),Fo=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/v4.31.0/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/v4.31.0/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:[pu]},$$scope:{ctx:A}}}),qo=new Ve({}),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/v4.31.0/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/v4.31.0/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/v4.31.0/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/v4.31.0/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/v4.31.0/src/transformers/models/lxmert/modeling_tf_lxmert.py#L107"}}),Ro=new Ve({}),Wo=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/v4.31.0/en/model_doc/lxmert#transformers.LxmertConfig">LxmertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.31.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/lxmert/modeling_lxmert.py#L883"}}),Bo=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/v4.31.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__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/v4.31.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/lxmert/modeling_lxmert.py#L898",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.0/en/model_doc/lxmert#transformers.models.lxmert.modeling_lxmert.LxmertModelOutput"
>transformers.models.lxmert.modeling_lxmert.LxmertModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.31.0/en/model_doc/lxmert#transformers.LxmertConfig"
>LxmertConfig</a>) and inputs.</p>
<ul>
<li><strong>language_output</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the language encoder.</li>
<li><strong>vision_output</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the visual encoder.</li>
<li><strong>pooled_output</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, hidden_size)</code>) \u2014 Last layer hidden-state of the first token of the sequence (classification, CLS, token) further processed
by a Linear layer and a Tanh activation function. The Linear</li>
<li><strong>language_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for input features + one for the output of each cross-modality layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</li>
<li><strong>vision_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for input features + one for the output of each cross-modality layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</li>
<li><strong>language_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.</li>
<li><strong>vision_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.</li>
<li><strong>cross_encoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.31.0/en/model_doc/lxmert#transformers.models.lxmert.modeling_lxmert.LxmertModelOutput"
>transformers.models.lxmert.modeling_lxmert.LxmertModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Bt=new En({props:{$$slots:{default:[fu]},$$scope:{ctx:A}}}),Qt=new cr({props:{anchor:"transformers.LxmertModel.forward.example",$$slots:{default:[gu]},$$scope:{ctx:A}}}),Qo=new Ve({}),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/v4.31.0/en/model_doc/lxmert#transformers.LxmertConfig">LxmertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.31.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/lxmert/modeling_lxmert.py#L1020"}}),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/v4.31.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__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/v4.31.0/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/v4.31.0/src/transformers/models/lxmert/modeling_lxmert.py#L1149",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.0/en/model_doc/lxmert#transformers.models.lxmert.modeling_lxmert.LxmertForPreTrainingOutput"
>transformers.models.lxmert.modeling_lxmert.LxmertForPreTrainingOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.31.0/en/model_doc/lxmert#transformers.LxmertConfig"
>LxmertConfig</a>) and inputs.</p>
<ul>
<li><strong>loss</strong> (<em>optional</em>, returned when <code>labels</code> is provided, <code>torch.FloatTensor</code> of shape <code>(1,)</code>) \u2014 Total loss as the sum of the masked language modeling loss and the next sequence prediction
(classification) loss.</li>
<li><strong>prediction_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</li>
<li><strong>cross_relationship_score</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, 2)</code>) \u2014 Prediction scores of the textual matching objective (classification) head (scores of True/False
continuation before SoftMax).</li>
<li><strong>question_answering_score</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, n_qa_answers)</code>) \u2014 Prediction scores of question answering objective (classification).</li>
<li><strong>language_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for input features + one for the output of each cross-modality layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</li>
<li><strong>vision_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for input features + one for the output of each cross-modality layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</li>
<li><strong>language_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.</li>
<li><strong>vision_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.</li>
<li><strong>cross_encoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.31.0/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:[_u]},$$scope:{ctx:A}}}),on=new Ve({}),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/v4.31.0/en/model_doc/lxmert#transformers.LxmertConfig">LxmertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.31.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/lxmert/modeling_lxmert.py#L1288"}}),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/v4.31.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__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/v4.31.0/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/v4.31.0/src/transformers/models/lxmert/modeling_lxmert.py#L1380",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.0/en/model_doc/lxmert#transformers.models.lxmert.modeling_lxmert.LxmertForQuestionAnsweringOutput"
>transformers.models.lxmert.modeling_lxmert.LxmertForQuestionAnsweringOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.31.0/en/model_doc/lxmert#transformers.LxmertConfig"
>LxmertConfig</a>) and inputs.</p>
<ul>
<li><strong>loss</strong> (<em>optional</em>, returned when <code>labels</code> is provided, <code>torch.FloatTensor</code> of shape <code>(1,)</code>) \u2014 Total loss as the sum of the masked language modeling loss and the next sequence prediction
(classification) loss.k.</li>
<li><strong>question_answering_score</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, n_qa_answers)</code>, <em>optional</em>) \u2014 Prediction scores of question answering objective (classification).</li>
<li><strong>language_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for input features + one for the output of each cross-modality layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</li>
<li><strong>vision_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for input features + one for the output of each cross-modality layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</li>
<li><strong>language_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.</li>
<li><strong>vision_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.</li>
<li><strong>cross_encoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.31.0/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:[vu]},$$scope:{ctx:A}}}),Kt=new cr({props:{anchor:"transformers.LxmertForQuestionAnswering.forward.example",$$slots:{default:[Tu]},$$scope:{ctx:A}}}),mn=new Ve({}),un=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/v4.31.0/en/model_doc/lxmert#transformers.LxmertConfig">LxmertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.31.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/lxmert/modeling_tf_lxmert.py#L927"}}),to=new En({props:{$$slots:{default:[bu]},$$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/v4.31.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.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/v4.31.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFLxmertModel.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/lxmert/modeling_tf_lxmert.py#L932",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.0/en/model_doc/lxmert#transformers.models.lxmert.modeling_tf_lxmert.TFLxmertModelOutput"
>transformers.models.lxmert.modeling_tf_lxmert.TFLxmertModelOutput</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/v4.31.0/en/model_doc/lxmert#transformers.LxmertConfig"
>LxmertConfig</a>) and inputs.</p>
<ul>
<li><strong>language_output</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the language encoder.</li>
<li><strong>vision_output</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the visual encoder.</li>
<li><strong>pooled_output</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, hidden_size)</code>) \u2014 Last layer hidden-state of the first token of the sequence (classification, CLS, token) further processed
by a Linear layer and a Tanh activation function. The Linear</li>
<li><strong>language_hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for input features + one for the output of each cross-modality layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</li>
<li><strong>vision_hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for input features + one for the output of each cross-modality layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</li>
<li><strong>language_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.</li>
<li><strong>vision_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.</li>
<li><strong>cross_encoder_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.31.0/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:[xu]},$$scope:{ctx:A}}}),no=new cr({props:{anchor:"transformers.TFLxmertModel.call.example",$$slots:{default:[wu]},$$scope:{ctx:A}}}),vn=new Ve({}),Tn=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/v4.31.0/en/model_doc/lxmert#transformers.LxmertConfig">LxmertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.31.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/lxmert/modeling_tf_lxmert.py#L1149"}}),ro=new En({props:{$$slots:{default:[yu]},$$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/v4.31.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.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/v4.31.0/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/v4.31.0/src/transformers/models/lxmert/modeling_tf_lxmert.py#L1249",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.0/en/model_doc/lxmert#transformers.models.lxmert.modeling_tf_lxmert.TFLxmertForPreTrainingOutput"
>transformers.models.lxmert.modeling_tf_lxmert.TFLxmertForPreTrainingOutput</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/v4.31.0/en/model_doc/lxmert#transformers.LxmertConfig"
>LxmertConfig</a>) and inputs.</p>
<ul>
<li><strong>loss</strong> (<em>optional</em>, returned when <code>labels</code> is provided, <code>tf.Tensor</code> of shape <code>(1,)</code>) \u2014 Total loss as the sum of the masked language modeling loss and the next sequence prediction
(classification) loss.</li>
<li><strong>prediction_logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</li>
<li><strong>cross_relationship_score</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, 2)</code>) \u2014 Prediction scores of the textual matching objective (classification) head (scores of True/False
continuation before SoftMax).</li>
<li><strong>question_answering_score</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, n_qa_answers)</code>) \u2014 Prediction scores of question answering objective (classification).</li>
<li><strong>language_hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for input features + one for the output of each cross-modality layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</li>
<li><strong>vision_hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for input features + one for the output of each cross-modality layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</li>
<li><strong>language_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.</li>
<li><strong>vision_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.</li>
<li><strong>cross_encoder_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.31.0/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:[ku]},$$scope:{ctx:A}}}),{c(){u=n("meta"),$=l(),g=n("h1"),_=n("a"),T=n("span"),b(c.$$.fragment),f=l(),E=n("span"),Ue=a("LXMERT"),Fe=l(),I=n("h2"),oe=n("a"),ae=n("span"),b(M.$$.fragment),Be=l(),B=n("span"),Qe=a("Overview"),Ee=l(),W=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(),V=n("p"),we=n("em"),Ye=a(`Vision-and-language reasoning requires an understanding of visual concepts, language semantics, and, most importantly,
the alignment and relationships between these two modalities. We thus propose the LXMERT (Learning Cross-Modality
Encoder Representations from Transformers) framework to learn these vision-and-language connections. In LXMERT, we
build a large-scale Transformer model that consists of three encoders: an object relationship encoder, a language
encoder, and a cross-modality encoder. Next, to endow our model with the capability of connecting vision and language
semantics, we pre-train the model with large amounts of image-and-sentence pairs, via five diverse representative
pretraining tasks: masked language modeling, masked object prediction (feature regression and label classification),
cross-modality matching, and image question answering. These tasks help in learning both intra-modality and
cross-modality relationships. After fine-tuning from our pretrained parameters, our model achieves the state-of-the-art
results on two visual question answering datasets (i.e., VQA and GQA). We also show the generalizability of our
pretrained cross-modality model by adapting it to a challenging visual-reasoning task, NLVR, and improve the previous
best result by 22% absolute (54% to 76%). Lastly, we demonstrate detailed ablation studies to prove that both our novel
model components and pretraining strategies significantly contribute to our strong results; and also present several
attention visualizations for the different encoders`),ve=l(),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(),U=n("p"),me=a("This model was contributed by "),ue=n("a"),tt=a("eltoto1219"),Q=a(". The original code can be found "),he=n("a"),pe=a("here"),ot=a("."),Te=l(),P=n("h2"),ne=n("a"),R=n("span"),b(fe.$$.fragment),nt=l(),v=n("span"),F=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(Me.$$.fragment),ft=l(),J=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(),vt=n("p"),$a=a("Configuration objects inherit from "),qn=n("a"),Ma=a("PretrainedConfig"),Fa=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."),hr=l(),Tt=n("h2"),Dt=n("a"),ms=n("span"),b(fo.$$.fragment),qa=l(),us=n("span"),Pa=a("LxmertTokenizer"),pr=l(),S=n("div"),b(go.$$.fragment),Aa=l(),hs=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(vo.$$.fragment),Ra=l(),ps=n("p"),Wa=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:`),Ja=l(),To=n("ul"),Cn=n("li"),Sa=a("single sequence: "),fs=n("code"),Xa=a("[CLS] X [SEP]"),Va=l(),On=n("li"),Ua=a("pair of sequences: "),gs=n("code"),Ba=a("[CLS] A [SEP] B [SEP]"),Qa=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(),vs=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(Wt.$$.fragment),ti=l(),bt=n("p"),oi=a("If "),Ts=n("code"),ni=a("token_ids_1"),si=a(" is "),bs=n("code"),ri=a("None"),ai=a(", this method only returns the first portion of the mask (0s)."),ii=l(),Jt=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"),St=n("a"),ws=n("span"),b(ko.$$.fragment),ui=l(),ys=n("span"),hi=a("LxmertTokenizerFast"),gr=l(),_e=n("div"),b(Lo.$$.fragment),pi=l(),$o=n("p"),fi=a("Construct a \u201Cfast\u201D Lxmert tokenizer (backed by HuggingFace\u2019s "),ks=n("em"),gi=a("tokenizers"),_i=a(" library). Based on WordPiece."),vi=l(),Mo=n("p"),Ti=a("This tokenizer inherits from "),Nn=n("a"),bi=a("PreTrainedTokenizerFast"),xi=a(` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),wi=l(),ct=n("div"),b(Fo.$$.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"),Mi=a("[CLS] X [SEP]"),Fi=l(),jn=n("li"),Ei=a("pair of sequences: "),Ms=n("code"),zi=a("[CLS] A [SEP] B [SEP]"),qi=l(),Ne=n("div"),b(zo.$$.fragment),Pi=l(),Fs=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"),Vt=n("a"),qs=n("span"),b(qo.$$.fragment),Wi=l(),Ps=n("span"),Ji=a("Lxmert specific outputs"),vr=l(),kt=n("div"),b(Po.$$.fragment),Si=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)`),Tr=l(),Lt=n("div"),b(Ao.$$.fragment),Vi=l(),Co=n("p"),Ui=a("Output type of "),Dn=n("a"),Bi=a("LxmertForPreTraining"),Qi=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(),Mt=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(),Ft=n("div"),b(jo.$$.fragment),tl=l(),Do=n("p"),ol=a("Output type of "),Wn=n("a"),nl=a("LxmertForPreTraining"),sl=a("."),yr=l(),Et=n("h2"),Ut=n("a"),Os=n("span"),b(Ro.$$.fragment),rl=l(),Ns=n("span"),al=a("LxmertModel"),kr=l(),H=n("div"),b(Wo.$$.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(),Jo=n("p"),cl=a("The LXMERT model was proposed in "),So=n("a"),ml=a(`LXMERT: Learning Cross-Modality Encoder Representations from
Transformers`),ul=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.`),hl=l(),Xo=n("p"),pl=a("This model inherits from "),Jn=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(),Vo=n("p"),vl=a("This model is also a PyTorch "),Uo=n("a"),Tl=a("torch.nn.Module"),bl=a(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),xl=l(),Ie=n("div"),b(Bo.$$.fragment),wl=l(),zt=n("p"),yl=a("The "),Sn=n("a"),kl=a("LxmertModel"),Ll=a(" forward method, overrides the "),js=n("code"),$l=a("__call__"),Ml=a(" special method."),Fl=l(),b(Bt.$$.fragment),El=l(),b(Qt.$$.fragment),Lr=l(),qt=n("h2"),Gt=n("a"),Ds=n("span"),b(Qo.$$.fragment),zl=l(),Rs=n("span"),ql=a("LxmertForPreTraining"),$r=l(),Y=n("div"),b(Go.$$.fragment),Pl=l(),Ws=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"),Wl=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.)`),Jl=l(),Ko=n("p"),Sl=a("This model is also a PyTorch "),en=n("a"),Xl=a("torch.nn.Module"),Vl=a(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Ul=l(),mt=n("div"),b(tn.$$.fragment),Bl=l(),Pt=n("p"),Ql=a("The "),Vn=n("a"),Gl=a("LxmertForPreTraining"),Zl=a(" forward method, overrides the "),Js=n("code"),Hl=a("__call__"),Yl=a(" special method."),Kl=l(),b(Zt.$$.fragment),Mr=l(),At=n("h2"),Ht=n("a"),Ss=n("span"),b(on.$$.fragment),ed=l(),Xs=n("span"),td=a("LxmertForQuestionAnswering"),Fr=l(),K=n("div"),b(nn.$$.fragment),od=l(),Vs=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 "),Un=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.)`),ud=l(),ln=n("p"),hd=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"),vd=a("The "),Bn=n("a"),Td=a("LxmertForQuestionAnswering"),bd=a(" forward method, overrides the "),Us=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"),Bs=n("span"),b(mn.$$.fragment),Ld=l(),Qs=n("span"),$d=a("TFLxmertModel"),zr=l(),ee=n("div"),b(un.$$.fragment),Md=l(),Gs=n("p"),Fd=a("The bare Lxmert Model transformer outputting raw hidden-states without any specific head on top."),Ed=l(),hn=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 "),Qn=n("a"),Wd=a("TFLxmertModel"),Jd=a(" forward method, overrides the "),Zs=n("code"),Sd=a("__call__"),Xd=a(" special method."),Vd=l(),b(oo.$$.fragment),Ud=l(),b(no.$$.fragment),qr=l(),It=n("h2"),so=n("a"),Hs=n("span"),b(vn.$$.fragment),Bd=l(),Ys=n("span"),Qd=a("TFLxmertForPreTraining"),Pr=l(),te=n("div"),b(Tn.$$.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(),ut=n("div"),b(Ln.$$.fragment),dc=l(),jt=n("p"),cc=a("The "),Gn=n("a"),mc=a("TFLxmertForPreTraining"),uc=a(" forward method, overrides the "),er=n("code"),hc=a("__call__"),pc=a(" special method."),fc=l(),b(ao.$$.fragment),this.h()},l(o){const p=mu('[data-svelte="svelte-1phssyn"]',document.head);u=s(p,"META",{name:!0,content:!0}),p.forEach(t),$=d(o),g=s(o,"H1",{class:!0});var $n=r(g);_=s($n,"A",{id:!0,class:!0,href:!0});var tr=r(_);T=s(tr,"SPAN",{});var or=r(T);x(c.$$.fragment,or),or.forEach(t),tr.forEach(t),f=d($n),E=s($n,"SPAN",{});var nr=r(E);Ue=i(nr,"LXMERT"),nr.forEach(t),$n.forEach(t),Fe=d(o),I=s(o,"H2",{class:!0});var Mn=r(I);oe=s(Mn,"A",{id:!0,class:!0,href:!0});var sr=r(oe);ae=s(sr,"SPAN",{});var rr=r(ae);x(M.$$.fragment,rr),rr.forEach(t),sr.forEach(t),Be=d(Mn),B=s(Mn,"SPAN",{});var ar=r(B);Qe=i(ar,"Overview"),ar.forEach(t),Mn.forEach(t),Ee=d(o),W=s(o,"P",{});var Fn=r(W);Ge=i(Fn,"The LXMERT model was proposed in "),ie=s(Fn,"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(Fn,` 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.`),Fn.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),V=s(o,"P",{});var dr=r(V);we=s(dr,"EM",{});var bc=r(we);Ye=i(bc,`Vision-and-language reasoning requires an understanding of visual concepts, language semantics, and, most importantly,
the alignment and relationships between these two modalities. We thus propose the LXMERT (Learning Cross-Modality
Encoder Representations from Transformers) framework to learn these vision-and-language connections. In LXMERT, we
build a large-scale Transformer model that consists of three encoders: an object relationship encoder, a language
encoder, and a cross-modality encoder. Next, to endow our model with the capability of connecting vision and language
semantics, we pre-train the model with large amounts of image-and-sentence pairs, via five diverse representative
pretraining tasks: masked language modeling, masked object prediction (feature regression and label classification),
cross-modality matching, and image question answering. These tasks help in learning both intra-modality and
cross-modality relationships. After fine-tuning from our pretrained parameters, our model achieves the state-of-the-art
results on two visual question answering datasets (i.e., VQA and GQA). We also show the generalizability of our
pretrained cross-modality model by adapting it to a challenging visual-reasoning task, NLVR, and improve the previous
best result by 22% absolute (54% to 76%). Lastly, we demonstrate detailed ablation studies to prove that both our novel
model components and pretraining strategies significantly contribute to our strong results; and also present several
attention visualizations for the different encoders`),bc.forEach(t),dr.forEach(t),ve=d(o),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),U=s(o,"P",{});var Hn=r(U);me=i(Hn,"This model was contributed by "),ue=s(Hn,"A",{href:!0,rel:!0});var Lc=r(ue);tt=i(Lc,"eltoto1219"),Lc.forEach(t),Q=i(Hn,". The original code can be found "),he=s(Hn,"A",{href:!0,rel:!0});var $c=r(he);pe=i($c,"here"),$c.forEach(t),ot=i(Hn,"."),Hn.forEach(t),Te=d(o),P=s(o,"H2",{class:!0});var Cr=r(P);ne=s(Cr,"A",{id:!0,class:!0,href:!0});var Mc=r(ne);R=s(Mc,"SPAN",{});var Fc=r(R);x(fe.$$.fragment,Fc),Fc.forEach(t),Mc.forEach(t),nt=d(Cr),v=s(Cr,"SPAN",{});var Ec=r(v);F=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(Me.$$.fragment,Yn),ft=d(Yn),J=s(Yn,"P",{});var io=r(J);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),vt=s(Yn,"P",{});var Kn=r(vt);$a=i(Kn,"Configuration objects inherit from "),qn=s(Kn,"A",{href:!0});var Dc=r(qn);Ma=i(Dc,"PretrainedConfig"),Dc.forEach(t),Fa=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),hr=d(o),Tt=s(o,"H2",{class:!0});var Nr=r(Tt);Dt=s(Nr,"A",{id:!0,class:!0,href:!0});var Wc=r(Dt);ms=s(Wc,"SPAN",{});var Jc=r(ms);x(fo.$$.fragment,Jc),Jc.forEach(t),Wc.forEach(t),qa=d(Nr),us=s(Nr,"SPAN",{});var Sc=r(us);Pa=i(Sc,"LxmertTokenizer"),Sc.forEach(t),Nr.forEach(t),pr=d(o),S=s(o,"DIV",{class:!0});var xe=r(S);x(go.$$.fragment,xe),Aa=d(xe),hs=s(xe,"P",{});var Xc=r(hs);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 Vc=r(An);Ia=i(Vc,"PreTrainedTokenizer"),Vc.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(vo.$$.fragment,es),Ra=d(es),ps=s(es,"P",{});var Uc=r(ps);Wa=i(Uc,`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:`),Uc.forEach(t),Ja=d(es),To=s(es,"UL",{});var jr=r(To);Cn=s(jr,"LI",{});var gc=r(Cn);Sa=i(gc,"single sequence: "),fs=s(gc,"CODE",{});var Bc=r(fs);Xa=i(Bc,"[CLS] X [SEP]"),Bc.forEach(t),gc.forEach(t),Va=d(jr),On=s(jr,"LI",{});var _c=r(On);Ua=i(_c,"pair of sequences: "),gs=s(_c,"CODE",{});var Qc=r(gs);Ba=i(Qc,"[CLS] A [SEP] B [SEP]"),Qc.forEach(t),_c.forEach(t),jr.forEach(t),es.forEach(t),Qa=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),vs=s(lo,"P",{});var Zc=r(vs);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(Wt.$$.fragment,lo),ti=d(lo),bt=s(lo,"P",{});var ts=r(bt);oi=i(ts,"If "),Ts=s(ts,"CODE",{});var Hc=r(Ts);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),Jt=s(xe,"DIV",{class:!0});var Rr=r(Jt);x(wo.$$.fragment,Rr),li=d(Rr),yo=s(Rr,"P",{});var Wr=r(yo);di=i(Wr,`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(Wr,"CODE",{});var Kc=r(xs);ci=i(Kc,"prepare_for_model"),Kc.forEach(t),mi=i(Wr," method."),Wr.forEach(t),Rr.forEach(t),xe.forEach(t),fr=d(o),xt=s(o,"H2",{class:!0});var Jr=r(xt);St=s(Jr,"A",{id:!0,class:!0,href:!0});var em=r(St);ws=s(em,"SPAN",{});var tm=r(ws);x(ko.$$.fragment,tm),tm.forEach(t),em.forEach(t),ui=d(Jr),ys=s(Jr,"SPAN",{});var om=r(ys);hi=i(om,"LxmertTokenizerFast"),om.forEach(t),Jr.forEach(t),gr=d(o),_e=s(o,"DIV",{class:!0});var ht=r(_e);x(Lo.$$.fragment,ht),pi=d(ht),$o=s(ht,"P",{});var Sr=r($o);fi=i(Sr,"Construct a \u201Cfast\u201D Lxmert tokenizer (backed by HuggingFace\u2019s "),ks=s(Sr,"EM",{});var nm=r(ks);gi=i(nm,"tokenizers"),nm.forEach(t),_i=i(Sr," library). Based on WordPiece."),Sr.forEach(t),vi=d(ht),Mo=s(ht,"P",{});var Xr=r(Mo);Ti=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(ht),ct=s(ht,"DIV",{class:!0});var os=r(ct);x(Fo.$$.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 Vr=r(Eo);In=s(Vr,"LI",{});var vc=r(In);$i=i(vc,"single sequence: "),$s=s(vc,"CODE",{});var am=r($s);Mi=i(am,"[CLS] X [SEP]"),am.forEach(t),vc.forEach(t),Fi=d(Vr),jn=s(Vr,"LI",{});var Tc=r(jn);Ei=i(Tc,"pair of sequences: "),Ms=s(Tc,"CODE",{});var im=r(Ms);zi=i(im,"[CLS] A [SEP] B [SEP]"),im.forEach(t),Tc.forEach(t),Vr.forEach(t),os.forEach(t),qi=d(ht),Ne=s(ht,"DIV",{class:!0});var co=r(Ne);x(zo.$$.fragment,co),Pi=d(co),Fs=s(co,"P",{});var lm=r(Fs);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),ht.forEach(t),_r=d(o),yt=s(o,"H2",{class:!0});var Ur=r(yt);Vt=s(Ur,"A",{id:!0,class:!0,href:!0});var mm=r(Vt);qs=s(mm,"SPAN",{});var um=r(qs);x(qo.$$.fragment,um),um.forEach(t),mm.forEach(t),Wi=d(Ur),Ps=s(Ur,"SPAN",{});var hm=r(Ps);Ji=i(hm,"Lxmert specific outputs"),hm.forEach(t),Ur.forEach(t),vr=d(o),kt=s(o,"DIV",{class:!0});var Br=r(kt);x(Po.$$.fragment,Br),Si=d(Br),As=s(Br,"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),Br.forEach(t),Tr=d(o),Lt=s(o,"DIV",{class:!0});var Qr=r(Lt);x(Ao.$$.fragment,Qr),Vi=d(Qr),Co=s(Qr,"P",{});var Gr=r(Co);Ui=i(Gr,"Output type of "),Dn=s(Gr,"A",{href:!0});var fm=r(Dn);Bi=i(fm,"LxmertForPreTraining"),fm.forEach(t),Qi=i(Gr,"."),Gr.forEach(t),Qr.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),Mt=s(o,"DIV",{class:!0});var Yr=r(Mt);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),Ft=s(o,"DIV",{class:!0});var Kr=r(Ft);x(jo.$$.fragment,Kr),tl=d(Kr),Do=s(Kr,"P",{});var ea=r(Do);ol=i(ea,"Output type of "),Wn=s(ea,"A",{href:!0});var vm=r(Wn);nl=i(vm,"LxmertForPreTraining"),vm.forEach(t),sl=i(ea,"."),ea.forEach(t),Kr.forEach(t),yr=d(o),Et=s(o,"H2",{class:!0});var ta=r(Et);Ut=s(ta,"A",{id:!0,class:!0,href:!0});var Tm=r(Ut);Os=s(Tm,"SPAN",{});var bm=r(Os);x(Ro.$$.fragment,bm),bm.forEach(t),Tm.forEach(t),rl=d(ta),Ns=s(ta,"SPAN",{});var xm=r(Ns);al=i(xm,"LxmertModel"),xm.forEach(t),ta.forEach(t),kr=d(o),H=s(o,"DIV",{class:!0});var Re=r(H);x(Wo.$$.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),Jo=s(Re,"P",{});var oa=r(Jo);cl=i(oa,"The LXMERT model was proposed in "),So=s(oa,"A",{href:!0,rel:!0});var ym=r(So);ml=i(ym,`LXMERT: Learning Cross-Modality Encoder Representations from
Transformers`),ym.forEach(t),ul=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),hl=d(Re),Xo=s(Re,"P",{});var na=r(Xo);pl=i(na,"This model inherits from "),Jn=s(na,"A",{href:!0});var km=r(Jn);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),Vo=s(Re,"P",{});var sa=r(Vo);vl=i(sa,"This model is also a PyTorch "),Uo=s(sa,"A",{href:!0,rel:!0});var Lm=r(Uo);Tl=i(Lm,"torch.nn.Module"),Lm.forEach(t),bl=i(sa,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),sa.forEach(t),xl=d(Re),Ie=s(Re,"DIV",{class:!0});var mo=r(Ie);x(Bo.$$.fragment,mo),wl=d(mo),zt=s(mo,"P",{});var ss=r(zt);yl=i(ss,"The "),Sn=s(ss,"A",{href:!0});var $m=r(Sn);kl=i($m,"LxmertModel"),$m.forEach(t),Ll=i(ss," forward method, overrides the "),js=s(ss,"CODE",{});var Mm=r(js);$l=i(Mm,"__call__"),Mm.forEach(t),Ml=i(ss," special method."),ss.forEach(t),Fl=d(mo),x(Bt.$$.fragment,mo),El=d(mo),x(Qt.$$.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 Fm=r(Gt);Ds=s(Fm,"SPAN",{});var Em=r(Ds);x(Qo.$$.fragment,Em),Em.forEach(t),Fm.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 We=r(Y);x(Go.$$.fragment,We),Pl=d(We),Ws=s(We,"P",{});var qm=r(Ws);Al=i(qm,"Lxmert Model with a specified pretraining head on top."),qm.forEach(t),Cl=d(We),Zo=s(We,"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(We),Yo=s(We,"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),Wl=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),Jl=d(We),Ko=s(We,"P",{});var la=r(Ko);Sl=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),Vl=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),Ul=d(We),mt=s(We,"DIV",{class:!0});var rs=r(mt);x(tn.$$.fragment,rs),Bl=d(rs),Pt=s(rs,"P",{});var as=r(Pt);Ql=i(as,"The "),Vn=s(as,"A",{href:!0});var Om=r(Vn);Gl=i(Om,"LxmertForPreTraining"),Om.forEach(t),Zl=i(as," forward method, overrides the "),Js=s(as,"CODE",{});var Nm=r(Js);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),We.forEach(t),Mr=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);Ss=s(Im,"SPAN",{});var jm=r(Ss);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),Fr=d(o),K=s(o,"DIV",{class:!0});var Je=r(K);x(nn.$$.fragment,Je),od=d(Je),Vs=s(Je,"P",{});var Rm=r(Vs);nd=i(Rm,"Lxmert Model with a visual-answering head on top for downstream QA tasks"),Rm.forEach(t),sd=d(Je),sn=s(Je,"P",{});var ca=r(sn);rd=i(ca,"The LXMERT model was proposed in "),rn=s(ca,"A",{href:!0,rel:!0});var Wm=r(rn);ad=i(Wm,`LXMERT: Learning Cross-Modality Encoder Representations from
Transformers`),Wm.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(Je),an=s(Je,"P",{});var ma=r(an);dd=i(ma,"This model inherits from "),Un=s(ma,"A",{href:!0});var Jm=r(Un);cd=i(Jm,"PreTrainedModel"),Jm.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),ud=d(Je),ln=s(Je,"P",{});var ua=r(ln);hd=i(ua,"This model is also a PyTorch "),dn=s(ua,"A",{href:!0,rel:!0});var Sm=r(dn);pd=i(Sm,"torch.nn.Module"),Sm.forEach(t),fd=i(ua,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),ua.forEach(t),gd=d(Je),je=s(Je,"DIV",{class:!0});var uo=r(je);x(cn.$$.fragment,uo),_d=d(uo),Ct=s(uo,"P",{});var is=r(Ct);vd=i(is,"The "),Bn=s(is,"A",{href:!0});var Xm=r(Bn);Td=i(Xm,"LxmertForQuestionAnswering"),Xm.forEach(t),bd=i(is," forward method, overrides the "),Us=s(is,"CODE",{});var Vm=r(Us);xd=i(Vm,"__call__"),Vm.forEach(t),wd=i(is," special method."),is.forEach(t),yd=d(uo),x(Yt.$$.fragment,uo),kd=d(uo),x(Kt.$$.fragment,uo),uo.forEach(t),Je.forEach(t),Er=d(o),Ot=s(o,"H2",{class:!0});var ha=r(Ot);eo=s(ha,"A",{id:!0,class:!0,href:!0});var Um=r(eo);Bs=s(Um,"SPAN",{});var Bm=r(Bs);x(mn.$$.fragment,Bm),Bm.forEach(t),Um.forEach(t),Ld=d(ha),Qs=s(ha,"SPAN",{});var Qm=r(Qs);$d=i(Qm,"TFLxmertModel"),Qm.forEach(t),ha.forEach(t),zr=d(o),ee=s(o,"DIV",{class:!0});var Se=r(ee);x(un.$$.fragment,Se),Md=d(Se),Gs=s(Se,"P",{});var Gm=r(Gs);Fd=i(Gm,"The bare Lxmert Model transformer outputting raw hidden-states without any specific head on top."),Gm.forEach(t),Ed=d(Se),hn=s(Se,"P",{});var pa=r(hn);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(Se),fn=s(Se,"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(Se),x(to.$$.fragment,Se),jd=d(Se),De=s(Se,"DIV",{class:!0});var ho=r(De);x(_n.$$.fragment,ho),Dd=d(ho),Nt=s(ho,"P",{});var ls=r(Nt);Rd=i(ls,"The "),Qn=s(ls,"A",{href:!0});var Ym=r(Qn);Wd=i(Ym,"TFLxmertModel"),Ym.forEach(t),Jd=i(ls," forward method, overrides the "),Zs=s(ls,"CODE",{});var Km=r(Zs);Sd=i(Km,"__call__"),Km.forEach(t),Xd=i(ls," special method."),ls.forEach(t),Vd=d(ho),x(oo.$$.fragment,ho),Ud=d(ho),x(no.$$.fragment,ho),ho.forEach(t),Se.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 eu=r(so);Hs=s(eu,"SPAN",{});var tu=r(Hs);x(vn.$$.fragment,tu),tu.forEach(t),eu.forEach(t),Bd=d(ga),Ys=s(ga,"SPAN",{});var ou=r(Ys);Qd=i(ou,"TFLxmertForPreTraining"),ou.forEach(t),ga.forEach(t),Pr=d(o),te=s(o,"DIV",{class:!0});var Xe=r(te);x(Tn.$$.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 nu=r(Ks);Hd=i(nu,"language modeling"),nu.forEach(t),Yd=i(_a," head on top."),_a.forEach(t),Kd=d(Xe),xn=s(Xe,"P",{});var va=r(xn);ec=i(va,"The LXMERT model was proposed in "),wn=s(va,"A",{href:!0,rel:!0});var su=r(wn);tc=i(su,`LXMERT: Learning Cross-Modality Encoder Representations from
Transformers`),su.forEach(t),oc=i(va,` by Hao Tan and Mohit Bansal. It\u2019s a vision and language transformer
model, pre-trained on a variety of multi-modal datasets comprising of GQA, VQAv2.0, MCSCOCO captions, and Visual
genome, using a combination of masked language modeling, region of interest feature regression, cross entropy loss
for question answering attribute prediction, and object tag prediction.`),va.forEach(t),nc=d(Xe),yn=s(Xe,"P",{});var Ta=r(yn);sc=i(Ta,"This model is also a "),kn=s(Ta,"A",{href:!0,rel:!0});var ru=r(kn);rc=i(ru,"tf.keras.Model"),ru.forEach(t),ac=i(Ta,` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),Ta.forEach(t),ic=d(Xe),x(ro.$$.fragment,Xe),lc=d(Xe),ut=s(Xe,"DIV",{class:!0});var ds=r(ut);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 au=r(Gn);mc=i(au,"TFLxmertForPreTraining"),au.forEach(t),uc=i(cs," forward method, overrides the "),er=s(cs,"CODE",{});var iu=r(er);hc=i(iu,"__call__"),iu.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(u,"name","hf:doc:metadata"),m(u,"content",JSON.stringify($u)),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(ue,"href","https://huggingface.co/eltoto1219"),m(ue,"rel","nofollow"),m(he,"href","https://github.com/airsplay/lxmert"),m(he,"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/v4.31.0/en/model_doc/lxmert#transformers.LxmertModel"),m(zn,"href","/docs/transformers/v4.31.0/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/v4.31.0/en/main_classes/configuration#transformers.PretrainedConfig"),m(Pn,"href","/docs/transformers/v4.31.0/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(Tt,"class","relative group"),m(An,"href","/docs/transformers/v4.31.0/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(Jt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(S,"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,"id","transformers.LxmertTokenizerFast"),m(St,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(St,"href","#transformers.LxmertTokenizerFast"),m(xt,"class","relative group"),m(Nn,"href","/docs/transformers/v4.31.0/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(Vt,"id","transformers.models.lxmert.modeling_lxmert.LxmertModelOutput"),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.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/v4.31.0/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/v4.31.0/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(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(Wn,"href","/docs/transformers/v4.31.0/en/model_doc/lxmert#transformers.LxmertForPreTraining"),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(Ut,"id","transformers.LxmertModel"),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.LxmertModel"),m(Et,"class","relative group"),m(So,"href","https://arxiv.org/abs/1908.07490"),m(So,"rel","nofollow"),m(Jn,"href","/docs/transformers/v4.31.0/en/main_classes/model#transformers.PreTrainedModel"),m(Uo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),m(Uo,"rel","nofollow"),m(Sn,"href","/docs/transformers/v4.31.0/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/v4.31.0/en/main_classes/model#transformers.PreTrainedModel"),m(en,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),m(en,"rel","nofollow"),m(Vn,"href","/docs/transformers/v4.31.0/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(Un,"href","/docs/transformers/v4.31.0/en/main_classes/model#transformers.PreTrainedModel"),m(dn,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),m(dn,"rel","nofollow"),m(Bn,"href","/docs/transformers/v4.31.0/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(Qn,"href","/docs/transformers/v4.31.0/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/v4.31.0/en/model_doc/lxmert#transformers.TFLxmertForPreTraining"),m(ut,"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,u),h(o,$,p),h(o,g,p),e(g,_),e(_,T),w(c,T,null),e(g,f),e(g,E),e(E,Ue),h(o,Fe,p),h(o,I,p),e(I,oe),e(oe,ae),w(M,ae,null),e(I,Be),e(I,B),e(B,Qe),h(o,Ee,p),h(o,W,p),e(W,Ge),e(W,ie),e(ie,le),e(W,Ze),h(o,ze,p),h(o,X,p),e(X,He),h(o,qe,p),h(o,V,p),e(V,we),e(we,Ye),h(o,ve,p),h(o,q,p),e(q,j),h(o,Pe,p),h(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),h(o,Ae,p),h(o,U,p),e(U,me),e(U,ue),e(ue,tt),e(U,Q),e(U,he),e(he,pe),e(U,ot),h(o,Te,p),h(o,P,p),e(P,ne),e(ne,R),w(fe,R,null),e(P,nt),e(P,v),e(v,F),h(o,at,p),h(o,se,p),e(se,st),e(st,Ce),e(Ce,z),h(o,it,p),h(o,ge,p),e(ge,be),e(be,rt),w($e,rt,null),e(ge,G),e(ge,Z),e(Z,pt),h(o,lt,p),h(o,O,p),w(Me,O,null),e(O,ft),e(O,J),e(J,gt),e(J,re),e(re,_t),e(J,ba),e(J,zn),e(zn,xa),e(J,wa),e(J,po),e(po,ya),e(J,ka),e(O,La),e(O,vt),e(vt,$a),e(vt,qn),e(qn,Ma),e(vt,Fa),e(vt,Pn),e(Pn,Ea),e(vt,za),h(o,hr,p),h(o,Tt,p),e(Tt,Dt),e(Dt,ms),w(fo,ms,null),e(Tt,qa),e(Tt,us),e(us,Pa),h(o,pr,p),h(o,S,p),w(go,S,null),e(S,Aa),e(S,hs),e(hs,Ca),e(S,Oa),e(S,_o),e(_o,Na),e(_o,An),e(An,Ia),e(_o,ja),e(S,Da),e(S,dt),w(vo,dt,null),e(dt,Ra),e(dt,ps),e(ps,Wa),e(dt,Ja),e(dt,To),e(To,Cn),e(Cn,Sa),e(Cn,fs),e(fs,Xa),e(To,Va),e(To,On),e(On,Ua),e(On,gs),e(gs,Ba),e(S,Qa),e(S,Rt),w(bo,Rt,null),e(Rt,Ga),e(Rt,_s),e(_s,Za),e(S,Ha),e(S,Oe),w(xo,Oe,null),e(Oe,Ya),e(Oe,vs),e(vs,Ka),e(Oe,ei),w(Wt,Oe,null),e(Oe,ti),e(Oe,bt),e(bt,oi),e(bt,Ts),e(Ts,ni),e(bt,si),e(bt,bs),e(bs,ri),e(bt,ai),e(S,ii),e(S,Jt),w(wo,Jt,null),e(Jt,li),e(Jt,yo),e(yo,di),e(yo,xs),e(xs,ci),e(yo,mi),h(o,fr,p),h(o,xt,p),e(xt,St),e(St,ws),w(ko,ws,null),e(xt,ui),e(xt,ys),e(ys,hi),h(o,gr,p),h(o,_e,p),w(Lo,_e,null),e(_e,pi),e(_e,$o),e($o,fi),e($o,ks),e(ks,gi),e($o,_i),e(_e,vi),e(_e,Mo),e(Mo,Ti),e(Mo,Nn),e(Nn,bi),e(Mo,xi),e(_e,wi),e(_e,ct),w(Fo,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,Mi),e(Eo,Fi),e(Eo,jn),e(jn,Ei),e(jn,Ms),e(Ms,zi),e(_e,qi),e(_e,Ne),w(zo,Ne,null),e(Ne,Pi),e(Ne,Fs),e(Fs,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),h(o,_r,p),h(o,yt,p),e(yt,Vt),e(Vt,qs),w(qo,qs,null),e(yt,Wi),e(yt,Ps),e(Ps,Ji),h(o,vr,p),h(o,kt,p),w(Po,kt,null),e(kt,Si),e(kt,As),e(As,Xi),h(o,Tr,p),h(o,Lt,p),w(Ao,Lt,null),e(Lt,Vi),e(Lt,Co),e(Co,Ui),e(Co,Dn),e(Dn,Bi),e(Co,Qi),h(o,br,p),h(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),h(o,xr,p),h(o,Mt,p),w(Io,Mt,null),e(Mt,Ki),e(Mt,Cs),e(Cs,el),h(o,wr,p),h(o,Ft,p),w(jo,Ft,null),e(Ft,tl),e(Ft,Do),e(Do,ol),e(Do,Wn),e(Wn,nl),e(Do,sl),h(o,yr,p),h(o,Et,p),e(Et,Ut),e(Ut,Os),w(Ro,Os,null),e(Et,rl),e(Et,Ns),e(Ns,al),h(o,kr,p),h(o,H,p),w(Wo,H,null),e(H,il),e(H,Is),e(Is,ll),e(H,dl),e(H,Jo),e(Jo,cl),e(Jo,So),e(So,ml),e(Jo,ul),e(H,hl),e(H,Xo),e(Xo,pl),e(Xo,Jn),e(Jn,fl),e(Xo,gl),e(H,_l),e(H,Vo),e(Vo,vl),e(Vo,Uo),e(Uo,Tl),e(Vo,bl),e(H,xl),e(H,Ie),w(Bo,Ie,null),e(Ie,wl),e(Ie,zt),e(zt,yl),e(zt,Sn),e(Sn,kl),e(zt,Ll),e(zt,js),e(js,$l),e(zt,Ml),e(Ie,Fl),w(Bt,Ie,null),e(Ie,El),w(Qt,Ie,null),h(o,Lr,p),h(o,qt,p),e(qt,Gt),e(Gt,Ds),w(Qo,Ds,null),e(qt,zl),e(qt,Rs),e(Rs,ql),h(o,$r,p),h(o,Y,p),w(Go,Y,null),e(Y,Pl),e(Y,Ws),e(Ws,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,Wl),e(Y,Jl),e(Y,Ko),e(Ko,Sl),e(Ko,en),e(en,Xl),e(Ko,Vl),e(Y,Ul),e(Y,mt),w(tn,mt,null),e(mt,Bl),e(mt,Pt),e(Pt,Ql),e(Pt,Vn),e(Vn,Gl),e(Pt,Zl),e(Pt,Js),e(Js,Hl),e(Pt,Yl),e(mt,Kl),w(Zt,mt,null),h(o,Mr,p),h(o,At,p),e(At,Ht),e(Ht,Ss),w(on,Ss,null),e(At,ed),e(At,Xs),e(Xs,td),h(o,Fr,p),h(o,K,p),w(nn,K,null),e(K,od),e(K,Vs),e(Vs,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,Un),e(Un,cd),e(an,md),e(K,ud),e(K,ln),e(ln,hd),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,vd),e(Ct,Bn),e(Bn,Td),e(Ct,bd),e(Ct,Us),e(Us,xd),e(Ct,wd),e(je,yd),w(Yt,je,null),e(je,kd),w(Kt,je,null),h(o,Er,p),h(o,Ot,p),e(Ot,eo),e(eo,Bs),w(mn,Bs,null),e(Ot,Ld),e(Ot,Qs),e(Qs,$d),h(o,zr,p),h(o,ee,p),w(un,ee,null),e(ee,Md),e(ee,Gs),e(Gs,Fd),e(ee,Ed),e(ee,hn),e(hn,zd),e(hn,pn),e(pn,qd),e(hn,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,Qn),e(Qn,Wd),e(Nt,Jd),e(Nt,Zs),e(Zs,Sd),e(Nt,Xd),e(De,Vd),w(oo,De,null),e(De,Ud),w(no,De,null),h(o,qr,p),h(o,It,p),e(It,so),e(so,Hs),w(vn,Hs,null),e(It,Bd),e(It,Ys),e(Ys,Qd),h(o,Pr,p),h(o,te,p),w(Tn,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,ut),w(Ln,ut,null),e(ut,dc),e(ut,jt),e(jt,cc),e(jt,Gn),e(Gn,mc),e(jt,uc),e(jt,er),e(er,hc),e(jt,pc),e(ut,fc),w(ao,ut,null),Ar=!0},p(o,[p]){const $n={};p&2&&($n.$$scope={dirty:p,ctx:o}),Wt.$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}),Bt.$set(or);const nr={};p&2&&(nr.$$scope={dirty:p,ctx:o}),Qt.$set(nr);const Mn={};p&2&&(Mn.$$scope={dirty:p,ctx:o}),Zt.$set(Mn);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 Fn={};p&2&&(Fn.$$scope={dirty:p,ctx:o}),oo.$set(Fn);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(M.$$.fragment,o),y(fe.$$.fragment,o),y($e.$$.fragment,o),y(Me.$$.fragment,o),y(fo.$$.fragment,o),y(go.$$.fragment,o),y(vo.$$.fragment,o),y(bo.$$.fragment,o),y(xo.$$.fragment,o),y(Wt.$$.fragment,o),y(wo.$$.fragment,o),y(ko.$$.fragment,o),y(Lo.$$.fragment,o),y(Fo.$$.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(Wo.$$.fragment,o),y(Bo.$$.fragment,o),y(Bt.$$.fragment,o),y(Qt.$$.fragment,o),y(Qo.$$.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(un.$$.fragment,o),y(to.$$.fragment,o),y(_n.$$.fragment,o),y(oo.$$.fragment,o),y(no.$$.fragment,o),y(vn.$$.fragment,o),y(Tn.$$.fragment,o),y(ro.$$.fragment,o),y(Ln.$$.fragment,o),y(ao.$$.fragment,o),Ar=!0)},o(o){k(c.$$.fragment,o),k(M.$$.fragment,o),k(fe.$$.fragment,o),k($e.$$.fragment,o),k(Me.$$.fragment,o),k(fo.$$.fragment,o),k(go.$$.fragment,o),k(vo.$$.fragment,o),k(bo.$$.fragment,o),k(xo.$$.fragment,o),k(Wt.$$.fragment,o),k(wo.$$.fragment,o),k(ko.$$.fragment,o),k(Lo.$$.fragment,o),k(Fo.$$.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(Wo.$$.fragment,o),k(Bo.$$.fragment,o),k(Bt.$$.fragment,o),k(Qt.$$.fragment,o),k(Qo.$$.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(un.$$.fragment,o),k(to.$$.fragment,o),k(_n.$$.fragment,o),k(oo.$$.fragment,o),k(no.$$.fragment,o),k(vn.$$.fragment,o),k(Tn.$$.fragment,o),k(ro.$$.fragment,o),k(Ln.$$.fragment,o),k(ao.$$.fragment,o),Ar=!1},d(o){t(u),o&&t($),o&&t(g),L(c),o&&t(Fe),o&&t(I),L(M),o&&t(Ee),o&&t(W),o&&t(ze),o&&t(X),o&&t(qe),o&&t(V),o&&t(ve),o&&t(q),o&&t(Pe),o&&t(N),o&&t(Ae),o&&t(U),o&&t(Te),o&&t(P),L(fe),o&&t(at),o&&t(se),o&&t(it),o&&t(ge),L($e),o&&t(lt),o&&t(O),L(Me),o&&t(hr),o&&t(Tt),L(fo),o&&t(pr),o&&t(S),L(go),L(vo),L(bo),L(xo),L(Wt),L(wo),o&&t(fr),o&&t(xt),L(ko),o&&t(gr),o&&t(_e),L(Lo),L(Fo),L(zo),L(Xt),o&&t(_r),o&&t(yt),L(qo),o&&t(vr),o&&t(kt),L(Po),o&&t(Tr),o&&t(Lt),L(Ao),o&&t(br),o&&t($t),L(Oo),o&&t(xr),o&&t(Mt),L(Io),o&&t(wr),o&&t(Ft),L(jo),o&&t(yr),o&&t(Et),L(Ro),o&&t(kr),o&&t(H),L(Wo),L(Bo),L(Bt),L(Qt),o&&t(Lr),o&&t(qt),L(Qo),o&&t($r),o&&t(Y),L(Go),L(tn),L(Zt),o&&t(Mr),o&&t(At),L(on),o&&t(Fr),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(un),L(to),L(_n),L(oo),L(no),o&&t(qr),o&&t(It),L(vn),o&&t(Pr),o&&t(te),L(Tn),L(ro),L(Ln),L(ao)}}}const $u={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 Mu(A){return uu(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Cu extends lu{constructor(u){super();du(this,u,Mu,Lu,cu,{})}}export{Cu as default,$u as metadata};
