import{S as hc,i as uc,s as pc,e as n,k as d,w as T,t as a,M as fc,c as r,d as t,m as c,a as s,x,h as i,b as l,F as e,g as m,y as b,q as w,o as y,B as k}from"../../chunks/vendor-4833417e.js";import{T as Vo}from"../../chunks/Tip-fffd6df1.js";import{D as I}from"../../chunks/Docstring-4f315ed9.js";import{C as Al}from"../../chunks/CodeBlock-6a3d1b46.js";import{I as De}from"../../chunks/IconCopyLink-4b81c553.js";import"../../chunks/CopyButton-dacfbfaf.js";function gc(D){let u,$,f,g,L;return{c(){u=n("p"),$=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=n("code"),g=a("Module"),L=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(v){u=r(v,"P",{});var _=s(u);$=i(_,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(_,"CODE",{});var z=s(f);g=i(z,"Module"),z.forEach(t),L=i(_,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),_.forEach(t)},m(v,_){m(v,u,_),e(u,$),e(u,f),e(f,g),e(u,L)},d(v){v&&t(u)}}}function _c(D){let u,$,f,g,L;return{c(){u=n("p"),$=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=n("code"),g=a("Module"),L=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(v){u=r(v,"P",{});var _=s(u);$=i(_,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(_,"CODE",{});var z=s(f);g=i(z,"Module"),z.forEach(t),L=i(_,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),_.forEach(t)},m(v,_){m(v,u,_),e(u,$),e(u,f),e(f,g),e(u,L)},d(v){v&&t(u)}}}function vc(D){let u,$,f,g,L;return{c(){u=n("p"),$=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=n("code"),g=a("Module"),L=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(v){u=r(v,"P",{});var _=s(u);$=i(_,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(_,"CODE",{});var z=s(f);g=i(z,"Module"),z.forEach(t),L=i(_,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),_.forEach(t)},m(v,_){m(v,u,_),e(u,$),e(u,f),e(f,g),e(u,L)},d(v){v&&t(u)}}}function Tc(D){let u,$,f,g,L,v,_,z,$e,re,E,Y,R,ee,ze,S,Ee,Te,C,Q,te,me,M,P,se,oe,xe,ae,V,Me,be,q,qe,Z,N,he,ne,Pe,ue,W,Ae,B,Oe;return{c(){u=n("p"),$=a("TF 2.0 models accepts two formats as inputs:"),f=d(),g=n("ul"),L=n("li"),v=a("having all inputs as keyword arguments (like PyTorch models), or"),_=d(),z=n("li"),$e=a("having all inputs as a list, tuple or dict in the first positional arguments."),re=d(),E=n("p"),Y=a("This second option is useful when using "),R=n("code"),ee=a("tf.keras.Model.fit"),ze=a(` method which currently requires having all the
tensors in the first argument of the model call function: `),S=n("code"),Ee=a("model(inputs)"),Te=a("."),C=d(),Q=n("p"),te=a(`If you choose this second option, there are three possibilities you can use to gather all the input Tensors in the
first positional argument :`),me=d(),M=n("ul"),P=n("li"),se=a("a single Tensor with "),oe=n("code"),xe=a("input_ids"),ae=a(" only and nothing else: "),V=n("code"),Me=a("model(inputs_ids)"),be=d(),q=n("li"),qe=a(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),Z=n("code"),N=a("model([input_ids, attention_mask])"),he=a(" or "),ne=n("code"),Pe=a("model([input_ids, attention_mask, token_type_ids])"),ue=d(),W=n("li"),Ae=a(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),B=n("code"),Oe=a('model({"input_ids": input_ids, "token_type_ids": token_type_ids})')},l(p){u=r(p,"P",{});var F=s(u);$=i(F,"TF 2.0 models accepts two formats as inputs:"),F.forEach(t),f=c(p),g=r(p,"UL",{});var pe=s(g);L=r(pe,"LI",{});var fe=s(L);v=i(fe,"having all inputs as keyword arguments (like PyTorch models), or"),fe.forEach(t),_=c(pe),z=r(pe,"LI",{});var Xe=s(z);$e=i(Xe,"having all inputs as a list, tuple or dict in the first positional arguments."),Xe.forEach(t),pe.forEach(t),re=c(p),E=r(p,"P",{});var X=s(E);Y=i(X,"This second option is useful when using "),R=r(X,"CODE",{});var ge=s(R);ee=i(ge,"tf.keras.Model.fit"),ge.forEach(t),ze=i(X,` method which currently requires having all the
tensors in the first argument of the model call function: `),S=r(X,"CODE",{});var He=s(S);Ee=i(He,"model(inputs)"),He.forEach(t),Te=i(X,"."),X.forEach(t),C=c(p),Q=r(p,"P",{});var Ge=s(Q);te=i(Ge,`If you choose this second option, there are three possibilities you can use to gather all the input Tensors in the
first positional argument :`),Ge.forEach(t),me=c(p),M=r(p,"UL",{});var j=s(M);P=r(j,"LI",{});var A=s(P);se=i(A,"a single Tensor with "),oe=r(A,"CODE",{});var ie=s(oe);xe=i(ie,"input_ids"),ie.forEach(t),ae=i(A," only and nothing else: "),V=r(A,"CODE",{});var Ce=s(V);Me=i(Ce,"model(inputs_ids)"),Ce.forEach(t),A.forEach(t),be=c(j),q=r(j,"LI",{});var O=s(q);qe=i(O,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),Z=r(O,"CODE",{});var Ue=s(Z);N=i(Ue,"model([input_ids, attention_mask])"),Ue.forEach(t),he=i(O," or "),ne=r(O,"CODE",{});var Ne=s(ne);Pe=i(Ne,"model([input_ids, attention_mask, token_type_ids])"),Ne.forEach(t),O.forEach(t),ue=c(j),W=r(j,"LI",{});var je=s(W);Ae=i(je,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),B=r(je,"CODE",{});var Re=s(B);Oe=i(Re,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),Re.forEach(t),je.forEach(t),j.forEach(t)},m(p,F){m(p,u,F),e(u,$),m(p,f,F),m(p,g,F),e(g,L),e(L,v),e(g,_),e(g,z),e(z,$e),m(p,re,F),m(p,E,F),e(E,Y),e(E,R),e(R,ee),e(E,ze),e(E,S),e(S,Ee),e(E,Te),m(p,C,F),m(p,Q,F),e(Q,te),m(p,me,F),m(p,M,F),e(M,P),e(P,se),e(P,oe),e(oe,xe),e(P,ae),e(P,V),e(V,Me),e(M,be),e(M,q),e(q,qe),e(q,Z),e(Z,N),e(q,he),e(q,ne),e(ne,Pe),e(M,ue),e(M,W),e(W,Ae),e(W,B),e(B,Oe)},d(p){p&&t(u),p&&t(f),p&&t(g),p&&t(re),p&&t(E),p&&t(C),p&&t(Q),p&&t(me),p&&t(M)}}}function xc(D){let u,$,f,g,L;return{c(){u=n("p"),$=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=n("code"),g=a("Module"),L=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(v){u=r(v,"P",{});var _=s(u);$=i(_,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(_,"CODE",{});var z=s(f);g=i(z,"Module"),z.forEach(t),L=i(_,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),_.forEach(t)},m(v,_){m(v,u,_),e(u,$),e(u,f),e(f,g),e(u,L)},d(v){v&&t(u)}}}function bc(D){let u,$,f,g,L,v,_,z,$e,re,E,Y,R,ee,ze,S,Ee,Te,C,Q,te,me,M,P,se,oe,xe,ae,V,Me,be,q,qe,Z,N,he,ne,Pe,ue,W,Ae,B,Oe;return{c(){u=n("p"),$=a("TF 2.0 models accepts two formats as inputs:"),f=d(),g=n("ul"),L=n("li"),v=a("having all inputs as keyword arguments (like PyTorch models), or"),_=d(),z=n("li"),$e=a("having all inputs as a list, tuple or dict in the first positional arguments."),re=d(),E=n("p"),Y=a("This second option is useful when using "),R=n("code"),ee=a("tf.keras.Model.fit"),ze=a(` method which currently requires having all the
tensors in the first argument of the model call function: `),S=n("code"),Ee=a("model(inputs)"),Te=a("."),C=d(),Q=n("p"),te=a(`If you choose this second option, there are three possibilities you can use to gather all the input Tensors in the
first positional argument :`),me=d(),M=n("ul"),P=n("li"),se=a("a single Tensor with "),oe=n("code"),xe=a("input_ids"),ae=a(" only and nothing else: "),V=n("code"),Me=a("model(inputs_ids)"),be=d(),q=n("li"),qe=a(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),Z=n("code"),N=a("model([input_ids, attention_mask])"),he=a(" or "),ne=n("code"),Pe=a("model([input_ids, attention_mask, token_type_ids])"),ue=d(),W=n("li"),Ae=a(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),B=n("code"),Oe=a('model({"input_ids": input_ids, "token_type_ids": token_type_ids})')},l(p){u=r(p,"P",{});var F=s(u);$=i(F,"TF 2.0 models accepts two formats as inputs:"),F.forEach(t),f=c(p),g=r(p,"UL",{});var pe=s(g);L=r(pe,"LI",{});var fe=s(L);v=i(fe,"having all inputs as keyword arguments (like PyTorch models), or"),fe.forEach(t),_=c(pe),z=r(pe,"LI",{});var Xe=s(z);$e=i(Xe,"having all inputs as a list, tuple or dict in the first positional arguments."),Xe.forEach(t),pe.forEach(t),re=c(p),E=r(p,"P",{});var X=s(E);Y=i(X,"This second option is useful when using "),R=r(X,"CODE",{});var ge=s(R);ee=i(ge,"tf.keras.Model.fit"),ge.forEach(t),ze=i(X,` method which currently requires having all the
tensors in the first argument of the model call function: `),S=r(X,"CODE",{});var He=s(S);Ee=i(He,"model(inputs)"),He.forEach(t),Te=i(X,"."),X.forEach(t),C=c(p),Q=r(p,"P",{});var Ge=s(Q);te=i(Ge,`If you choose this second option, there are three possibilities you can use to gather all the input Tensors in the
first positional argument :`),Ge.forEach(t),me=c(p),M=r(p,"UL",{});var j=s(M);P=r(j,"LI",{});var A=s(P);se=i(A,"a single Tensor with "),oe=r(A,"CODE",{});var ie=s(oe);xe=i(ie,"input_ids"),ie.forEach(t),ae=i(A," only and nothing else: "),V=r(A,"CODE",{});var Ce=s(V);Me=i(Ce,"model(inputs_ids)"),Ce.forEach(t),A.forEach(t),be=c(j),q=r(j,"LI",{});var O=s(q);qe=i(O,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),Z=r(O,"CODE",{});var Ue=s(Z);N=i(Ue,"model([input_ids, attention_mask])"),Ue.forEach(t),he=i(O," or "),ne=r(O,"CODE",{});var Ne=s(ne);Pe=i(Ne,"model([input_ids, attention_mask, token_type_ids])"),Ne.forEach(t),O.forEach(t),ue=c(j),W=r(j,"LI",{});var je=s(W);Ae=i(je,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),B=r(je,"CODE",{});var Re=s(B);Oe=i(Re,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),Re.forEach(t),je.forEach(t),j.forEach(t)},m(p,F){m(p,u,F),e(u,$),m(p,f,F),m(p,g,F),e(g,L),e(L,v),e(g,_),e(g,z),e(z,$e),m(p,re,F),m(p,E,F),e(E,Y),e(E,R),e(R,ee),e(E,ze),e(E,S),e(S,Ee),e(E,Te),m(p,C,F),m(p,Q,F),e(Q,te),m(p,me,F),m(p,M,F),e(M,P),e(P,se),e(P,oe),e(oe,xe),e(P,ae),e(P,V),e(V,Me),e(M,be),e(M,q),e(q,qe),e(q,Z),e(Z,N),e(q,he),e(q,ne),e(ne,Pe),e(M,ue),e(M,W),e(W,Ae),e(W,B),e(B,Oe)},d(p){p&&t(u),p&&t(f),p&&t(g),p&&t(re),p&&t(E),p&&t(C),p&&t(Q),p&&t(me),p&&t(M)}}}function wc(D){let u,$,f,g,L;return{c(){u=n("p"),$=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=n("code"),g=a("Module"),L=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(v){u=r(v,"P",{});var _=s(u);$=i(_,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(_,"CODE",{});var z=s(f);g=i(z,"Module"),z.forEach(t),L=i(_,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),_.forEach(t)},m(v,_){m(v,u,_),e(u,$),e(u,f),e(f,g),e(u,L)},d(v){v&&t(u)}}}function yc(D){let u,$,f,g,L,v,_,z,$e,re,E,Y,R,ee,ze,S,Ee,Te,C,Q,te,me,M,P,se,oe,xe,ae,V,Me,be,q,qe,Z,N,he,ne,Pe,ue,W,Ae,B,Oe,p,F,pe,fe,Xe,X,ge,He,Ge,j,A,ie,Ce,O,Ue,Ne,je,Re,Ie,Ct,hs,Ke,us,Wo,ps,fs,Bo,gs,_s,vs,Je,Ts,Xo,xs,bs,Ho,ws,ys,cr,Ye,gt,kn,Nt,ks,Ln,Ls,mr,_e,jt,Fs,Fn,$s,zs,_t,Go,Es,Ms,Uo,qs,Ps,As,It,Os,Ko,Cs,Ns,hr,Ze,vt,$n,Dt,js,zn,Is,ur,ve,Rt,Ds,St,Rs,En,Ss,Qs,Vs,Tt,Jo,Ws,Bs,Yo,Xs,Hs,Gs,Qt,Us,Zo,Ks,Js,pr,et,xt,Mn,Vt,Ys,qn,Zs,fr,tt,Wt,ea,Pn,ta,gr,ot,Bt,oa,Xt,na,en,ra,sa,_r,nt,Ht,aa,Gt,ia,tn,la,da,vr,rt,Ut,ca,An,ma,Tr,st,Kt,ha,Jt,ua,on,pa,fa,xr,at,bt,On,Yt,ga,Cn,_a,br,H,Zt,va,Nn,Ta,xa,eo,ba,to,wa,ya,ka,oo,La,nn,Fa,$a,za,no,Ea,ro,Ma,qa,Pa,le,so,Aa,it,Oa,rn,Ca,Na,jn,ja,Ia,Da,wt,Ra,In,Sa,Qa,ao,wr,lt,yt,Dn,io,Va,Rn,Wa,yr,G,lo,Ba,Sn,Xa,Ha,co,Ga,mo,Ua,Ka,Ja,ho,Ya,sn,Za,ei,ti,uo,oi,po,ni,ri,si,Se,fo,ai,dt,ii,an,li,di,Qn,ci,mi,hi,kt,kr,ct,Lt,Vn,go,ui,Wn,pi,Lr,U,_o,fi,Bn,gi,_i,vo,vi,To,Ti,xi,bi,xo,wi,ln,yi,ki,Li,bo,Fi,wo,$i,zi,Ei,de,yo,Mi,mt,qi,dn,Pi,Ai,Xn,Oi,Ci,Ni,Ft,ji,Hn,Ii,Di,ko,Fr,ht,$t,Gn,Lo,Ri,Un,Si,$r,K,Fo,Qi,Kn,Vi,Wi,$o,Bi,zo,Xi,Hi,Gi,Eo,Ui,Mo,Ki,Ji,Yi,zt,Zi,ce,qo,el,ut,tl,cn,ol,nl,Jn,rl,sl,al,Et,il,Yn,ll,dl,Po,zr,pt,Mt,Zn,Ao,cl,er,ml,Er,J,Oo,hl,Co,ul,tr,pl,fl,gl,No,_l,jo,vl,Tl,xl,Io,bl,Do,wl,yl,kl,qt,Ll,Qe,Ro,Fl,ft,$l,mn,zl,El,or,Ml,ql,Pl,Pt,Mr;return v=new De({}),ee=new De({}),O=new De({}),Ct=new I({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:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/lxmert/configuration_lxmert.py#L29",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/pr_15839/en/model_doc/lxmert#transformers.LxmertModel">LxmertModel</a> or <a href="/docs/transformers/pr_15839/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/pr_15839/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"}]}}),Nt=new De({}),jt=new I({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:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/lxmert/tokenization_lxmert.py#L36"}}),Dt=new De({}),Rt=new I({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:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/lxmert/tokenization_lxmert_fast.py#L40"}}),Vt=new De({}),Wt=new I({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"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/lxmert/modeling_lxmert.py#L61",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"}]}}),Bt=new I({props:{name:"class transformers.models.lxmert.modeling_lxmert.LxmertForPreTrainingOutput",anchor:"transformers.models.lxmert.modeling_lxmert.LxmertForPreTrainingOutput",parameters:[{name:"loss",val:": [<class '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"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/lxmert/modeling_lxmert.py#L147",parametersDescription:[{anchor:"transformers.models.lxmert.modeling_lxmert.LxmertForPreTrainingOutput.loss",description:`<strong>loss</strong> (<em>optional</em>, returned when <code>labels</code> is provided, <code>torch.FloatTensor</code> of shape <code>(1,)</code>) &#x2014;
Total loss as the sum of the masked language modeling loss and the next sequence prediction
(classification) loss.`,name:"loss"},{anchor:"transformers.models.lxmert.modeling_lxmert.LxmertForPreTrainingOutput.prediction_logits",description:`<strong>prediction_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) &#x2014;
Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).
cross_relationship_score &#x2014; (<code>torch.FloatTensor</code> of shape <code>(batch_size, 2)</code>):
Prediction scores of the textual matching objective (classification) head (scores of True/False
continuation before SoftMax).
question_answering_score &#x2014; (<code>torch.FloatTensor</code> of shape <code>(batch_size, n_qa_answers)</code>):
Prediction scores of question answering objective (classification).`,name:"prediction_logits"},{anchor:"transformers.models.lxmert.modeling_lxmert.LxmertForPreTrainingOutput.language_hidden_states",description:`<strong>language_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for input features + one for the output of each cross-modality layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.`,name:"language_hidden_states"},{anchor:"transformers.models.lxmert.modeling_lxmert.LxmertForPreTrainingOutput.vision_hidden_states",description:`<strong>vision_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for input features + one for the output of each cross-modality layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.`,name:"vision_hidden_states"},{anchor:"transformers.models.lxmert.modeling_lxmert.LxmertForPreTrainingOutput.language_attentions",description:`<strong>language_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.`,name:"language_attentions"},{anchor:"transformers.models.lxmert.modeling_lxmert.LxmertForPreTrainingOutput.vision_attentions",description:`<strong>vision_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.`,name:"vision_attentions"},{anchor:"transformers.models.lxmert.modeling_lxmert.LxmertForPreTrainingOutput.cross_encoder_attentions",description:`<strong>cross_encoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.`,name:"cross_encoder_attentions"}]}}),Ht=new I({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"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/lxmert/modeling_lxmert.py#L107",parametersDescription:[{anchor:"transformers.models.lxmert.modeling_lxmert.LxmertForQuestionAnsweringOutput.loss",description:`<strong>loss</strong> (<em>optional</em>, returned when <code>labels</code> is provided, <code>torch.FloatTensor</code> of shape <code>(1,)</code>) &#x2014;
Total loss as the sum of the masked language modeling loss and the next sequence prediction
(classification) loss.k.
question_answering_score &#x2014; (<code>torch.FloatTensor</code> of shape <code>(batch_size, n_qa_answers)</code>, <em>optional</em>):
Prediction scores of question answering objective (classification).`,name:"loss"},{anchor:"transformers.models.lxmert.modeling_lxmert.LxmertForQuestionAnsweringOutput.language_hidden_states",description:`<strong>language_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for input features + one for the output of each cross-modality layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.`,name:"language_hidden_states"},{anchor:"transformers.models.lxmert.modeling_lxmert.LxmertForQuestionAnsweringOutput.vision_hidden_states",description:`<strong>vision_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for input features + one for the output of each cross-modality layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.`,name:"vision_hidden_states"},{anchor:"transformers.models.lxmert.modeling_lxmert.LxmertForQuestionAnsweringOutput.language_attentions",description:`<strong>language_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.`,name:"language_attentions"},{anchor:"transformers.models.lxmert.modeling_lxmert.LxmertForQuestionAnsweringOutput.vision_attentions",description:`<strong>vision_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.`,name:"vision_attentions"},{anchor:"transformers.models.lxmert.modeling_lxmert.LxmertForQuestionAnsweringOutput.cross_encoder_attentions",description:`<strong>cross_encoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.`,name:"cross_encoder_attentions"}]}}),Ut=new I({props:{name:"class transformers.models.lxmert.modeling_tf_lxmert.TFLxmertModelOutput",anchor:"transformers.models.lxmert.modeling_tf_lxmert.TFLxmertModelOutput",parameters:[{name:"language_output",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"vision_output",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"pooled_output",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"language_hidden_states",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"},{name:"vision_hidden_states",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"},{name:"language_attentions",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"},{name:"vision_attentions",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"},{name:"cross_encoder_attentions",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/lxmert/modeling_tf_lxmert.py#L50",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"}]}}),Kt=new I({props:{name:"class transformers.models.lxmert.modeling_tf_lxmert.TFLxmertForPreTrainingOutput",anchor:"transformers.models.lxmert.modeling_tf_lxmert.TFLxmertForPreTrainingOutput",parameters:[{name:"loss",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"prediction_logits",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"cross_relationship_score",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"question_answering_score",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"language_hidden_states",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"},{name:"vision_hidden_states",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"},{name:"language_attentions",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"},{name:"vision_attentions",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"},{name:"cross_encoder_attentions",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/lxmert/modeling_tf_lxmert.py#L96",parametersDescription:[{anchor:"transformers.models.lxmert.modeling_tf_lxmert.TFLxmertForPreTrainingOutput.loss",description:`<strong>loss</strong> (<em>optional</em>, returned when <code>labels</code> is provided, <code>tf.Tensor</code> of shape <code>(1,)</code>) &#x2014;
Total loss as the sum of the masked language modeling loss and the next sequence prediction
(classification) loss.`,name:"loss"},{anchor:"transformers.models.lxmert.modeling_tf_lxmert.TFLxmertForPreTrainingOutput.prediction_logits",description:`<strong>prediction_logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) &#x2014;
Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).
cross_relationship_score &#x2014; (<code>tf.Tensor</code> of shape <code>(batch_size, 2)</code>):
Prediction scores of the textual matching objective (classification) head (scores of True/False
continuation before SoftMax).
question_answering_score &#x2014; (<code>tf.Tensor</code> of shape <code>(batch_size, n_qa_answers)</code>):
Prediction scores of question answering objective (classification).`,name:"prediction_logits"},{anchor:"transformers.models.lxmert.modeling_tf_lxmert.TFLxmertForPreTrainingOutput.language_hidden_states",description:`<strong>language_hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for input features + one for the output of each cross-modality layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.`,name:"language_hidden_states"},{anchor:"transformers.models.lxmert.modeling_tf_lxmert.TFLxmertForPreTrainingOutput.vision_hidden_states",description:`<strong>vision_hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for input features + one for the output of each cross-modality layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.`,name:"vision_hidden_states"},{anchor:"transformers.models.lxmert.modeling_tf_lxmert.TFLxmertForPreTrainingOutput.language_attentions",description:`<strong>language_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.`,name:"language_attentions"},{anchor:"transformers.models.lxmert.modeling_tf_lxmert.TFLxmertForPreTrainingOutput.vision_attentions",description:`<strong>vision_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.`,name:"vision_attentions"},{anchor:"transformers.models.lxmert.modeling_tf_lxmert.TFLxmertForPreTrainingOutput.cross_encoder_attentions",description:`<strong>cross_encoder_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.`,name:"cross_encoder_attentions"}]}}),Yt=new De({}),Zt=new I({props:{name:"class transformers.LxmertModel",anchor:"transformers.LxmertModel",parameters:[{name:"config",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/lxmert/modeling_lxmert.py#L886",parametersDescription:[{anchor:"transformers.LxmertModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/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/pr_15839/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}]}}),so=new I({props:{name:"forward",anchor:"transformers.LxmertModel.forward",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:"output_attentions",val:" = None"},{name:"output_hidden_states",val:" = None"},{name:"return_dict",val:" = None"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/lxmert/modeling_lxmert.py#L901",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/pr_15839/en/model_doc/lxmert#transformers.LxmertTokenizer">LxmertTokenizer</a>. See <a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>
visual_feats &#x2014; (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_visual_features, visual_feat_dim)</code>):
This input represents visual features. They ROI pooled object features from bounding boxes using a
faster-RCNN model)</p>
<p>These are currently not provided by the transformers library.
visual_pos &#x2014; (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_visual_features, visual_pos_dim)</code>):
This input represents spacial features corresponding to their relative (via index) visual features. The
pre-trained LXMERT model expects these spacial features to be normalized bounding boxes on a scale of 0 to</p>
<ol>
<li></li>
</ol>
<p>These are currently not provided by the transformers library.`,name:"input_ids"},{anchor:"transformers.LxmertModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.LxmertModel.forward.visual_attention_mask",description:`<strong>visual_attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"visual_attention_mask"},{anchor:"transformers.LxmertModel.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.LxmertModel.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.LxmertModel.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.LxmertModel.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.LxmertModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/pr_15839/en/main_classes/output#transformers.file_utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],returnDescription:`
<p>A <a
  href="/docs/transformers/pr_15839/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/pr_15839/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/pr_15839/en/model_doc/lxmert#transformers.models.lxmert.modeling_lxmert.LxmertModelOutput"
>transformers.models.lxmert.modeling_lxmert.LxmertModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),wt=new Vo({props:{$$slots:{default:[gc]},$$scope:{ctx:D}}}),ao=new Al({props:{code:`from transformers import LxmertTokenizer, LxmertModel
import torch

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

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

last_hidden_states = outputs.last_hidden_state`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> LxmertTokenizer, 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 = LxmertTokenizer.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`}}),io=new De({}),lo=new I({props:{name:"class transformers.LxmertForPreTraining",anchor:"transformers.LxmertForPreTraining",parameters:[{name:"config",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/lxmert/modeling_lxmert.py#L1025",parametersDescription:[{anchor:"transformers.LxmertForPreTraining.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/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/pr_15839/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}]}}),fo=new I({props:{name:"forward",anchor:"transformers.LxmertForPreTraining.forward",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:"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:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/lxmert/modeling_lxmert.py#L1153",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/pr_15839/en/model_doc/lxmert#transformers.LxmertTokenizer">LxmertTokenizer</a>. See <a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>
visual_feats &#x2014; (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_visual_features, visual_feat_dim)</code>):
This input represents visual features. They ROI pooled object features from bounding boxes using a
faster-RCNN model)</p>
<p>These are currently not provided by the transformers library.
visual_pos &#x2014; (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_visual_features, visual_pos_dim)</code>):
This input represents spacial features corresponding to their relative (via index) visual features. The
pre-trained LXMERT model expects these spacial features to be normalized bounding boxes on a scale of 0 to</p>
<ol>
<li></li>
</ol>
<p>These are currently not provided by the transformers library.`,name:"input_ids"},{anchor:"transformers.LxmertForPreTraining.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.LxmertForPreTraining.forward.visual_attention_mask",description:`<strong>visual_attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"visual_attention_mask"},{anchor:"transformers.LxmertForPreTraining.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.LxmertForPreTraining.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.LxmertForPreTraining.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.LxmertForPreTraining.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.LxmertForPreTraining.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/pr_15839/en/main_classes/output#transformers.file_utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.LxmertForPreTraining.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the masked language modeling loss. Indices should be in <code>[-100, 0, ..., config.vocab_size]</code> (see <code>input_ids</code> docstring) Tokens with indices set to <code>-100</code> are ignored (masked), the
loss is only computed for the tokens with labels in <code>[0, ..., config.vocab_size]</code>
obj_labels &#x2014; (<code>Dict[Str: Tuple[Torch.FloatTensor, Torch.FloatTensor]]</code>, <em>optional</em>):
each key is named after each one of the visual losses and each element of the tuple is of the shape
<code>(batch_size, num_features)</code> and <code>(batch_size, num_features, visual_feature_dim)</code> for each the label id and
the label score respectively`,name:"labels"},{anchor:"transformers.LxmertForPreTraining.forward.matched_label",description:`<strong>matched_label</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the whether or not the text input matches the image (classification) loss. Input
should be a sequence pair (see <code>input_ids</code> docstring) Indices should be in <code>[0, 1]</code>:</p>
<ul>
<li>0 indicates that the sentence does not match the image,</li>
<li>1 indicates that the sentence does match the image.</li>
</ul>`,name:"matched_label"},{anchor:"transformers.LxmertForPreTraining.forward.ans",description:`<strong>ans</strong> (<code>Torch.Tensor</code> of shape <code>(batch_size)</code>, <em>optional</em>) &#x2014;
a one hot representation hof the correct answer <em>optional</em>`,name:"ans"}],returnDescription:`
<p>A <a
  href="/docs/transformers/pr_15839/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/pr_15839/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/pr_15839/en/model_doc/lxmert#transformers.models.lxmert.modeling_lxmert.LxmertForPreTrainingOutput"
>transformers.models.lxmert.modeling_lxmert.LxmertForPreTrainingOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),kt=new Vo({props:{$$slots:{default:[_c]},$$scope:{ctx:D}}}),go=new De({}),_o=new I({props:{name:"class transformers.LxmertForQuestionAnswering",anchor:"transformers.LxmertForQuestionAnswering",parameters:[{name:"config",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/lxmert/modeling_lxmert.py#L1291",parametersDescription:[{anchor:"transformers.LxmertForQuestionAnswering.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/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/pr_15839/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}]}}),yo=new I({props:{name:"forward",anchor:"transformers.LxmertForQuestionAnswering.forward",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:"labels",val:" = None"},{name:"output_attentions",val:" = None"},{name:"output_hidden_states",val:" = None"},{name:"return_dict",val:" = None"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/lxmert/modeling_lxmert.py#L1384",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/pr_15839/en/model_doc/lxmert#transformers.LxmertTokenizer">LxmertTokenizer</a>. See <a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>
visual_feats &#x2014; (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_visual_features, visual_feat_dim)</code>):
This input represents visual features. They ROI pooled object features from bounding boxes using a
faster-RCNN model)</p>
<p>These are currently not provided by the transformers library.
visual_pos &#x2014; (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_visual_features, visual_pos_dim)</code>):
This input represents spacial features corresponding to their relative (via index) visual features. The
pre-trained LXMERT model expects these spacial features to be normalized bounding boxes on a scale of 0 to</p>
<ol>
<li></li>
</ol>
<p>These are currently not provided by the transformers library.`,name:"input_ids"},{anchor:"transformers.LxmertForQuestionAnswering.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.LxmertForQuestionAnswering.forward.visual_attention_mask",description:`<strong>visual_attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"visual_attention_mask"},{anchor:"transformers.LxmertForQuestionAnswering.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.LxmertForQuestionAnswering.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.LxmertForQuestionAnswering.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.LxmertForQuestionAnswering.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.LxmertForQuestionAnswering.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/pr_15839/en/main_classes/output#transformers.file_utils.ModelOutput">ModelOutput</a> instead of a plain tuple.</p>
<p>labels &#x2014; (<code>Torch.Tensor</code> of shape <code>(batch_size)</code>, <em>optional</em>):
A one-hot representation of the correct answer`,name:"return_dict"}],returnDescription:`
<p>A <a
  href="/docs/transformers/pr_15839/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/pr_15839/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/pr_15839/en/model_doc/lxmert#transformers.models.lxmert.modeling_lxmert.LxmertForQuestionAnsweringOutput"
>transformers.models.lxmert.modeling_lxmert.LxmertForQuestionAnsweringOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ft=new Vo({props:{$$slots:{default:[vc]},$$scope:{ctx:D}}}),ko=new Al({props:{code:`from transformers import LxmertTokenizer, LxmertForQuestionAnswering
import torch

torch.manual_seed(0)
tokenizer = LxmertTokenizer.from_pretrained("unc-nlp/lxmert-base-uncased")
model = LxmertForQuestionAnswering.from_pretrained("unc-nlp/lxmert-base-uncased")

question, text = "Who was Jim Henson?", "Jim Henson was a nice puppet"
inputs = tokenizer(question, text, return_tensors="pt")
start_positions = torch.tensor([1])
end_positions = torch.tensor([3])

outputs = model(**inputs, start_positions=start_positions, end_positions=end_positions)
loss = outputs.loss
round(loss.item(), 2)


start_scores = outputs.start_logits
list(start_scores.shape)


end_scores = outputs.end_logits
list(end_scores.shape)
`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> LxmertTokenizer, LxmertForQuestionAnswering
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>torch.manual_seed(<span class="hljs-number">0</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = LxmertTokenizer.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>start_positions = torch.tensor([<span class="hljs-number">1</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>end_positions = torch.tensor([<span class="hljs-number">3</span>])

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs, start_positions=start_positions, end_positions=end_positions)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = outputs.loss
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">round</span>(loss.item(), <span class="hljs-number">2</span>)


<span class="hljs-meta">&gt;&gt;&gt; </span>start_scores = outputs.start_logits
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(start_scores.shape)


<span class="hljs-meta">&gt;&gt;&gt; </span>end_scores = outputs.end_logits
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(end_scores.shape)
`}}),Lo=new De({}),Fo=new I({props:{name:"class transformers.TFLxmertModel",anchor:"transformers.TFLxmertModel",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/lxmert/modeling_tf_lxmert.py#L944",parametersDescription:[{anchor:"transformers.TFLxmertModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/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/pr_15839/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}]}}),zt=new Vo({props:{$$slots:{default:[Tc]},$$scope:{ctx:D}}}),qo=new I({props:{name:"call",anchor:"transformers.TFLxmertModel.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:"output_attentions",val:" = None"},{name:"output_hidden_states",val:" = None"},{name:"return_dict",val:" = None"},{name:"training",val:" = False"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/lxmert/modeling_tf_lxmert.py#L949",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/pr_15839/en/model_doc/lxmert#transformers.LxmertTokenizer">LxmertTokenizer</a>. See <a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>
visual_feats &#x2014; (<code>tf.Tensor</code> of shape <code>(batch_size, num_visual_features, visual_feat_dim)</code>):
This input represents visual features. They ROI pooled object features from bounding boxes using a
faster-RCNN model)</p>
<p>These are currently not provided by the transformers library.
visual_pos &#x2014; (<code>tf.Tensor</code> of shape <code>(batch_size, num_visual_features, visual_feat_dim)</code>):
This input represents spacial features corresponding to their relative (via index) visual features. The
pre-trained LXMERT model expects these spacial features to be normalized bounding boxes on a scale of 0 to</p>
<ol>
<li></li>
</ol>
<p>These are currently not provided by the transformers library.`,name:"input_ids"},{anchor:"transformers.TFLxmertModel.call.attention_mask",description:`<strong>attention_mask</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.TFLxmertModel.call.visual_attention_mask",description:`<strong>visual_attention_mask</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
MMask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"visual_attention_mask"},{anchor:"transformers.TFLxmertModel.call.token_type_ids",description:`<strong>token_type_ids</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.TFLxmertModel.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.TFLxmertModel.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFLxmertModel.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFLxmertModel.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/pr_15839/en/main_classes/output#transformers.file_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"}],returnDescription:`
<p>A <a
  href="/docs/transformers/pr_15839/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/pr_15839/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/pr_15839/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>
`}}),Et=new Vo({props:{$$slots:{default:[xc]},$$scope:{ctx:D}}}),Po=new Al({props:{code:`from transformers import LxmertTokenizer, TFLxmertModel
import tensorflow as tf

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

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

last_hidden_states = outputs.last_hidden_state`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> LxmertTokenizer, 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 = LxmertTokenizer.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`}}),Ao=new De({}),Oo=new I({props:{name:"class transformers.TFLxmertForPreTraining",anchor:"transformers.TFLxmertForPreTraining",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/lxmert/modeling_tf_lxmert.py#L1201",parametersDescription:[{anchor:"transformers.TFLxmertForPreTraining.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/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/pr_15839/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}]}}),qt=new Vo({props:{$$slots:{default:[bc]},$$scope:{ctx:D}}}),Ro=new I({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"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/lxmert/modeling_tf_lxmert.py#L1301",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/pr_15839/en/model_doc/lxmert#transformers.LxmertTokenizer">LxmertTokenizer</a>. See <a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>
visual_feats &#x2014; (<code>tf.Tensor</code> of shape <code>(batch_size, num_visual_features, visual_feat_dim)</code>):
This input represents visual features. They ROI pooled object features from bounding boxes using a
faster-RCNN model)</p>
<p>These are currently not provided by the transformers library.
visual_pos &#x2014; (<code>tf.Tensor</code> of shape <code>(batch_size, num_visual_features, visual_feat_dim)</code>):
This input represents spacial features corresponding to their relative (via index) visual features. The
pre-trained LXMERT model expects these spacial features to be normalized bounding boxes on a scale of 0 to</p>
<ol>
<li></li>
</ol>
<p>These are currently not provided by the transformers library.`,name:"input_ids"},{anchor:"transformers.TFLxmertForPreTraining.call.attention_mask",description:`<strong>attention_mask</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.TFLxmertForPreTraining.call.visual_attention_mask",description:`<strong>visual_attention_mask</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
MMask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"visual_attention_mask"},{anchor:"transformers.TFLxmertForPreTraining.call.token_type_ids",description:`<strong>token_type_ids</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.TFLxmertForPreTraining.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.TFLxmertForPreTraining.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFLxmertForPreTraining.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFLxmertForPreTraining.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/pr_15839/en/main_classes/output#transformers.file_utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used
in eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFLxmertForPreTraining.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"},{anchor:"transformers.TFLxmertForPreTraining.call.masked_lm_labels",description:`<strong>masked_lm_labels</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the masked language modeling loss. Indices should be in <code>[-100, 0, ..., config.vocab_size]</code> (see <code>input_ids</code> docstring) Tokens with indices set to <code>-100</code> are ignored (masked), the
loss is only computed for the tokens with labels in <code>[0, ..., config.vocab_size]</code>
obj_labels &#x2014; (<code>Dict[Str: Tuple[tf.Tensor, tf.Tensor]]</code>, <em>optional</em>, defaults to <code>None</code>):
each key is named after each one of the visual losses and each element of the tuple is of the shape
<code>(batch_size, num_features)</code> and <code>(batch_size, num_features, visual_feature_dim)</code> for each the label id and
the label score respectively`,name:"masked_lm_labels"},{anchor:"transformers.TFLxmertForPreTraining.call.matched_label",description:`<strong>matched_label</strong> (<code>tf.Tensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the whether or not the text input matches the image (classification) loss. Input
should be a sequence pair (see <code>input_ids</code> docstring) Indices should be in <code>[0, 1]</code>:</p>
<ul>
<li>0 indicates that the sentence does not match the image,</li>
<li>1 indicates that the sentence does match the image.</li>
</ul>`,name:"matched_label"},{anchor:"transformers.TFLxmertForPreTraining.call.ans",description:`<strong>ans</strong> (<code>Torch.Tensor</code> of shape <code>(batch_size)</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
a one hot representation hof the correct answer <em>optional</em>`,name:"ans"}],returnDescription:`
<p>A <a
  href="/docs/transformers/pr_15839/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/pr_15839/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/pr_15839/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>
`}}),Pt=new Vo({props:{$$slots:{default:[wc]},$$scope:{ctx:D}}}),{c(){u=n("meta"),$=d(),f=n("h1"),g=n("a"),L=n("span"),T(v.$$.fragment),_=d(),z=n("span"),$e=a("LXMERT"),re=d(),E=n("h2"),Y=n("a"),R=n("span"),T(ee.$$.fragment),ze=d(),S=n("span"),Ee=a("Overview"),Te=d(),C=n("p"),Q=a("The LXMERT model was proposed in "),te=n("a"),me=a("LXMERT: Learning Cross-Modality Encoder Representations from Transformers"),M=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.`),P=d(),se=n("p"),oe=a("The abstract from the paper is the following:"),xe=d(),ae=n("p"),V=n("em"),Me=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`),be=d(),q=n("p"),qe=a("Tips:"),Z=d(),N=n("ul"),he=n("li"),ne=a(`Bounding boxes are not necessary to be used in the visual feature embeddings, any kind of visual-spacial features
will work.`),Pe=d(),ue=n("li"),W=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.`),Ae=d(),B=n("li"),Oe=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.`),p=d(),F=n("p"),pe=a("This model was contributed by "),fe=n("a"),Xe=a("eltoto1219"),X=a(". The original code can be found "),ge=n("a"),He=a("here"),Ge=a("."),j=d(),A=n("h2"),ie=n("a"),Ce=n("span"),T(O.$$.fragment),Ue=d(),Ne=n("span"),je=a("LxmertConfig"),Re=d(),Ie=n("div"),T(Ct.$$.fragment),hs=d(),Ke=n("p"),us=a("This is the configuration class to store the configuration of a "),Wo=n("a"),ps=a("LxmertModel"),fs=a(" or a "),Bo=n("a"),gs=a("TFLxmertModel"),_s=a(`. It is used
to instantiate a LXMERT model according to the specified arguments, defining the model architecture.`),vs=d(),Je=n("p"),Ts=a("Configuration objects inherit from "),Xo=n("a"),xs=a("PretrainedConfig"),bs=a(` and can be used to control the model outputs. Read the
documentation from `),Ho=n("a"),ws=a("PretrainedConfig"),ys=a(" for more information."),cr=d(),Ye=n("h2"),gt=n("a"),kn=n("span"),T(Nt.$$.fragment),ks=d(),Ln=n("span"),Ls=a("LxmertTokenizer"),mr=d(),_e=n("div"),T(jt.$$.fragment),Fs=d(),Fn=n("p"),$s=a("Construct an LXMERT tokenizer."),zs=d(),_t=n("p"),Go=n("a"),Es=a("LxmertTokenizer"),Ms=a(" is identical to "),Uo=n("a"),qs=a("BertTokenizer"),Ps=a(` and runs end-to-end tokenization: punctuation splitting and
wordpiece.`),As=d(),It=n("p"),Os=a("Refer to superclass "),Ko=n("a"),Cs=a("BertTokenizer"),Ns=a(" for usage examples and documentation concerning parameters."),hr=d(),Ze=n("h2"),vt=n("a"),$n=n("span"),T(Dt.$$.fragment),js=d(),zn=n("span"),Is=a("LxmertTokenizerFast"),ur=d(),ve=n("div"),T(Rt.$$.fragment),Ds=d(),St=n("p"),Rs=a("Construct a \u201Cfast\u201D LXMERT tokenizer (backed by HuggingFace\u2019s "),En=n("em"),Ss=a("tokenizers"),Qs=a(" library)."),Vs=d(),Tt=n("p"),Jo=n("a"),Ws=a("LxmertTokenizerFast"),Bs=a(" is identical to "),Yo=n("a"),Xs=a("BertTokenizerFast"),Hs=a(` and runs end-to-end tokenization: punctuation
splitting and wordpiece.`),Gs=d(),Qt=n("p"),Us=a("Refer to superclass "),Zo=n("a"),Ks=a("BertTokenizerFast"),Js=a(" for usage examples and documentation concerning parameters."),pr=d(),et=n("h2"),xt=n("a"),Mn=n("span"),T(Vt.$$.fragment),Ys=d(),qn=n("span"),Zs=a("Lxmert specific outputs"),fr=d(),tt=n("div"),T(Wt.$$.fragment),ea=d(),Pn=n("p"),ta=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)`),gr=d(),ot=n("div"),T(Bt.$$.fragment),oa=d(),Xt=n("p"),na=a("Output type of "),en=n("a"),ra=a("LxmertForPreTraining"),sa=a("."),_r=d(),nt=n("div"),T(Ht.$$.fragment),aa=d(),Gt=n("p"),ia=a("Output type of "),tn=n("a"),la=a("LxmertForQuestionAnswering"),da=a("."),vr=d(),rt=n("div"),T(Ut.$$.fragment),ca=d(),An=n("p"),ma=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=d(),st=n("div"),T(Kt.$$.fragment),ha=d(),Jt=n("p"),ua=a("Output type of "),on=n("a"),pa=a("LxmertForPreTraining"),fa=a("."),xr=d(),at=n("h2"),bt=n("a"),On=n("span"),T(Yt.$$.fragment),ga=d(),Cn=n("span"),_a=a("LxmertModel"),br=d(),H=n("div"),T(Zt.$$.fragment),va=d(),Nn=n("p"),Ta=a("The bare Lxmert Model transformer outputting raw hidden-states without any specific head on top."),xa=d(),eo=n("p"),ba=a("The LXMERT model was proposed in "),to=n("a"),wa=a(`LXMERT: Learning Cross-Modality Encoder Representations from
Transformers`),ya=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, 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.`),ka=d(),oo=n("p"),La=a("This model inherits from "),nn=n("a"),Fa=a("PreTrainedModel"),$a=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.)`),za=d(),no=n("p"),Ea=a("This model is also a PyTorch "),ro=n("a"),Ma=a("torch.nn.Module"),qa=a(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Pa=d(),le=n("div"),T(so.$$.fragment),Aa=d(),it=n("p"),Oa=a("The "),rn=n("a"),Ca=a("LxmertModel"),Na=a(" forward method, overrides the "),jn=n("code"),ja=a("__call__"),Ia=a(" special method."),Da=d(),T(wt.$$.fragment),Ra=d(),In=n("p"),Sa=a("Example:"),Qa=d(),T(ao.$$.fragment),wr=d(),lt=n("h2"),yt=n("a"),Dn=n("span"),T(io.$$.fragment),Va=d(),Rn=n("span"),Wa=a("LxmertForPreTraining"),yr=d(),G=n("div"),T(lo.$$.fragment),Ba=d(),Sn=n("p"),Xa=a("Lxmert Model with a specified pretraining head on top."),Ha=d(),co=n("p"),Ga=a("The LXMERT model was proposed in "),mo=n("a"),Ua=a(`LXMERT: Learning Cross-Modality Encoder Representations from
Transformers`),Ka=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, 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.`),Ja=d(),ho=n("p"),Ya=a("This model inherits from "),sn=n("a"),Za=a("PreTrainedModel"),ei=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.)`),ti=d(),uo=n("p"),oi=a("This model is also a PyTorch "),po=n("a"),ni=a("torch.nn.Module"),ri=a(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),si=d(),Se=n("div"),T(fo.$$.fragment),ai=d(),dt=n("p"),ii=a("The "),an=n("a"),li=a("LxmertForPreTraining"),di=a(" forward method, overrides the "),Qn=n("code"),ci=a("__call__"),mi=a(" special method."),hi=d(),T(kt.$$.fragment),kr=d(),ct=n("h2"),Lt=n("a"),Vn=n("span"),T(go.$$.fragment),ui=d(),Wn=n("span"),pi=a("LxmertForQuestionAnswering"),Lr=d(),U=n("div"),T(_o.$$.fragment),fi=d(),Bn=n("p"),gi=a("Lxmert Model with a visual-answering head on top for downstream QA tasks"),_i=d(),vo=n("p"),vi=a("The LXMERT model was proposed in "),To=n("a"),Ti=a(`LXMERT: Learning Cross-Modality Encoder Representations from
Transformers`),xi=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, 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.`),bi=d(),xo=n("p"),wi=a("This model inherits from "),ln=n("a"),yi=a("PreTrainedModel"),ki=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.)`),Li=d(),bo=n("p"),Fi=a("This model is also a PyTorch "),wo=n("a"),$i=a("torch.nn.Module"),zi=a(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Ei=d(),de=n("div"),T(yo.$$.fragment),Mi=d(),mt=n("p"),qi=a("The "),dn=n("a"),Pi=a("LxmertForQuestionAnswering"),Ai=a(" forward method, overrides the "),Xn=n("code"),Oi=a("__call__"),Ci=a(" special method."),Ni=d(),T(Ft.$$.fragment),ji=d(),Hn=n("p"),Ii=a("Example:"),Di=d(),T(ko.$$.fragment),Fr=d(),ht=n("h2"),$t=n("a"),Gn=n("span"),T(Lo.$$.fragment),Ri=d(),Un=n("span"),Si=a("TFLxmertModel"),$r=d(),K=n("div"),T(Fo.$$.fragment),Qi=d(),Kn=n("p"),Vi=a("The bare Lxmert Model transformer outputting raw hidden-states without any specific head on top."),Wi=d(),$o=n("p"),Bi=a("The LXMERT model was proposed in "),zo=n("a"),Xi=a(`LXMERT: Learning Cross-Modality Encoder Representations from
Transformers`),Hi=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.`),Gi=d(),Eo=n("p"),Ui=a("This model is also a "),Mo=n("a"),Ki=a("tf.keras.Model"),Ji=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.`),Yi=d(),T(zt.$$.fragment),Zi=d(),ce=n("div"),T(qo.$$.fragment),el=d(),ut=n("p"),tl=a("The "),cn=n("a"),ol=a("TFLxmertModel"),nl=a(" forward method, overrides the "),Jn=n("code"),rl=a("__call__"),sl=a(" special method."),al=d(),T(Et.$$.fragment),il=d(),Yn=n("p"),ll=a("Example:"),dl=d(),T(Po.$$.fragment),zr=d(),pt=n("h2"),Mt=n("a"),Zn=n("span"),T(Ao.$$.fragment),cl=d(),er=n("span"),ml=a("TFLxmertForPreTraining"),Er=d(),J=n("div"),T(Oo.$$.fragment),hl=d(),Co=n("p"),ul=a("Lxmert Model with a "),tr=n("code"),pl=a("language modeling"),fl=a(" head on top."),gl=d(),No=n("p"),_l=a("The LXMERT model was proposed in "),jo=n("a"),vl=a(`LXMERT: Learning Cross-Modality Encoder Representations from
Transformers`),Tl=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.`),xl=d(),Io=n("p"),bl=a("This model is also a "),Do=n("a"),wl=a("tf.keras.Model"),yl=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.`),kl=d(),T(qt.$$.fragment),Ll=d(),Qe=n("div"),T(Ro.$$.fragment),Fl=d(),ft=n("p"),$l=a("The "),mn=n("a"),zl=a("TFLxmertForPreTraining"),El=a(" forward method, overrides the "),or=n("code"),Ml=a("__call__"),ql=a(" special method."),Pl=d(),T(Pt.$$.fragment),this.h()},l(o){const h=fc('[data-svelte="svelte-1phssyn"]',document.head);u=r(h,"META",{name:!0,content:!0}),h.forEach(t),$=c(o),f=r(o,"H1",{class:!0});var So=s(f);g=r(So,"A",{id:!0,class:!0,href:!0});var nr=s(g);L=r(nr,"SPAN",{});var rr=s(L);x(v.$$.fragment,rr),rr.forEach(t),nr.forEach(t),_=c(So),z=r(So,"SPAN",{});var sr=s(z);$e=i(sr,"LXMERT"),sr.forEach(t),So.forEach(t),re=c(o),E=r(o,"H2",{class:!0});var Qo=s(E);Y=r(Qo,"A",{id:!0,class:!0,href:!0});var ar=s(Y);R=r(ar,"SPAN",{});var ir=s(R);x(ee.$$.fragment,ir),ir.forEach(t),ar.forEach(t),ze=c(Qo),S=r(Qo,"SPAN",{});var Ol=s(S);Ee=i(Ol,"Overview"),Ol.forEach(t),Qo.forEach(t),Te=c(o),C=r(o,"P",{});var qr=s(C);Q=i(qr,"The LXMERT model was proposed in "),te=r(qr,"A",{href:!0,rel:!0});var Cl=s(te);me=i(Cl,"LXMERT: Learning Cross-Modality Encoder Representations from Transformers"),Cl.forEach(t),M=i(qr,` 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.`),qr.forEach(t),P=c(o),se=r(o,"P",{});var Nl=s(se);oe=i(Nl,"The abstract from the paper is the following:"),Nl.forEach(t),xe=c(o),ae=r(o,"P",{});var jl=s(ae);V=r(jl,"EM",{});var Il=s(V);Me=i(Il,`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`),Il.forEach(t),jl.forEach(t),be=c(o),q=r(o,"P",{});var Dl=s(q);qe=i(Dl,"Tips:"),Dl.forEach(t),Z=c(o),N=r(o,"UL",{});var hn=s(N);he=r(hn,"LI",{});var Rl=s(he);ne=i(Rl,`Bounding boxes are not necessary to be used in the visual feature embeddings, any kind of visual-spacial features
will work.`),Rl.forEach(t),Pe=c(hn),ue=r(hn,"LI",{});var Sl=s(ue);W=i(Sl,`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.`),Sl.forEach(t),Ae=c(hn),B=r(hn,"LI",{});var Ql=s(B);Oe=i(Ql,`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.`),Ql.forEach(t),hn.forEach(t),p=c(o),F=r(o,"P",{});var un=s(F);pe=i(un,"This model was contributed by "),fe=r(un,"A",{href:!0,rel:!0});var Vl=s(fe);Xe=i(Vl,"eltoto1219"),Vl.forEach(t),X=i(un,". The original code can be found "),ge=r(un,"A",{href:!0,rel:!0});var Wl=s(ge);He=i(Wl,"here"),Wl.forEach(t),Ge=i(un,"."),un.forEach(t),j=c(o),A=r(o,"H2",{class:!0});var Pr=s(A);ie=r(Pr,"A",{id:!0,class:!0,href:!0});var Bl=s(ie);Ce=r(Bl,"SPAN",{});var Xl=s(Ce);x(O.$$.fragment,Xl),Xl.forEach(t),Bl.forEach(t),Ue=c(Pr),Ne=r(Pr,"SPAN",{});var Hl=s(Ne);je=i(Hl,"LxmertConfig"),Hl.forEach(t),Pr.forEach(t),Re=c(o),Ie=r(o,"DIV",{class:!0});var pn=s(Ie);x(Ct.$$.fragment,pn),hs=c(pn),Ke=r(pn,"P",{});var fn=s(Ke);us=i(fn,"This is the configuration class to store the configuration of a "),Wo=r(fn,"A",{href:!0});var Gl=s(Wo);ps=i(Gl,"LxmertModel"),Gl.forEach(t),fs=i(fn," or a "),Bo=r(fn,"A",{href:!0});var Ul=s(Bo);gs=i(Ul,"TFLxmertModel"),Ul.forEach(t),_s=i(fn,`. It is used
to instantiate a LXMERT model according to the specified arguments, defining the model architecture.`),fn.forEach(t),vs=c(pn),Je=r(pn,"P",{});var gn=s(Je);Ts=i(gn,"Configuration objects inherit from "),Xo=r(gn,"A",{href:!0});var Kl=s(Xo);xs=i(Kl,"PretrainedConfig"),Kl.forEach(t),bs=i(gn,` and can be used to control the model outputs. Read the
documentation from `),Ho=r(gn,"A",{href:!0});var Jl=s(Ho);ws=i(Jl,"PretrainedConfig"),Jl.forEach(t),ys=i(gn," for more information."),gn.forEach(t),pn.forEach(t),cr=c(o),Ye=r(o,"H2",{class:!0});var Ar=s(Ye);gt=r(Ar,"A",{id:!0,class:!0,href:!0});var Yl=s(gt);kn=r(Yl,"SPAN",{});var Zl=s(kn);x(Nt.$$.fragment,Zl),Zl.forEach(t),Yl.forEach(t),ks=c(Ar),Ln=r(Ar,"SPAN",{});var ed=s(Ln);Ls=i(ed,"LxmertTokenizer"),ed.forEach(t),Ar.forEach(t),mr=c(o),_e=r(o,"DIV",{class:!0});var At=s(_e);x(jt.$$.fragment,At),Fs=c(At),Fn=r(At,"P",{});var td=s(Fn);$s=i(td,"Construct an LXMERT tokenizer."),td.forEach(t),zs=c(At),_t=r(At,"P",{});var lr=s(_t);Go=r(lr,"A",{href:!0});var od=s(Go);Es=i(od,"LxmertTokenizer"),od.forEach(t),Ms=i(lr," is identical to "),Uo=r(lr,"A",{href:!0});var nd=s(Uo);qs=i(nd,"BertTokenizer"),nd.forEach(t),Ps=i(lr,` and runs end-to-end tokenization: punctuation splitting and
wordpiece.`),lr.forEach(t),As=c(At),It=r(At,"P",{});var Or=s(It);Os=i(Or,"Refer to superclass "),Ko=r(Or,"A",{href:!0});var rd=s(Ko);Cs=i(rd,"BertTokenizer"),rd.forEach(t),Ns=i(Or," for usage examples and documentation concerning parameters."),Or.forEach(t),At.forEach(t),hr=c(o),Ze=r(o,"H2",{class:!0});var Cr=s(Ze);vt=r(Cr,"A",{id:!0,class:!0,href:!0});var sd=s(vt);$n=r(sd,"SPAN",{});var ad=s($n);x(Dt.$$.fragment,ad),ad.forEach(t),sd.forEach(t),js=c(Cr),zn=r(Cr,"SPAN",{});var id=s(zn);Is=i(id,"LxmertTokenizerFast"),id.forEach(t),Cr.forEach(t),ur=c(o),ve=r(o,"DIV",{class:!0});var Ot=s(ve);x(Rt.$$.fragment,Ot),Ds=c(Ot),St=r(Ot,"P",{});var Nr=s(St);Rs=i(Nr,"Construct a \u201Cfast\u201D LXMERT tokenizer (backed by HuggingFace\u2019s "),En=r(Nr,"EM",{});var ld=s(En);Ss=i(ld,"tokenizers"),ld.forEach(t),Qs=i(Nr," library)."),Nr.forEach(t),Vs=c(Ot),Tt=r(Ot,"P",{});var dr=s(Tt);Jo=r(dr,"A",{href:!0});var dd=s(Jo);Ws=i(dd,"LxmertTokenizerFast"),dd.forEach(t),Bs=i(dr," is identical to "),Yo=r(dr,"A",{href:!0});var cd=s(Yo);Xs=i(cd,"BertTokenizerFast"),cd.forEach(t),Hs=i(dr,` and runs end-to-end tokenization: punctuation
splitting and wordpiece.`),dr.forEach(t),Gs=c(Ot),Qt=r(Ot,"P",{});var jr=s(Qt);Us=i(jr,"Refer to superclass "),Zo=r(jr,"A",{href:!0});var md=s(Zo);Ks=i(md,"BertTokenizerFast"),md.forEach(t),Js=i(jr," for usage examples and documentation concerning parameters."),jr.forEach(t),Ot.forEach(t),pr=c(o),et=r(o,"H2",{class:!0});var Ir=s(et);xt=r(Ir,"A",{id:!0,class:!0,href:!0});var hd=s(xt);Mn=r(hd,"SPAN",{});var ud=s(Mn);x(Vt.$$.fragment,ud),ud.forEach(t),hd.forEach(t),Ys=c(Ir),qn=r(Ir,"SPAN",{});var pd=s(qn);Zs=i(pd,"Lxmert specific outputs"),pd.forEach(t),Ir.forEach(t),fr=c(o),tt=r(o,"DIV",{class:!0});var Dr=s(tt);x(Wt.$$.fragment,Dr),ea=c(Dr),Pn=r(Dr,"P",{});var fd=s(Pn);ta=i(fd,`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)`),fd.forEach(t),Dr.forEach(t),gr=c(o),ot=r(o,"DIV",{class:!0});var Rr=s(ot);x(Bt.$$.fragment,Rr),oa=c(Rr),Xt=r(Rr,"P",{});var Sr=s(Xt);na=i(Sr,"Output type of "),en=r(Sr,"A",{href:!0});var gd=s(en);ra=i(gd,"LxmertForPreTraining"),gd.forEach(t),sa=i(Sr,"."),Sr.forEach(t),Rr.forEach(t),_r=c(o),nt=r(o,"DIV",{class:!0});var Qr=s(nt);x(Ht.$$.fragment,Qr),aa=c(Qr),Gt=r(Qr,"P",{});var Vr=s(Gt);ia=i(Vr,"Output type of "),tn=r(Vr,"A",{href:!0});var _d=s(tn);la=i(_d,"LxmertForQuestionAnswering"),_d.forEach(t),da=i(Vr,"."),Vr.forEach(t),Qr.forEach(t),vr=c(o),rt=r(o,"DIV",{class:!0});var Wr=s(rt);x(Ut.$$.fragment,Wr),ca=c(Wr),An=r(Wr,"P",{});var vd=s(An);ma=i(vd,`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)`),vd.forEach(t),Wr.forEach(t),Tr=c(o),st=r(o,"DIV",{class:!0});var Br=s(st);x(Kt.$$.fragment,Br),ha=c(Br),Jt=r(Br,"P",{});var Xr=s(Jt);ua=i(Xr,"Output type of "),on=r(Xr,"A",{href:!0});var Td=s(on);pa=i(Td,"LxmertForPreTraining"),Td.forEach(t),fa=i(Xr,"."),Xr.forEach(t),Br.forEach(t),xr=c(o),at=r(o,"H2",{class:!0});var Hr=s(at);bt=r(Hr,"A",{id:!0,class:!0,href:!0});var xd=s(bt);On=r(xd,"SPAN",{});var bd=s(On);x(Yt.$$.fragment,bd),bd.forEach(t),xd.forEach(t),ga=c(Hr),Cn=r(Hr,"SPAN",{});var wd=s(Cn);_a=i(wd,"LxmertModel"),wd.forEach(t),Hr.forEach(t),br=c(o),H=r(o,"DIV",{class:!0});var we=s(H);x(Zt.$$.fragment,we),va=c(we),Nn=r(we,"P",{});var yd=s(Nn);Ta=i(yd,"The bare Lxmert Model transformer outputting raw hidden-states without any specific head on top."),yd.forEach(t),xa=c(we),eo=r(we,"P",{});var Gr=s(eo);ba=i(Gr,"The LXMERT model was proposed in "),to=r(Gr,"A",{href:!0,rel:!0});var kd=s(to);wa=i(kd,`LXMERT: Learning Cross-Modality Encoder Representations from
Transformers`),kd.forEach(t),ya=i(Gr,` 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, 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.`),Gr.forEach(t),ka=c(we),oo=r(we,"P",{});var Ur=s(oo);La=i(Ur,"This model inherits from "),nn=r(Ur,"A",{href:!0});var Ld=s(nn);Fa=i(Ld,"PreTrainedModel"),Ld.forEach(t),$a=i(Ur,`. 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.)`),Ur.forEach(t),za=c(we),no=r(we,"P",{});var Kr=s(no);Ea=i(Kr,"This model is also a PyTorch "),ro=r(Kr,"A",{href:!0,rel:!0});var Fd=s(ro);Ma=i(Fd,"torch.nn.Module"),Fd.forEach(t),qa=i(Kr,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Kr.forEach(t),Pa=c(we),le=r(we,"DIV",{class:!0});var Ve=s(le);x(so.$$.fragment,Ve),Aa=c(Ve),it=r(Ve,"P",{});var _n=s(it);Oa=i(_n,"The "),rn=r(_n,"A",{href:!0});var $d=s(rn);Ca=i($d,"LxmertModel"),$d.forEach(t),Na=i(_n," forward method, overrides the "),jn=r(_n,"CODE",{});var zd=s(jn);ja=i(zd,"__call__"),zd.forEach(t),Ia=i(_n," special method."),_n.forEach(t),Da=c(Ve),x(wt.$$.fragment,Ve),Ra=c(Ve),In=r(Ve,"P",{});var Ed=s(In);Sa=i(Ed,"Example:"),Ed.forEach(t),Qa=c(Ve),x(ao.$$.fragment,Ve),Ve.forEach(t),we.forEach(t),wr=c(o),lt=r(o,"H2",{class:!0});var Jr=s(lt);yt=r(Jr,"A",{id:!0,class:!0,href:!0});var Md=s(yt);Dn=r(Md,"SPAN",{});var qd=s(Dn);x(io.$$.fragment,qd),qd.forEach(t),Md.forEach(t),Va=c(Jr),Rn=r(Jr,"SPAN",{});var Pd=s(Rn);Wa=i(Pd,"LxmertForPreTraining"),Pd.forEach(t),Jr.forEach(t),yr=c(o),G=r(o,"DIV",{class:!0});var ye=s(G);x(lo.$$.fragment,ye),Ba=c(ye),Sn=r(ye,"P",{});var Ad=s(Sn);Xa=i(Ad,"Lxmert Model with a specified pretraining head on top."),Ad.forEach(t),Ha=c(ye),co=r(ye,"P",{});var Yr=s(co);Ga=i(Yr,"The LXMERT model was proposed in "),mo=r(Yr,"A",{href:!0,rel:!0});var Od=s(mo);Ua=i(Od,`LXMERT: Learning Cross-Modality Encoder Representations from
Transformers`),Od.forEach(t),Ka=i(Yr,` 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, 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.`),Yr.forEach(t),Ja=c(ye),ho=r(ye,"P",{});var Zr=s(ho);Ya=i(Zr,"This model inherits from "),sn=r(Zr,"A",{href:!0});var Cd=s(sn);Za=i(Cd,"PreTrainedModel"),Cd.forEach(t),ei=i(Zr,`. 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.)`),Zr.forEach(t),ti=c(ye),uo=r(ye,"P",{});var es=s(uo);oi=i(es,"This model is also a PyTorch "),po=r(es,"A",{href:!0,rel:!0});var Nd=s(po);ni=i(Nd,"torch.nn.Module"),Nd.forEach(t),ri=i(es,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),es.forEach(t),si=c(ye),Se=r(ye,"DIV",{class:!0});var vn=s(Se);x(fo.$$.fragment,vn),ai=c(vn),dt=r(vn,"P",{});var Tn=s(dt);ii=i(Tn,"The "),an=r(Tn,"A",{href:!0});var jd=s(an);li=i(jd,"LxmertForPreTraining"),jd.forEach(t),di=i(Tn," forward method, overrides the "),Qn=r(Tn,"CODE",{});var Id=s(Qn);ci=i(Id,"__call__"),Id.forEach(t),mi=i(Tn," special method."),Tn.forEach(t),hi=c(vn),x(kt.$$.fragment,vn),vn.forEach(t),ye.forEach(t),kr=c(o),ct=r(o,"H2",{class:!0});var ts=s(ct);Lt=r(ts,"A",{id:!0,class:!0,href:!0});var Dd=s(Lt);Vn=r(Dd,"SPAN",{});var Rd=s(Vn);x(go.$$.fragment,Rd),Rd.forEach(t),Dd.forEach(t),ui=c(ts),Wn=r(ts,"SPAN",{});var Sd=s(Wn);pi=i(Sd,"LxmertForQuestionAnswering"),Sd.forEach(t),ts.forEach(t),Lr=c(o),U=r(o,"DIV",{class:!0});var ke=s(U);x(_o.$$.fragment,ke),fi=c(ke),Bn=r(ke,"P",{});var Qd=s(Bn);gi=i(Qd,"Lxmert Model with a visual-answering head on top for downstream QA tasks"),Qd.forEach(t),_i=c(ke),vo=r(ke,"P",{});var os=s(vo);vi=i(os,"The LXMERT model was proposed in "),To=r(os,"A",{href:!0,rel:!0});var Vd=s(To);Ti=i(Vd,`LXMERT: Learning Cross-Modality Encoder Representations from
Transformers`),Vd.forEach(t),xi=i(os,` 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, 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.`),os.forEach(t),bi=c(ke),xo=r(ke,"P",{});var ns=s(xo);wi=i(ns,"This model inherits from "),ln=r(ns,"A",{href:!0});var Wd=s(ln);yi=i(Wd,"PreTrainedModel"),Wd.forEach(t),ki=i(ns,`. 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.)`),ns.forEach(t),Li=c(ke),bo=r(ke,"P",{});var rs=s(bo);Fi=i(rs,"This model is also a PyTorch "),wo=r(rs,"A",{href:!0,rel:!0});var Bd=s(wo);$i=i(Bd,"torch.nn.Module"),Bd.forEach(t),zi=i(rs,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),rs.forEach(t),Ei=c(ke),de=r(ke,"DIV",{class:!0});var We=s(de);x(yo.$$.fragment,We),Mi=c(We),mt=r(We,"P",{});var xn=s(mt);qi=i(xn,"The "),dn=r(xn,"A",{href:!0});var Xd=s(dn);Pi=i(Xd,"LxmertForQuestionAnswering"),Xd.forEach(t),Ai=i(xn," forward method, overrides the "),Xn=r(xn,"CODE",{});var Hd=s(Xn);Oi=i(Hd,"__call__"),Hd.forEach(t),Ci=i(xn," special method."),xn.forEach(t),Ni=c(We),x(Ft.$$.fragment,We),ji=c(We),Hn=r(We,"P",{});var Gd=s(Hn);Ii=i(Gd,"Example:"),Gd.forEach(t),Di=c(We),x(ko.$$.fragment,We),We.forEach(t),ke.forEach(t),Fr=c(o),ht=r(o,"H2",{class:!0});var ss=s(ht);$t=r(ss,"A",{id:!0,class:!0,href:!0});var Ud=s($t);Gn=r(Ud,"SPAN",{});var Kd=s(Gn);x(Lo.$$.fragment,Kd),Kd.forEach(t),Ud.forEach(t),Ri=c(ss),Un=r(ss,"SPAN",{});var Jd=s(Un);Si=i(Jd,"TFLxmertModel"),Jd.forEach(t),ss.forEach(t),$r=c(o),K=r(o,"DIV",{class:!0});var Le=s(K);x(Fo.$$.fragment,Le),Qi=c(Le),Kn=r(Le,"P",{});var Yd=s(Kn);Vi=i(Yd,"The bare Lxmert Model transformer outputting raw hidden-states without any specific head on top."),Yd.forEach(t),Wi=c(Le),$o=r(Le,"P",{});var as=s($o);Bi=i(as,"The LXMERT model was proposed in "),zo=r(as,"A",{href:!0,rel:!0});var Zd=s(zo);Xi=i(Zd,`LXMERT: Learning Cross-Modality Encoder Representations from
Transformers`),Zd.forEach(t),Hi=i(as,` 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.`),as.forEach(t),Gi=c(Le),Eo=r(Le,"P",{});var is=s(Eo);Ui=i(is,"This model is also a "),Mo=r(is,"A",{href:!0,rel:!0});var ec=s(Mo);Ki=i(ec,"tf.keras.Model"),ec.forEach(t),Ji=i(is,` 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.`),is.forEach(t),Yi=c(Le),x(zt.$$.fragment,Le),Zi=c(Le),ce=r(Le,"DIV",{class:!0});var Be=s(ce);x(qo.$$.fragment,Be),el=c(Be),ut=r(Be,"P",{});var bn=s(ut);tl=i(bn,"The "),cn=r(bn,"A",{href:!0});var tc=s(cn);ol=i(tc,"TFLxmertModel"),tc.forEach(t),nl=i(bn," forward method, overrides the "),Jn=r(bn,"CODE",{});var oc=s(Jn);rl=i(oc,"__call__"),oc.forEach(t),sl=i(bn," special method."),bn.forEach(t),al=c(Be),x(Et.$$.fragment,Be),il=c(Be),Yn=r(Be,"P",{});var nc=s(Yn);ll=i(nc,"Example:"),nc.forEach(t),dl=c(Be),x(Po.$$.fragment,Be),Be.forEach(t),Le.forEach(t),zr=c(o),pt=r(o,"H2",{class:!0});var ls=s(pt);Mt=r(ls,"A",{id:!0,class:!0,href:!0});var rc=s(Mt);Zn=r(rc,"SPAN",{});var sc=s(Zn);x(Ao.$$.fragment,sc),sc.forEach(t),rc.forEach(t),cl=c(ls),er=r(ls,"SPAN",{});var ac=s(er);ml=i(ac,"TFLxmertForPreTraining"),ac.forEach(t),ls.forEach(t),Er=c(o),J=r(o,"DIV",{class:!0});var Fe=s(J);x(Oo.$$.fragment,Fe),hl=c(Fe),Co=r(Fe,"P",{});var ds=s(Co);ul=i(ds,"Lxmert Model with a "),tr=r(ds,"CODE",{});var ic=s(tr);pl=i(ic,"language modeling"),ic.forEach(t),fl=i(ds," head on top."),ds.forEach(t),gl=c(Fe),No=r(Fe,"P",{});var cs=s(No);_l=i(cs,"The LXMERT model was proposed in "),jo=r(cs,"A",{href:!0,rel:!0});var lc=s(jo);vl=i(lc,`LXMERT: Learning Cross-Modality Encoder Representations from
Transformers`),lc.forEach(t),Tl=i(cs,` 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.`),cs.forEach(t),xl=c(Fe),Io=r(Fe,"P",{});var ms=s(Io);bl=i(ms,"This model is also a "),Do=r(ms,"A",{href:!0,rel:!0});var dc=s(Do);wl=i(dc,"tf.keras.Model"),dc.forEach(t),yl=i(ms,` 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.`),ms.forEach(t),kl=c(Fe),x(qt.$$.fragment,Fe),Ll=c(Fe),Qe=r(Fe,"DIV",{class:!0});var wn=s(Qe);x(Ro.$$.fragment,wn),Fl=c(wn),ft=r(wn,"P",{});var yn=s(ft);$l=i(yn,"The "),mn=r(yn,"A",{href:!0});var cc=s(mn);zl=i(cc,"TFLxmertForPreTraining"),cc.forEach(t),El=i(yn," forward method, overrides the "),or=r(yn,"CODE",{});var mc=s(or);Ml=i(mc,"__call__"),mc.forEach(t),ql=i(yn," special method."),yn.forEach(t),Pl=c(wn),x(Pt.$$.fragment,wn),wn.forEach(t),Fe.forEach(t),this.h()},h(){l(u,"name","hf:doc:metadata"),l(u,"content",JSON.stringify(kc)),l(g,"id","lxmert"),l(g,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(g,"href","#lxmert"),l(f,"class","relative group"),l(Y,"id","overview"),l(Y,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(Y,"href","#overview"),l(E,"class","relative group"),l(te,"href","https://arxiv.org/abs/1908.07490"),l(te,"rel","nofollow"),l(fe,"href","https://huggingface.co/eltoto1219"),l(fe,"rel","nofollow"),l(ge,"href","https://github.com/airsplay/lxmert"),l(ge,"rel","nofollow"),l(ie,"id","transformers.LxmertConfig"),l(ie,"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"),l(ie,"href","#transformers.LxmertConfig"),l(A,"class","relative group"),l(Wo,"href","/docs/transformers/pr_15839/en/model_doc/lxmert#transformers.LxmertModel"),l(Bo,"href","/docs/transformers/pr_15839/en/model_doc/lxmert#transformers.TFLxmertModel"),l(Xo,"href","/docs/transformers/pr_15839/en/main_classes/configuration#transformers.PretrainedConfig"),l(Ho,"href","/docs/transformers/pr_15839/en/main_classes/configuration#transformers.PretrainedConfig"),l(Ie,"class","docstring"),l(gt,"id","transformers.LxmertTokenizer"),l(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"),l(gt,"href","#transformers.LxmertTokenizer"),l(Ye,"class","relative group"),l(Go,"href","/docs/transformers/pr_15839/en/model_doc/lxmert#transformers.LxmertTokenizer"),l(Uo,"href","/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertTokenizer"),l(Ko,"href","/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertTokenizer"),l(_e,"class","docstring"),l(vt,"id","transformers.LxmertTokenizerFast"),l(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"),l(vt,"href","#transformers.LxmertTokenizerFast"),l(Ze,"class","relative group"),l(Jo,"href","/docs/transformers/pr_15839/en/model_doc/lxmert#transformers.LxmertTokenizerFast"),l(Yo,"href","/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertTokenizerFast"),l(Zo,"href","/docs/transformers/pr_15839/en/model_doc/bert#transformers.BertTokenizerFast"),l(ve,"class","docstring"),l(xt,"id","transformers.models.lxmert.modeling_lxmert.LxmertModelOutput"),l(xt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(xt,"href","#transformers.models.lxmert.modeling_lxmert.LxmertModelOutput"),l(et,"class","relative group"),l(tt,"class","docstring"),l(en,"href","/docs/transformers/pr_15839/en/model_doc/lxmert#transformers.LxmertForPreTraining"),l(ot,"class","docstring"),l(tn,"href","/docs/transformers/pr_15839/en/model_doc/lxmert#transformers.LxmertForQuestionAnswering"),l(nt,"class","docstring"),l(rt,"class","docstring"),l(on,"href","/docs/transformers/pr_15839/en/model_doc/lxmert#transformers.LxmertForPreTraining"),l(st,"class","docstring"),l(bt,"id","transformers.LxmertModel"),l(bt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(bt,"href","#transformers.LxmertModel"),l(at,"class","relative group"),l(to,"href","https://arxiv.org/abs/1908.07490"),l(to,"rel","nofollow"),l(nn,"href","/docs/transformers/pr_15839/en/main_classes/model#transformers.PreTrainedModel"),l(ro,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(ro,"rel","nofollow"),l(rn,"href","/docs/transformers/pr_15839/en/model_doc/lxmert#transformers.LxmertModel"),l(le,"class","docstring"),l(H,"class","docstring"),l(yt,"id","transformers.LxmertForPreTraining"),l(yt,"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"),l(yt,"href","#transformers.LxmertForPreTraining"),l(lt,"class","relative group"),l(mo,"href","https://arxiv.org/abs/1908.07490"),l(mo,"rel","nofollow"),l(sn,"href","/docs/transformers/pr_15839/en/main_classes/model#transformers.PreTrainedModel"),l(po,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(po,"rel","nofollow"),l(an,"href","/docs/transformers/pr_15839/en/model_doc/lxmert#transformers.LxmertForPreTraining"),l(Se,"class","docstring"),l(G,"class","docstring"),l(Lt,"id","transformers.LxmertForQuestionAnswering"),l(Lt,"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"),l(Lt,"href","#transformers.LxmertForQuestionAnswering"),l(ct,"class","relative group"),l(To,"href","https://arxiv.org/abs/1908.07490"),l(To,"rel","nofollow"),l(ln,"href","/docs/transformers/pr_15839/en/main_classes/model#transformers.PreTrainedModel"),l(wo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(wo,"rel","nofollow"),l(dn,"href","/docs/transformers/pr_15839/en/model_doc/lxmert#transformers.LxmertForQuestionAnswering"),l(de,"class","docstring"),l(U,"class","docstring"),l($t,"id","transformers.TFLxmertModel"),l($t,"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"),l($t,"href","#transformers.TFLxmertModel"),l(ht,"class","relative group"),l(zo,"href","https://arxiv.org/abs/1908.07490"),l(zo,"rel","nofollow"),l(Mo,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),l(Mo,"rel","nofollow"),l(cn,"href","/docs/transformers/pr_15839/en/model_doc/lxmert#transformers.TFLxmertModel"),l(ce,"class","docstring"),l(K,"class","docstring"),l(Mt,"id","transformers.TFLxmertForPreTraining"),l(Mt,"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"),l(Mt,"href","#transformers.TFLxmertForPreTraining"),l(pt,"class","relative group"),l(jo,"href","https://arxiv.org/abs/1908.07490"),l(jo,"rel","nofollow"),l(Do,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),l(Do,"rel","nofollow"),l(mn,"href","/docs/transformers/pr_15839/en/model_doc/lxmert#transformers.TFLxmertForPreTraining"),l(Qe,"class","docstring"),l(J,"class","docstring")},m(o,h){e(document.head,u),m(o,$,h),m(o,f,h),e(f,g),e(g,L),b(v,L,null),e(f,_),e(f,z),e(z,$e),m(o,re,h),m(o,E,h),e(E,Y),e(Y,R),b(ee,R,null),e(E,ze),e(E,S),e(S,Ee),m(o,Te,h),m(o,C,h),e(C,Q),e(C,te),e(te,me),e(C,M),m(o,P,h),m(o,se,h),e(se,oe),m(o,xe,h),m(o,ae,h),e(ae,V),e(V,Me),m(o,be,h),m(o,q,h),e(q,qe),m(o,Z,h),m(o,N,h),e(N,he),e(he,ne),e(N,Pe),e(N,ue),e(ue,W),e(N,Ae),e(N,B),e(B,Oe),m(o,p,h),m(o,F,h),e(F,pe),e(F,fe),e(fe,Xe),e(F,X),e(F,ge),e(ge,He),e(F,Ge),m(o,j,h),m(o,A,h),e(A,ie),e(ie,Ce),b(O,Ce,null),e(A,Ue),e(A,Ne),e(Ne,je),m(o,Re,h),m(o,Ie,h),b(Ct,Ie,null),e(Ie,hs),e(Ie,Ke),e(Ke,us),e(Ke,Wo),e(Wo,ps),e(Ke,fs),e(Ke,Bo),e(Bo,gs),e(Ke,_s),e(Ie,vs),e(Ie,Je),e(Je,Ts),e(Je,Xo),e(Xo,xs),e(Je,bs),e(Je,Ho),e(Ho,ws),e(Je,ys),m(o,cr,h),m(o,Ye,h),e(Ye,gt),e(gt,kn),b(Nt,kn,null),e(Ye,ks),e(Ye,Ln),e(Ln,Ls),m(o,mr,h),m(o,_e,h),b(jt,_e,null),e(_e,Fs),e(_e,Fn),e(Fn,$s),e(_e,zs),e(_e,_t),e(_t,Go),e(Go,Es),e(_t,Ms),e(_t,Uo),e(Uo,qs),e(_t,Ps),e(_e,As),e(_e,It),e(It,Os),e(It,Ko),e(Ko,Cs),e(It,Ns),m(o,hr,h),m(o,Ze,h),e(Ze,vt),e(vt,$n),b(Dt,$n,null),e(Ze,js),e(Ze,zn),e(zn,Is),m(o,ur,h),m(o,ve,h),b(Rt,ve,null),e(ve,Ds),e(ve,St),e(St,Rs),e(St,En),e(En,Ss),e(St,Qs),e(ve,Vs),e(ve,Tt),e(Tt,Jo),e(Jo,Ws),e(Tt,Bs),e(Tt,Yo),e(Yo,Xs),e(Tt,Hs),e(ve,Gs),e(ve,Qt),e(Qt,Us),e(Qt,Zo),e(Zo,Ks),e(Qt,Js),m(o,pr,h),m(o,et,h),e(et,xt),e(xt,Mn),b(Vt,Mn,null),e(et,Ys),e(et,qn),e(qn,Zs),m(o,fr,h),m(o,tt,h),b(Wt,tt,null),e(tt,ea),e(tt,Pn),e(Pn,ta),m(o,gr,h),m(o,ot,h),b(Bt,ot,null),e(ot,oa),e(ot,Xt),e(Xt,na),e(Xt,en),e(en,ra),e(Xt,sa),m(o,_r,h),m(o,nt,h),b(Ht,nt,null),e(nt,aa),e(nt,Gt),e(Gt,ia),e(Gt,tn),e(tn,la),e(Gt,da),m(o,vr,h),m(o,rt,h),b(Ut,rt,null),e(rt,ca),e(rt,An),e(An,ma),m(o,Tr,h),m(o,st,h),b(Kt,st,null),e(st,ha),e(st,Jt),e(Jt,ua),e(Jt,on),e(on,pa),e(Jt,fa),m(o,xr,h),m(o,at,h),e(at,bt),e(bt,On),b(Yt,On,null),e(at,ga),e(at,Cn),e(Cn,_a),m(o,br,h),m(o,H,h),b(Zt,H,null),e(H,va),e(H,Nn),e(Nn,Ta),e(H,xa),e(H,eo),e(eo,ba),e(eo,to),e(to,wa),e(eo,ya),e(H,ka),e(H,oo),e(oo,La),e(oo,nn),e(nn,Fa),e(oo,$a),e(H,za),e(H,no),e(no,Ea),e(no,ro),e(ro,Ma),e(no,qa),e(H,Pa),e(H,le),b(so,le,null),e(le,Aa),e(le,it),e(it,Oa),e(it,rn),e(rn,Ca),e(it,Na),e(it,jn),e(jn,ja),e(it,Ia),e(le,Da),b(wt,le,null),e(le,Ra),e(le,In),e(In,Sa),e(le,Qa),b(ao,le,null),m(o,wr,h),m(o,lt,h),e(lt,yt),e(yt,Dn),b(io,Dn,null),e(lt,Va),e(lt,Rn),e(Rn,Wa),m(o,yr,h),m(o,G,h),b(lo,G,null),e(G,Ba),e(G,Sn),e(Sn,Xa),e(G,Ha),e(G,co),e(co,Ga),e(co,mo),e(mo,Ua),e(co,Ka),e(G,Ja),e(G,ho),e(ho,Ya),e(ho,sn),e(sn,Za),e(ho,ei),e(G,ti),e(G,uo),e(uo,oi),e(uo,po),e(po,ni),e(uo,ri),e(G,si),e(G,Se),b(fo,Se,null),e(Se,ai),e(Se,dt),e(dt,ii),e(dt,an),e(an,li),e(dt,di),e(dt,Qn),e(Qn,ci),e(dt,mi),e(Se,hi),b(kt,Se,null),m(o,kr,h),m(o,ct,h),e(ct,Lt),e(Lt,Vn),b(go,Vn,null),e(ct,ui),e(ct,Wn),e(Wn,pi),m(o,Lr,h),m(o,U,h),b(_o,U,null),e(U,fi),e(U,Bn),e(Bn,gi),e(U,_i),e(U,vo),e(vo,vi),e(vo,To),e(To,Ti),e(vo,xi),e(U,bi),e(U,xo),e(xo,wi),e(xo,ln),e(ln,yi),e(xo,ki),e(U,Li),e(U,bo),e(bo,Fi),e(bo,wo),e(wo,$i),e(bo,zi),e(U,Ei),e(U,de),b(yo,de,null),e(de,Mi),e(de,mt),e(mt,qi),e(mt,dn),e(dn,Pi),e(mt,Ai),e(mt,Xn),e(Xn,Oi),e(mt,Ci),e(de,Ni),b(Ft,de,null),e(de,ji),e(de,Hn),e(Hn,Ii),e(de,Di),b(ko,de,null),m(o,Fr,h),m(o,ht,h),e(ht,$t),e($t,Gn),b(Lo,Gn,null),e(ht,Ri),e(ht,Un),e(Un,Si),m(o,$r,h),m(o,K,h),b(Fo,K,null),e(K,Qi),e(K,Kn),e(Kn,Vi),e(K,Wi),e(K,$o),e($o,Bi),e($o,zo),e(zo,Xi),e($o,Hi),e(K,Gi),e(K,Eo),e(Eo,Ui),e(Eo,Mo),e(Mo,Ki),e(Eo,Ji),e(K,Yi),b(zt,K,null),e(K,Zi),e(K,ce),b(qo,ce,null),e(ce,el),e(ce,ut),e(ut,tl),e(ut,cn),e(cn,ol),e(ut,nl),e(ut,Jn),e(Jn,rl),e(ut,sl),e(ce,al),b(Et,ce,null),e(ce,il),e(ce,Yn),e(Yn,ll),e(ce,dl),b(Po,ce,null),m(o,zr,h),m(o,pt,h),e(pt,Mt),e(Mt,Zn),b(Ao,Zn,null),e(pt,cl),e(pt,er),e(er,ml),m(o,Er,h),m(o,J,h),b(Oo,J,null),e(J,hl),e(J,Co),e(Co,ul),e(Co,tr),e(tr,pl),e(Co,fl),e(J,gl),e(J,No),e(No,_l),e(No,jo),e(jo,vl),e(No,Tl),e(J,xl),e(J,Io),e(Io,bl),e(Io,Do),e(Do,wl),e(Io,yl),e(J,kl),b(qt,J,null),e(J,Ll),e(J,Qe),b(Ro,Qe,null),e(Qe,Fl),e(Qe,ft),e(ft,$l),e(ft,mn),e(mn,zl),e(ft,El),e(ft,or),e(or,Ml),e(ft,ql),e(Qe,Pl),b(Pt,Qe,null),Mr=!0},p(o,[h]){const So={};h&2&&(So.$$scope={dirty:h,ctx:o}),wt.$set(So);const nr={};h&2&&(nr.$$scope={dirty:h,ctx:o}),kt.$set(nr);const rr={};h&2&&(rr.$$scope={dirty:h,ctx:o}),Ft.$set(rr);const sr={};h&2&&(sr.$$scope={dirty:h,ctx:o}),zt.$set(sr);const Qo={};h&2&&(Qo.$$scope={dirty:h,ctx:o}),Et.$set(Qo);const ar={};h&2&&(ar.$$scope={dirty:h,ctx:o}),qt.$set(ar);const ir={};h&2&&(ir.$$scope={dirty:h,ctx:o}),Pt.$set(ir)},i(o){Mr||(w(v.$$.fragment,o),w(ee.$$.fragment,o),w(O.$$.fragment,o),w(Ct.$$.fragment,o),w(Nt.$$.fragment,o),w(jt.$$.fragment,o),w(Dt.$$.fragment,o),w(Rt.$$.fragment,o),w(Vt.$$.fragment,o),w(Wt.$$.fragment,o),w(Bt.$$.fragment,o),w(Ht.$$.fragment,o),w(Ut.$$.fragment,o),w(Kt.$$.fragment,o),w(Yt.$$.fragment,o),w(Zt.$$.fragment,o),w(so.$$.fragment,o),w(wt.$$.fragment,o),w(ao.$$.fragment,o),w(io.$$.fragment,o),w(lo.$$.fragment,o),w(fo.$$.fragment,o),w(kt.$$.fragment,o),w(go.$$.fragment,o),w(_o.$$.fragment,o),w(yo.$$.fragment,o),w(Ft.$$.fragment,o),w(ko.$$.fragment,o),w(Lo.$$.fragment,o),w(Fo.$$.fragment,o),w(zt.$$.fragment,o),w(qo.$$.fragment,o),w(Et.$$.fragment,o),w(Po.$$.fragment,o),w(Ao.$$.fragment,o),w(Oo.$$.fragment,o),w(qt.$$.fragment,o),w(Ro.$$.fragment,o),w(Pt.$$.fragment,o),Mr=!0)},o(o){y(v.$$.fragment,o),y(ee.$$.fragment,o),y(O.$$.fragment,o),y(Ct.$$.fragment,o),y(Nt.$$.fragment,o),y(jt.$$.fragment,o),y(Dt.$$.fragment,o),y(Rt.$$.fragment,o),y(Vt.$$.fragment,o),y(Wt.$$.fragment,o),y(Bt.$$.fragment,o),y(Ht.$$.fragment,o),y(Ut.$$.fragment,o),y(Kt.$$.fragment,o),y(Yt.$$.fragment,o),y(Zt.$$.fragment,o),y(so.$$.fragment,o),y(wt.$$.fragment,o),y(ao.$$.fragment,o),y(io.$$.fragment,o),y(lo.$$.fragment,o),y(fo.$$.fragment,o),y(kt.$$.fragment,o),y(go.$$.fragment,o),y(_o.$$.fragment,o),y(yo.$$.fragment,o),y(Ft.$$.fragment,o),y(ko.$$.fragment,o),y(Lo.$$.fragment,o),y(Fo.$$.fragment,o),y(zt.$$.fragment,o),y(qo.$$.fragment,o),y(Et.$$.fragment,o),y(Po.$$.fragment,o),y(Ao.$$.fragment,o),y(Oo.$$.fragment,o),y(qt.$$.fragment,o),y(Ro.$$.fragment,o),y(Pt.$$.fragment,o),Mr=!1},d(o){t(u),o&&t($),o&&t(f),k(v),o&&t(re),o&&t(E),k(ee),o&&t(Te),o&&t(C),o&&t(P),o&&t(se),o&&t(xe),o&&t(ae),o&&t(be),o&&t(q),o&&t(Z),o&&t(N),o&&t(p),o&&t(F),o&&t(j),o&&t(A),k(O),o&&t(Re),o&&t(Ie),k(Ct),o&&t(cr),o&&t(Ye),k(Nt),o&&t(mr),o&&t(_e),k(jt),o&&t(hr),o&&t(Ze),k(Dt),o&&t(ur),o&&t(ve),k(Rt),o&&t(pr),o&&t(et),k(Vt),o&&t(fr),o&&t(tt),k(Wt),o&&t(gr),o&&t(ot),k(Bt),o&&t(_r),o&&t(nt),k(Ht),o&&t(vr),o&&t(rt),k(Ut),o&&t(Tr),o&&t(st),k(Kt),o&&t(xr),o&&t(at),k(Yt),o&&t(br),o&&t(H),k(Zt),k(so),k(wt),k(ao),o&&t(wr),o&&t(lt),k(io),o&&t(yr),o&&t(G),k(lo),k(fo),k(kt),o&&t(kr),o&&t(ct),k(go),o&&t(Lr),o&&t(U),k(_o),k(yo),k(Ft),k(ko),o&&t(Fr),o&&t(ht),k(Lo),o&&t($r),o&&t(K),k(Fo),k(zt),k(qo),k(Et),k(Po),o&&t(zr),o&&t(pt),k(Ao),o&&t(Er),o&&t(J),k(Oo),k(qt),k(Ro),k(Pt)}}}const kc={local:"lxmert",sections:[{local:"overview",title:"Overview"},{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 Lc(D,u,$){let{fw:f}=u;return D.$$set=g=>{"fw"in g&&$(0,f=g.fw)},[f]}class Pc extends hc{constructor(u){super();uc(this,u,Lc,yc,pc,{fw:0})}}export{Pc as default,kc as metadata};
