import{S as lc,i as dc,s as cc,e as n,k as d,w as b,t as a,M as mc,c as r,d as t,m as c,a as s,x as w,h as i,b as l,G as e,g as h,y,q as k,o as L,B as $,v as uc,L as fs}from"../../chunks/vendor-hf-doc-builder.js";import{T as Ho}from"../../chunks/Tip-hf-doc-builder.js";import{D}from"../../chunks/Docstring-hf-doc-builder.js";import{C as gs}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as Re}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as ps}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function hc(q){let m,x,f,g,T;return{c(){m=n("p"),x=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=n("code"),g=a("Module"),T=a(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(u){m=r(u,"P",{});var _=s(m);x=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),T=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(u,_){h(u,m,_),e(m,x),e(m,f),e(f,g),e(m,T)},d(u){u&&t(m)}}}function pc(q){let m,x,f,g,T;return g=new gs({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`}}),{c(){m=n("p"),x=a("Example:"),f=d(),b(g.$$.fragment)},l(u){m=r(u,"P",{});var _=s(m);x=i(_,"Example:"),_.forEach(t),f=c(u),w(g.$$.fragment,u)},m(u,_){h(u,m,_),e(m,x),h(u,f,_),y(g,u,_),T=!0},p:fs,i(u){T||(k(g.$$.fragment,u),T=!0)},o(u){L(g.$$.fragment,u),T=!1},d(u){u&&t(m),u&&t(f),$(g,u)}}}function fc(q){let m,x,f,g,T;return{c(){m=n("p"),x=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=n("code"),g=a("Module"),T=a(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(u){m=r(u,"P",{});var _=s(m);x=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),T=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(u,_){h(u,m,_),e(m,x),e(m,f),e(f,g),e(m,T)},d(u){u&&t(m)}}}function gc(q){let m,x,f,g,T;return{c(){m=n("p"),x=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=n("code"),g=a("Module"),T=a(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(u){m=r(u,"P",{});var _=s(m);x=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),T=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(u,_){h(u,m,_),e(m,x),e(m,f),e(f,g),e(m,T)},d(u){u&&t(m)}}}function _c(q){let m,x,f,g,T;return g=new gs({props:{code:`from transformers import LxmertTokenizer, LxmertForQuestionAnswering
import torch

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")
with torch.no_grad():
    outputs = model(**inputs)

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

predict_answer_tokens = inputs.input_ids[0, answer_start_index : answer_end_index + 1]
tokenizer.decode(predict_answer_tokens)
`,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>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><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    outputs = model(**inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span>answer_start_index = outputs.start_logits.argmax()
<span class="hljs-meta">&gt;&gt;&gt; </span>answer_end_index = outputs.end_logits.argmax()

<span class="hljs-meta">&gt;&gt;&gt; </span>predict_answer_tokens = inputs.input_ids[<span class="hljs-number">0</span>, answer_start_index : answer_end_index + <span class="hljs-number">1</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer.decode(predict_answer_tokens)
`}}),{c(){m=n("p"),x=a("Example:"),f=d(),b(g.$$.fragment)},l(u){m=r(u,"P",{});var _=s(m);x=i(_,"Example:"),_.forEach(t),f=c(u),w(g.$$.fragment,u)},m(u,_){h(u,m,_),e(m,x),h(u,f,_),y(g,u,_),T=!0},p:fs,i(u){T||(k(g.$$.fragment,u),T=!0)},o(u){L(g.$$.fragment,u),T=!1},d(u){u&&t(m),u&&t(f),$(g,u)}}}function vc(q){let m,x;return m=new gs({props:{code:`# target is "nice puppet"
target_start_index = torch.tensor([14])
target_end_index = torch.tensor([15])

outputs = model(**inputs, start_positions=target_start_index, end_positions=target_end_index)
loss = outputs.loss
round(loss.item(), 2)
`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># target is &quot;nice puppet&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>target_start_index = torch.tensor([<span class="hljs-number">14</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>target_end_index = torch.tensor([<span class="hljs-number">15</span>])

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs, start_positions=target_start_index, end_positions=target_end_index)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = outputs.loss
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">round</span>(loss.item(), <span class="hljs-number">2</span>)
`}}),{c(){b(m.$$.fragment)},l(f){w(m.$$.fragment,f)},m(f,g){y(m,f,g),x=!0},p:fs,i(f){x||(k(m.$$.fragment,f),x=!0)},o(f){L(m.$$.fragment,f),x=!1},d(f){$(m,f)}}}function Tc(q){let m,x,f,g,T,u,_,z,Fe,re,E,Y,R,ee,ze,S,Ee,_e,N,Q,te,de,M,O,se,oe,ve,ae,V,Me,Te,P,qe,Z,j,ce,ne,Pe,me,W,Oe,X,Ae;return{c(){m=n("p"),x=a("TF 2.0 models accepts two formats as inputs:"),f=d(),g=n("ul"),T=n("li"),u=a("having all inputs as keyword arguments (like PyTorch models), or"),_=d(),z=n("li"),Fe=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)"),_e=a("."),N=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 :`),de=d(),M=n("ul"),O=n("li"),se=a("a single Tensor with "),oe=n("code"),ve=a("input_ids"),ae=a(" only and nothing else: "),V=n("code"),Me=a("model(inputs_ids)"),Te=d(),P=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"),j=a("model([input_ids, attention_mask])"),ce=a(" or "),ne=n("code"),Pe=a("model([input_ids, attention_mask, token_type_ids])"),me=d(),W=n("li"),Oe=a(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),X=n("code"),Ae=a('model({"input_ids": input_ids, "token_type_ids": token_type_ids})')},l(v){m=r(v,"P",{});var F=s(m);x=i(F,"TF 2.0 models accepts two formats as inputs:"),F.forEach(t),f=c(v),g=r(v,"UL",{});var ue=s(g);T=r(ue,"LI",{});var he=s(T);u=i(he,"having all inputs as keyword arguments (like PyTorch models), or"),he.forEach(t),_=c(ue),z=r(ue,"LI",{});var Xe=s(z);Fe=i(Xe,"having all inputs as a list, tuple or dict in the first positional arguments."),Xe.forEach(t),ue.forEach(t),re=c(v),E=r(v,"P",{});var B=s(E);Y=i(B,"This second option is useful when using "),R=r(B,"CODE",{});var pe=s(R);ee=i(pe,"tf.keras.Model.fit"),pe.forEach(t),ze=i(B,` method which currently requires having all the
tensors in the first argument of the model call function: `),S=r(B,"CODE",{});var Be=s(S);Ee=i(Be,"model(inputs)"),Be.forEach(t),_e=i(B,"."),B.forEach(t),N=c(v),Q=r(v,"P",{});var He=s(Q);te=i(He,`If you choose this second option, there are three possibilities you can use to gather all the input Tensors in the
first positional argument :`),He.forEach(t),de=c(v),M=r(v,"UL",{});var I=s(M);O=r(I,"LI",{});var A=s(O);se=i(A,"a single Tensor with "),oe=r(A,"CODE",{});var ie=s(oe);ve=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),Te=c(I),P=r(I,"LI",{});var C=s(P);qe=i(C,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),Z=r(C,"CODE",{});var Ge=s(Z);j=i(Ge,"model([input_ids, attention_mask])"),Ge.forEach(t),ce=i(C," or "),ne=r(C,"CODE",{});var Ne=s(ne);Pe=i(Ne,"model([input_ids, attention_mask, token_type_ids])"),Ne.forEach(t),C.forEach(t),me=c(I),W=r(I,"LI",{});var je=s(W);Oe=i(je,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),X=r(je,"CODE",{});var Se=s(X);Ae=i(Se,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),Se.forEach(t),je.forEach(t),I.forEach(t)},m(v,F){h(v,m,F),e(m,x),h(v,f,F),h(v,g,F),e(g,T),e(T,u),e(g,_),e(g,z),e(z,Fe),h(v,re,F),h(v,E,F),e(E,Y),e(E,R),e(R,ee),e(E,ze),e(E,S),e(S,Ee),e(E,_e),h(v,N,F),h(v,Q,F),e(Q,te),h(v,de,F),h(v,M,F),e(M,O),e(O,se),e(O,oe),e(oe,ve),e(O,ae),e(O,V),e(V,Me),e(M,Te),e(M,P),e(P,qe),e(P,Z),e(Z,j),e(P,ce),e(P,ne),e(ne,Pe),e(M,me),e(M,W),e(W,Oe),e(W,X),e(X,Ae)},d(v){v&&t(m),v&&t(f),v&&t(g),v&&t(re),v&&t(E),v&&t(N),v&&t(Q),v&&t(de),v&&t(M)}}}function xc(q){let m,x,f,g,T;return{c(){m=n("p"),x=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=n("code"),g=a("Module"),T=a(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(u){m=r(u,"P",{});var _=s(m);x=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),T=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(u,_){h(u,m,_),e(m,x),e(m,f),e(f,g),e(m,T)},d(u){u&&t(m)}}}function bc(q){let m,x,f,g,T;return g=new gs({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`}}),{c(){m=n("p"),x=a("Example:"),f=d(),b(g.$$.fragment)},l(u){m=r(u,"P",{});var _=s(m);x=i(_,"Example:"),_.forEach(t),f=c(u),w(g.$$.fragment,u)},m(u,_){h(u,m,_),e(m,x),h(u,f,_),y(g,u,_),T=!0},p:fs,i(u){T||(k(g.$$.fragment,u),T=!0)},o(u){L(g.$$.fragment,u),T=!1},d(u){u&&t(m),u&&t(f),$(g,u)}}}function wc(q){let m,x,f,g,T,u,_,z,Fe,re,E,Y,R,ee,ze,S,Ee,_e,N,Q,te,de,M,O,se,oe,ve,ae,V,Me,Te,P,qe,Z,j,ce,ne,Pe,me,W,Oe,X,Ae;return{c(){m=n("p"),x=a("TF 2.0 models accepts two formats as inputs:"),f=d(),g=n("ul"),T=n("li"),u=a("having all inputs as keyword arguments (like PyTorch models), or"),_=d(),z=n("li"),Fe=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)"),_e=a("."),N=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 :`),de=d(),M=n("ul"),O=n("li"),se=a("a single Tensor with "),oe=n("code"),ve=a("input_ids"),ae=a(" only and nothing else: "),V=n("code"),Me=a("model(inputs_ids)"),Te=d(),P=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"),j=a("model([input_ids, attention_mask])"),ce=a(" or "),ne=n("code"),Pe=a("model([input_ids, attention_mask, token_type_ids])"),me=d(),W=n("li"),Oe=a(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),X=n("code"),Ae=a('model({"input_ids": input_ids, "token_type_ids": token_type_ids})')},l(v){m=r(v,"P",{});var F=s(m);x=i(F,"TF 2.0 models accepts two formats as inputs:"),F.forEach(t),f=c(v),g=r(v,"UL",{});var ue=s(g);T=r(ue,"LI",{});var he=s(T);u=i(he,"having all inputs as keyword arguments (like PyTorch models), or"),he.forEach(t),_=c(ue),z=r(ue,"LI",{});var Xe=s(z);Fe=i(Xe,"having all inputs as a list, tuple or dict in the first positional arguments."),Xe.forEach(t),ue.forEach(t),re=c(v),E=r(v,"P",{});var B=s(E);Y=i(B,"This second option is useful when using "),R=r(B,"CODE",{});var pe=s(R);ee=i(pe,"tf.keras.Model.fit"),pe.forEach(t),ze=i(B,` method which currently requires having all the
tensors in the first argument of the model call function: `),S=r(B,"CODE",{});var Be=s(S);Ee=i(Be,"model(inputs)"),Be.forEach(t),_e=i(B,"."),B.forEach(t),N=c(v),Q=r(v,"P",{});var He=s(Q);te=i(He,`If you choose this second option, there are three possibilities you can use to gather all the input Tensors in the
first positional argument :`),He.forEach(t),de=c(v),M=r(v,"UL",{});var I=s(M);O=r(I,"LI",{});var A=s(O);se=i(A,"a single Tensor with "),oe=r(A,"CODE",{});var ie=s(oe);ve=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),Te=c(I),P=r(I,"LI",{});var C=s(P);qe=i(C,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),Z=r(C,"CODE",{});var Ge=s(Z);j=i(Ge,"model([input_ids, attention_mask])"),Ge.forEach(t),ce=i(C," or "),ne=r(C,"CODE",{});var Ne=s(ne);Pe=i(Ne,"model([input_ids, attention_mask, token_type_ids])"),Ne.forEach(t),C.forEach(t),me=c(I),W=r(I,"LI",{});var je=s(W);Oe=i(je,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),X=r(je,"CODE",{});var Se=s(X);Ae=i(Se,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),Se.forEach(t),je.forEach(t),I.forEach(t)},m(v,F){h(v,m,F),e(m,x),h(v,f,F),h(v,g,F),e(g,T),e(T,u),e(g,_),e(g,z),e(z,Fe),h(v,re,F),h(v,E,F),e(E,Y),e(E,R),e(R,ee),e(E,ze),e(E,S),e(S,Ee),e(E,_e),h(v,N,F),h(v,Q,F),e(Q,te),h(v,de,F),h(v,M,F),e(M,O),e(O,se),e(O,oe),e(oe,ve),e(O,ae),e(O,V),e(V,Me),e(M,Te),e(M,P),e(P,qe),e(P,Z),e(Z,j),e(P,ce),e(P,ne),e(ne,Pe),e(M,me),e(M,W),e(W,Oe),e(W,X),e(X,Ae)},d(v){v&&t(m),v&&t(f),v&&t(g),v&&t(re),v&&t(E),v&&t(N),v&&t(Q),v&&t(de),v&&t(M)}}}function yc(q){let m,x,f,g,T;return{c(){m=n("p"),x=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=n("code"),g=a("Module"),T=a(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(u){m=r(u,"P",{});var _=s(m);x=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),T=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(u,_){h(u,m,_),e(m,x),e(m,f),e(f,g),e(m,T)},d(u){u&&t(m)}}}function kc(q){let m,x,f,g,T,u,_,z,Fe,re,E,Y,R,ee,ze,S,Ee,_e,N,Q,te,de,M,O,se,oe,ve,ae,V,Me,Te,P,qe,Z,j,ce,ne,Pe,me,W,Oe,X,Ae,v,F,ue,he,Xe,B,pe,Be,He,I,A,ie,Ce,C,Ge,Ne,je,Se,Ie,Rt,_s,De,vs,Go,Ts,xs,Uo,bs,ws,St,ys,ks,Ls,Ue,$s,Ko,Fs,zs,Jo,Es,Ms,hr,Ke,pt,Fn,Qt,qs,zn,Ps,pr,fe,Vt,Os,En,As,Cs,ft,Yo,Ns,js,Zo,Is,Ds,Rs,Wt,Ss,en,Qs,Vs,fr,Je,gt,Mn,Xt,Ws,qn,Xs,gr,ge,Bt,Bs,Ht,Hs,Pn,Gs,Us,Ks,_t,tn,Js,Ys,on,Zs,ea,ta,Gt,oa,nn,na,ra,_r,Ye,vt,On,Ut,sa,An,aa,vr,Ze,Kt,ia,Cn,la,Tr,et,Jt,da,Yt,ca,rn,ma,ua,xr,tt,Zt,ha,eo,pa,sn,fa,ga,br,ot,to,_a,Nn,va,wr,nt,oo,Ta,no,xa,an,ba,wa,yr,rt,Tt,jn,ro,ya,In,ka,kr,H,so,La,Dn,$a,Fa,ao,za,io,Ea,Ma,qa,lo,Pa,ln,Oa,Aa,Ca,co,Na,mo,ja,Ia,Da,xe,uo,Ra,st,Sa,dn,Qa,Va,Rn,Wa,Xa,Ba,xt,Ha,bt,Lr,at,wt,Sn,ho,Ga,Qn,Ua,$r,G,po,Ka,Vn,Ja,Ya,fo,Za,go,ei,ti,oi,_o,ni,cn,ri,si,ai,vo,ii,To,li,di,ci,Qe,xo,mi,it,ui,mn,hi,pi,Wn,fi,gi,_i,yt,Fr,lt,kt,Xn,bo,vi,Bn,Ti,zr,U,wo,xi,Hn,bi,wi,yo,yi,ko,ki,Li,$i,Lo,Fi,un,zi,Ei,Mi,$o,qi,Fo,Pi,Oi,Ai,le,zo,Ci,dt,Ni,hn,ji,Ii,Gn,Di,Ri,Si,Lt,Qi,$t,Vi,Ft,Er,ct,zt,Un,Eo,Wi,Kn,Xi,Mr,K,Mo,Bi,Jn,Hi,Gi,qo,Ui,Po,Ki,Ji,Yi,Oo,Zi,Ao,el,tl,ol,Et,nl,be,Co,rl,mt,sl,pn,al,il,Yn,ll,dl,cl,Mt,ml,qt,qr,ut,Pt,Zn,No,ul,er,hl,Pr,J,jo,pl,Io,fl,tr,gl,_l,vl,Do,Tl,Ro,xl,bl,wl,So,yl,Qo,kl,Ll,$l,Ot,Fl,Ve,Vo,zl,ht,El,fn,Ml,ql,or,Pl,Ol,Al,At,Or;return u=new Re({}),ee=new Re({}),C=new Re({}),Rt=new D({props:{name:"class transformers.LxmertConfig",anchor:"transformers.LxmertConfig",parameters:[{name:"vocab_size",val:" = 30522"},{name:"hidden_size",val:" = 768"},{name:"num_attention_heads",val:" = 12"},{name:"num_qa_labels",val:" = 9500"},{name:"num_object_labels",val:" = 1600"},{name:"num_attr_labels",val:" = 400"},{name:"intermediate_size",val:" = 3072"},{name:"hidden_act",val:" = 'gelu'"},{name:"hidden_dropout_prob",val:" = 0.1"},{name:"attention_probs_dropout_prob",val:" = 0.1"},{name:"max_position_embeddings",val:" = 512"},{name:"type_vocab_size",val:" = 2"},{name:"initializer_range",val:" = 0.02"},{name:"layer_norm_eps",val:" = 1e-12"},{name:"l_layers",val:" = 9"},{name:"x_layers",val:" = 5"},{name:"r_layers",val:" = 5"},{name:"visual_feat_dim",val:" = 2048"},{name:"visual_pos_dim",val:" = 4"},{name:"visual_loss_normalizer",val:" = 6.67"},{name:"task_matched",val:" = True"},{name:"task_mask_lm",val:" = True"},{name:"task_obj_predict",val:" = True"},{name:"task_qa",val:" = True"},{name:"visual_obj_loss",val:" = True"},{name:"visual_attr_loss",val:" = True"},{name:"visual_feat_loss",val:" = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.LxmertConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 30522) &#x2014;
Vocabulary size of the LXMERT model. Defines the number of different tokens that can be represented by the
<code>inputs_ids</code> passed when calling <a href="/docs/transformers/pr_17548/en/model_doc/lxmert#transformers.LxmertModel">LxmertModel</a> or <a href="/docs/transformers/pr_17548/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_17548/en/model_doc/bert#transformers.BertModel">BertModel</a>.`,name:"type_vocab_size"},{anchor:"transformers.LxmertConfig.initializer_range",description:`<strong>initializer_range</strong> (<code>float</code>, <em>optional</em>, defaults to 0.02) &#x2014;
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.`,name:"initializer_range"},{anchor:"transformers.LxmertConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-12) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.LxmertConfig.visual_feat_dim",description:`<strong>visual_feat_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 2048) &#x2014;
This represents the last dimension of the pooled-object features used as input for the model, representing
the size of each object feature itself.`,name:"visual_feat_dim"},{anchor:"transformers.LxmertConfig.visual_pos_dim",description:`<strong>visual_pos_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 4) &#x2014;
This represents the number of spacial features that are mixed into the visual features. The default is set
to 4 because most commonly this will represent the location of a bounding box. i.e., (x, y, width, height)`,name:"visual_pos_dim"},{anchor:"transformers.LxmertConfig.visual_loss_normalizer",description:`<strong>visual_loss_normalizer</strong> (<code>float</code>, <em>optional</em>, defaults to 1/15) &#x2014;
This represents the scaling factor in which each visual loss is multiplied by if during pretraining, one
decided to train with multiple vision-based loss objectives.`,name:"visual_loss_normalizer"},{anchor:"transformers.LxmertConfig.num_qa_labels",description:`<strong>num_qa_labels</strong> (<code>int</code>, <em>optional</em>, defaults to 9500) &#x2014;
This represents the total number of different question answering (QA) labels there are. If using more than
one dataset with QA, the user will need to account for the total number of labels that all of the datasets
have in total.`,name:"num_qa_labels"},{anchor:"transformers.LxmertConfig.num_object_labels",description:`<strong>num_object_labels</strong> (<code>int</code>, <em>optional</em>, defaults to 1600) &#x2014;
This represents the total number of semantically unique objects that lxmert will be able to classify a
pooled-object feature as belonging too.`,name:"num_object_labels"},{anchor:"transformers.LxmertConfig.num_attr_labels",description:`<strong>num_attr_labels</strong> (<code>int</code>, <em>optional</em>, defaults to 400) &#x2014;
This represents the total number of semantically unique attributes that lxmert will be able to classify a
pooled-object feature as possessing.`,name:"num_attr_labels"},{anchor:"transformers.LxmertConfig.task_matched",description:`<strong>task_matched</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
This task is used for sentence-image matching. If the sentence correctly describes the image the label will
be 1. If the sentence does not correctly describe the image, the label will be 0.`,name:"task_matched"},{anchor:"transformers.LxmertConfig.task_mask_lm",description:`<strong>task_mask_lm</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to add masked language modeling (as used in pretraining models such as BERT) to the loss
objective.`,name:"task_mask_lm"},{anchor:"transformers.LxmertConfig.task_obj_predict",description:`<strong>task_obj_predict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to add object prediction, attribute prediction and feature regression to the loss objective.`,name:"task_obj_predict"},{anchor:"transformers.LxmertConfig.task_qa",description:`<strong>task_qa</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to add the question-answering loss to the objective`,name:"task_qa"},{anchor:"transformers.LxmertConfig.visual_obj_loss",description:`<strong>visual_obj_loss</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to calculate the object-prediction loss objective`,name:"visual_obj_loss"},{anchor:"transformers.LxmertConfig.visual_attr_loss",description:`<strong>visual_attr_loss</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to calculate the attribute-prediction loss objective`,name:"visual_attr_loss"},{anchor:"transformers.LxmertConfig.visual_feat_loss",description:`<strong>visual_feat_loss</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to calculate the feature-regression loss objective`,name:"visual_feat_loss"},{anchor:"transformers.LxmertConfig.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the model should return the attentions from the vision, language, and cross-modality layers
should be returned.`,name:"output_attentions"},{anchor:"transformers.LxmertConfig.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the model should return the hidden states from the vision, language, and cross-modality
layers should be returned.`,name:"output_hidden_states"}],source:"https://github.com/huggingface/transformers/blob/vr_17548/src/transformers/models/lxmert/configuration_lxmert.py#L29"}}),Qt=new Re({}),Vt=new D({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/vr_17548/src/transformers/models/lxmert/tokenization_lxmert.py#L36"}}),Xt=new Re({}),Bt=new D({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/vr_17548/src/transformers/models/lxmert/tokenization_lxmert_fast.py#L42"}}),Ut=new Re({}),Kt=new D({props:{name:"class transformers.models.lxmert.modeling_lxmert.LxmertModelOutput",anchor:"transformers.models.lxmert.modeling_lxmert.LxmertModelOutput",parameters:[{name:"language_output",val:": typing.Optional[torch.FloatTensor] = None"},{name:"vision_output",val:": typing.Optional[torch.FloatTensor] = None"},{name:"pooled_output",val:": typing.Optional[torch.FloatTensor] = None"},{name:"language_hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"vision_hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"language_attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"vision_attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"cross_encoder_attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"}],parametersDescription:[{anchor:"transformers.models.lxmert.modeling_lxmert.LxmertModelOutput.language_output",description:`<strong>language_output</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) &#x2014;
Sequence of hidden-states at the output of the last layer of the language encoder.`,name:"language_output"},{anchor:"transformers.models.lxmert.modeling_lxmert.LxmertModelOutput.vision_output",description:`<strong>vision_output</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) &#x2014;
Sequence of hidden-states at the output of the last layer of the visual encoder.`,name:"vision_output"},{anchor:"transformers.models.lxmert.modeling_lxmert.LxmertModelOutput.pooled_output",description:`<strong>pooled_output</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, hidden_size)</code>) &#x2014;
Last layer hidden-state of the first token of the sequence (classification, CLS, token) further processed
by a Linear layer and a Tanh activation function. The Linear`,name:"pooled_output"},{anchor:"transformers.models.lxmert.modeling_lxmert.LxmertModelOutput.language_hidden_states",description:`<strong>language_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for input features + one for the output of each cross-modality layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.`,name:"language_hidden_states"},{anchor:"transformers.models.lxmert.modeling_lxmert.LxmertModelOutput.vision_hidden_states",description:`<strong>vision_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for input features + one for the output of each cross-modality layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.`,name:"vision_hidden_states"},{anchor:"transformers.models.lxmert.modeling_lxmert.LxmertModelOutput.language_attentions",description:`<strong>language_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.`,name:"language_attentions"},{anchor:"transformers.models.lxmert.modeling_lxmert.LxmertModelOutput.vision_attentions",description:`<strong>vision_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.`,name:"vision_attentions"},{anchor:"transformers.models.lxmert.modeling_lxmert.LxmertModelOutput.cross_encoder_attentions",description:`<strong>cross_encoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.`,name:"cross_encoder_attentions"}],source:"https://github.com/huggingface/transformers/blob/vr_17548/src/transformers/models/lxmert/modeling_lxmert.py#L61"}}),Jt=new D({props:{name:"class transformers.models.lxmert.modeling_lxmert.LxmertForPreTrainingOutput",anchor:"transformers.models.lxmert.modeling_lxmert.LxmertForPreTrainingOutput",parameters:[{name:"loss",val:": typing.Optional[torch.FloatTensor] = None"},{name:"prediction_logits",val:": typing.Optional[torch.FloatTensor] = None"},{name:"cross_relationship_score",val:": typing.Optional[torch.FloatTensor] = None"},{name:"question_answering_score",val:": typing.Optional[torch.FloatTensor] = None"},{name:"language_hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"vision_hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"language_attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"vision_attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"cross_encoder_attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"}],parametersDescription:[{anchor:"transformers.models.lxmert.modeling_lxmert.LxmertForPreTrainingOutput.loss",description:`<strong>loss</strong> (<em>optional</em>, returned when <code>labels</code> is provided, <code>torch.FloatTensor</code> of shape <code>(1,)</code>) &#x2014;
Total loss as the sum of the masked language modeling loss and the next sequence prediction
(classification) loss.`,name:"loss"},{anchor:"transformers.models.lxmert.modeling_lxmert.LxmertForPreTrainingOutput.prediction_logits",description:`<strong>prediction_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) &#x2014;
Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).
cross_relationship_score &#x2014; (<code>torch.FloatTensor</code> of shape <code>(batch_size, 2)</code>):
Prediction scores of the textual matching objective (classification) head (scores of True/False
continuation before SoftMax).
question_answering_score &#x2014; (<code>torch.FloatTensor</code> of shape <code>(batch_size, n_qa_answers)</code>):
Prediction scores of question answering objective (classification).`,name:"prediction_logits"},{anchor:"transformers.models.lxmert.modeling_lxmert.LxmertForPreTrainingOutput.language_hidden_states",description:`<strong>language_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for input features + one for the output of each cross-modality layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.`,name:"language_hidden_states"},{anchor:"transformers.models.lxmert.modeling_lxmert.LxmertForPreTrainingOutput.vision_hidden_states",description:`<strong>vision_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for input features + one for the output of each cross-modality layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.`,name:"vision_hidden_states"},{anchor:"transformers.models.lxmert.modeling_lxmert.LxmertForPreTrainingOutput.language_attentions",description:`<strong>language_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.`,name:"language_attentions"},{anchor:"transformers.models.lxmert.modeling_lxmert.LxmertForPreTrainingOutput.vision_attentions",description:`<strong>vision_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.`,name:"vision_attentions"},{anchor:"transformers.models.lxmert.modeling_lxmert.LxmertForPreTrainingOutput.cross_encoder_attentions",description:`<strong>cross_encoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.`,name:"cross_encoder_attentions"}],source:"https://github.com/huggingface/transformers/blob/vr_17548/src/transformers/models/lxmert/modeling_lxmert.py#L147"}}),Zt=new D({props:{name:"class transformers.models.lxmert.modeling_lxmert.LxmertForQuestionAnsweringOutput",anchor:"transformers.models.lxmert.modeling_lxmert.LxmertForQuestionAnsweringOutput",parameters:[{name:"loss",val:": typing.Optional[torch.FloatTensor] = None"},{name:"question_answering_score",val:": typing.Optional[torch.FloatTensor] = None"},{name:"language_hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"vision_hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"language_attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"vision_attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"cross_encoder_attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"}],parametersDescription:[{anchor:"transformers.models.lxmert.modeling_lxmert.LxmertForQuestionAnsweringOutput.loss",description:`<strong>loss</strong> (<em>optional</em>, returned when <code>labels</code> is provided, <code>torch.FloatTensor</code> of shape <code>(1,)</code>) &#x2014;
Total loss as the sum of the masked language modeling loss and the next sequence prediction
(classification) loss.k.
question_answering_score &#x2014; (<code>torch.FloatTensor</code> of shape <code>(batch_size, n_qa_answers)</code>, <em>optional</em>):
Prediction scores of question answering objective (classification).`,name:"loss"},{anchor:"transformers.models.lxmert.modeling_lxmert.LxmertForQuestionAnsweringOutput.language_hidden_states",description:`<strong>language_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for input features + one for the output of each cross-modality layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.`,name:"language_hidden_states"},{anchor:"transformers.models.lxmert.modeling_lxmert.LxmertForQuestionAnsweringOutput.vision_hidden_states",description:`<strong>vision_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for input features + one for the output of each cross-modality layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.`,name:"vision_hidden_states"},{anchor:"transformers.models.lxmert.modeling_lxmert.LxmertForQuestionAnsweringOutput.language_attentions",description:`<strong>language_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.`,name:"language_attentions"},{anchor:"transformers.models.lxmert.modeling_lxmert.LxmertForQuestionAnsweringOutput.vision_attentions",description:`<strong>vision_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.`,name:"vision_attentions"},{anchor:"transformers.models.lxmert.modeling_lxmert.LxmertForQuestionAnsweringOutput.cross_encoder_attentions",description:`<strong>cross_encoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.`,name:"cross_encoder_attentions"}],source:"https://github.com/huggingface/transformers/blob/vr_17548/src/transformers/models/lxmert/modeling_lxmert.py#L107"}}),to=new D({props:{name:"class transformers.models.lxmert.modeling_tf_lxmert.TFLxmertModelOutput",anchor:"transformers.models.lxmert.modeling_tf_lxmert.TFLxmertModelOutput",parameters:[{name:"language_output",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"vision_output",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"pooled_output",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"language_hidden_states",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"},{name:"vision_hidden_states",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"},{name:"language_attentions",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"},{name:"vision_attentions",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"},{name:"cross_encoder_attentions",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"}],parametersDescription:[{anchor:"transformers.models.lxmert.modeling_tf_lxmert.TFLxmertModelOutput.language_output",description:`<strong>language_output</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) &#x2014;
Sequence of hidden-states at the output of the last layer of the language encoder.`,name:"language_output"},{anchor:"transformers.models.lxmert.modeling_tf_lxmert.TFLxmertModelOutput.vision_output",description:`<strong>vision_output</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) &#x2014;
Sequence of hidden-states at the output of the last layer of the visual encoder.`,name:"vision_output"},{anchor:"transformers.models.lxmert.modeling_tf_lxmert.TFLxmertModelOutput.pooled_output",description:`<strong>pooled_output</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, hidden_size)</code>) &#x2014;
Last layer hidden-state of the first token of the sequence (classification, CLS, token) further processed
by a Linear layer and a Tanh activation function. The Linear`,name:"pooled_output"},{anchor:"transformers.models.lxmert.modeling_tf_lxmert.TFLxmertModelOutput.language_hidden_states",description:`<strong>language_hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for input features + one for the output of each cross-modality layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.`,name:"language_hidden_states"},{anchor:"transformers.models.lxmert.modeling_tf_lxmert.TFLxmertModelOutput.vision_hidden_states",description:`<strong>vision_hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for input features + one for the output of each cross-modality layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.`,name:"vision_hidden_states"},{anchor:"transformers.models.lxmert.modeling_tf_lxmert.TFLxmertModelOutput.language_attentions",description:`<strong>language_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.`,name:"language_attentions"},{anchor:"transformers.models.lxmert.modeling_tf_lxmert.TFLxmertModelOutput.vision_attentions",description:`<strong>vision_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.`,name:"vision_attentions"},{anchor:"transformers.models.lxmert.modeling_tf_lxmert.TFLxmertModelOutput.cross_encoder_attentions",description:`<strong>cross_encoder_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.`,name:"cross_encoder_attentions"}],source:"https://github.com/huggingface/transformers/blob/vr_17548/src/transformers/models/lxmert/modeling_tf_lxmert.py#L52"}}),oo=new D({props:{name:"class transformers.models.lxmert.modeling_tf_lxmert.TFLxmertForPreTrainingOutput",anchor:"transformers.models.lxmert.modeling_tf_lxmert.TFLxmertForPreTrainingOutput",parameters:[{name:"loss",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"prediction_logits",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"cross_relationship_score",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"question_answering_score",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"language_hidden_states",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"},{name:"vision_hidden_states",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"},{name:"language_attentions",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"},{name:"vision_attentions",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"},{name:"cross_encoder_attentions",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"}],parametersDescription:[{anchor:"transformers.models.lxmert.modeling_tf_lxmert.TFLxmertForPreTrainingOutput.loss",description:`<strong>loss</strong> (<em>optional</em>, returned when <code>labels</code> is provided, <code>tf.Tensor</code> of shape <code>(1,)</code>) &#x2014;
Total loss as the sum of the masked language modeling loss and the next sequence prediction
(classification) loss.`,name:"loss"},{anchor:"transformers.models.lxmert.modeling_tf_lxmert.TFLxmertForPreTrainingOutput.prediction_logits",description:`<strong>prediction_logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) &#x2014;
Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).
cross_relationship_score &#x2014; (<code>tf.Tensor</code> of shape <code>(batch_size, 2)</code>):
Prediction scores of the textual matching objective (classification) head (scores of True/False
continuation before SoftMax).
question_answering_score &#x2014; (<code>tf.Tensor</code> of shape <code>(batch_size, n_qa_answers)</code>):
Prediction scores of question answering objective (classification).`,name:"prediction_logits"},{anchor:"transformers.models.lxmert.modeling_tf_lxmert.TFLxmertForPreTrainingOutput.language_hidden_states",description:`<strong>language_hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for input features + one for the output of each cross-modality layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.`,name:"language_hidden_states"},{anchor:"transformers.models.lxmert.modeling_tf_lxmert.TFLxmertForPreTrainingOutput.vision_hidden_states",description:`<strong>vision_hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for input features + one for the output of each cross-modality layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.`,name:"vision_hidden_states"},{anchor:"transformers.models.lxmert.modeling_tf_lxmert.TFLxmertForPreTrainingOutput.language_attentions",description:`<strong>language_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.`,name:"language_attentions"},{anchor:"transformers.models.lxmert.modeling_tf_lxmert.TFLxmertForPreTrainingOutput.vision_attentions",description:`<strong>vision_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.`,name:"vision_attentions"},{anchor:"transformers.models.lxmert.modeling_tf_lxmert.TFLxmertForPreTrainingOutput.cross_encoder_attentions",description:`<strong>cross_encoder_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.`,name:"cross_encoder_attentions"}],source:"https://github.com/huggingface/transformers/blob/vr_17548/src/transformers/models/lxmert/modeling_tf_lxmert.py#L98"}}),ro=new Re({}),so=new D({props:{name:"class transformers.LxmertModel",anchor:"transformers.LxmertModel",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.LxmertModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_17548/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_17548/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/vr_17548/src/transformers/models/lxmert/modeling_lxmert.py#L886"}}),uo=new D({props:{name:"forward",anchor:"transformers.LxmertModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"visual_feats",val:": typing.Optional[torch.FloatTensor] = None"},{name:"visual_pos",val:": typing.Optional[torch.FloatTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"visual_attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.LxmertModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/pr_17548/en/model_doc/lxmert#transformers.LxmertTokenizer">LxmertTokenizer</a>. See <a href="/docs/transformers/pr_17548/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_17548/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>
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_17548/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/vr_17548/src/transformers/models/lxmert/modeling_lxmert.py#L901",returnDescription:`
<p>A <a
  href="/docs/transformers/pr_17548/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_17548/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_17548/en/model_doc/lxmert#transformers.models.lxmert.modeling_lxmert.LxmertModelOutput"
>transformers.models.lxmert.modeling_lxmert.LxmertModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),xt=new Ho({props:{$$slots:{default:[hc]},$$scope:{ctx:q}}}),bt=new ps({props:{anchor:"transformers.LxmertModel.forward.example",$$slots:{default:[pc]},$$scope:{ctx:q}}}),ho=new Re({}),po=new D({props:{name:"class transformers.LxmertForPreTraining",anchor:"transformers.LxmertForPreTraining",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.LxmertForPreTraining.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_17548/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_17548/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/vr_17548/src/transformers/models/lxmert/modeling_lxmert.py#L1025"}}),xo=new D({props:{name:"forward",anchor:"transformers.LxmertForPreTraining.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"visual_feats",val:": typing.Optional[torch.FloatTensor] = None"},{name:"visual_pos",val:": typing.Optional[torch.FloatTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"visual_attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"obj_labels",val:": typing.Union[typing.Dict[str, typing.Tuple[torch.FloatTensor, torch.FloatTensor]], NoneType] = None"},{name:"matched_label",val:": typing.Optional[torch.LongTensor] = None"},{name:"ans",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.LxmertForPreTraining.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/pr_17548/en/model_doc/lxmert#transformers.LxmertTokenizer">LxmertTokenizer</a>. See <a href="/docs/transformers/pr_17548/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_17548/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>
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_17548/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.LxmertForPreTraining.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the masked language modeling loss. Indices should be in <code>[-100, 0, ..., config.vocab_size]</code> (see <code>input_ids</code> docstring) Tokens with indices set to <code>-100</code> are ignored (masked), the
loss is only computed for the tokens with labels in <code>[0, ..., config.vocab_size]</code>
obj_labels &#x2014; (<code>Dict[Str: Tuple[Torch.FloatTensor, Torch.FloatTensor]]</code>, <em>optional</em>):
each key is named after each one of the visual losses and each element of the tuple is of the shape
<code>(batch_size, num_features)</code> and <code>(batch_size, num_features, visual_feature_dim)</code> for each the label id and
the label score respectively`,name:"labels"},{anchor:"transformers.LxmertForPreTraining.forward.matched_label",description:`<strong>matched_label</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the whether or not the text input matches the image (classification) loss. Input
should be a sequence pair (see <code>input_ids</code> docstring) Indices should be in <code>[0, 1]</code>:</p>
<ul>
<li>0 indicates that the sentence does not match the image,</li>
<li>1 indicates that the sentence does match the image.</li>
</ul>`,name:"matched_label"},{anchor:"transformers.LxmertForPreTraining.forward.ans",description:`<strong>ans</strong> (<code>Torch.Tensor</code> of shape <code>(batch_size)</code>, <em>optional</em>) &#x2014;
a one hot representation hof the correct answer <em>optional</em>`,name:"ans"}],source:"https://github.com/huggingface/transformers/blob/vr_17548/src/transformers/models/lxmert/modeling_lxmert.py#L1153",returnDescription:`
<p>A <a
  href="/docs/transformers/pr_17548/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_17548/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_17548/en/model_doc/lxmert#transformers.models.lxmert.modeling_lxmert.LxmertForPreTrainingOutput"
>transformers.models.lxmert.modeling_lxmert.LxmertForPreTrainingOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),yt=new Ho({props:{$$slots:{default:[fc]},$$scope:{ctx:q}}}),bo=new Re({}),wo=new D({props:{name:"class transformers.LxmertForQuestionAnswering",anchor:"transformers.LxmertForQuestionAnswering",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.LxmertForQuestionAnswering.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_17548/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_17548/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/vr_17548/src/transformers/models/lxmert/modeling_lxmert.py#L1292"}}),zo=new D({props:{name:"forward",anchor:"transformers.LxmertForQuestionAnswering.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"visual_feats",val:": typing.Optional[torch.FloatTensor] = None"},{name:"visual_pos",val:": typing.Optional[torch.FloatTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"visual_attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.LxmertForQuestionAnswering.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/pr_17548/en/model_doc/lxmert#transformers.LxmertTokenizer">LxmertTokenizer</a>. See <a href="/docs/transformers/pr_17548/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_17548/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>
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_17548/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.</p>
<p>labels &#x2014; (<code>Torch.Tensor</code> of shape <code>(batch_size)</code>, <em>optional</em>):
A one-hot representation of the correct answer`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/vr_17548/src/transformers/models/lxmert/modeling_lxmert.py#L1385",returnDescription:`
<p>A <a
  href="/docs/transformers/pr_17548/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_17548/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_17548/en/model_doc/lxmert#transformers.models.lxmert.modeling_lxmert.LxmertForQuestionAnsweringOutput"
>transformers.models.lxmert.modeling_lxmert.LxmertForQuestionAnsweringOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Lt=new Ho({props:{$$slots:{default:[gc]},$$scope:{ctx:q}}}),$t=new ps({props:{anchor:"transformers.LxmertForQuestionAnswering.forward.example",$$slots:{default:[_c]},$$scope:{ctx:q}}}),Ft=new ps({props:{anchor:"transformers.LxmertForQuestionAnswering.forward.example-2",$$slots:{default:[vc]},$$scope:{ctx:q}}}),Eo=new Re({}),Mo=new D({props:{name:"class transformers.TFLxmertModel",anchor:"transformers.TFLxmertModel",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFLxmertModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_17548/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_17548/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/vr_17548/src/transformers/models/lxmert/modeling_tf_lxmert.py#L924"}}),Et=new Ho({props:{$$slots:{default:[Tc]},$$scope:{ctx:q}}}),Co=new D({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"}],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_17548/en/model_doc/lxmert#transformers.LxmertTokenizer">LxmertTokenizer</a>. See <a href="/docs/transformers/pr_17548/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/pr_17548/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_17548/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFLxmertModel.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"}],source:"https://github.com/huggingface/transformers/blob/vr_17548/src/transformers/models/lxmert/modeling_tf_lxmert.py#L929",returnDescription:`
<p>A <a
  href="/docs/transformers/pr_17548/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_17548/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_17548/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>
`}}),Mt=new Ho({props:{$$slots:{default:[xc]},$$scope:{ctx:q}}}),qt=new ps({props:{anchor:"transformers.TFLxmertModel.call.example",$$slots:{default:[bc]},$$scope:{ctx:q}}}),No=new Re({}),jo=new D({props:{name:"class transformers.TFLxmertForPreTraining",anchor:"transformers.TFLxmertForPreTraining",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFLxmertForPreTraining.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_17548/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_17548/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/vr_17548/src/transformers/models/lxmert/modeling_tf_lxmert.py#L1165"}}),Ot=new Ho({props:{$$slots:{default:[wc]},$$scope:{ctx:q}}}),Vo=new D({props:{name:"call",anchor:"transformers.TFLxmertForPreTraining.call",parameters:[{name:"input_ids",val:" = None"},{name:"visual_feats",val:" = None"},{name:"visual_pos",val:" = None"},{name:"attention_mask",val:" = None"},{name:"visual_attention_mask",val:" = None"},{name:"token_type_ids",val:" = None"},{name:"inputs_embeds",val:" = None"},{name:"masked_lm_labels",val:" = None"},{name:"obj_labels",val:" = None"},{name:"matched_label",val:" = None"},{name:"ans",val:" = None"},{name:"output_attentions",val:" = None"},{name:"output_hidden_states",val:" = None"},{name:"return_dict",val:" = None"},{name:"training",val:" = False"}],parametersDescription:[{anchor:"transformers.TFLxmertForPreTraining.call.input_ids",description:`<strong>input_ids</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/pr_17548/en/model_doc/lxmert#transformers.LxmertTokenizer">LxmertTokenizer</a>. See <a href="/docs/transformers/pr_17548/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/pr_17548/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_17548/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFLxmertForPreTraining.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"},{anchor:"transformers.TFLxmertForPreTraining.call.masked_lm_labels",description:`<strong>masked_lm_labels</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the masked language modeling loss. Indices should be in <code>[-100, 0, ..., config.vocab_size]</code> (see <code>input_ids</code> docstring) Tokens with indices set to <code>-100</code> are ignored (masked), the
loss is only computed for the tokens with labels in <code>[0, ..., config.vocab_size]</code>
obj_labels &#x2014; (<code>Dict[Str: Tuple[tf.Tensor, tf.Tensor]]</code>, <em>optional</em>, defaults to <code>None</code>):
each key is named after each one of the visual losses and each element of the tuple is of the shape
<code>(batch_size, num_features)</code> and <code>(batch_size, num_features, visual_feature_dim)</code> for each the label id and
the label score respectively`,name:"masked_lm_labels"},{anchor:"transformers.TFLxmertForPreTraining.call.matched_label",description:`<strong>matched_label</strong> (<code>tf.Tensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the whether or not the text input matches the image (classification) loss. Input
should be a sequence pair (see <code>input_ids</code> docstring) Indices should be in <code>[0, 1]</code>:</p>
<ul>
<li>0 indicates that the sentence does not match the image,</li>
<li>1 indicates that the sentence does match the image.</li>
</ul>`,name:"matched_label"},{anchor:"transformers.TFLxmertForPreTraining.call.ans",description:`<strong>ans</strong> (<code>Torch.Tensor</code> of shape <code>(batch_size)</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
a one hot representation hof the correct answer <em>optional</em>`,name:"ans"}],source:"https://github.com/huggingface/transformers/blob/vr_17548/src/transformers/models/lxmert/modeling_tf_lxmert.py#L1265",returnDescription:`
<p>A <a
  href="/docs/transformers/pr_17548/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_17548/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_17548/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>
`}}),At=new Ho({props:{$$slots:{default:[yc]},$$scope:{ctx:q}}}),{c(){m=n("meta"),x=d(),f=n("h1"),g=n("a"),T=n("span"),b(u.$$.fragment),_=d(),z=n("span"),Fe=a("LXMERT"),re=d(),E=n("h2"),Y=n("a"),R=n("span"),b(ee.$$.fragment),ze=d(),S=n("span"),Ee=a("Overview"),_e=d(),N=n("p"),Q=a("The LXMERT model was proposed in "),te=n("a"),de=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.`),O=d(),se=n("p"),oe=a("The abstract from the paper is the following:"),ve=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`),Te=d(),P=n("p"),qe=a("Tips:"),Z=d(),j=n("ul"),ce=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(),me=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.`),Oe=d(),X=n("li"),Ae=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.`),v=d(),F=n("p"),ue=a("This model was contributed by "),he=n("a"),Xe=a("eltoto1219"),B=a(". The original code can be found "),pe=n("a"),Be=a("here"),He=a("."),I=d(),A=n("h2"),ie=n("a"),Ce=n("span"),b(C.$$.fragment),Ge=d(),Ne=n("span"),je=a("LxmertConfig"),Se=d(),Ie=n("div"),b(Rt.$$.fragment),_s=d(),De=n("p"),vs=a("This is the configuration class to store the configuration of a "),Go=n("a"),Ts=a("LxmertModel"),xs=a(" or a "),Uo=n("a"),bs=a("TFLxmertModel"),ws=a(`. It is used
to instantiate a LXMERT model according to the specified arguments, defining the model architecture. Instantiating
a configuration with the defaults will yield a similar configuration to that of the Lxmert
`),St=n("a"),ys=a("unc-nlp/lxmert-base-uncased"),ks=a(" architecture."),Ls=d(),Ue=n("p"),$s=a("Configuration objects inherit from "),Ko=n("a"),Fs=a("PretrainedConfig"),zs=a(` and can be used to control the model outputs. Read the
documentation from `),Jo=n("a"),Es=a("PretrainedConfig"),Ms=a(" for more information."),hr=d(),Ke=n("h2"),pt=n("a"),Fn=n("span"),b(Qt.$$.fragment),qs=d(),zn=n("span"),Ps=a("LxmertTokenizer"),pr=d(),fe=n("div"),b(Vt.$$.fragment),Os=d(),En=n("p"),As=a("Construct an LXMERT tokenizer."),Cs=d(),ft=n("p"),Yo=n("a"),Ns=a("LxmertTokenizer"),js=a(" is identical to "),Zo=n("a"),Is=a("BertTokenizer"),Ds=a(` and runs end-to-end tokenization: punctuation splitting and
wordpiece.`),Rs=d(),Wt=n("p"),Ss=a("Refer to superclass "),en=n("a"),Qs=a("BertTokenizer"),Vs=a(" for usage examples and documentation concerning parameters."),fr=d(),Je=n("h2"),gt=n("a"),Mn=n("span"),b(Xt.$$.fragment),Ws=d(),qn=n("span"),Xs=a("LxmertTokenizerFast"),gr=d(),ge=n("div"),b(Bt.$$.fragment),Bs=d(),Ht=n("p"),Hs=a("Construct a \u201Cfast\u201D LXMERT tokenizer (backed by HuggingFace\u2019s "),Pn=n("em"),Gs=a("tokenizers"),Us=a(" library)."),Ks=d(),_t=n("p"),tn=n("a"),Js=a("LxmertTokenizerFast"),Ys=a(" is identical to "),on=n("a"),Zs=a("BertTokenizerFast"),ea=a(` and runs end-to-end tokenization: punctuation
splitting and wordpiece.`),ta=d(),Gt=n("p"),oa=a("Refer to superclass "),nn=n("a"),na=a("BertTokenizerFast"),ra=a(" for usage examples and documentation concerning parameters."),_r=d(),Ye=n("h2"),vt=n("a"),On=n("span"),b(Ut.$$.fragment),sa=d(),An=n("span"),aa=a("Lxmert specific outputs"),vr=d(),Ze=n("div"),b(Kt.$$.fragment),ia=d(),Cn=n("p"),la=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(),et=n("div"),b(Jt.$$.fragment),da=d(),Yt=n("p"),ca=a("Output type of "),rn=n("a"),ma=a("LxmertForPreTraining"),ua=a("."),xr=d(),tt=n("div"),b(Zt.$$.fragment),ha=d(),eo=n("p"),pa=a("Output type of "),sn=n("a"),fa=a("LxmertForQuestionAnswering"),ga=a("."),br=d(),ot=n("div"),b(to.$$.fragment),_a=d(),Nn=n("p"),va=a(`Lxmert\u2019s outputs that contain the last hidden states, pooled outputs, and attention probabilities for the language,
visual, and, cross-modality encoders. (note: the visual encoder in Lxmert is referred to as the \u201Crelation-ship\u201D
encoder\u201D)`),wr=d(),nt=n("div"),b(oo.$$.fragment),Ta=d(),no=n("p"),xa=a("Output type of "),an=n("a"),ba=a("LxmertForPreTraining"),wa=a("."),yr=d(),rt=n("h2"),Tt=n("a"),jn=n("span"),b(ro.$$.fragment),ya=d(),In=n("span"),ka=a("LxmertModel"),kr=d(),H=n("div"),b(so.$$.fragment),La=d(),Dn=n("p"),$a=a("The bare Lxmert Model transformer outputting raw hidden-states without any specific head on top."),Fa=d(),ao=n("p"),za=a("The LXMERT model was proposed in "),io=n("a"),Ea=a(`LXMERT: Learning Cross-Modality Encoder Representations from
Transformers`),Ma=a(` by Hao Tan and Mohit Bansal. It\u2019s a vision and language transformer
model, pretrained on a variety of multi-modal datasets comprising of GQA, VQAv2.0, MSCOCO captions, and Visual
genome, using a combination of masked language modeling, region of interest feature regression, cross entropy loss
for question answering attribute prediction, and object tag prediction.`),qa=d(),lo=n("p"),Pa=a("This model inherits from "),ln=n("a"),Oa=a("PreTrainedModel"),Aa=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.)`),Ca=d(),co=n("p"),Na=a("This model is also a PyTorch "),mo=n("a"),ja=a("torch.nn.Module"),Ia=a(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Da=d(),xe=n("div"),b(uo.$$.fragment),Ra=d(),st=n("p"),Sa=a("The "),dn=n("a"),Qa=a("LxmertModel"),Va=a(" forward method, overrides the "),Rn=n("code"),Wa=a("__call__"),Xa=a(" special method."),Ba=d(),b(xt.$$.fragment),Ha=d(),b(bt.$$.fragment),Lr=d(),at=n("h2"),wt=n("a"),Sn=n("span"),b(ho.$$.fragment),Ga=d(),Qn=n("span"),Ua=a("LxmertForPreTraining"),$r=d(),G=n("div"),b(po.$$.fragment),Ka=d(),Vn=n("p"),Ja=a("Lxmert Model with a specified pretraining head on top."),Ya=d(),fo=n("p"),Za=a("The LXMERT model was proposed in "),go=n("a"),ei=a(`LXMERT: Learning Cross-Modality Encoder Representations from
Transformers`),ti=a(` by Hao Tan and Mohit Bansal. It\u2019s a vision and language transformer
model, pretrained on a variety of multi-modal datasets comprising of GQA, VQAv2.0, MSCOCO captions, and Visual
genome, using a combination of masked language modeling, region of interest feature regression, cross entropy loss
for question answering attribute prediction, and object tag prediction.`),oi=d(),_o=n("p"),ni=a("This model inherits from "),cn=n("a"),ri=a("PreTrainedModel"),si=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.)`),ai=d(),vo=n("p"),ii=a("This model is also a PyTorch "),To=n("a"),li=a("torch.nn.Module"),di=a(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),ci=d(),Qe=n("div"),b(xo.$$.fragment),mi=d(),it=n("p"),ui=a("The "),mn=n("a"),hi=a("LxmertForPreTraining"),pi=a(" forward method, overrides the "),Wn=n("code"),fi=a("__call__"),gi=a(" special method."),_i=d(),b(yt.$$.fragment),Fr=d(),lt=n("h2"),kt=n("a"),Xn=n("span"),b(bo.$$.fragment),vi=d(),Bn=n("span"),Ti=a("LxmertForQuestionAnswering"),zr=d(),U=n("div"),b(wo.$$.fragment),xi=d(),Hn=n("p"),bi=a("Lxmert Model with a visual-answering head on top for downstream QA tasks"),wi=d(),yo=n("p"),yi=a("The LXMERT model was proposed in "),ko=n("a"),ki=a(`LXMERT: Learning Cross-Modality Encoder Representations from
Transformers`),Li=a(` by Hao Tan and Mohit Bansal. It\u2019s a vision and language transformer
model, pretrained on a variety of multi-modal datasets comprising of GQA, VQAv2.0, MSCOCO captions, and Visual
genome, using a combination of masked language modeling, region of interest feature regression, cross entropy loss
for question answering attribute prediction, and object tag prediction.`),$i=d(),Lo=n("p"),Fi=a("This model inherits from "),un=n("a"),zi=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.)`),Mi=d(),$o=n("p"),qi=a("This model is also a PyTorch "),Fo=n("a"),Pi=a("torch.nn.Module"),Oi=a(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Ai=d(),le=n("div"),b(zo.$$.fragment),Ci=d(),dt=n("p"),Ni=a("The "),hn=n("a"),ji=a("LxmertForQuestionAnswering"),Ii=a(" forward method, overrides the "),Gn=n("code"),Di=a("__call__"),Ri=a(" special method."),Si=d(),b(Lt.$$.fragment),Qi=d(),b($t.$$.fragment),Vi=d(),b(Ft.$$.fragment),Er=d(),ct=n("h2"),zt=n("a"),Un=n("span"),b(Eo.$$.fragment),Wi=d(),Kn=n("span"),Xi=a("TFLxmertModel"),Mr=d(),K=n("div"),b(Mo.$$.fragment),Bi=d(),Jn=n("p"),Hi=a("The bare Lxmert Model transformer outputting raw hidden-states without any specific head on top."),Gi=d(),qo=n("p"),Ui=a("The LXMERT model was proposed in "),Po=n("a"),Ki=a(`LXMERT: Learning Cross-Modality Encoder Representations from
Transformers`),Ji=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.`),Yi=d(),Oo=n("p"),Zi=a("This model is also a "),Ao=n("a"),el=a("tf.keras.Model"),tl=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.`),ol=d(),b(Et.$$.fragment),nl=d(),be=n("div"),b(Co.$$.fragment),rl=d(),mt=n("p"),sl=a("The "),pn=n("a"),al=a("TFLxmertModel"),il=a(" forward method, overrides the "),Yn=n("code"),ll=a("__call__"),dl=a(" special method."),cl=d(),b(Mt.$$.fragment),ml=d(),b(qt.$$.fragment),qr=d(),ut=n("h2"),Pt=n("a"),Zn=n("span"),b(No.$$.fragment),ul=d(),er=n("span"),hl=a("TFLxmertForPreTraining"),Pr=d(),J=n("div"),b(jo.$$.fragment),pl=d(),Io=n("p"),fl=a("Lxmert Model with a "),tr=n("code"),gl=a("language modeling"),_l=a(" head on top."),vl=d(),Do=n("p"),Tl=a("The LXMERT model was proposed in "),Ro=n("a"),xl=a(`LXMERT: Learning Cross-Modality Encoder Representations from
Transformers`),bl=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.`),wl=d(),So=n("p"),yl=a("This model is also a "),Qo=n("a"),kl=a("tf.keras.Model"),Ll=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.`),$l=d(),b(Ot.$$.fragment),Fl=d(),Ve=n("div"),b(Vo.$$.fragment),zl=d(),ht=n("p"),El=a("The "),fn=n("a"),Ml=a("TFLxmertForPreTraining"),ql=a(" forward method, overrides the "),or=n("code"),Pl=a("__call__"),Ol=a(" special method."),Al=d(),b(At.$$.fragment),this.h()},l(o){const p=mc('[data-svelte="svelte-1phssyn"]',document.head);m=r(p,"META",{name:!0,content:!0}),p.forEach(t),x=c(o),f=r(o,"H1",{class:!0});var Wo=s(f);g=r(Wo,"A",{id:!0,class:!0,href:!0});var nr=s(g);T=r(nr,"SPAN",{});var rr=s(T);w(u.$$.fragment,rr),rr.forEach(t),nr.forEach(t),_=c(Wo),z=r(Wo,"SPAN",{});var sr=s(z);Fe=i(sr,"LXMERT"),sr.forEach(t),Wo.forEach(t),re=c(o),E=r(o,"H2",{class:!0});var Xo=s(E);Y=r(Xo,"A",{id:!0,class:!0,href:!0});var ar=s(Y);R=r(ar,"SPAN",{});var ir=s(R);w(ee.$$.fragment,ir),ir.forEach(t),ar.forEach(t),ze=c(Xo),S=r(Xo,"SPAN",{});var lr=s(S);Ee=i(lr,"Overview"),lr.forEach(t),Xo.forEach(t),_e=c(o),N=r(o,"P",{});var Bo=s(N);Q=i(Bo,"The LXMERT model was proposed in "),te=r(Bo,"A",{href:!0,rel:!0});var dr=s(te);de=i(dr,"LXMERT: Learning Cross-Modality Encoder Representations from Transformers"),dr.forEach(t),M=i(Bo,` 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.`),Bo.forEach(t),O=c(o),se=r(o,"P",{});var cr=s(se);oe=i(cr,"The abstract from the paper is the following:"),cr.forEach(t),ve=c(o),ae=r(o,"P",{});var Cl=s(ae);V=r(Cl,"EM",{});var Nl=s(V);Me=i(Nl,`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`),Nl.forEach(t),Cl.forEach(t),Te=c(o),P=r(o,"P",{});var jl=s(P);qe=i(jl,"Tips:"),jl.forEach(t),Z=c(o),j=r(o,"UL",{});var gn=s(j);ce=r(gn,"LI",{});var Il=s(ce);ne=i(Il,`Bounding boxes are not necessary to be used in the visual feature embeddings, any kind of visual-spacial features
will work.`),Il.forEach(t),Pe=c(gn),me=r(gn,"LI",{});var Dl=s(me);W=i(Dl,`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.`),Dl.forEach(t),Oe=c(gn),X=r(gn,"LI",{});var Rl=s(X);Ae=i(Rl,`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.`),Rl.forEach(t),gn.forEach(t),v=c(o),F=r(o,"P",{});var _n=s(F);ue=i(_n,"This model was contributed by "),he=r(_n,"A",{href:!0,rel:!0});var Sl=s(he);Xe=i(Sl,"eltoto1219"),Sl.forEach(t),B=i(_n,". The original code can be found "),pe=r(_n,"A",{href:!0,rel:!0});var Ql=s(pe);Be=i(Ql,"here"),Ql.forEach(t),He=i(_n,"."),_n.forEach(t),I=c(o),A=r(o,"H2",{class:!0});var Ar=s(A);ie=r(Ar,"A",{id:!0,class:!0,href:!0});var Vl=s(ie);Ce=r(Vl,"SPAN",{});var Wl=s(Ce);w(C.$$.fragment,Wl),Wl.forEach(t),Vl.forEach(t),Ge=c(Ar),Ne=r(Ar,"SPAN",{});var Xl=s(Ne);je=i(Xl,"LxmertConfig"),Xl.forEach(t),Ar.forEach(t),Se=c(o),Ie=r(o,"DIV",{class:!0});var vn=s(Ie);w(Rt.$$.fragment,vn),_s=c(vn),De=r(vn,"P",{});var Ct=s(De);vs=i(Ct,"This is the configuration class to store the configuration of a "),Go=r(Ct,"A",{href:!0});var Bl=s(Go);Ts=i(Bl,"LxmertModel"),Bl.forEach(t),xs=i(Ct," or a "),Uo=r(Ct,"A",{href:!0});var Hl=s(Uo);bs=i(Hl,"TFLxmertModel"),Hl.forEach(t),ws=i(Ct,`. It is used
to instantiate a LXMERT model according to the specified arguments, defining the model architecture. Instantiating
a configuration with the defaults will yield a similar configuration to that of the Lxmert
`),St=r(Ct,"A",{href:!0,rel:!0});var Gl=s(St);ys=i(Gl,"unc-nlp/lxmert-base-uncased"),Gl.forEach(t),ks=i(Ct," architecture."),Ct.forEach(t),Ls=c(vn),Ue=r(vn,"P",{});var Tn=s(Ue);$s=i(Tn,"Configuration objects inherit from "),Ko=r(Tn,"A",{href:!0});var Ul=s(Ko);Fs=i(Ul,"PretrainedConfig"),Ul.forEach(t),zs=i(Tn,` and can be used to control the model outputs. Read the
documentation from `),Jo=r(Tn,"A",{href:!0});var Kl=s(Jo);Es=i(Kl,"PretrainedConfig"),Kl.forEach(t),Ms=i(Tn," for more information."),Tn.forEach(t),vn.forEach(t),hr=c(o),Ke=r(o,"H2",{class:!0});var Cr=s(Ke);pt=r(Cr,"A",{id:!0,class:!0,href:!0});var Jl=s(pt);Fn=r(Jl,"SPAN",{});var Yl=s(Fn);w(Qt.$$.fragment,Yl),Yl.forEach(t),Jl.forEach(t),qs=c(Cr),zn=r(Cr,"SPAN",{});var Zl=s(zn);Ps=i(Zl,"LxmertTokenizer"),Zl.forEach(t),Cr.forEach(t),pr=c(o),fe=r(o,"DIV",{class:!0});var Nt=s(fe);w(Vt.$$.fragment,Nt),Os=c(Nt),En=r(Nt,"P",{});var ed=s(En);As=i(ed,"Construct an LXMERT tokenizer."),ed.forEach(t),Cs=c(Nt),ft=r(Nt,"P",{});var mr=s(ft);Yo=r(mr,"A",{href:!0});var td=s(Yo);Ns=i(td,"LxmertTokenizer"),td.forEach(t),js=i(mr," is identical to "),Zo=r(mr,"A",{href:!0});var od=s(Zo);Is=i(od,"BertTokenizer"),od.forEach(t),Ds=i(mr,` and runs end-to-end tokenization: punctuation splitting and
wordpiece.`),mr.forEach(t),Rs=c(Nt),Wt=r(Nt,"P",{});var Nr=s(Wt);Ss=i(Nr,"Refer to superclass "),en=r(Nr,"A",{href:!0});var nd=s(en);Qs=i(nd,"BertTokenizer"),nd.forEach(t),Vs=i(Nr," for usage examples and documentation concerning parameters."),Nr.forEach(t),Nt.forEach(t),fr=c(o),Je=r(o,"H2",{class:!0});var jr=s(Je);gt=r(jr,"A",{id:!0,class:!0,href:!0});var rd=s(gt);Mn=r(rd,"SPAN",{});var sd=s(Mn);w(Xt.$$.fragment,sd),sd.forEach(t),rd.forEach(t),Ws=c(jr),qn=r(jr,"SPAN",{});var ad=s(qn);Xs=i(ad,"LxmertTokenizerFast"),ad.forEach(t),jr.forEach(t),gr=c(o),ge=r(o,"DIV",{class:!0});var jt=s(ge);w(Bt.$$.fragment,jt),Bs=c(jt),Ht=r(jt,"P",{});var Ir=s(Ht);Hs=i(Ir,"Construct a \u201Cfast\u201D LXMERT tokenizer (backed by HuggingFace\u2019s "),Pn=r(Ir,"EM",{});var id=s(Pn);Gs=i(id,"tokenizers"),id.forEach(t),Us=i(Ir," library)."),Ir.forEach(t),Ks=c(jt),_t=r(jt,"P",{});var ur=s(_t);tn=r(ur,"A",{href:!0});var ld=s(tn);Js=i(ld,"LxmertTokenizerFast"),ld.forEach(t),Ys=i(ur," is identical to "),on=r(ur,"A",{href:!0});var dd=s(on);Zs=i(dd,"BertTokenizerFast"),dd.forEach(t),ea=i(ur,` and runs end-to-end tokenization: punctuation
splitting and wordpiece.`),ur.forEach(t),ta=c(jt),Gt=r(jt,"P",{});var Dr=s(Gt);oa=i(Dr,"Refer to superclass "),nn=r(Dr,"A",{href:!0});var cd=s(nn);na=i(cd,"BertTokenizerFast"),cd.forEach(t),ra=i(Dr," for usage examples and documentation concerning parameters."),Dr.forEach(t),jt.forEach(t),_r=c(o),Ye=r(o,"H2",{class:!0});var Rr=s(Ye);vt=r(Rr,"A",{id:!0,class:!0,href:!0});var md=s(vt);On=r(md,"SPAN",{});var ud=s(On);w(Ut.$$.fragment,ud),ud.forEach(t),md.forEach(t),sa=c(Rr),An=r(Rr,"SPAN",{});var hd=s(An);aa=i(hd,"Lxmert specific outputs"),hd.forEach(t),Rr.forEach(t),vr=c(o),Ze=r(o,"DIV",{class:!0});var Sr=s(Ze);w(Kt.$$.fragment,Sr),ia=c(Sr),Cn=r(Sr,"P",{});var pd=s(Cn);la=i(pd,`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)`),pd.forEach(t),Sr.forEach(t),Tr=c(o),et=r(o,"DIV",{class:!0});var Qr=s(et);w(Jt.$$.fragment,Qr),da=c(Qr),Yt=r(Qr,"P",{});var Vr=s(Yt);ca=i(Vr,"Output type of "),rn=r(Vr,"A",{href:!0});var fd=s(rn);ma=i(fd,"LxmertForPreTraining"),fd.forEach(t),ua=i(Vr,"."),Vr.forEach(t),Qr.forEach(t),xr=c(o),tt=r(o,"DIV",{class:!0});var Wr=s(tt);w(Zt.$$.fragment,Wr),ha=c(Wr),eo=r(Wr,"P",{});var Xr=s(eo);pa=i(Xr,"Output type of "),sn=r(Xr,"A",{href:!0});var gd=s(sn);fa=i(gd,"LxmertForQuestionAnswering"),gd.forEach(t),ga=i(Xr,"."),Xr.forEach(t),Wr.forEach(t),br=c(o),ot=r(o,"DIV",{class:!0});var Br=s(ot);w(to.$$.fragment,Br),_a=c(Br),Nn=r(Br,"P",{});var _d=s(Nn);va=i(_d,`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)`),_d.forEach(t),Br.forEach(t),wr=c(o),nt=r(o,"DIV",{class:!0});var Hr=s(nt);w(oo.$$.fragment,Hr),Ta=c(Hr),no=r(Hr,"P",{});var Gr=s(no);xa=i(Gr,"Output type of "),an=r(Gr,"A",{href:!0});var vd=s(an);ba=i(vd,"LxmertForPreTraining"),vd.forEach(t),wa=i(Gr,"."),Gr.forEach(t),Hr.forEach(t),yr=c(o),rt=r(o,"H2",{class:!0});var Ur=s(rt);Tt=r(Ur,"A",{id:!0,class:!0,href:!0});var Td=s(Tt);jn=r(Td,"SPAN",{});var xd=s(jn);w(ro.$$.fragment,xd),xd.forEach(t),Td.forEach(t),ya=c(Ur),In=r(Ur,"SPAN",{});var bd=s(In);ka=i(bd,"LxmertModel"),bd.forEach(t),Ur.forEach(t),kr=c(o),H=r(o,"DIV",{class:!0});var we=s(H);w(so.$$.fragment,we),La=c(we),Dn=r(we,"P",{});var wd=s(Dn);$a=i(wd,"The bare Lxmert Model transformer outputting raw hidden-states without any specific head on top."),wd.forEach(t),Fa=c(we),ao=r(we,"P",{});var Kr=s(ao);za=i(Kr,"The LXMERT model was proposed in "),io=r(Kr,"A",{href:!0,rel:!0});var yd=s(io);Ea=i(yd,`LXMERT: Learning Cross-Modality Encoder Representations from
Transformers`),yd.forEach(t),Ma=i(Kr,` by Hao Tan and Mohit Bansal. It\u2019s a vision and language transformer
model, pretrained on a variety of multi-modal datasets comprising of GQA, VQAv2.0, MSCOCO captions, and Visual
genome, using a combination of masked language modeling, region of interest feature regression, cross entropy loss
for question answering attribute prediction, and object tag prediction.`),Kr.forEach(t),qa=c(we),lo=r(we,"P",{});var Jr=s(lo);Pa=i(Jr,"This model inherits from "),ln=r(Jr,"A",{href:!0});var kd=s(ln);Oa=i(kd,"PreTrainedModel"),kd.forEach(t),Aa=i(Jr,`. 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.)`),Jr.forEach(t),Ca=c(we),co=r(we,"P",{});var Yr=s(co);Na=i(Yr,"This model is also a PyTorch "),mo=r(Yr,"A",{href:!0,rel:!0});var Ld=s(mo);ja=i(Ld,"torch.nn.Module"),Ld.forEach(t),Ia=i(Yr,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Yr.forEach(t),Da=c(we),xe=r(we,"DIV",{class:!0});var It=s(xe);w(uo.$$.fragment,It),Ra=c(It),st=r(It,"P",{});var xn=s(st);Sa=i(xn,"The "),dn=r(xn,"A",{href:!0});var $d=s(dn);Qa=i($d,"LxmertModel"),$d.forEach(t),Va=i(xn," forward method, overrides the "),Rn=r(xn,"CODE",{});var Fd=s(Rn);Wa=i(Fd,"__call__"),Fd.forEach(t),Xa=i(xn," special method."),xn.forEach(t),Ba=c(It),w(xt.$$.fragment,It),Ha=c(It),w(bt.$$.fragment,It),It.forEach(t),we.forEach(t),Lr=c(o),at=r(o,"H2",{class:!0});var Zr=s(at);wt=r(Zr,"A",{id:!0,class:!0,href:!0});var zd=s(wt);Sn=r(zd,"SPAN",{});var Ed=s(Sn);w(ho.$$.fragment,Ed),Ed.forEach(t),zd.forEach(t),Ga=c(Zr),Qn=r(Zr,"SPAN",{});var Md=s(Qn);Ua=i(Md,"LxmertForPreTraining"),Md.forEach(t),Zr.forEach(t),$r=c(o),G=r(o,"DIV",{class:!0});var ye=s(G);w(po.$$.fragment,ye),Ka=c(ye),Vn=r(ye,"P",{});var qd=s(Vn);Ja=i(qd,"Lxmert Model with a specified pretraining head on top."),qd.forEach(t),Ya=c(ye),fo=r(ye,"P",{});var es=s(fo);Za=i(es,"The LXMERT model was proposed in "),go=r(es,"A",{href:!0,rel:!0});var Pd=s(go);ei=i(Pd,`LXMERT: Learning Cross-Modality Encoder Representations from
Transformers`),Pd.forEach(t),ti=i(es,` by Hao Tan and Mohit Bansal. It\u2019s a vision and language transformer
model, pretrained on a variety of multi-modal datasets comprising of GQA, VQAv2.0, MSCOCO captions, and Visual
genome, using a combination of masked language modeling, region of interest feature regression, cross entropy loss
for question answering attribute prediction, and object tag prediction.`),es.forEach(t),oi=c(ye),_o=r(ye,"P",{});var ts=s(_o);ni=i(ts,"This model inherits from "),cn=r(ts,"A",{href:!0});var Od=s(cn);ri=i(Od,"PreTrainedModel"),Od.forEach(t),si=i(ts,`. 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.)`),ts.forEach(t),ai=c(ye),vo=r(ye,"P",{});var os=s(vo);ii=i(os,"This model is also a PyTorch "),To=r(os,"A",{href:!0,rel:!0});var Ad=s(To);li=i(Ad,"torch.nn.Module"),Ad.forEach(t),di=i(os,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),os.forEach(t),ci=c(ye),Qe=r(ye,"DIV",{class:!0});var bn=s(Qe);w(xo.$$.fragment,bn),mi=c(bn),it=r(bn,"P",{});var wn=s(it);ui=i(wn,"The "),mn=r(wn,"A",{href:!0});var Cd=s(mn);hi=i(Cd,"LxmertForPreTraining"),Cd.forEach(t),pi=i(wn," forward method, overrides the "),Wn=r(wn,"CODE",{});var Nd=s(Wn);fi=i(Nd,"__call__"),Nd.forEach(t),gi=i(wn," special method."),wn.forEach(t),_i=c(bn),w(yt.$$.fragment,bn),bn.forEach(t),ye.forEach(t),Fr=c(o),lt=r(o,"H2",{class:!0});var ns=s(lt);kt=r(ns,"A",{id:!0,class:!0,href:!0});var jd=s(kt);Xn=r(jd,"SPAN",{});var Id=s(Xn);w(bo.$$.fragment,Id),Id.forEach(t),jd.forEach(t),vi=c(ns),Bn=r(ns,"SPAN",{});var Dd=s(Bn);Ti=i(Dd,"LxmertForQuestionAnswering"),Dd.forEach(t),ns.forEach(t),zr=c(o),U=r(o,"DIV",{class:!0});var ke=s(U);w(wo.$$.fragment,ke),xi=c(ke),Hn=r(ke,"P",{});var Rd=s(Hn);bi=i(Rd,"Lxmert Model with a visual-answering head on top for downstream QA tasks"),Rd.forEach(t),wi=c(ke),yo=r(ke,"P",{});var rs=s(yo);yi=i(rs,"The LXMERT model was proposed in "),ko=r(rs,"A",{href:!0,rel:!0});var Sd=s(ko);ki=i(Sd,`LXMERT: Learning Cross-Modality Encoder Representations from
Transformers`),Sd.forEach(t),Li=i(rs,` by Hao Tan and Mohit Bansal. It\u2019s a vision and language transformer
model, pretrained on a variety of multi-modal datasets comprising of GQA, VQAv2.0, MSCOCO captions, and Visual
genome, using a combination of masked language modeling, region of interest feature regression, cross entropy loss
for question answering attribute prediction, and object tag prediction.`),rs.forEach(t),$i=c(ke),Lo=r(ke,"P",{});var ss=s(Lo);Fi=i(ss,"This model inherits from "),un=r(ss,"A",{href:!0});var Qd=s(un);zi=i(Qd,"PreTrainedModel"),Qd.forEach(t),Ei=i(ss,`. 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.)`),ss.forEach(t),Mi=c(ke),$o=r(ke,"P",{});var as=s($o);qi=i(as,"This model is also a PyTorch "),Fo=r(as,"A",{href:!0,rel:!0});var Vd=s(Fo);Pi=i(Vd,"torch.nn.Module"),Vd.forEach(t),Oi=i(as,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),as.forEach(t),Ai=c(ke),le=r(ke,"DIV",{class:!0});var We=s(le);w(zo.$$.fragment,We),Ci=c(We),dt=r(We,"P",{});var yn=s(dt);Ni=i(yn,"The "),hn=r(yn,"A",{href:!0});var Wd=s(hn);ji=i(Wd,"LxmertForQuestionAnswering"),Wd.forEach(t),Ii=i(yn," forward method, overrides the "),Gn=r(yn,"CODE",{});var Xd=s(Gn);Di=i(Xd,"__call__"),Xd.forEach(t),Ri=i(yn," special method."),yn.forEach(t),Si=c(We),w(Lt.$$.fragment,We),Qi=c(We),w($t.$$.fragment,We),Vi=c(We),w(Ft.$$.fragment,We),We.forEach(t),ke.forEach(t),Er=c(o),ct=r(o,"H2",{class:!0});var is=s(ct);zt=r(is,"A",{id:!0,class:!0,href:!0});var Bd=s(zt);Un=r(Bd,"SPAN",{});var Hd=s(Un);w(Eo.$$.fragment,Hd),Hd.forEach(t),Bd.forEach(t),Wi=c(is),Kn=r(is,"SPAN",{});var Gd=s(Kn);Xi=i(Gd,"TFLxmertModel"),Gd.forEach(t),is.forEach(t),Mr=c(o),K=r(o,"DIV",{class:!0});var Le=s(K);w(Mo.$$.fragment,Le),Bi=c(Le),Jn=r(Le,"P",{});var Ud=s(Jn);Hi=i(Ud,"The bare Lxmert Model transformer outputting raw hidden-states without any specific head on top."),Ud.forEach(t),Gi=c(Le),qo=r(Le,"P",{});var ls=s(qo);Ui=i(ls,"The LXMERT model was proposed in "),Po=r(ls,"A",{href:!0,rel:!0});var Kd=s(Po);Ki=i(Kd,`LXMERT: Learning Cross-Modality Encoder Representations from
Transformers`),Kd.forEach(t),Ji=i(ls,` 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.`),ls.forEach(t),Yi=c(Le),Oo=r(Le,"P",{});var ds=s(Oo);Zi=i(ds,"This model is also a "),Ao=r(ds,"A",{href:!0,rel:!0});var Jd=s(Ao);el=i(Jd,"tf.keras.Model"),Jd.forEach(t),tl=i(ds,` 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.`),ds.forEach(t),ol=c(Le),w(Et.$$.fragment,Le),nl=c(Le),be=r(Le,"DIV",{class:!0});var Dt=s(be);w(Co.$$.fragment,Dt),rl=c(Dt),mt=r(Dt,"P",{});var kn=s(mt);sl=i(kn,"The "),pn=r(kn,"A",{href:!0});var Yd=s(pn);al=i(Yd,"TFLxmertModel"),Yd.forEach(t),il=i(kn," forward method, overrides the "),Yn=r(kn,"CODE",{});var Zd=s(Yn);ll=i(Zd,"__call__"),Zd.forEach(t),dl=i(kn," special method."),kn.forEach(t),cl=c(Dt),w(Mt.$$.fragment,Dt),ml=c(Dt),w(qt.$$.fragment,Dt),Dt.forEach(t),Le.forEach(t),qr=c(o),ut=r(o,"H2",{class:!0});var cs=s(ut);Pt=r(cs,"A",{id:!0,class:!0,href:!0});var ec=s(Pt);Zn=r(ec,"SPAN",{});var tc=s(Zn);w(No.$$.fragment,tc),tc.forEach(t),ec.forEach(t),ul=c(cs),er=r(cs,"SPAN",{});var oc=s(er);hl=i(oc,"TFLxmertForPreTraining"),oc.forEach(t),cs.forEach(t),Pr=c(o),J=r(o,"DIV",{class:!0});var $e=s(J);w(jo.$$.fragment,$e),pl=c($e),Io=r($e,"P",{});var ms=s(Io);fl=i(ms,"Lxmert Model with a "),tr=r(ms,"CODE",{});var nc=s(tr);gl=i(nc,"language modeling"),nc.forEach(t),_l=i(ms," head on top."),ms.forEach(t),vl=c($e),Do=r($e,"P",{});var us=s(Do);Tl=i(us,"The LXMERT model was proposed in "),Ro=r(us,"A",{href:!0,rel:!0});var rc=s(Ro);xl=i(rc,`LXMERT: Learning Cross-Modality Encoder Representations from
Transformers`),rc.forEach(t),bl=i(us,` 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.`),us.forEach(t),wl=c($e),So=r($e,"P",{});var hs=s(So);yl=i(hs,"This model is also a "),Qo=r(hs,"A",{href:!0,rel:!0});var sc=s(Qo);kl=i(sc,"tf.keras.Model"),sc.forEach(t),Ll=i(hs,` 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.`),hs.forEach(t),$l=c($e),w(Ot.$$.fragment,$e),Fl=c($e),Ve=r($e,"DIV",{class:!0});var Ln=s(Ve);w(Vo.$$.fragment,Ln),zl=c(Ln),ht=r(Ln,"P",{});var $n=s(ht);El=i($n,"The "),fn=r($n,"A",{href:!0});var ac=s(fn);Ml=i(ac,"TFLxmertForPreTraining"),ac.forEach(t),ql=i($n," forward method, overrides the "),or=r($n,"CODE",{});var ic=s(or);Pl=i(ic,"__call__"),ic.forEach(t),Ol=i($n," special method."),$n.forEach(t),Al=c(Ln),w(At.$$.fragment,Ln),Ln.forEach(t),$e.forEach(t),this.h()},h(){l(m,"name","hf:doc:metadata"),l(m,"content",JSON.stringify(Lc)),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(he,"href","https://huggingface.co/eltoto1219"),l(he,"rel","nofollow"),l(pe,"href","https://github.com/airsplay/lxmert"),l(pe,"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(Go,"href","/docs/transformers/pr_17548/en/model_doc/lxmert#transformers.LxmertModel"),l(Uo,"href","/docs/transformers/pr_17548/en/model_doc/lxmert#transformers.TFLxmertModel"),l(St,"href","https://huggingface.co/unc-nlp/lxmert-base-uncased"),l(St,"rel","nofollow"),l(Ko,"href","/docs/transformers/pr_17548/en/main_classes/configuration#transformers.PretrainedConfig"),l(Jo,"href","/docs/transformers/pr_17548/en/main_classes/configuration#transformers.PretrainedConfig"),l(Ie,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(pt,"id","transformers.LxmertTokenizer"),l(pt,"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(pt,"href","#transformers.LxmertTokenizer"),l(Ke,"class","relative group"),l(Yo,"href","/docs/transformers/pr_17548/en/model_doc/lxmert#transformers.LxmertTokenizer"),l(Zo,"href","/docs/transformers/pr_17548/en/model_doc/bert#transformers.BertTokenizer"),l(en,"href","/docs/transformers/pr_17548/en/model_doc/bert#transformers.BertTokenizer"),l(fe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(gt,"id","transformers.LxmertTokenizerFast"),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.LxmertTokenizerFast"),l(Je,"class","relative group"),l(tn,"href","/docs/transformers/pr_17548/en/model_doc/lxmert#transformers.LxmertTokenizerFast"),l(on,"href","/docs/transformers/pr_17548/en/model_doc/bert#transformers.BertTokenizerFast"),l(nn,"href","/docs/transformers/pr_17548/en/model_doc/bert#transformers.BertTokenizerFast"),l(ge,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(vt,"id","transformers.models.lxmert.modeling_lxmert.LxmertModelOutput"),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.models.lxmert.modeling_lxmert.LxmertModelOutput"),l(Ye,"class","relative group"),l(Ze,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(rn,"href","/docs/transformers/pr_17548/en/model_doc/lxmert#transformers.LxmertForPreTraining"),l(et,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(sn,"href","/docs/transformers/pr_17548/en/model_doc/lxmert#transformers.LxmertForQuestionAnswering"),l(tt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(ot,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(an,"href","/docs/transformers/pr_17548/en/model_doc/lxmert#transformers.LxmertForPreTraining"),l(nt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Tt,"id","transformers.LxmertModel"),l(Tt,"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(Tt,"href","#transformers.LxmertModel"),l(rt,"class","relative group"),l(io,"href","https://arxiv.org/abs/1908.07490"),l(io,"rel","nofollow"),l(ln,"href","/docs/transformers/pr_17548/en/main_classes/model#transformers.PreTrainedModel"),l(mo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(mo,"rel","nofollow"),l(dn,"href","/docs/transformers/pr_17548/en/model_doc/lxmert#transformers.LxmertModel"),l(xe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(wt,"id","transformers.LxmertForPreTraining"),l(wt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(wt,"href","#transformers.LxmertForPreTraining"),l(at,"class","relative group"),l(go,"href","https://arxiv.org/abs/1908.07490"),l(go,"rel","nofollow"),l(cn,"href","/docs/transformers/pr_17548/en/main_classes/model#transformers.PreTrainedModel"),l(To,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(To,"rel","nofollow"),l(mn,"href","/docs/transformers/pr_17548/en/model_doc/lxmert#transformers.LxmertForPreTraining"),l(Qe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(kt,"id","transformers.LxmertForQuestionAnswering"),l(kt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(kt,"href","#transformers.LxmertForQuestionAnswering"),l(lt,"class","relative group"),l(ko,"href","https://arxiv.org/abs/1908.07490"),l(ko,"rel","nofollow"),l(un,"href","/docs/transformers/pr_17548/en/main_classes/model#transformers.PreTrainedModel"),l(Fo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(Fo,"rel","nofollow"),l(hn,"href","/docs/transformers/pr_17548/en/model_doc/lxmert#transformers.LxmertForQuestionAnswering"),l(le,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(zt,"id","transformers.TFLxmertModel"),l(zt,"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(zt,"href","#transformers.TFLxmertModel"),l(ct,"class","relative group"),l(Po,"href","https://arxiv.org/abs/1908.07490"),l(Po,"rel","nofollow"),l(Ao,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),l(Ao,"rel","nofollow"),l(pn,"href","/docs/transformers/pr_17548/en/model_doc/lxmert#transformers.TFLxmertModel"),l(be,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(K,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Pt,"id","transformers.TFLxmertForPreTraining"),l(Pt,"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(Pt,"href","#transformers.TFLxmertForPreTraining"),l(ut,"class","relative group"),l(Ro,"href","https://arxiv.org/abs/1908.07490"),l(Ro,"rel","nofollow"),l(Qo,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),l(Qo,"rel","nofollow"),l(fn,"href","/docs/transformers/pr_17548/en/model_doc/lxmert#transformers.TFLxmertForPreTraining"),l(Ve,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(o,p){e(document.head,m),h(o,x,p),h(o,f,p),e(f,g),e(g,T),y(u,T,null),e(f,_),e(f,z),e(z,Fe),h(o,re,p),h(o,E,p),e(E,Y),e(Y,R),y(ee,R,null),e(E,ze),e(E,S),e(S,Ee),h(o,_e,p),h(o,N,p),e(N,Q),e(N,te),e(te,de),e(N,M),h(o,O,p),h(o,se,p),e(se,oe),h(o,ve,p),h(o,ae,p),e(ae,V),e(V,Me),h(o,Te,p),h(o,P,p),e(P,qe),h(o,Z,p),h(o,j,p),e(j,ce),e(ce,ne),e(j,Pe),e(j,me),e(me,W),e(j,Oe),e(j,X),e(X,Ae),h(o,v,p),h(o,F,p),e(F,ue),e(F,he),e(he,Xe),e(F,B),e(F,pe),e(pe,Be),e(F,He),h(o,I,p),h(o,A,p),e(A,ie),e(ie,Ce),y(C,Ce,null),e(A,Ge),e(A,Ne),e(Ne,je),h(o,Se,p),h(o,Ie,p),y(Rt,Ie,null),e(Ie,_s),e(Ie,De),e(De,vs),e(De,Go),e(Go,Ts),e(De,xs),e(De,Uo),e(Uo,bs),e(De,ws),e(De,St),e(St,ys),e(De,ks),e(Ie,Ls),e(Ie,Ue),e(Ue,$s),e(Ue,Ko),e(Ko,Fs),e(Ue,zs),e(Ue,Jo),e(Jo,Es),e(Ue,Ms),h(o,hr,p),h(o,Ke,p),e(Ke,pt),e(pt,Fn),y(Qt,Fn,null),e(Ke,qs),e(Ke,zn),e(zn,Ps),h(o,pr,p),h(o,fe,p),y(Vt,fe,null),e(fe,Os),e(fe,En),e(En,As),e(fe,Cs),e(fe,ft),e(ft,Yo),e(Yo,Ns),e(ft,js),e(ft,Zo),e(Zo,Is),e(ft,Ds),e(fe,Rs),e(fe,Wt),e(Wt,Ss),e(Wt,en),e(en,Qs),e(Wt,Vs),h(o,fr,p),h(o,Je,p),e(Je,gt),e(gt,Mn),y(Xt,Mn,null),e(Je,Ws),e(Je,qn),e(qn,Xs),h(o,gr,p),h(o,ge,p),y(Bt,ge,null),e(ge,Bs),e(ge,Ht),e(Ht,Hs),e(Ht,Pn),e(Pn,Gs),e(Ht,Us),e(ge,Ks),e(ge,_t),e(_t,tn),e(tn,Js),e(_t,Ys),e(_t,on),e(on,Zs),e(_t,ea),e(ge,ta),e(ge,Gt),e(Gt,oa),e(Gt,nn),e(nn,na),e(Gt,ra),h(o,_r,p),h(o,Ye,p),e(Ye,vt),e(vt,On),y(Ut,On,null),e(Ye,sa),e(Ye,An),e(An,aa),h(o,vr,p),h(o,Ze,p),y(Kt,Ze,null),e(Ze,ia),e(Ze,Cn),e(Cn,la),h(o,Tr,p),h(o,et,p),y(Jt,et,null),e(et,da),e(et,Yt),e(Yt,ca),e(Yt,rn),e(rn,ma),e(Yt,ua),h(o,xr,p),h(o,tt,p),y(Zt,tt,null),e(tt,ha),e(tt,eo),e(eo,pa),e(eo,sn),e(sn,fa),e(eo,ga),h(o,br,p),h(o,ot,p),y(to,ot,null),e(ot,_a),e(ot,Nn),e(Nn,va),h(o,wr,p),h(o,nt,p),y(oo,nt,null),e(nt,Ta),e(nt,no),e(no,xa),e(no,an),e(an,ba),e(no,wa),h(o,yr,p),h(o,rt,p),e(rt,Tt),e(Tt,jn),y(ro,jn,null),e(rt,ya),e(rt,In),e(In,ka),h(o,kr,p),h(o,H,p),y(so,H,null),e(H,La),e(H,Dn),e(Dn,$a),e(H,Fa),e(H,ao),e(ao,za),e(ao,io),e(io,Ea),e(ao,Ma),e(H,qa),e(H,lo),e(lo,Pa),e(lo,ln),e(ln,Oa),e(lo,Aa),e(H,Ca),e(H,co),e(co,Na),e(co,mo),e(mo,ja),e(co,Ia),e(H,Da),e(H,xe),y(uo,xe,null),e(xe,Ra),e(xe,st),e(st,Sa),e(st,dn),e(dn,Qa),e(st,Va),e(st,Rn),e(Rn,Wa),e(st,Xa),e(xe,Ba),y(xt,xe,null),e(xe,Ha),y(bt,xe,null),h(o,Lr,p),h(o,at,p),e(at,wt),e(wt,Sn),y(ho,Sn,null),e(at,Ga),e(at,Qn),e(Qn,Ua),h(o,$r,p),h(o,G,p),y(po,G,null),e(G,Ka),e(G,Vn),e(Vn,Ja),e(G,Ya),e(G,fo),e(fo,Za),e(fo,go),e(go,ei),e(fo,ti),e(G,oi),e(G,_o),e(_o,ni),e(_o,cn),e(cn,ri),e(_o,si),e(G,ai),e(G,vo),e(vo,ii),e(vo,To),e(To,li),e(vo,di),e(G,ci),e(G,Qe),y(xo,Qe,null),e(Qe,mi),e(Qe,it),e(it,ui),e(it,mn),e(mn,hi),e(it,pi),e(it,Wn),e(Wn,fi),e(it,gi),e(Qe,_i),y(yt,Qe,null),h(o,Fr,p),h(o,lt,p),e(lt,kt),e(kt,Xn),y(bo,Xn,null),e(lt,vi),e(lt,Bn),e(Bn,Ti),h(o,zr,p),h(o,U,p),y(wo,U,null),e(U,xi),e(U,Hn),e(Hn,bi),e(U,wi),e(U,yo),e(yo,yi),e(yo,ko),e(ko,ki),e(yo,Li),e(U,$i),e(U,Lo),e(Lo,Fi),e(Lo,un),e(un,zi),e(Lo,Ei),e(U,Mi),e(U,$o),e($o,qi),e($o,Fo),e(Fo,Pi),e($o,Oi),e(U,Ai),e(U,le),y(zo,le,null),e(le,Ci),e(le,dt),e(dt,Ni),e(dt,hn),e(hn,ji),e(dt,Ii),e(dt,Gn),e(Gn,Di),e(dt,Ri),e(le,Si),y(Lt,le,null),e(le,Qi),y($t,le,null),e(le,Vi),y(Ft,le,null),h(o,Er,p),h(o,ct,p),e(ct,zt),e(zt,Un),y(Eo,Un,null),e(ct,Wi),e(ct,Kn),e(Kn,Xi),h(o,Mr,p),h(o,K,p),y(Mo,K,null),e(K,Bi),e(K,Jn),e(Jn,Hi),e(K,Gi),e(K,qo),e(qo,Ui),e(qo,Po),e(Po,Ki),e(qo,Ji),e(K,Yi),e(K,Oo),e(Oo,Zi),e(Oo,Ao),e(Ao,el),e(Oo,tl),e(K,ol),y(Et,K,null),e(K,nl),e(K,be),y(Co,be,null),e(be,rl),e(be,mt),e(mt,sl),e(mt,pn),e(pn,al),e(mt,il),e(mt,Yn),e(Yn,ll),e(mt,dl),e(be,cl),y(Mt,be,null),e(be,ml),y(qt,be,null),h(o,qr,p),h(o,ut,p),e(ut,Pt),e(Pt,Zn),y(No,Zn,null),e(ut,ul),e(ut,er),e(er,hl),h(o,Pr,p),h(o,J,p),y(jo,J,null),e(J,pl),e(J,Io),e(Io,fl),e(Io,tr),e(tr,gl),e(Io,_l),e(J,vl),e(J,Do),e(Do,Tl),e(Do,Ro),e(Ro,xl),e(Do,bl),e(J,wl),e(J,So),e(So,yl),e(So,Qo),e(Qo,kl),e(So,Ll),e(J,$l),y(Ot,J,null),e(J,Fl),e(J,Ve),y(Vo,Ve,null),e(Ve,zl),e(Ve,ht),e(ht,El),e(ht,fn),e(fn,Ml),e(ht,ql),e(ht,or),e(or,Pl),e(ht,Ol),e(Ve,Al),y(At,Ve,null),Or=!0},p(o,[p]){const Wo={};p&2&&(Wo.$$scope={dirty:p,ctx:o}),xt.$set(Wo);const nr={};p&2&&(nr.$$scope={dirty:p,ctx:o}),bt.$set(nr);const rr={};p&2&&(rr.$$scope={dirty:p,ctx:o}),yt.$set(rr);const sr={};p&2&&(sr.$$scope={dirty:p,ctx:o}),Lt.$set(sr);const Xo={};p&2&&(Xo.$$scope={dirty:p,ctx:o}),$t.$set(Xo);const ar={};p&2&&(ar.$$scope={dirty:p,ctx:o}),Ft.$set(ar);const ir={};p&2&&(ir.$$scope={dirty:p,ctx:o}),Et.$set(ir);const lr={};p&2&&(lr.$$scope={dirty:p,ctx:o}),Mt.$set(lr);const Bo={};p&2&&(Bo.$$scope={dirty:p,ctx:o}),qt.$set(Bo);const dr={};p&2&&(dr.$$scope={dirty:p,ctx:o}),Ot.$set(dr);const cr={};p&2&&(cr.$$scope={dirty:p,ctx:o}),At.$set(cr)},i(o){Or||(k(u.$$.fragment,o),k(ee.$$.fragment,o),k(C.$$.fragment,o),k(Rt.$$.fragment,o),k(Qt.$$.fragment,o),k(Vt.$$.fragment,o),k(Xt.$$.fragment,o),k(Bt.$$.fragment,o),k(Ut.$$.fragment,o),k(Kt.$$.fragment,o),k(Jt.$$.fragment,o),k(Zt.$$.fragment,o),k(to.$$.fragment,o),k(oo.$$.fragment,o),k(ro.$$.fragment,o),k(so.$$.fragment,o),k(uo.$$.fragment,o),k(xt.$$.fragment,o),k(bt.$$.fragment,o),k(ho.$$.fragment,o),k(po.$$.fragment,o),k(xo.$$.fragment,o),k(yt.$$.fragment,o),k(bo.$$.fragment,o),k(wo.$$.fragment,o),k(zo.$$.fragment,o),k(Lt.$$.fragment,o),k($t.$$.fragment,o),k(Ft.$$.fragment,o),k(Eo.$$.fragment,o),k(Mo.$$.fragment,o),k(Et.$$.fragment,o),k(Co.$$.fragment,o),k(Mt.$$.fragment,o),k(qt.$$.fragment,o),k(No.$$.fragment,o),k(jo.$$.fragment,o),k(Ot.$$.fragment,o),k(Vo.$$.fragment,o),k(At.$$.fragment,o),Or=!0)},o(o){L(u.$$.fragment,o),L(ee.$$.fragment,o),L(C.$$.fragment,o),L(Rt.$$.fragment,o),L(Qt.$$.fragment,o),L(Vt.$$.fragment,o),L(Xt.$$.fragment,o),L(Bt.$$.fragment,o),L(Ut.$$.fragment,o),L(Kt.$$.fragment,o),L(Jt.$$.fragment,o),L(Zt.$$.fragment,o),L(to.$$.fragment,o),L(oo.$$.fragment,o),L(ro.$$.fragment,o),L(so.$$.fragment,o),L(uo.$$.fragment,o),L(xt.$$.fragment,o),L(bt.$$.fragment,o),L(ho.$$.fragment,o),L(po.$$.fragment,o),L(xo.$$.fragment,o),L(yt.$$.fragment,o),L(bo.$$.fragment,o),L(wo.$$.fragment,o),L(zo.$$.fragment,o),L(Lt.$$.fragment,o),L($t.$$.fragment,o),L(Ft.$$.fragment,o),L(Eo.$$.fragment,o),L(Mo.$$.fragment,o),L(Et.$$.fragment,o),L(Co.$$.fragment,o),L(Mt.$$.fragment,o),L(qt.$$.fragment,o),L(No.$$.fragment,o),L(jo.$$.fragment,o),L(Ot.$$.fragment,o),L(Vo.$$.fragment,o),L(At.$$.fragment,o),Or=!1},d(o){t(m),o&&t(x),o&&t(f),$(u),o&&t(re),o&&t(E),$(ee),o&&t(_e),o&&t(N),o&&t(O),o&&t(se),o&&t(ve),o&&t(ae),o&&t(Te),o&&t(P),o&&t(Z),o&&t(j),o&&t(v),o&&t(F),o&&t(I),o&&t(A),$(C),o&&t(Se),o&&t(Ie),$(Rt),o&&t(hr),o&&t(Ke),$(Qt),o&&t(pr),o&&t(fe),$(Vt),o&&t(fr),o&&t(Je),$(Xt),o&&t(gr),o&&t(ge),$(Bt),o&&t(_r),o&&t(Ye),$(Ut),o&&t(vr),o&&t(Ze),$(Kt),o&&t(Tr),o&&t(et),$(Jt),o&&t(xr),o&&t(tt),$(Zt),o&&t(br),o&&t(ot),$(to),o&&t(wr),o&&t(nt),$(oo),o&&t(yr),o&&t(rt),$(ro),o&&t(kr),o&&t(H),$(so),$(uo),$(xt),$(bt),o&&t(Lr),o&&t(at),$(ho),o&&t($r),o&&t(G),$(po),$(xo),$(yt),o&&t(Fr),o&&t(lt),$(bo),o&&t(zr),o&&t(U),$(wo),$(zo),$(Lt),$($t),$(Ft),o&&t(Er),o&&t(ct),$(Eo),o&&t(Mr),o&&t(K),$(Mo),$(Et),$(Co),$(Mt),$(qt),o&&t(qr),o&&t(ut),$(No),o&&t(Pr),o&&t(J),$(jo),$(Ot),$(Vo),$(At)}}}const Lc={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 $c(q){return uc(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Oc extends lc{constructor(m){super();dc(this,m,$c,kc,cc,{})}}export{Oc as default,Lc as metadata};
