import{S as Wu,i as Qu,s as Ku,e as o,k as m,w as u,t,W as x,M as Uu,c as r,d as a,m as p,a as i,x as f,h as n,X as T,b as l,F as s,g as h,y as _,q as v,o as y,B as b}from"../../chunks/vendor-4833417e.js";import{T as Yn}from"../../chunks/Tip-fffd6df1.js";import{D as V}from"../../chunks/Docstring-4f315ed9.js";import{C as ye}from"../../chunks/CodeBlock-6a3d1b46.js";import{I as G}from"../../chunks/IconCopyLink-4b81c553.js";import"../../chunks/CopyButton-dacfbfaf.js";function Bu(J){let d,M,g,z,R;return{c(){d=o("p"),M=t("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=o("code"),z=t("Module"),R=t(`
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(w){d=r(w,"P",{});var k=i(d);M=n(k,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r(k,"CODE",{});var L=i(g);z=n(L,"Module"),L.forEach(a),R=n(k,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),k.forEach(a)},m(w,k){h(w,d,k),s(d,M),s(d,g),s(g,z),s(d,R)},d(w){w&&a(d)}}}function Xu(J){let d,M,g,z,R;return{c(){d=o("p"),M=t("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=o("code"),z=t("Module"),R=t(`
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(w){d=r(w,"P",{});var k=i(d);M=n(k,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r(k,"CODE",{});var L=i(g);z=n(L,"Module"),L.forEach(a),R=n(k,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),k.forEach(a)},m(w,k){h(w,d,k),s(d,M),s(d,g),s(g,z),s(d,R)},d(w){w&&a(d)}}}function Vu(J){let d,M,g,z,R;return{c(){d=o("p"),M=t("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=o("code"),z=t("Module"),R=t(`
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(w){d=r(w,"P",{});var k=i(d);M=n(k,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r(k,"CODE",{});var L=i(g);z=n(L,"Module"),L.forEach(a),R=n(k,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),k.forEach(a)},m(w,k){h(w,d,k),s(d,M),s(d,g),s(g,z),s(d,R)},d(w){w&&a(d)}}}function Gu(J){let d,M,g,z,R;return{c(){d=o("p"),M=t("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=o("code"),z=t("Module"),R=t(`
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(w){d=r(w,"P",{});var k=i(d);M=n(k,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r(k,"CODE",{});var L=i(g);z=n(L,"Module"),L.forEach(a),R=n(k,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),k.forEach(a)},m(w,k){h(w,d,k),s(d,M),s(d,g),s(g,z),s(d,R)},d(w){w&&a(d)}}}function Ju(J){let d,M,g,z,R;return{c(){d=o("p"),M=t("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=o("code"),z=t("Module"),R=t(`
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(w){d=r(w,"P",{});var k=i(d);M=n(k,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r(k,"CODE",{});var L=i(g);z=n(L,"Module"),L.forEach(a),R=n(k,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),k.forEach(a)},m(w,k){h(w,d,k),s(d,M),s(d,g),s(g,z),s(d,R)},d(w){w&&a(d)}}}function Yu(J){let d,M,g,z,R,w,k,L,Ti,Zn,ws,Rt,Mi,Ri,be,$i,qi,so,zs,Bs,$t,ke,Ei,qt,Li,eo,Xs,Fi,we,Pi,Ci,ao,Ka,Ai,to,Ua,Et,ji,no,is,Si,ze,Ni,Di,xe,Hi,Oi,oo,Te,Lt,Ii,Wi,ro,Ba,ls,Qi,Ft,Ki,Ui,Pt,Bi,Xi,Me,Vi,io,xs,Vs,Ct,Re,Gi,At,Ji,lo,$,Yi,$e,Zi,sl,mo,gu='<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>d</mi></mrow><annotation encoding="application/x-tex">d</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em;"></span><span class="mord mathnormal">d</span></span></span></span>',po,jt,el,al,co,uu='<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>i</mi><mo separator="true">,</mo><mo>\u2026</mo><mo separator="true">,</mo><msub><mi>n</mi><mi>s</mi></msub></mrow><annotation encoding="application/x-tex">i, \\ldots, n_s</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.854em;vertical-align:-0.1944em;"></span><span class="mord mathnormal">i</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="minner">\u2026</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord"><span class="mord mathnormal">n</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">s</span></span></span></span><span class="vlist-s">\u200B</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span>',ho,go,fu='<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>n</mi><mi>s</mi></msub></mrow><annotation encoding="application/x-tex">n_s</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.5806em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal">n</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">s</span></span></span></span><span class="vlist-s">\u200B</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span>',uo,St,tl,nl,fo,_u='<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>n</mi><mi>s</mi></msub><mo>=</mo><msup><mn>2</mn><mn>19</mn></msup><mo>\u2248</mo><mn>0.5</mn><mi>M</mi></mrow><annotation encoding="application/x-tex">n_s = 2^{19} \\approx 0.5M</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.5806em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal">n</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">s</span></span></span></span><span class="vlist-s">\u200B</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.8141em;"></span><span class="mord"><span class="mord">2</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8141em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">19</span></span></span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">\u2248</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord">0.5</span><span class="mord mathnormal" style="margin-right:0.10903em;">M</span></span></span></span>',_o,Nt,ol,rl,vo,vu='<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>d</mi><mo>=</mo><msup><mn>2</mn><mn>10</mn></msup><mo>\u2248</mo><mn>1000</mn></mrow><annotation encoding="application/x-tex">d = 2^{10} \\approx 1000</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em;"></span><span class="mord mathnormal">d</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.8141em;"></span><span class="mord"><span class="mord">2</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8141em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">10</span></span></span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">\u2248</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">1000</span></span></span></span>',yo,bo,yu='<span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msub><mi>X</mi><mrow><mi>i</mi><mo separator="true">,</mo><mi>j</mi></mrow></msub><mo separator="true">,</mo><mtext>\xA0with\xA0</mtext><mi>i</mi><mo>\u2208</mo><mrow><mo fence="true">[</mo><mn>1</mn><mo separator="true">,</mo><mo>\u2026</mo><mo separator="true">,</mo><mi>d</mi><mo fence="true">]</mo></mrow><mtext>\xA0and\xA0</mtext><mi>j</mi><mo>\u2208</mo><mrow><mo fence="true">[</mo><mn>1</mn><mo separator="true">,</mo><mo>\u2026</mo><mo separator="true">,</mo><msub><mi>n</mi><mi>s</mi></msub><mo fence="true">]</mo></mrow></mrow><annotation encoding="application/x-tex">X_{i,j}, \\text{ with } i \\in \\left[1,\\ldots, d\\right] \\text{ and } j \\in \\left[1,\\ldots, n_s\\right]</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.9805em;vertical-align:-0.2861em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.07847em;">X</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:-0.0785em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight">i</span><span class="mpunct mtight">,</span><span class="mord mathnormal mtight" style="margin-right:0.05724em;">j</span></span></span></span></span><span class="vlist-s">\u200B</span></span><span class="vlist-r"><span class="vlist" style="height:0.2861em;"><span></span></span></span></span></span></span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord text"><span class="mord">\xA0with\xA0</span></span><span class="mord mathnormal">i</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">\u2208</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="minner"><span class="mopen delimcenter" style="top:0em;">[</span><span class="mord">1</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="minner">\u2026</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord mathnormal">d</span><span class="mclose delimcenter" style="top:0em;">]</span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord text"><span class="mord">\xA0and\xA0</span></span><span class="mord mathnormal" style="margin-right:0.05724em;">j</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">\u2208</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="minner"><span class="mopen delimcenter" style="top:0em;">[</span><span class="mord">1</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="minner">\u2026</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord"><span class="mord mathnormal">n</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">s</span></span></span></span><span class="vlist-s">\u200B</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mclose delimcenter" style="top:0em;">]</span></span></span></span></span></span>',ko,Ts,il,wo,bu='<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>X</mi><mrow><mi>i</mi><mo separator="true">,</mo><mi>j</mi></mrow></msub></mrow><annotation encoding="application/x-tex">X_{i,j}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.9694em;vertical-align:-0.2861em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.07847em;">X</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:-0.0785em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight">i</span><span class="mpunct mtight">,</span><span class="mord mathnormal mtight" style="margin-right:0.05724em;">j</span></span></span></span></span><span class="vlist-s">\u200B</span></span><span class="vlist-r"><span class="vlist" style="height:0.2861em;"><span></span></span></span></span></span></span></span></span></span>',zo,xo,ku='<span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msubsup><mi>X</mi><mrow><mi>i</mi><mo separator="true">,</mo><mi>j</mi></mrow><mn>1</mn></msubsup><mo separator="true">,</mo><mtext>\xA0with\xA0</mtext><mi>i</mi><mo>\u2208</mo><mrow><mo fence="true">[</mo><mn>1</mn><mo separator="true">,</mo><mo>\u2026</mo><mo separator="true">,</mo><msup><mi>d</mi><mn>1</mn></msup><mo fence="true">]</mo></mrow><mtext>\xA0and\xA0</mtext><mi>j</mi><mo>\u2208</mo><mrow><mo fence="true">[</mo><mn>1</mn><mo separator="true">,</mo><mo>\u2026</mo><mo separator="true">,</mo><msubsup><mi>n</mi><mi>s</mi><mn>1</mn></msubsup><mo fence="true">]</mo></mrow></mrow><annotation encoding="application/x-tex">X^{1}_{i,j}, \\text{ with } i \\in \\left[1,\\ldots, d^1\\right] \\text{ and } j \\in \\left[1,\\ldots, n_s^1\\right]</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.2472em;vertical-align:-0.3831em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.07847em;">X</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8641em;"><span style="top:-2.453em;margin-left:-0.0785em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight">i</span><span class="mpunct mtight">,</span><span class="mord mathnormal mtight" style="margin-right:0.05724em;">j</span></span></span></span><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">1</span></span></span></span></span><span class="vlist-s">\u200B</span></span><span class="vlist-r"><span class="vlist" style="height:0.3831em;"><span></span></span></span></span></span></span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord text"><span class="mord">\xA0with\xA0</span></span><span class="mord mathnormal">i</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">\u2208</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1.2141em;vertical-align:-0.35em;"></span><span class="minner"><span class="mopen delimcenter" style="top:0em;"><span class="delimsizing size1">[</span></span><span class="mord">1</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="minner">\u2026</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord"><span class="mord mathnormal">d</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8641em;"><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">1</span></span></span></span></span></span></span></span><span class="mclose delimcenter" style="top:0em;"><span class="delimsizing size1">]</span></span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord text"><span class="mord">\xA0and\xA0</span></span><span class="mord mathnormal" style="margin-right:0.05724em;">j</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">\u2208</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1.2141em;vertical-align:-0.35em;"></span><span class="minner"><span class="mopen delimcenter" style="top:0em;"><span class="delimsizing size1">[</span></span><span class="mord">1</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="minner">\u2026</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord"><span class="mord mathnormal">n</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8641em;"><span style="top:-2.453em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">s</span></span></span><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">1</span></span></span></span><span class="vlist-s">\u200B</span></span><span class="vlist-r"><span class="vlist" style="height:0.247em;"><span></span></span></span></span></span></span><span class="mclose delimcenter" style="top:0em;"><span class="delimsizing size1">]</span></span></span></span></span></span></span>',To,qe,ll,Mo,wu='<span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msubsup><mi>X</mi><mrow><mi>i</mi><mo separator="true">,</mo><mi>j</mi></mrow><mn>2</mn></msubsup><mo separator="true">,</mo><mtext>\xA0with\xA0</mtext><mi>i</mi><mo>\u2208</mo><mrow><mo fence="true">[</mo><mn>1</mn><mo separator="true">,</mo><mo>\u2026</mo><mo separator="true">,</mo><msup><mi>d</mi><mn>2</mn></msup><mo fence="true">]</mo></mrow><mtext>\xA0and\xA0</mtext><mi>j</mi><mo>\u2208</mo><mrow><mo fence="true">[</mo><mn>1</mn><mo separator="true">,</mo><mo>\u2026</mo><mo separator="true">,</mo><msubsup><mi>n</mi><mi>s</mi><mn>2</mn></msubsup><mo fence="true">]</mo></mrow></mrow><annotation encoding="application/x-tex">X^{2}_{i,j}, \\text{ with } i \\in \\left[1,\\ldots, d^2\\right] \\text{ and } j \\in \\left[1,\\ldots, n_s^2\\right]</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.2472em;vertical-align:-0.3831em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.07847em;">X</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8641em;"><span style="top:-2.453em;margin-left:-0.0785em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight">i</span><span class="mpunct mtight">,</span><span class="mord mathnormal mtight" style="margin-right:0.05724em;">j</span></span></span></span><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">2</span></span></span></span></span><span class="vlist-s">\u200B</span></span><span class="vlist-r"><span class="vlist" style="height:0.3831em;"><span></span></span></span></span></span></span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord text"><span class="mord">\xA0with\xA0</span></span><span class="mord mathnormal">i</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">\u2208</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1.2141em;vertical-align:-0.35em;"></span><span class="minner"><span class="mopen delimcenter" style="top:0em;"><span class="delimsizing size1">[</span></span><span class="mord">1</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="minner">\u2026</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord"><span class="mord mathnormal">d</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8641em;"><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span></span></span></span></span><span class="mclose delimcenter" style="top:0em;"><span class="delimsizing size1">]</span></span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord text"><span class="mord">\xA0and\xA0</span></span><span class="mord mathnormal" style="margin-right:0.05724em;">j</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">\u2208</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1.2141em;vertical-align:-0.35em;"></span><span class="minner"><span class="mopen delimcenter" style="top:0em;"><span class="delimsizing size1">[</span></span><span class="mord">1</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="minner">\u2026</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord"><span class="mord mathnormal">n</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8641em;"><span style="top:-2.453em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">s</span></span></span><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span><span class="vlist-s">\u200B</span></span><span class="vlist-r"><span class="vlist" style="height:0.247em;"><span></span></span></span></span></span></span><span class="mclose delimcenter" style="top:0em;"><span class="delimsizing size1">]</span></span></span></span></span></span></span>',Ro,Ee,ml,$o,zu='<span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>d</mi><mo>=</mo><msup><mi>d</mi><mn>1</mn></msup><mo>+</mo><msup><mi>d</mi><mn>2</mn></msup><mtext>\xA0and\xA0</mtext><msub><mi>n</mi><mi>s</mi></msub><mo>=</mo><msubsup><mi>n</mi><mi>s</mi><mn>1</mn></msubsup><mo>\xD7</mo><msubsup><mi>n</mi><mi>s</mi><mn>2</mn></msubsup><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">d = d^1 + d^2 \\text{ and } n_s = n_s^1 \\times n_s^2 .</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em;"></span><span class="mord mathnormal">d</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.9474em;vertical-align:-0.0833em;"></span><span class="mord"><span class="mord mathnormal">d</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8641em;"><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">1</span></span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:1.0141em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal">d</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8641em;"><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span></span></span></span></span><span class="mord text"><span class="mord">\xA0and\xA0</span></span><span class="mord"><span class="mord mathnormal">n</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">s</span></span></span></span><span class="vlist-s">\u200B</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1.1111em;vertical-align:-0.247em;"></span><span class="mord"><span class="mord mathnormal">n</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8641em;"><span style="top:-2.453em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">s</span></span></span><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">1</span></span></span></span><span class="vlist-s">\u200B</span></span><span class="vlist-r"><span class="vlist" style="height:0.247em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">\xD7</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:1.1111em;vertical-align:-0.247em;"></span><span class="mord"><span class="mord mathnormal">n</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8641em;"><span style="top:-2.453em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">s</span></span></span><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span><span class="vlist-s">\u200B</span></span><span class="vlist-r"><span class="vlist" style="height:0.247em;"><span></span></span></span></span></span></span><span class="mord">.</span></span></span></span></span>',qo,Le,pl,Eo,xu=`<span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msub><mi>X</mi><mrow><mi>i</mi><mo separator="true">,</mo><mi>j</mi></mrow></msub><mo>=</mo><mrow><mo fence="true">{</mo><mtable rowspacing="0.36em" columnalign="left left" columnspacing="1em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="false"><mrow><msubsup><mi>X</mi><mrow><mi>i</mi><mo separator="true">,</mo><mi>k</mi></mrow><mn>1</mn></msubsup><mo separator="true">,</mo></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="false"><mrow><mtext>if\xA0\xA0</mtext><mi>i</mi><mo>&lt;</mo><msup><mi>d</mi><mn>1</mn></msup><mtext>\xA0with\xA0</mtext><mi>k</mi><mo>=</mo><mi>j</mi><mspace></mspace><mspace width="0.6667em"/><mrow><mi mathvariant="normal">m</mi><mi mathvariant="normal">o</mi><mi mathvariant="normal">d</mi></mrow><mtext>\u2009</mtext><mtext>\u2009</mtext><msubsup><mi>n</mi><mi>s</mi><mn>1</mn></msubsup></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="false"><mrow><msubsup><mi>X</mi><mrow><mi>i</mi><mo>\u2212</mo><msup><mi>d</mi><mn>1</mn></msup><mo separator="true">,</mo><mi>l</mi></mrow><mn>2</mn></msubsup><mo separator="true">,</mo></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="false"><mrow><mtext>if\xA0</mtext><mi>i</mi><mo>\u2265</mo><msup><mi>d</mi><mn>1</mn></msup><mtext>\xA0with\xA0</mtext><mi>l</mi><mo>=</mo><mo stretchy="false">\u230A</mo><mfrac><mi>j</mi><msubsup><mi>n</mi><mi>s</mi><mn>1</mn></msubsup></mfrac><mo stretchy="false">\u230B</mo></mrow></mstyle></mtd></mtr></mtable></mrow></mrow><annotation encoding="application/x-tex">X_{i,j} = \\begin{cases}
X^{1}_{i, k}, &amp; \\text{if }\\ i &lt; d^1 \\text{ with } k = j \\mod n_s^1 \\\\
X^{2}_{i - d^1, l}, &amp; \\text{if } i \\ge d^1 \\text{ with } l = \\lfloor\\frac{j}{n_s^1}\\rfloor
\\end{cases}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.9694em;vertical-align:-0.2861em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.07847em;">X</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:-0.0785em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight">i</span><span class="mpunct mtight">,</span><span class="mord mathnormal mtight" style="margin-right:0.05724em;">j</span></span></span></span></span><span class="vlist-s">\u200B</span></span><span class="vlist-r"><span class="vlist" style="height:0.2861em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:3em;vertical-align:-1.25em;"></span><span class="minner"><span class="mopen delimcenter" style="top:0em;"><span class="delimsizing size4">{</span></span><span class="mord"><span class="mtable"><span class="col-align-l"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.7466em;"><span style="top:-3.7466em;"><span class="pstrut" style="height:3.008em;"></span><span class="mord"><span class="mord"><span class="mord mathnormal" style="margin-right:0.07847em;">X</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8141em;"><span style="top:-2.4169em;margin-left:-0.0785em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight">i</span><span class="mpunct mtight">,</span><span class="mord mathnormal mtight" style="margin-right:0.03148em;">k</span></span></span></span><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">1</span></span></span></span></span><span class="vlist-s">\u200B</span></span><span class="vlist-r"><span class="vlist" style="height:0.4192em;"><span></span></span></span></span></span></span><span class="mpunct">,</span></span></span><span style="top:-2.3066em;"><span class="pstrut" style="height:3.008em;"></span><span class="mord"><span class="mord"><span class="mord mathnormal" style="margin-right:0.07847em;">X</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8141em;"><span style="top:-2.3806em;margin-left:-0.0785em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight">i</span><span class="mbin mtight">\u2212</span><span class="mord mtight"><span class="mord mathnormal mtight">d</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.7463em;"><span style="top:-2.786em;margin-right:0.0714em;"><span class="pstrut" style="height:2.5em;"></span><span class="sizing reset-size3 size1 mtight"><span class="mord mtight">1</span></span></span></span></span></span></span></span><span class="mpunct mtight">,</span><span class="mord mathnormal mtight" style="margin-right:0.01968em;">l</span></span></span></span><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">2</span></span></span></span></span><span class="vlist-s">\u200B</span></span><span class="vlist-r"><span class="vlist" style="height:0.4555em;"><span></span></span></span></span></span></span><span class="mpunct">,</span></span></span></span><span class="vlist-s">\u200B</span></span><span class="vlist-r"><span class="vlist" style="height:1.2466em;"><span></span></span></span></span></span><span class="arraycolsep" style="width:1em;"></span><span class="col-align-l"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.7466em;"><span style="top:-3.7466em;"><span class="pstrut" style="height:3.008em;"></span><span class="mord"><span class="mord text"><span class="mord">if\xA0</span></span><span class="mspace">\xA0</span><span class="mord mathnormal">i</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">&lt;</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mord"><span class="mord mathnormal">d</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8141em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">1</span></span></span></span></span></span></span></span><span class="mord text"><span class="mord">\xA0with\xA0</span></span><span class="mord mathnormal" style="margin-right:0.03148em;">k</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mord mathnormal" style="margin-right:0.05724em;">j</span><span class="mspace allowbreak"></span><span class="mspace" style="margin-right:0.6667em;"></span><span class="mord"><span class="mord"><span class="mord mathrm">mod</span></span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord"><span class="mord mathnormal">n</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8141em;"><span style="top:-2.453em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">s</span></span></span><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">1</span></span></span></span><span class="vlist-s">\u200B</span></span><span class="vlist-r"><span class="vlist" style="height:0.247em;"><span></span></span></span></span></span></span></span></span><span style="top:-2.3066em;"><span class="pstrut" style="height:3.008em;"></span><span class="mord"><span class="mord text"><span class="mord">if\xA0</span></span><span class="mord mathnormal">i</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">\u2265</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mord"><span class="mord mathnormal">d</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8141em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">1</span></span></span></span></span></span></span></span><span class="mord text"><span class="mord">\xA0with\xA0</span></span><span class="mord mathnormal" style="margin-right:0.01968em;">l</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mopen">\u230A</span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.9078em;"><span style="top:-2.655em;"><span class="pstrut" style="height:3em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight"><span class="mord mathnormal mtight">n</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.7463em;"><span style="top:-2.214em;margin-left:0em;margin-right:0.0714em;"><span class="pstrut" style="height:2.5em;"></span><span class="sizing reset-size3 size1 mtight"><span class="mord mathnormal mtight">s</span></span></span><span style="top:-2.786em;margin-right:0.0714em;"><span class="pstrut" style="height:2.5em;"></span><span class="sizing reset-size3 size1 mtight"><span class="mord mtight">1</span></span></span></span><span class="vlist-s">\u200B</span></span><span class="vlist-r"><span class="vlist" style="height:0.286em;"><span></span></span></span></span></span></span></span></span></span><span style="top:-3.23em;"><span class="pstrut" style="height:3em;"></span><span class="frac-line" style="border-bottom-width:0.04em;"></span></span><span style="top:-3.4461em;"><span class="pstrut" style="height:3em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight" style="margin-right:0.05724em;">j</span></span></span></span></span><span class="vlist-s">\u200B</span></span><span class="vlist-r"><span class="vlist" style="height:0.5452em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span><span class="mclose">\u230B</span></span></span></span><span class="vlist-s">\u200B</span></span><span class="vlist-r"><span class="vlist" style="height:1.2466em;"><span></span></span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span></span></span></span></span>`,Lo,F,cl,Fo,Tu='<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>x</mi><mi>j</mi></msub><mo>\u2208</mo><msup><mi mathvariant="double-struck">R</mi><mi>d</mi></msup></mrow><annotation encoding="application/x-tex">x_j \\in \\mathbb{R}^{d}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8252em;vertical-align:-0.2861em;"></span><span class="mord"><span class="mord mathnormal">x</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.05724em;">j</span></span></span></span><span class="vlist-s">\u200B</span></span><span class="vlist-r"><span class="vlist" style="height:0.2861em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">\u2208</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.8491em;"></span><span class="mord"><span class="mord mathbb">R</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8491em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight">d</span></span></span></span></span></span></span></span></span></span></span></span>',Po,Co,Mu='<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msubsup><mi>x</mi><mrow><mi>k</mi><mo separator="true">,</mo><mi>l</mi></mrow><mn>1</mn></msubsup><mo>+</mo><msubsup><mi>x</mi><mrow><mi>l</mi><mo separator="true">,</mo><mi>k</mi></mrow><mn>2</mn></msubsup></mrow><annotation encoding="application/x-tex">x^1_{k, l} + x^2_{l, k}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.2333em;vertical-align:-0.4192em;"></span><span class="mord"><span class="mord mathnormal">x</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8141em;"><span style="top:-2.4169em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight" style="margin-right:0.03148em;">k</span><span class="mpunct mtight">,</span><span class="mord mathnormal mtight" style="margin-right:0.01968em;">l</span></span></span></span><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">1</span></span></span></span><span class="vlist-s">\u200B</span></span><span class="vlist-r"><span class="vlist" style="height:0.4192em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:1.2333em;vertical-align:-0.4192em;"></span><span class="mord"><span class="mord mathnormal">x</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8141em;"><span style="top:-2.4169em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight" style="margin-right:0.01968em;">l</span><span class="mpunct mtight">,</span><span class="mord mathnormal mtight" style="margin-right:0.03148em;">k</span></span></span></span><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span><span class="vlist-s">\u200B</span></span><span class="vlist-r"><span class="vlist" style="height:0.4192em;"><span></span></span></span></span></span></span></span></span></span>',Ao,Dt,hl,dl,jo,Ru='<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>j</mi></mrow><annotation encoding="application/x-tex">j</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.854em;vertical-align:-0.1944em;"></span><span class="mord mathnormal" style="margin-right:0.05724em;">j</span></span></span></span>',So,No,$u='<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>k</mi><mtext>\xA0and\xA0</mtext><mi>l</mi></mrow><annotation encoding="application/x-tex">k \\text{ and } l</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em;"></span><span class="mord mathnormal" style="margin-right:0.03148em;">k</span><span class="mord text"><span class="mord">\xA0and\xA0</span></span><span class="mord mathnormal" style="margin-right:0.01968em;">l</span></span></span></span>',Do,Ho,qu='<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>x</mi><mi>j</mi></msub></mrow><annotation encoding="application/x-tex">x_j</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.7167em;vertical-align:-0.2861em;"></span><span class="mord"><span class="mord mathnormal">x</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.05724em;">j</span></span></span></span><span class="vlist-s">\u200B</span></span><span class="vlist-r"><span class="vlist" style="height:0.2861em;"><span></span></span></span></span></span></span></span></span></span>',Oo,Io,ms,gl,Wo,Eu='<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>d</mi><mn>1</mn></msup><mo>=</mo><msup><mn>2</mn><mn>5</mn></msup><mo separator="true">,</mo><msup><mi>d</mi><mn>2</mn></msup><mo>=</mo><msup><mn>2</mn><mn>5</mn></msup><mo separator="true">,</mo><msubsup><mi>n</mi><mi>s</mi><mn>1</mn></msubsup><mo>=</mo><msup><mn>2</mn><mn>9</mn></msup><mo separator="true">,</mo><msubsup><mi>n</mi><mi>s</mi><mn>2</mn></msubsup><mo>=</mo><msup><mn>2</mn><mn>10</mn></msup></mrow><annotation encoding="application/x-tex">d^1 = 2^5, d^2 = 2^5, n_s^1 = 2^9, n_s^2 = 2^{10}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8141em;"></span><span class="mord"><span class="mord mathnormal">d</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8141em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">1</span></span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1.0085em;vertical-align:-0.1944em;"></span><span class="mord"><span class="mord">2</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8141em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">5</span></span></span></span></span></span></span></span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord"><span class="mord mathnormal">d</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8141em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1.0611em;vertical-align:-0.247em;"></span><span class="mord"><span class="mord">2</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8141em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">5</span></span></span></span></span></span></span></span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord"><span class="mord mathnormal">n</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8141em;"><span style="top:-2.453em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">s</span></span></span><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">1</span></span></span></span><span class="vlist-s">\u200B</span></span><span class="vlist-r"><span class="vlist" style="height:0.247em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1.0611em;vertical-align:-0.247em;"></span><span class="mord"><span class="mord">2</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8141em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">9</span></span></span></span></span></span></span></span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord"><span class="mord mathnormal">n</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8141em;"><span style="top:-2.453em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">s</span></span></span><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span><span class="vlist-s">\u200B</span></span><span class="vlist-r"><span class="vlist" style="height:0.247em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.8141em;"></span><span class="mord"><span class="mord">2</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8141em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">10</span></span></span></span></span></span></span></span></span></span></span></span>',Qo,Ko,Lu='<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mn>2</mn><mn>14</mn></msup><mo>+</mo><msup><mn>2</mn><mn>15</mn></msup><mo>\u2248</mo><mn>49000</mn></mrow><annotation encoding="application/x-tex">2^{14} + 2^{15} \\approx 49000</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8974em;vertical-align:-0.0833em;"></span><span class="mord"><span class="mord">2</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8141em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">14</span></span></span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:0.8141em;"></span><span class="mord"><span class="mord">2</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8141em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">15</span></span></span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">\u2248</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">49000</span></span></span></span>',Uo,Bo,q,ul,Ht,fl,_l,Xo,Fu='<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo stretchy="false">(</mo><msup><mi>d</mi><mn>1</mn></msup><mo separator="true">,</mo><msup><mi>d</mi><mn>2</mn></msup><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">(d^1, d^2)</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.0641em;vertical-align:-0.25em;"></span><span class="mopen">(</span><span class="mord"><span class="mord mathnormal">d</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8141em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">1</span></span></span></span></span></span></span></span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord"><span class="mord mathnormal">d</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8141em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span></span></span></span></span><span class="mclose">)</span></span></span></span>',Vo,Ot,vl,yl,It,bl,kl,Go,Pu='<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo stretchy="false">(</mo><msubsup><mi>n</mi><mi>s</mi><mn>1</mn></msubsup><mo separator="true">,</mo><msubsup><mi>n</mi><mi>s</mi><mn>2</mn></msubsup><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">(n_s^1, n_s^2)</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.0641em;vertical-align:-0.25em;"></span><span class="mopen">(</span><span class="mord"><span class="mord mathnormal">n</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8141em;"><span style="top:-2.453em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">s</span></span></span><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">1</span></span></span></span><span class="vlist-s">\u200B</span></span><span class="vlist-r"><span class="vlist" style="height:0.247em;"><span></span></span></span></span></span></span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord"><span class="mord mathnormal">n</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8141em;"><span style="top:-2.453em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">s</span></span></span><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span><span class="vlist-s">\u200B</span></span><span class="vlist-r"><span class="vlist" style="height:0.247em;"><span></span></span></span></span></span></span><span class="mclose">)</span></span></span></span>',Jo,Wt,wl,zl,Qt,xl,Tl,Kt,Ml,Rl,Yo,Ms,Gs,Ut,Fe,$l,Bt,ql,Zo,Z,El,Pe,Ll,Fl,Xt,Pl,Cl,Vt,Al,jl,sr,S,Sl,Gt,Nl,Dl,Jt,Hl,Ol,Yt,Il,Wl,Zt,Ql,Kl,sn,Ul,Bl,er,ps,Xl,Ce,Vl,Gl,Ae,Jl,Yl,ar,I,Zl,en,sm,em,tr,Cu=`<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo stretchy="false">(</mo><msubsup><mi>n</mi><mtext>buckets</mtext><mn>1</mn></msubsup><mo separator="true">,</mo><msubsup><mi>n</mi><mtext>buckets</mtext><mn>2</mn></msubsup><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">(n_{\\text{buckets}}^1,
n_{\\text{buckets}}^2)</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.0972em;vertical-align:-0.2831em;"></span><span class="mopen">(</span><span class="mord"><span class="mord mathnormal">n</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8141em;"><span style="top:-2.4169em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord text mtight"><span class="mord mtight">buckets</span></span></span></span></span><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">1</span></span></span></span><span class="vlist-s">\u200B</span></span><span class="vlist-r"><span class="vlist" style="height:0.2831em;"><span></span></span></span></span></span></span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord"><span class="mord mathnormal">n</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8141em;"><span style="top:-2.4169em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord text mtight"><span class="mord mtight">buckets</span></span></span></span></span><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span><span class="vlist-s">\u200B</span></span><span class="vlist-r"><span class="vlist" style="height:0.2831em;"><span></span></span></span></span></span></span><span class="mclose">)</span></span></span></span>`,nr,or,Au=`<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo stretchy="false">(</mo><mn>1</mn><mo separator="true">,</mo><mo>\u2026</mo><mo separator="true">,</mo><msub><mi>n</mi><mtext>buckets</mtext></msub><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">(1,\\ldots,
n_{\\text{buckets}})</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mopen">(</span><span class="mord">1</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="minner">\u2026</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord"><span class="mord mathnormal">n</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3361em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord text mtight"><span class="mord mtight">buckets</span></span></span></span></span></span><span class="vlist-s">\u200B</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mclose">)</span></span></span></span>`,rr,ir,ju=`<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo stretchy="false">(</mo><mn>1</mn><mo>\u2212</mo><mn>1</mn><mo separator="true">,</mo><mo>\u2026</mo><mo separator="true">,</mo><msubsup><mi>n</mi><mtext>buckets</mtext><mn>1</mn></msubsup><mo>\u2212</mo><mn>1</mn><mo separator="true">,</mo><mo>\u2026</mo><mo separator="true">,</mo><mn>1</mn><mo>\u2212</mo><msubsup><mi>n</mi><mtext>buckets</mtext><mn>2</mn></msubsup><mo separator="true">,</mo><mo>\u2026</mo><mo separator="true">,</mo><msubsup><mi>n</mi><mtext>buckets</mtext><mn>1</mn></msubsup><mo>\u2212</mo><msubsup><mi>n</mi><mtext>buckets</mtext><mn>2</mn></msubsup><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">(1-1,\\ldots, n_{\\text{buckets}}^1-1, \\ldots,
1-n_{\\text{buckets}}^2, \\ldots, n_{\\text{buckets}}^1-n_{\\text{buckets}}^2)</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mopen">(</span><span class="mord">1</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">\u2212</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:1.0972em;vertical-align:-0.2831em;"></span><span class="mord">1</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="minner">\u2026</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord"><span class="mord mathnormal">n</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8141em;"><span style="top:-2.4169em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord text mtight"><span class="mord mtight">buckets</span></span></span></span></span><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">1</span></span></span></span><span class="vlist-s">\u200B</span></span><span class="vlist-r"><span class="vlist" style="height:0.2831em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">\u2212</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:0.8389em;vertical-align:-0.1944em;"></span><span class="mord">1</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="minner">\u2026</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord">1</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">\u2212</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:1.0972em;vertical-align:-0.2831em;"></span><span class="mord"><span class="mord mathnormal">n</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8141em;"><span style="top:-2.4169em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord text mtight"><span class="mord mtight">buckets</span></span></span></span></span><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span><span class="vlist-s">\u200B</span></span><span class="vlist-r"><span class="vlist" style="height:0.2831em;"><span></span></span></span></span></span></span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="minner">\u2026</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord"><span class="mord mathnormal">n</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8141em;"><span style="top:-2.4169em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord text mtight"><span class="mord mtight">buckets</span></span></span></span></span><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">1</span></span></span></span><span class="vlist-s">\u200B</span></span><span class="vlist-r"><span class="vlist" style="height:0.2831em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">\u2212</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:1.0972em;vertical-align:-0.2831em;"></span><span class="mord"><span class="mord mathnormal">n</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8141em;"><span style="top:-2.4169em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord text mtight"><span class="mord mtight">buckets</span></span></span></span></span><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span><span class="vlist-s">\u200B</span></span><span class="vlist-r"><span class="vlist" style="height:0.2831em;"><span></span></span></span></span></span></span><span class="mclose">)</span></span></span></span>`,lr,mr,cs,am,an,tm,nm,tn,om,rm,pr,ss,im,cr,Su='<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="script">O</mi><mo stretchy="false">(</mo><msub><mi>n</mi><mi>s</mi></msub><mo>\xD7</mo><msub><mi>n</mi><mi>s</mi></msub><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">\\mathcal{O}(n_s \\times n_s)</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathcal" style="margin-right:0.02778em;">O</span><span class="mopen">(</span><span class="mord"><span class="mord mathnormal">n</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">s</span></span></span></span><span class="vlist-s">\u200B</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">\xD7</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord"><span class="mord mathnormal">n</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">s</span></span></span></span><span class="vlist-s">\u200B</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mclose">)</span></span></span></span>',hr,dr,Nu='<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="script">O</mi><mo stretchy="false">(</mo><msub><mi>n</mi><mi>s</mi></msub><mo>\xD7</mo><mi>log</mi><mo>\u2061</mo><mo stretchy="false">(</mo><msub><mi>n</mi><mi>s</mi></msub><mo stretchy="false">)</mo><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">\\mathcal{O}(n_s \\times \\log(n_s))</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathcal" style="margin-right:0.02778em;">O</span><span class="mopen">(</span><span class="mord"><span class="mord mathnormal">n</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">s</span></span></span></span><span class="vlist-s">\u200B</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">\xD7</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mop">lo<span style="margin-right:0.01389em;">g</span></span><span class="mopen">(</span><span class="mord"><span class="mord mathnormal">n</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">s</span></span></span></span><span class="vlist-s">\u200B</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mclose">))</span></span></span></span>',gr,ur,Du='<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>n</mi><mi>s</mi></msub></mrow><annotation encoding="application/x-tex">n_s</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.5806em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal">n</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">s</span></span></span></span><span class="vlist-s">\u200B</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span>',fr,_r,Rs,Js,nn,je,lm,on,mm,vr,es,pm,rn,cm,hm,ln,dm,gm,mn,um,fm,yr,as,_m,br,Hu='<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="script">O</mi><mo stretchy="false">(</mo><msub><mi>n</mi><mi>s</mi></msub><mo>\xD7</mo><msub><mi>n</mi><mi>s</mi></msub><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">\\mathcal{O}(n_s \\times n_s)</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathcal" style="margin-right:0.02778em;">O</span><span class="mopen">(</span><span class="mord"><span class="mord mathnormal">n</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">s</span></span></span></span><span class="vlist-s">\u200B</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">\xD7</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord"><span class="mord mathnormal">n</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">s</span></span></span></span><span class="vlist-s">\u200B</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mclose">)</span></span></span></span>',kr,wr,Ou='<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="script">O</mi><mo stretchy="false">(</mo><msub><mi>n</mi><mi>s</mi></msub><mo>\xD7</mo><mi>log</mi><mo>\u2061</mo><mo stretchy="false">(</mo><msub><mi>n</mi><mi>s</mi></msub><mo stretchy="false">)</mo><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">\\mathcal{O}(n_s \\times \\log(n_s))</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathcal" style="margin-right:0.02778em;">O</span><span class="mopen">(</span><span class="mord"><span class="mord mathnormal">n</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">s</span></span></span></span><span class="vlist-s">\u200B</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">\xD7</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mop">lo<span style="margin-right:0.01389em;">g</span></span><span class="mopen">(</span><span class="mord"><span class="mord mathnormal">n</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">s</span></span></span></span><span class="vlist-s">\u200B</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mclose">))</span></span></span></span>',zr,xr,Iu='<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>n</mi><mi>s</mi></msub></mrow><annotation encoding="application/x-tex">n_s</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.5806em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal">n</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">s</span></span></span></span><span class="vlist-s">\u200B</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span>',Tr,Mr,$s,Ys,pn,Se,vm,cn,ym,Rr,hs,bm,hn,km,wm,dn,zm,xm,$r,Zs,Tm,Xa,Mm,Rm,qr,Ne,Er,qs,se,gn,De,$m,un,qm,Lr,N,He,Em,Oe,Lm,Va,Fm,Pm,Cm,Es,Am,Ga,jm,Sm,Ja,Nm,Dm,Hm,fn,Om,Im,Ie,Fr,Ls,ee,_n,We,Wm,vn,Qm,Pr,Y,Qe,Km,Ke,Um,Ue,Bm,Xm,Vm,Be,Gm,Ya,Jm,Ym,Zm,Za,Xe,Cr,Fs,ae,yn,Ve,sp,bn,ep,Ar,rs,Ge,ap,Ps,tp,kn,np,op,Je,rp,ip,lp,Ye,mp,st,pp,cp,jr,Cs,te,wn,Ze,hp,zn,dp,Sr,D,sa,gp,ea,up,aa,fp,_p,vp,ta,yp,et,bp,kp,wp,na,zp,oa,xp,Tp,Mp,W,ra,Rp,As,$p,at,qp,Ep,xn,Lp,Fp,Pp,ne,Cp,Tn,Ap,jp,ia,Nr,js,oe,Mn,la,Sp,Rn,Np,Dr,H,ma,Dp,Ss,Hp,$n,Op,Ip,pa,Wp,Qp,Kp,ca,Up,tt,Bp,Xp,Vp,ha,Gp,da,Jp,Yp,Zp,Q,ga,sc,Ns,ec,nt,ac,tc,qn,nc,oc,rc,re,ic,En,lc,mc,ua,Hr,Ds,ie,Ln,fa,pc,Fn,cc,Or,O,_a,hc,Hs,dc,Pn,gc,uc,va,fc,_c,vc,ya,yc,ot,bc,kc,wc,ba,zc,ka,xc,Tc,Mc,K,wa,Rc,Os,$c,rt,qc,Ec,Cn,Lc,Fc,Pc,le,Cc,An,Ac,jc,za,Ir,Is,me,jn,xa,Sc,Sn,Nc,Wr,A,Ta,Dc,Nn,Hc,Oc,Ma,Ic,Ra,Wc,Qc,Kc,$a,Uc,it,Bc,Xc,Vc,qa,Gc,Ea,Jc,Yc,Zc,P,La,sh,Ws,eh,lt,ah,th,Dn,nh,oh,rh,pe,ih,Hn,lh,mh,Fa,ph,On,ch,hh,Pa,Qr,Qs,ce,In,Ca,dh,Wn,gh,Kr,j,Aa,uh,Ks,fh,Qn,_h,vh,Kn,yh,bh,kh,ja,wh,Sa,zh,xh,Th,Na,Mh,mt,Rh,$h,qh,Da,Eh,Ha,Lh,Fh,Ph,U,Oa,Ch,Us,Ah,pt,jh,Sh,Un,Nh,Dh,Hh,he,Oh,Bn,Ih,Wh,Ia,Ur;return w=new G({}),ke=new G({}),Re=new G({}),Fe=new G({}),je=new G({}),Se=new G({}),Ne=new ye({props:{code:`input_ids = tokenizer.encode("This is a sentence from the training data", return_tensors="pt")
loss = model(input_ids, labels=input_ids)[0]`,highlighted:`input_ids = tokenizer.encode(<span class="hljs-string">&quot;This is a sentence from the training data&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
loss = model(input_ids, labels=input_ids)[<span class="hljs-number">0</span>]`}}),De=new G({}),He=new V({props:{name:"class transformers.ReformerConfig",anchor:"transformers.ReformerConfig",parameters:[{name:"attention_head_size",val:" = 64"},{name:"attn_layers",val:" = ['local', 'lsh', 'local', 'lsh', 'local', 'lsh']"},{name:"axial_norm_std",val:" = 1.0"},{name:"axial_pos_embds",val:" = True"},{name:"axial_pos_shape",val:" = [64, 64]"},{name:"axial_pos_embds_dim",val:" = [64, 192]"},{name:"chunk_size_lm_head",val:" = 0"},{name:"eos_token_id",val:" = 2"},{name:"feed_forward_size",val:" = 512"},{name:"hash_seed",val:" = None"},{name:"hidden_act",val:" = 'relu'"},{name:"hidden_dropout_prob",val:" = 0.05"},{name:"hidden_size",val:" = 256"},{name:"initializer_range",val:" = 0.02"},{name:"is_decoder",val:" = False"},{name:"layer_norm_eps",val:" = 1e-12"},{name:"local_num_chunks_before",val:" = 1"},{name:"local_num_chunks_after",val:" = 0"},{name:"local_attention_probs_dropout_prob",val:" = 0.05"},{name:"local_attn_chunk_length",val:" = 64"},{name:"lsh_attn_chunk_length",val:" = 64"},{name:"lsh_attention_probs_dropout_prob",val:" = 0.0"},{name:"lsh_num_chunks_before",val:" = 1"},{name:"lsh_num_chunks_after",val:" = 0"},{name:"max_position_embeddings",val:" = 4096"},{name:"num_attention_heads",val:" = 12"},{name:"num_buckets",val:" = None"},{name:"num_hashes",val:" = 1"},{name:"pad_token_id",val:" = 0"},{name:"vocab_size",val:" = 320"},{name:"tie_word_embeddings",val:" = False"},{name:"use_cache",val:" = True"},{name:"classifier_dropout",val:" = None"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/reformer/configuration_reformer.py#L30",parametersDescription:[{anchor:"transformers.ReformerConfig.attention_head_size",description:`<strong>attention_head_size</strong> (<code>int</code>, <em>optional</em>, defaults to 64) &#x2014;
Dimensionality of the projected key, query and value vectors`,name:"attention_head_size"},{anchor:"transformers.ReformerConfig.attn_layers",description:`<strong>attn_layers</strong> (<code>List[str]</code>, <em>optional</em>, defaults to <code>[&quot;local&quot;, &quot;lsh&quot;, &quot;local&quot;, &quot;lsh&quot;, &quot;local&quot;, &quot;lsh&quot;]</code>) &#x2014;
List of attention layer types in ascending order. It can be chosen between a LSHSelfAttention layer
(<code>&quot;lsh&quot;</code>) and a LocalSelfAttention layer (<code>&quot;local&quot;</code>).</p>
<p>For more information on LSHSelfAttention layer, see <a href="reformer#lsh-self-attention">LSH Self Attention</a>. For
more information on LocalSelfAttention layer, see <a href="reformer#local-self-attention">Local Self Attention</a>.`,name:"attn_layers"},{anchor:"transformers.ReformerConfig.axial_pos_embds",description:`<strong>axial_pos_embds</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to use axial position embeddings. For more information on how axial position embeddings
work, see <a href="reformer#axial-positional-encodings">Axial Position Encodings</a>.`,name:"axial_pos_embds"},{anchor:"transformers.ReformerConfig.axial_norm_std",description:`<strong>axial_norm_std</strong> (<code>float</code>, <em>optional</em>, defaults to 1.0) &#x2014;
The standard deviation of the normal_initializer for initializing the weight matrices of the axial
positional encodings.`,name:"axial_norm_std"},{anchor:"transformers.ReformerConfig.axial_pos_shape",description:`<strong>axial_pos_shape</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[64, 64]</code>) &#x2014;
The position dims of the axial position encodings. During training, the product of the position dims has to
be equal to the sequence length.</p>
<p>For more information on how axial position embeddings work, see <a href="reformer#axial-positional-encodings">Axial Position
Encodings</a>.`,name:"axial_pos_shape"},{anchor:"transformers.ReformerConfig.axial_pos_embds_dim",description:`<strong>axial_pos_embds_dim</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[64, 192]</code>) &#x2014;
The embedding dims of the axial position encodings. The sum of the embedding dims has to be equal to the
hidden size.</p>
<p>For more information on how axial position embeddings work, see <a href="reformer#axial-positional-encodings">Axial Position
Encodings</a>.`,name:"axial_pos_embds_dim"},{anchor:"transformers.ReformerConfig.chunk_size_lm_head",description:`<strong>chunk_size_lm_head</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014;
The chunk size of the final language model feed forward head layer. A chunk size of 0 means that the feed
forward layer is not chunked. A chunk size of n means that the feed forward layer processes n &lt;
sequence_length embeddings at a time.</p>
<p>For more information on feed forward chunking, see <a href="../glossary#feed-forward-chunking">How does Feed Forward Chunking
work?</a>.`,name:"chunk_size_lm_head"},{anchor:"transformers.ReformerConfig.eos_token_id",description:`<strong>eos_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014;
The token id for the end-of-sentence token.`,name:"eos_token_id"},{anchor:"transformers.ReformerConfig.feed_forward_size",description:`<strong>feed_forward_size</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
Dimensionality of the feed_forward layer in the residual attention block.`,name:"feed_forward_size"},{anchor:"transformers.ReformerConfig.hash_seed",description:`<strong>hash_seed</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Seed that can be used to make local sensitive hashing in <code>LSHSelfAttention</code> deterministic. This should only
be set for testing purposed. For evaluation and training purposes <code>hash_seed</code> should be left as <code>None</code> to
ensure fully random rotations in local sensitive hashing scheme.`,name:"hash_seed"},{anchor:"transformers.ReformerConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>Callable</code>, <em>optional</em>, defaults to <code>&quot;relu&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the feed forward layer in the residual attention
block. 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.ReformerConfig.hidden_dropout_prob",description:`<strong>hidden_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.05) &#x2014;
The dropout probability for all fully connected layers in the embeddings, encoder, and pooler.`,name:"hidden_dropout_prob"},{anchor:"transformers.ReformerConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 256) &#x2014;
Dimensionality of the output hidden states of the residual attention blocks.`,name:"hidden_size"},{anchor:"transformers.ReformerConfig.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.ReformerConfig.is_decoder",description:`<strong>is_decoder</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to use a causal mask in addition to the <code>attention_mask</code> passed to <a href="/docs/transformers/pr_15839/en/model_doc/reformer#transformers.ReformerModel">ReformerModel</a>. When
using the Reformer for causal language modeling, this argument should be set to <code>True</code>.`,name:"is_decoder"},{anchor:"transformers.ReformerConfig.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.ReformerConfig.local_chunk_length",description:`<strong>local_chunk_length</strong> (<code>int</code>, <em>optional</em>, defaults to 64) &#x2014;
Length of chunk which attends to itself in <code>LocalSelfAttention</code>. Chunking reduces memory complexity from
sequence length x sequence length (self attention) to chunk length x chunk length x sequence length / chunk
length (chunked self attention).`,name:"local_chunk_length"},{anchor:"transformers.ReformerConfig.local_num_chunks_before",description:`<strong>local_num_chunks_before</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
Number of previous neighbouring chunks to attend to in <code>LocalSelfAttention</code> layer to itself.`,name:"local_num_chunks_before"},{anchor:"transformers.ReformerConfig.local_num_chunks_after",description:`<strong>local_num_chunks_after</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014;
Number of following neighbouring chunks to attend to in <code>LocalSelfAttention</code> layer in addition to itself.`,name:"local_num_chunks_after"},{anchor:"transformers.ReformerConfig.local_attention_probs_dropout_prob",description:`<strong>local_attention_probs_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout ratio for the attention probabilities in <code>LocalSelfAttention</code>.`,name:"local_attention_probs_dropout_prob"},{anchor:"transformers.ReformerConfig.lsh_attn_chunk_length",description:`<strong>lsh_attn_chunk_length</strong> (<code>int</code>, <em>optional</em>, defaults to 64) &#x2014;
Length of chunk which attends to itself in <code>LSHSelfAttention</code>. Chunking reduces memory complexity from
sequence length x sequence length (self attention) to chunk length x chunk length x sequence length / chunk
length (chunked self attention).`,name:"lsh_attn_chunk_length"},{anchor:"transformers.ReformerConfig.lsh_num_chunks_before",description:`<strong>lsh_num_chunks_before</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
Number of previous neighbouring chunks to attend to in <code>LSHSelfAttention</code> layer to itself.`,name:"lsh_num_chunks_before"},{anchor:"transformers.ReformerConfig.lsh_num_chunks_after",description:`<strong>lsh_num_chunks_after</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014;
Number of following neighbouring chunks to attend to in <code>LSHSelfAttention</code> layer to itself.`,name:"lsh_num_chunks_after"},{anchor:"transformers.ReformerConfig.lsh_attention_probs_dropout_prob",description:`<strong>lsh_attention_probs_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout ratio for the attention probabilities in <code>LSHSelfAttention</code>.`,name:"lsh_attention_probs_dropout_prob"},{anchor:"transformers.ReformerConfig.max_position_embeddings",description:`<strong>max_position_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 4096) &#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.ReformerConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"num_attention_heads"},{anchor:"transformers.ReformerConfig.num_buckets",description:`<strong>num_buckets</strong> (<code>int</code> or <code>List[int]</code>, <em>optional</em>) &#x2014;
Number of buckets, the key query vectors can be &#x201C;hashed into&#x201D; using the locality sensitive hashing scheme.
Each query key vector is hashed into a hash in <code>1, ..., num_buckets</code>. The number of buckets can also be
factorized into a list for improved memory complexity. In this case, each query key vector is hashed into a
hash in <code>1-1, 1-2, ..., num_buckets[0]-1, ..., num_buckets[0]-num_buckets[1]</code> if <code>num_buckets</code> is
factorized into two factors. The number of buckets (or the product the factors) should approximately equal
sequence length / lsh_chunk_length. If <code>num_buckets</code> not set, a good value is calculated on the fly.`,name:"num_buckets"},{anchor:"transformers.ReformerConfig.num_hashes",description:`<strong>num_hashes</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
Number of hashing rounds (e.g., number of random rotations) in Local Sensitive Hashing scheme. The higher
<code>num_hashes</code>, the more accurate the <code>LSHSelfAttention</code> becomes, but also the more memory and time intensive
the hashing becomes.`,name:"num_hashes"},{anchor:"transformers.ReformerConfig.pad_token_id",description:`<strong>pad_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014;
The token id for the padding token.`,name:"pad_token_id"},{anchor:"transformers.ReformerConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 320) &#x2014;\\
Vocabulary size of the Reformer model. Defines the number of different tokens that can be represented by
the <code>inputs_ids</code> passed when calling <a href="/docs/transformers/pr_15839/en/model_doc/reformer#transformers.ReformerModel">ReformerModel</a>.`,name:"vocab_size"},{anchor:"transformers.ReformerConfig.tie_word_embeddings",description:`<strong>tie_word_embeddings</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to tie input and output embeddings.`,name:"tie_word_embeddings"},{anchor:"transformers.ReformerConfig.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not the model should return the last key/values attentions (not used by all models).`,name:"use_cache"},{anchor:"transformers.ReformerConfig.classifier_dropout",description:`<strong>classifier_dropout</strong> (<code>float</code>, <em>optional</em>) &#x2014;
The dropout ratio for the classification head.`,name:"classifier_dropout"}]}}),Ie=new ye({props:{code:`from transformers import ReformerModel, ReformerConfig

# Initializing a Reformer configuration
configuration = ReformerConfig()

# Initializing a Reformer model
model = ReformerModel(configuration)

# Accessing the model configuration
configuration = model.config`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> ReformerModel, ReformerConfig

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a Reformer configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = ReformerConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a Reformer model</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ReformerModel(configuration)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Accessing the model configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = model.config`}}),We=new G({}),Qe=new V({props:{name:"class transformers.ReformerTokenizer",anchor:"transformers.ReformerTokenizer",parameters:[{name:"vocab_file",val:""},{name:"eos_token",val:" = '</s>'"},{name:"unk_token",val:" = '<unk>'"},{name:"additional_special_tokens",val:" = []"},{name:"sp_model_kwargs",val:": typing.Union[typing.Dict[str, typing.Any], NoneType] = None"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/reformer/tokenization_reformer.py#L46",parametersDescription:[{anchor:"transformers.ReformerTokenizer.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
<a href="https://github.com/google/sentencepiece" rel="nofollow">SentencePiece</a> file (generally has a <em>.spm</em> extension) that
contains the vocabulary necessary to instantiate a tokenizer.`,name:"vocab_file"},{anchor:"transformers.ReformerTokenizer.eos_token",description:`<strong>eos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;/s&gt;&quot;</code>) &#x2014;
The end of sequence token.</p>
<div class="course-tip  bg-gradient-to-br dark:bg-gradient-to-r before:border-green-500 dark:before:border-green-800 from-green-50 dark:from-gray-900 to-white dark:to-gray-950 border border-green-50 text-green-700 dark:text-gray-400">
						
<p>When building a sequence using special tokens, this is not the token that is used for the end of sequence.
The token used is the <code>sep_token</code>.</p>

					</div>`,name:"eos_token"},{anchor:"transformers.ReformerTokenizer.unk_token",description:`<strong>unk_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;unk&gt;&quot;</code>) &#x2014;
The unknown token. A token that is not in the vocabulary cannot be converted to an ID and is set to be this
token instead.`,name:"unk_token"},{anchor:"transformers.ReformerTokenizer.pad_token",description:`<strong>pad_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;pad&gt;&quot;</code>) &#x2014;
The token used for padding, for example when batching sequences of different lengths.`,name:"pad_token"},{anchor:"transformers.ReformerTokenizer.additional_special_tokens",description:`<strong>additional_special_tokens</strong> (<code>List[str]</code>, <em>optional</em>) &#x2014;
Additional special tokens used by the tokenizer.`,name:"additional_special_tokens"},{anchor:"transformers.ReformerTokenizer.sp_model_kwargs",description:`<strong>sp_model_kwargs</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
Will be passed to the <code>SentencePieceProcessor.__init__()</code> method. The <a href="https://github.com/google/sentencepiece/tree/master/python" rel="nofollow">Python wrapper for
SentencePiece</a> can be used, among other things,
to set:</p>
<ul>
<li>
<p><code>enable_sampling</code>: Enable subword regularization.</p>
</li>
<li>
<p><code>nbest_size</code>: Sampling parameters for unigram. Invalid for BPE-Dropout.</p>
<ul>
<li><code>nbest_size = {0,1}</code>: No sampling is performed.</li>
<li><code>nbest_size &gt; 1</code>: samples from the nbest_size results.</li>
<li><code>nbest_size &lt; 0</code>: assuming that nbest_size is infinite and samples from the all hypothesis (lattice)
using forward-filtering-and-backward-sampling algorithm.</li>
</ul>
</li>
<li>
<p><code>alpha</code>: Smoothing parameter for unigram sampling, and dropout probability of merge operations for
BPE-dropout.</p>
</li>
</ul>`,name:"sp_model_kwargs"}]}}),Xe=new V({props:{name:"save_vocabulary",anchor:"transformers.ReformerTokenizer.save_vocabulary",parameters:[{name:"save_directory",val:": str"},{name:"filename_prefix",val:": typing.Optional[str] = None"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/reformer/tokenization_reformer.py#L162"}}),Ve=new G({}),Ge=new V({props:{name:"class transformers.ReformerTokenizerFast",anchor:"transformers.ReformerTokenizerFast",parameters:[{name:"vocab_file",val:" = None"},{name:"tokenizer_file",val:" = None"},{name:"eos_token",val:" = '</s>'"},{name:"unk_token",val:" = '<unk>'"},{name:"additional_special_tokens",val:" = []"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/reformer/tokenization_reformer_fast.py#L54",parametersDescription:[{anchor:"transformers.ReformerTokenizerFast.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
<a href="https://github.com/google/sentencepiece" rel="nofollow">SentencePiece</a> file (generally has a <em>.spm</em> extension) that
contains the vocabulary necessary to instantiate a tokenizer.`,name:"vocab_file"},{anchor:"transformers.ReformerTokenizerFast.eos_token",description:`<strong>eos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;/s&gt;&quot;</code>) &#x2014;
The end of sequence token.</p>
<div class="course-tip  bg-gradient-to-br dark:bg-gradient-to-r before:border-green-500 dark:before:border-green-800 from-green-50 dark:from-gray-900 to-white dark:to-gray-950 border border-green-50 text-green-700 dark:text-gray-400">
						
<p>When building a sequence using special tokens, this is not the token that is used for the end of sequence.
The token used is the <code>sep_token</code>.</p>

					</div>`,name:"eos_token"},{anchor:"transformers.ReformerTokenizerFast.unk_token",description:`<strong>unk_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;unk&gt;&quot;</code>) &#x2014;
The unknown token. A token that is not in the vocabulary cannot be converted to an ID and is set to be this
token instead.`,name:"unk_token"},{anchor:"transformers.ReformerTokenizerFast.pad_token",description:`<strong>pad_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;pad&gt;&quot;</code>) &#x2014;
The token used for padding, for example when batching sequences of different lengths.`,name:"pad_token"},{anchor:"transformers.ReformerTokenizerFast.additional_special_tokens",description:`<strong>additional_special_tokens</strong> (<code>List[str]</code>, <em>optional</em>) &#x2014;
Additional special tokens used by the tokenizer.`,name:"additional_special_tokens"}]}}),Ze=new G({}),sa=new V({props:{name:"class transformers.ReformerModel",anchor:"transformers.ReformerModel",parameters:[{name:"config",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/reformer/modeling_reformer.py#L1961",parametersDescription:[{anchor:"transformers.ReformerModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/en/model_doc/reformer#transformers.ReformerConfig">ReformerConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/pr_15839/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}]}}),ra=new V({props:{name:"forward",anchor:"transformers.ReformerModel.forward",parameters:[{name:"input_ids",val:" = None"},{name:"attention_mask",val:" = None"},{name:"position_ids",val:" = None"},{name:"head_mask",val:" = None"},{name:"inputs_embeds",val:" = None"},{name:"num_hashes",val:" = None"},{name:"past_buckets_states",val:" = None"},{name:"use_cache",val:" = None"},{name:"output_hidden_states",val:" = None"},{name:"output_attentions",val:" = None"},{name:"return_dict",val:" = None"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/reformer/modeling_reformer.py#L1989",parametersDescription:[{anchor:"transformers.ReformerModel.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. During training the input_ids sequence_length has to be
a multiple of the relevant model&#x2019;s chunk lengths (lsh&#x2019;s, local&#x2019;s or both). During evaluation, the indices
are automatically padded to be a multiple of the chunk length.</p>
<p>Indices can be obtained using <a href="/docs/transformers/pr_15839/en/model_doc/reformer#transformers.ReformerTokenizer">ReformerTokenizer</a>. See <a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.ReformerModel.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.ReformerModel.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.ReformerModel.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.ReformerModel.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.ReformerModel.forward.num_hashes",description:`<strong>num_hashes</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The number of hashing rounds that should be performed during bucketing. Setting this argument overwrites
the default defined in <code>config.num_hashes</code>.</p>
<p>For more information, see <code>num_hashes</code> in <a href="/docs/transformers/pr_15839/en/model_doc/reformer#transformers.ReformerConfig">ReformerConfig</a>.`,name:"num_hashes"},{anchor:"transformers.ReformerModel.forward.past_buckets_states",description:`<strong>past_buckets_states</strong> (<code>List[Tuple(torch.LongTensor, torch.FloatTensor)]</code>, <em>optional</em>) &#x2014;
List of <code>Tuple(torch.LongTensor, torch.FloatTensor</code> of length <code>config.n_layers</code>, with the first element
being the previous <em>buckets</em> of shape <code>(batch_size, num_heads, num_hashes, sequence_length)</code>) and the
second being the previous <em>hidden_states</em> of shape <code>(batch_size, sequence_length, hidden_size)</code>).</p>
<p>Contains precomputed hidden-states and buckets (only relevant for LSH Self-Attention). Can be used to speed
up sequential decoding.`,name:"past_buckets_states"},{anchor:"transformers.ReformerModel.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"},{anchor:"transformers.ReformerModel.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.ReformerModel.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.ReformerModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/pr_15839/en/main_classes/output#transformers.file_utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],returnDescription:`
<p>A <code>transformers.models.reformer.modeling_reformer.ReformerModelOutput</code>or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/pr_15839/en/model_doc/reformer#transformers.ReformerConfig"
>ReformerConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_predict, hidden_size)</code>) \u2014 Sequence of hidden-states at the last layer of the model.</p>
<p><code>num_predict</code> corresponds to <code>target_mapping.shape[1]</code>. If <code>target_mapping</code> is <code>None</code>, then <code>num_predict</code>
corresponds to <code>sequence_length</code>.</p>
</li>
<li>
<p><strong>past_buckets_states</strong> (<code>List[Tuple(torch.LongTensor, torch.FloatTensor)]</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 List of <code>Tuple(torch.LongTensor, torch.FloatTensor</code> of length <code>config.n_layers</code>, with the first element
being the previous <em>buckets</em> of shape <code>(batch_size, num_heads, num_hashes, sequence_length)</code>) and the
second being the previous <em>hidden_states</em> of shape <code>(batch_size, sequence_length, hidden_size)</code>).</p>
<p>Contains precomputed buckets and hidden-states that can be used (see <code>past_buckets_states</code> input) to speed
up sequential decoding.</p>
</li>
<li>
<p><strong>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 the output of the embeddings and one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>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>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><code>transformers.models.reformer.modeling_reformer.ReformerModelOutput</code>or <code>tuple(torch.FloatTensor)</code></p>
`}}),ne=new Yn({props:{$$slots:{default:[Bu]},$$scope:{ctx:J}}}),ia=new ye({props:{code:`from transformers import ReformerTokenizer, ReformerModel
import torch

tokenizer = ReformerTokenizer.from_pretrained("google/reformer-crime-and-punishment")
model = ReformerModel.from_pretrained("google/reformer-crime-and-punishment")

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> ReformerTokenizer, ReformerModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = ReformerTokenizer.from_pretrained(<span class="hljs-string">&quot;google/reformer-crime-and-punishment&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ReformerModel.from_pretrained(<span class="hljs-string">&quot;google/reformer-crime-and-punishment&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`}}),la=new G({}),ma=new V({props:{name:"class transformers.ReformerModelWithLMHead",anchor:"transformers.ReformerModelWithLMHead",parameters:[{name:"config",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/reformer/modeling_reformer.py#L2173",parametersDescription:[{anchor:"transformers.ReformerModelWithLMHead.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/en/model_doc/reformer#transformers.ReformerConfig">ReformerConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/pr_15839/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}]}}),ga=new V({props:{name:"forward",anchor:"transformers.ReformerModelWithLMHead.forward",parameters:[{name:"input_ids",val:" = None"},{name:"position_ids",val:" = None"},{name:"attention_mask",val:" = None"},{name:"head_mask",val:" = None"},{name:"inputs_embeds",val:" = None"},{name:"num_hashes",val:" = None"},{name:"past_buckets_states",val:" = None"},{name:"use_cache",val:" = None"},{name:"output_hidden_states",val:" = None"},{name:"output_attentions",val:" = None"},{name:"return_dict",val:" = None"},{name:"labels",val:" = None"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/reformer/modeling_reformer.py#L2196",parametersDescription:[{anchor:"transformers.ReformerModelWithLMHead.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. During training the input_ids sequence_length has to be
a multiple of the relevant model&#x2019;s chunk lengths (lsh&#x2019;s, local&#x2019;s or both). During evaluation, the indices
are automatically padded to be a multiple of the chunk length.</p>
<p>Indices can be obtained using <a href="/docs/transformers/pr_15839/en/model_doc/reformer#transformers.ReformerTokenizer">ReformerTokenizer</a>. See <a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.ReformerModelWithLMHead.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.ReformerModelWithLMHead.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.ReformerModelWithLMHead.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.ReformerModelWithLMHead.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.ReformerModelWithLMHead.forward.num_hashes",description:`<strong>num_hashes</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The number of hashing rounds that should be performed during bucketing. Setting this argument overwrites
the default defined in <code>config.num_hashes</code>.</p>
<p>For more information, see <code>num_hashes</code> in <a href="/docs/transformers/pr_15839/en/model_doc/reformer#transformers.ReformerConfig">ReformerConfig</a>.`,name:"num_hashes"},{anchor:"transformers.ReformerModelWithLMHead.forward.past_buckets_states",description:`<strong>past_buckets_states</strong> (<code>List[Tuple(torch.LongTensor, torch.FloatTensor)]</code>, <em>optional</em>) &#x2014;
List of <code>Tuple(torch.LongTensor, torch.FloatTensor</code> of length <code>config.n_layers</code>, with the first element
being the previous <em>buckets</em> of shape <code>(batch_size, num_heads, num_hashes, sequence_length)</code>) and the
second being the previous <em>hidden_states</em> of shape <code>(batch_size, sequence_length, hidden_size)</code>).</p>
<p>Contains precomputed hidden-states and buckets (only relevant for LSH Self-Attention). Can be used to speed
up sequential decoding.`,name:"past_buckets_states"},{anchor:"transformers.ReformerModelWithLMHead.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"},{anchor:"transformers.ReformerModelWithLMHead.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.ReformerModelWithLMHead.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.ReformerModelWithLMHead.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/pr_15839/en/main_classes/output#transformers.file_utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.ReformerModelWithLMHead.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the sequence classification/regression loss. Indices should be in <code>[-100, 0, ..., config.vocab_size - 1]</code>. All labels set to <code>-100</code> are ignored (masked), the loss is only computed for
labels in <code>[0, ..., config.vocab_size]</code>`,name:"labels"}],returnDescription:`
<p>A <a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_outputs.CausalLMOutput"
>transformers.modeling_outputs.CausalLMOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/pr_15839/en/model_doc/reformer#transformers.ReformerConfig"
>ReformerConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Language modeling loss (for next-token prediction).</p>
</li>
<li>
<p><strong>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).</p>
</li>
<li>
<p><strong>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 the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>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>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_outputs.CausalLMOutput"
>transformers.modeling_outputs.CausalLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),re=new Yn({props:{$$slots:{default:[Xu]},$$scope:{ctx:J}}}),ua=new ye({props:{code:`import torch
from transformers import ReformerTokenizer, ReformerModelWithLMHead

tokenizer = ReformerTokenizer.from_pretrained("google/reformer-crime-and-punishment")
model = ReformerModelWithLMHead.from_pretrained("google/reformer-crime-and-punishment")

inputs = tokenizer("Hello, my dog is cute", return_tensors="pt")
outputs = model(**inputs, labels=inputs["input_ids"])
loss = outputs.loss
logits = outputs.logits`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> ReformerTokenizer, ReformerModelWithLMHead

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = ReformerTokenizer.from_pretrained(<span class="hljs-string">&quot;google/reformer-crime-and-punishment&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ReformerModelWithLMHead.from_pretrained(<span class="hljs-string">&quot;google/reformer-crime-and-punishment&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, labels=inputs[<span class="hljs-string">&quot;input_ids&quot;</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = outputs.loss
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits`}}),fa=new G({}),_a=new V({props:{name:"class transformers.ReformerForMaskedLM",anchor:"transformers.ReformerForMaskedLM",parameters:[{name:"config",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/reformer/modeling_reformer.py#L2294",parametersDescription:[{anchor:"transformers.ReformerForMaskedLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/en/model_doc/reformer#transformers.ReformerConfig">ReformerConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/pr_15839/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}]}}),wa=new V({props:{name:"forward",anchor:"transformers.ReformerForMaskedLM.forward",parameters:[{name:"input_ids",val:" = None"},{name:"position_ids",val:" = None"},{name:"attention_mask",val:" = None"},{name:"head_mask",val:" = None"},{name:"inputs_embeds",val:" = None"},{name:"num_hashes",val:" = None"},{name:"labels",val:" = None"},{name:"output_hidden_states",val:" = None"},{name:"output_attentions",val:" = None"},{name:"return_dict",val:" = None"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/reformer/modeling_reformer.py#L2312",parametersDescription:[{anchor:"transformers.ReformerForMaskedLM.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. During training the input_ids sequence_length has to be
a multiple of the relevant model&#x2019;s chunk lengths (lsh&#x2019;s, local&#x2019;s or both). During evaluation, the indices
are automatically padded to be a multiple of the chunk length.</p>
<p>Indices can be obtained using <a href="/docs/transformers/pr_15839/en/model_doc/reformer#transformers.ReformerTokenizer">ReformerTokenizer</a>. See <a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.ReformerForMaskedLM.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.ReformerForMaskedLM.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.ReformerForMaskedLM.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.ReformerForMaskedLM.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.ReformerForMaskedLM.forward.num_hashes",description:`<strong>num_hashes</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The number of hashing rounds that should be performed during bucketing. Setting this argument overwrites
the default defined in <code>config.num_hashes</code>.</p>
<p>For more information, see <code>num_hashes</code> in <a href="/docs/transformers/pr_15839/en/model_doc/reformer#transformers.ReformerConfig">ReformerConfig</a>.`,name:"num_hashes"},{anchor:"transformers.ReformerForMaskedLM.forward.past_buckets_states",description:`<strong>past_buckets_states</strong> (<code>List[Tuple(torch.LongTensor, torch.FloatTensor)]</code>, <em>optional</em>) &#x2014;
List of <code>Tuple(torch.LongTensor, torch.FloatTensor</code> of length <code>config.n_layers</code>, with the first element
being the previous <em>buckets</em> of shape <code>(batch_size, num_heads, num_hashes, sequence_length)</code>) and the
second being the previous <em>hidden_states</em> of shape <code>(batch_size, sequence_length, hidden_size)</code>).</p>
<p>Contains precomputed hidden-states and buckets (only relevant for LSH Self-Attention). Can be used to speed
up sequential decoding.`,name:"past_buckets_states"},{anchor:"transformers.ReformerForMaskedLM.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"},{anchor:"transformers.ReformerForMaskedLM.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.ReformerForMaskedLM.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.ReformerForMaskedLM.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/pr_15839/en/main_classes/output#transformers.file_utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.ReformerForMaskedLM.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`,name:"labels"}],returnDescription:`
<p>A <a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_outputs.MaskedLMOutput"
>transformers.modeling_outputs.MaskedLMOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/pr_15839/en/model_doc/reformer#transformers.ReformerConfig"
>ReformerConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Masked language modeling (MLM) loss.</p>
</li>
<li>
<p><strong>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).</p>
</li>
<li>
<p><strong>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 the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>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>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_outputs.MaskedLMOutput"
>transformers.modeling_outputs.MaskedLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),le=new Yn({props:{$$slots:{default:[Vu]},$$scope:{ctx:J}}}),za=new ye({props:{code:`from transformers import ReformerTokenizer, ReformerForMaskedLM
import torch

tokenizer = ReformerTokenizer.from_pretrained("google/reformer-crime-and-punishment")
model = ReformerForMaskedLM.from_pretrained("google/reformer-crime-and-punishment")

inputs = tokenizer("The capital of France is [MASK].", return_tensors="pt")
labels = tokenizer("The capital of France is Paris.", return_tensors="pt")["input_ids"]

outputs = model(**inputs, labels=labels)
loss = outputs.loss
logits = outputs.logits`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> ReformerTokenizer, ReformerForMaskedLM
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = ReformerTokenizer.from_pretrained(<span class="hljs-string">&quot;google/reformer-crime-and-punishment&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ReformerForMaskedLM.from_pretrained(<span class="hljs-string">&quot;google/reformer-crime-and-punishment&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;The capital of France is [MASK].&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>labels = tokenizer(<span class="hljs-string">&quot;The capital of France is Paris.&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)[<span class="hljs-string">&quot;input_ids&quot;</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs, labels=labels)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = outputs.loss
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits`}}),xa=new G({}),Ta=new V({props:{name:"class transformers.ReformerForSequenceClassification",anchor:"transformers.ReformerForSequenceClassification",parameters:[{name:"config",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/reformer/modeling_reformer.py#L2380",parametersDescription:[{anchor:"transformers.ReformerForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/en/model_doc/reformer#transformers.ReformerConfig">ReformerConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/pr_15839/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}]}}),La=new V({props:{name:"forward",anchor:"transformers.ReformerForSequenceClassification.forward",parameters:[{name:"input_ids",val:" = None"},{name:"position_ids",val:" = None"},{name:"attention_mask",val:" = None"},{name:"head_mask",val:" = None"},{name:"inputs_embeds",val:" = None"},{name:"num_hashes",val:" = None"},{name:"labels",val:" = None"},{name:"output_hidden_states",val:" = None"},{name:"output_attentions",val:" = None"},{name:"return_dict",val:" = None"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/reformer/modeling_reformer.py#L2394",parametersDescription:[{anchor:"transformers.ReformerForSequenceClassification.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. During training the input_ids sequence_length has to be
a multiple of the relevant model&#x2019;s chunk lengths (lsh&#x2019;s, local&#x2019;s or both). During evaluation, the indices
are automatically padded to be a multiple of the chunk length.</p>
<p>Indices can be obtained using <a href="/docs/transformers/pr_15839/en/model_doc/reformer#transformers.ReformerTokenizer">ReformerTokenizer</a>. See <a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.ReformerForSequenceClassification.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.ReformerForSequenceClassification.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.ReformerForSequenceClassification.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.ReformerForSequenceClassification.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.ReformerForSequenceClassification.forward.num_hashes",description:`<strong>num_hashes</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The number of hashing rounds that should be performed during bucketing. Setting this argument overwrites
the default defined in <code>config.num_hashes</code>.</p>
<p>For more information, see <code>num_hashes</code> in <a href="/docs/transformers/pr_15839/en/model_doc/reformer#transformers.ReformerConfig">ReformerConfig</a>.`,name:"num_hashes"},{anchor:"transformers.ReformerForSequenceClassification.forward.past_buckets_states",description:`<strong>past_buckets_states</strong> (<code>List[Tuple(torch.LongTensor, torch.FloatTensor)]</code>, <em>optional</em>) &#x2014;
List of <code>Tuple(torch.LongTensor, torch.FloatTensor</code> of length <code>config.n_layers</code>, with the first element
being the previous <em>buckets</em> of shape <code>(batch_size, num_heads, num_hashes, sequence_length)</code>) and the
second being the previous <em>hidden_states</em> of shape <code>(batch_size, sequence_length, hidden_size)</code>).</p>
<p>Contains precomputed hidden-states and buckets (only relevant for LSH Self-Attention). Can be used to speed
up sequential decoding.`,name:"past_buckets_states"},{anchor:"transformers.ReformerForSequenceClassification.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"},{anchor:"transformers.ReformerForSequenceClassification.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.ReformerForSequenceClassification.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.ReformerForSequenceClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/pr_15839/en/main_classes/output#transformers.file_utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.ReformerForSequenceClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the sequence classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss), If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],returnDescription:`
<p>A <a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_outputs.SequenceClassifierOutput"
>transformers.modeling_outputs.SequenceClassifierOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/pr_15839/en/model_doc/reformer#transformers.ReformerConfig"
>ReformerConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification (or regression if config.num_labels==1) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Classification (or regression if config.num_labels==1) scores (before SoftMax).</p>
</li>
<li>
<p><strong>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 the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>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>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_outputs.SequenceClassifierOutput"
>transformers.modeling_outputs.SequenceClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),pe=new Yn({props:{$$slots:{default:[Gu]},$$scope:{ctx:J}}}),Fa=new ye({props:{code:`import torch
from transformers import ReformerTokenizer, ReformerForSequenceClassification

torch.manual_seed(0)
tokenizer = ReformerTokenizer.from_pretrained("google/reformer-crime-and-punishment")
model = ReformerForSequenceClassification.from_pretrained("google/reformer-crime-and-punishment", num_labels=2)

inputs = tokenizer("Hello, my dog is cute", return_tensors="pt")
labels = torch.tensor([1]).unsqueeze(0)  # Batch size 1
outputs = model(**inputs, labels=labels)
loss = outputs.loss
logits = outputs.logits
list(logits.shape)
`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> ReformerTokenizer, ReformerForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>torch.manual_seed(<span class="hljs-number">0</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = ReformerTokenizer.from_pretrained(<span class="hljs-string">&quot;google/reformer-crime-and-punishment&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ReformerForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;google/reformer-crime-and-punishment&quot;</span>, num_labels=<span class="hljs-number">2</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>labels = torch.tensor([<span class="hljs-number">1</span>]).unsqueeze(<span class="hljs-number">0</span>)  <span class="hljs-comment"># Batch size 1</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs, labels=labels)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = outputs.loss
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(logits.shape)
`}}),Pa=new ye({props:{code:`import torch
from transformers import ReformerTokenizer, ReformerForSequenceClassification

torch.manual_seed(0)
tokenizer = ReformerTokenizer.from_pretrained("google/reformer-crime-and-punishment")
model = ReformerForSequenceClassification.from_pretrained("google/reformer-crime-and-punishment", problem_type="multi_label_classification", num_labels=2)

inputs = tokenizer("Hello, my dog is cute", return_tensors="pt")
labels = torch.tensor([[1, 1]], dtype=torch.float)  # need dtype=float for BCEWithLogitsLoss
outputs = model(**inputs, labels=labels)
loss = outputs.loss
list(logits.shape)
`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> ReformerTokenizer, ReformerForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>torch.manual_seed(<span class="hljs-number">0</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = ReformerTokenizer.from_pretrained(<span class="hljs-string">&quot;google/reformer-crime-and-punishment&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ReformerForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;google/reformer-crime-and-punishment&quot;</span>, problem_type=<span class="hljs-string">&quot;multi_label_classification&quot;</span>, num_labels=<span class="hljs-number">2</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>labels = torch.tensor([[<span class="hljs-number">1</span>, <span class="hljs-number">1</span>]], dtype=torch.<span class="hljs-built_in">float</span>)  <span class="hljs-comment"># need dtype=float for BCEWithLogitsLoss</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs, labels=labels)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = outputs.loss
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(logits.shape)
`}}),Ca=new G({}),Aa=new V({props:{name:"class transformers.ReformerForQuestionAnswering",anchor:"transformers.ReformerForQuestionAnswering",parameters:[{name:"config",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/reformer/modeling_reformer.py#L2501",parametersDescription:[{anchor:"transformers.ReformerForQuestionAnswering.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_15839/en/model_doc/reformer#transformers.ReformerConfig">ReformerConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/pr_15839/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}]}}),Oa=new V({props:{name:"forward",anchor:"transformers.ReformerForQuestionAnswering.forward",parameters:[{name:"input_ids",val:" = None"},{name:"position_ids",val:" = None"},{name:"attention_mask",val:" = None"},{name:"head_mask",val:" = None"},{name:"inputs_embeds",val:" = None"},{name:"num_hashes",val:" = None"},{name:"start_positions",val:" = None"},{name:"end_positions",val:" = None"},{name:"output_hidden_states",val:" = None"},{name:"output_attentions",val:" = None"},{name:"return_dict",val:" = None"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/models/reformer/modeling_reformer.py#L2513",parametersDescription:[{anchor:"transformers.ReformerForQuestionAnswering.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. During training the input_ids sequence_length has to be
a multiple of the relevant model&#x2019;s chunk lengths (lsh&#x2019;s, local&#x2019;s or both). During evaluation, the indices
are automatically padded to be a multiple of the chunk length.</p>
<p>Indices can be obtained using <a href="/docs/transformers/pr_15839/en/model_doc/reformer#transformers.ReformerTokenizer">ReformerTokenizer</a>. See <a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.ReformerForQuestionAnswering.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.ReformerForQuestionAnswering.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.ReformerForQuestionAnswering.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.ReformerForQuestionAnswering.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.ReformerForQuestionAnswering.forward.num_hashes",description:`<strong>num_hashes</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The number of hashing rounds that should be performed during bucketing. Setting this argument overwrites
the default defined in <code>config.num_hashes</code>.</p>
<p>For more information, see <code>num_hashes</code> in <a href="/docs/transformers/pr_15839/en/model_doc/reformer#transformers.ReformerConfig">ReformerConfig</a>.`,name:"num_hashes"},{anchor:"transformers.ReformerForQuestionAnswering.forward.past_buckets_states",description:`<strong>past_buckets_states</strong> (<code>List[Tuple(torch.LongTensor, torch.FloatTensor)]</code>, <em>optional</em>) &#x2014;
List of <code>Tuple(torch.LongTensor, torch.FloatTensor</code> of length <code>config.n_layers</code>, with the first element
being the previous <em>buckets</em> of shape <code>(batch_size, num_heads, num_hashes, sequence_length)</code>) and the
second being the previous <em>hidden_states</em> of shape <code>(batch_size, sequence_length, hidden_size)</code>).</p>
<p>Contains precomputed hidden-states and buckets (only relevant for LSH Self-Attention). Can be used to speed
up sequential decoding.`,name:"past_buckets_states"},{anchor:"transformers.ReformerForQuestionAnswering.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"},{anchor:"transformers.ReformerForQuestionAnswering.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.ReformerForQuestionAnswering.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.ReformerForQuestionAnswering.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/pr_15839/en/main_classes/output#transformers.file_utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.ReformerForQuestionAnswering.forward.start_positions",description:`<strong>start_positions</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for position (index) of the start of the labelled span for computing the token classification loss.
Positions are clamped to the length of the sequence (<code>sequence_length</code>). Position outside of the sequence
are not taken into account for computing the loss.`,name:"start_positions"},{anchor:"transformers.ReformerForQuestionAnswering.forward.end_positions",description:`<strong>end_positions</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for position (index) of the end of the labelled span for computing the token classification loss.
Positions are clamped to the length of the sequence (<code>sequence_length</code>). Position outside of the sequence
are not taken into account for computing the loss.`,name:"end_positions"}],returnDescription:`
<p>A <a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_outputs.QuestionAnsweringModelOutput"
>transformers.modeling_outputs.QuestionAnsweringModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/pr_15839/en/model_doc/reformer#transformers.ReformerConfig"
>ReformerConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Total span extraction loss is the sum of a Cross-Entropy for the start and end positions.</p>
</li>
<li>
<p><strong>start_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>) \u2014 Span-start scores (before SoftMax).</p>
</li>
<li>
<p><strong>end_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>) \u2014 Span-end scores (before SoftMax).</p>
</li>
<li>
<p><strong>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 the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>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>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/pr_15839/en/main_classes/output#transformers.modeling_outputs.QuestionAnsweringModelOutput"
>transformers.modeling_outputs.QuestionAnsweringModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),he=new Yn({props:{$$slots:{default:[Ju]},$$scope:{ctx:J}}}),Ia=new ye({props:{code:`from transformers import ReformerTokenizer, ReformerForQuestionAnswering
import torch

torch.manual_seed(0)
tokenizer = ReformerTokenizer.from_pretrained("google/reformer-crime-and-punishment")
model = ReformerForQuestionAnswering.from_pretrained("google/reformer-crime-and-punishment")

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

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


start_scores = outputs.start_logits
list(start_scores.shape)


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

<span class="hljs-meta">&gt;&gt;&gt; </span>torch.manual_seed(<span class="hljs-number">0</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = ReformerTokenizer.from_pretrained(<span class="hljs-string">&quot;google/reformer-crime-and-punishment&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ReformerForQuestionAnswering.from_pretrained(<span class="hljs-string">&quot;google/reformer-crime-and-punishment&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>question, text = <span class="hljs-string">&quot;Who was Jim Henson?&quot;</span>, <span class="hljs-string">&quot;Jim Henson was a nice puppet&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(question, text, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>start_positions = torch.tensor([<span class="hljs-number">1</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>end_positions = torch.tensor([<span class="hljs-number">3</span>])

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


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


<span class="hljs-meta">&gt;&gt;&gt; </span>end_scores = outputs.end_logits
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(end_scores.shape)
`}}),{c(){d=o("meta"),M=m(),g=o("h1"),z=o("a"),R=o("span"),u(w.$$.fragment),k=m(),L=o("span"),Ti=t("Reformer"),Zn=m(),ws=o("p"),Rt=o("strong"),Mi=t("DISCLAIMER:"),Ri=t(" This model is still a work in progress, if you see something strange, file a "),be=o("a"),$i=t("Github Issue"),qi=t("."),so=m(),zs=o("h2"),Bs=o("a"),$t=o("span"),u(ke.$$.fragment),Ei=m(),qt=o("span"),Li=t("Overview"),eo=m(),Xs=o("p"),Fi=t("The Reformer model was proposed in the paper "),we=o("a"),Pi=t("Reformer: The Efficient Transformer"),Ci=t(" by Nikita Kitaev, \u0141ukasz Kaiser, Anselm Levskaya."),ao=m(),Ka=o("p"),Ai=t("The abstract from the paper is the following:"),to=m(),Ua=o("p"),Et=o("em"),ji=t(`Large Transformer models routinely achieve state-of-the-art results on a number of tasks but training these models can
be prohibitively costly, especially on long sequences. We introduce two techniques to improve the efficiency of
Transformers. For one, we replace dot-product attention by one that uses locality-sensitive hashing, changing its
complexity from O(L^2) to O(Llog(L)), where L is the length of the sequence. Furthermore, we use reversible residual
layers instead of the standard residuals, which allows storing activations only once in the training process instead of
N times, where N is the number of layers. The resulting model, the Reformer, performs on par with Transformer models
while being much more memory-efficient and much faster on long sequences.`),no=m(),is=o("p"),Si=t("This model was contributed by "),ze=o("a"),Ni=t("patrickvonplaten"),Di=t(`. The Authors\u2019 code can be
found `),xe=o("a"),Hi=t("here"),Oi=t("."),oo=m(),Te=o("p"),Lt=o("strong"),Ii=t("Note"),Wi=t(":"),ro=m(),Ba=o("ul"),ls=o("li"),Qi=t("Reformer does "),Ft=o("strong"),Ki=t("not"),Ui=t(" work with "),Pt=o("em"),Bi=t("torch.nn.DataParallel"),Xi=t(" due to a bug in PyTorch, see "),Me=o("a"),Vi=t("issue #36035"),io=m(),xs=o("h2"),Vs=o("a"),Ct=o("span"),u(Re.$$.fragment),Gi=m(),At=o("span"),Ji=t("Axial Positional Encodings"),lo=m(),$=o("p"),Yi=t("Axial Positional Encodings were first implemented in Google\u2019s "),$e=o("a"),Zi=t("trax library"),sl=t(`
and developed by the authors of this model\u2019s paper. In models that are treating very long input sequences, the
conventional position id encodings store an embedings vector of size `),mo=new x,po=t(" being the "),jt=o("code"),el=t("config.hidden_size"),al=t(` for
every position `),co=new x,ho=t(", with "),go=new x,uo=t(" being "),St=o("code"),tl=t("config.max_embedding_size"),nl=t(`. This means that having
a sequence length of `),fo=new x,_o=t(" and a "),Nt=o("code"),ol=t("config.hidden_size"),rl=t(" of "),vo=new x,yo=t(`
would result in a position encoding matrix:
`),bo=new x,ko=m(),Ts=o("p"),il=t("which alone has over 500M parameters to store. Axial positional encodings factorize "),wo=new x,zo=t(` into two matrices:
`),xo=new x,To=m(),qe=o("p"),ll=t(`and
`),Mo=new x,Ro=m(),Ee=o("p"),ml=t(`with:
`),$o=new x,qo=m(),Le=o("p"),pl=t(`Therefore the following holds:
`),Eo=new x,Lo=m(),F=o("p"),cl=t("Intuitively, this means that a position embedding vector "),Fo=new x,Po=t(` is now the composition of two
factorized embedding vectors: `),Co=new x,Ao=t(", where as the "),Dt=o("code"),hl=t("config.max_embedding_size"),dl=t(` dimension
`),jo=new x,So=t(" is factorized into "),No=new x,Do=t(`. This design ensures that each position embedding vector
`),Ho=new x,Oo=t(" is unique."),Io=m(),ms=o("p"),gl=t("Using the above example again, axial position encoding with "),Wo=new x,Qo=t(`
can drastically reduced the number of parameters to `),Ko=new x,Uo=t(" parameters."),Bo=m(),q=o("p"),ul=t("In practice, the parameter "),Ht=o("code"),fl=t("config.axial_pos_embds_dim"),_l=t(" is set to a tuple "),Xo=new x,Vo=t(` which sum has to be
equal to `),Ot=o("code"),vl=t("config.hidden_size"),yl=t(" and "),It=o("code"),bl=t("config.axial_pos_shape"),kl=t(" is set to a tuple "),Go=new x,Jo=t(` which
product has to be equal to `),Wt=o("code"),wl=t("config.max_embedding_size"),zl=t(", which during training has to be equal to the "),Qt=o("em"),xl=t(`sequence
length`),Tl=t(" of the "),Kt=o("code"),Ml=t("input_ids"),Rl=t("."),Yo=m(),Ms=o("h2"),Gs=o("a"),Ut=o("span"),u(Fe.$$.fragment),$l=m(),Bt=o("span"),ql=t("LSH Self Attention"),Zo=m(),Z=o("p"),El=t(`In Locality sensitive hashing (LSH) self attention the key and query projection weights are tied. Therefore, the key
query embedding vectors are also tied. LSH self attention uses the locality sensitive hashing mechanism proposed in
`),Pe=o("a"),Ll=t("Practical and Optimal LSH for Angular Distance"),Fl=t(` to assign each of the tied key
query embedding vectors to one of `),Xt=o("code"),Pl=t("config.num_buckets"),Cl=t(` possible buckets. The premise is that the more \u201Csimilar\u201D
key query embedding vectors (in terms of `),Vt=o("em"),Al=t("cosine similarity"),jl=t(`) are to each other, the more likely they are assigned to
the same bucket.`),sr=m(),S=o("p"),Sl=t("The accuracy of the LSH mechanism can be improved by increasing "),Gt=o("code"),Nl=t("config.num_hashes"),Dl=t(` or directly the argument
`),Jt=o("code"),Hl=t("num_hashes"),Ol=t(` of the forward function so that the output of the LSH self attention better approximates the output
of the \u201Cnormal\u201D full self attention. The buckets are then sorted and chunked into query key embedding vector chunks
each of length `),Yt=o("code"),Il=t("config.lsh_chunk_length"),Wl=t(`. For each chunk, the query embedding vectors attend to its key vectors
(which are tied to themselves) and to the key embedding vectors of `),Zt=o("code"),Ql=t("config.lsh_num_chunks_before"),Kl=t(` previous
neighboring chunks and `),sn=o("code"),Ul=t("config.lsh_num_chunks_after"),Bl=t(" following neighboring chunks."),er=m(),ps=o("p"),Xl=t("For more information, see the "),Ce=o("a"),Vl=t("original Paper"),Gl=t(" or this great "),Ae=o("a"),Jl=t("blog post"),Yl=t("."),ar=m(),I=o("p"),Zl=t("Note that "),en=o("code"),sm=t("config.num_buckets"),em=t(" can also be factorized into a list "),tr=new x,nr=t(". This way instead of assigning the query key embedding vectors to one of "),or=new x,rr=t(" they are assigned to one of "),ir=new x,lr=t(`. This is crucial for very long sequences to
save memory.`),mr=m(),cs=o("p"),am=t("When training a model from scratch, it is recommended to leave "),an=o("code"),tm=t("config.num_buckets=None"),nm=t(`, so that depending on the
sequence length a good value for `),tn=o("code"),om=t("num_buckets"),rm=t(` is calculated on the fly. This value will then automatically be
saved in the config and should be reused for inference.`),pr=m(),ss=o("p"),im=t(`Using LSH self attention, the memory and time complexity of the query-key matmul operation can be reduced from
`),cr=new x,hr=t(" to "),dr=new x,gr=t(`, which usually represents the memory
and time bottleneck in a transformer model, with `),ur=new x,fr=t(" being the sequence length."),_r=m(),Rs=o("h2"),Js=o("a"),nn=o("span"),u(je.$$.fragment),lm=m(),on=o("span"),mm=t("Local Self Attention"),vr=m(),es=o("p"),pm=t(`Local self attention is essentially a \u201Cnormal\u201D self attention layer with key, query and value projections, but is
chunked so that in each chunk of length `),rn=o("code"),cm=t("config.local_chunk_length"),hm=t(` the query embedding vectors only attends to
the key embedding vectors in its chunk and to the key embedding vectors of `),ln=o("code"),dm=t("config.local_num_chunks_before"),gm=t(`
previous neighboring chunks and `),mn=o("code"),um=t("config.local_num_chunks_after"),fm=t(" following neighboring chunks."),yr=m(),as=o("p"),_m=t(`Using Local self attention, the memory and time complexity of the query-key matmul operation can be reduced from
`),br=new x,kr=t(" to "),wr=new x,zr=t(`, which usually represents the memory
and time bottleneck in a transformer model, with `),xr=new x,Tr=t(" being the sequence length."),Mr=m(),$s=o("h2"),Ys=o("a"),pn=o("span"),u(Se.$$.fragment),vm=m(),cn=o("span"),ym=t("Training"),Rr=m(),hs=o("p"),bm=t(`During training, we must ensure that the sequence length is set to a value that can be divided by the least common
multiple of `),hn=o("code"),km=t("config.lsh_chunk_length"),wm=t(" and "),dn=o("code"),zm=t("config.local_chunk_length"),xm=t(` and that the parameters of the Axial
Positional Encodings are correctly set as described above. Reformer is very memory efficient so that the model can
easily be trained on sequences as long as 64000 tokens.`),$r=m(),Zs=o("p"),Tm=t("For training, the "),Xa=o("a"),Mm=t("ReformerModelWithLMHead"),Rm=t(" should be used as follows:"),qr=m(),u(Ne.$$.fragment),Er=m(),qs=o("h2"),se=o("a"),gn=o("span"),u(De.$$.fragment),$m=m(),un=o("span"),qm=t("ReformerConfig"),Lr=m(),N=o("div"),u(He.$$.fragment),Em=m(),Oe=o("p"),Lm=t("This is the configuration class to store the configuration of a "),Va=o("a"),Fm=t("ReformerModel"),Pm=t(`. It is used to instantiate a
Reformer model according to the specified arguments, defining the model architecture.`),Cm=m(),Es=o("p"),Am=t("Configuration objects inherit from "),Ga=o("a"),jm=t("PretrainedConfig"),Sm=t(` and can be used to control the model outputs. Read the
documentation from `),Ja=o("a"),Nm=t("PretrainedConfig"),Dm=t(" for more information."),Hm=m(),fn=o("p"),Om=t("Examples:"),Im=m(),u(Ie.$$.fragment),Fr=m(),Ls=o("h2"),ee=o("a"),_n=o("span"),u(We.$$.fragment),Wm=m(),vn=o("span"),Qm=t("ReformerTokenizer"),Pr=m(),Y=o("div"),u(Qe.$$.fragment),Km=m(),Ke=o("p"),Um=t("Construct a Reformer tokenizer. Based on "),Ue=o("a"),Bm=t("SentencePiece"),Xm=t(" ."),Vm=m(),Be=o("p"),Gm=t("This tokenizer inherits from "),Ya=o("a"),Jm=t("PreTrainedTokenizer"),Ym=t(` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),Zm=m(),Za=o("div"),u(Xe.$$.fragment),Cr=m(),Fs=o("h2"),ae=o("a"),yn=o("span"),u(Ve.$$.fragment),sp=m(),bn=o("span"),ep=t("ReformerTokenizerFast"),Ar=m(),rs=o("div"),u(Ge.$$.fragment),ap=m(),Ps=o("p"),tp=t("Construct a \u201Cfast\u201D Reformer tokenizer (backed by HuggingFace\u2019s "),kn=o("em"),np=t("tokenizers"),op=t(` library). Based on
`),Je=o("a"),rp=t("Unigram"),ip=t("."),lp=m(),Ye=o("p"),mp=t("This tokenizer inherits from "),st=o("a"),pp=t("PreTrainedTokenizerFast"),cp=t(` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),jr=m(),Cs=o("h2"),te=o("a"),wn=o("span"),u(Ze.$$.fragment),hp=m(),zn=o("span"),dp=t("ReformerModel"),Sr=m(),D=o("div"),u(sa.$$.fragment),gp=m(),ea=o("p"),up=t(`The bare Reformer Model transformer outputting raw hidden-stateswithout any specific head on top.
Reformer was proposed in `),aa=o("a"),fp=t("Reformer: The Efficient Transformer"),_p=t(` by Nikita Kitaev,
\u0141ukasz Kaiser, Anselm Levskaya.`),vp=m(),ta=o("p"),yp=t("This model inherits from "),et=o("a"),bp=t("PreTrainedModel"),kp=t(`. 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.)`),wp=m(),na=o("p"),zp=t("This model is also a PyTorch "),oa=o("a"),xp=t("torch.nn.Module"),Tp=t(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Mp=m(),W=o("div"),u(ra.$$.fragment),Rp=m(),As=o("p"),$p=t("The "),at=o("a"),qp=t("ReformerModel"),Ep=t(" forward method, overrides the "),xn=o("code"),Lp=t("__call__"),Fp=t(" special method."),Pp=m(),u(ne.$$.fragment),Cp=m(),Tn=o("p"),Ap=t("Example:"),jp=m(),u(ia.$$.fragment),Nr=m(),js=o("h2"),oe=o("a"),Mn=o("span"),u(la.$$.fragment),Sp=m(),Rn=o("span"),Np=t("ReformerModelWithLMHead"),Dr=m(),H=o("div"),u(ma.$$.fragment),Dp=m(),Ss=o("p"),Hp=t("Reformer Model with a "),$n=o("code"),Op=t("language modeling"),Ip=t(` head on top.
Reformer was proposed in `),pa=o("a"),Wp=t("Reformer: The Efficient Transformer"),Qp=t(` by Nikita Kitaev,
\u0141ukasz Kaiser, Anselm Levskaya.`),Kp=m(),ca=o("p"),Up=t("This model inherits from "),tt=o("a"),Bp=t("PreTrainedModel"),Xp=t(`. 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.)`),Vp=m(),ha=o("p"),Gp=t("This model is also a PyTorch "),da=o("a"),Jp=t("torch.nn.Module"),Yp=t(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Zp=m(),Q=o("div"),u(ga.$$.fragment),sc=m(),Ns=o("p"),ec=t("The "),nt=o("a"),ac=t("ReformerModelWithLMHead"),tc=t(" forward method, overrides the "),qn=o("code"),nc=t("__call__"),oc=t(" special method."),rc=m(),u(re.$$.fragment),ic=m(),En=o("p"),lc=t("Example:"),mc=m(),u(ua.$$.fragment),Hr=m(),Ds=o("h2"),ie=o("a"),Ln=o("span"),u(fa.$$.fragment),pc=m(),Fn=o("span"),cc=t("ReformerForMaskedLM"),Or=m(),O=o("div"),u(_a.$$.fragment),hc=m(),Hs=o("p"),dc=t("Reformer Model with a "),Pn=o("code"),gc=t("language modeling"),uc=t(` head on top.
Reformer was proposed in `),va=o("a"),fc=t("Reformer: The Efficient Transformer"),_c=t(` by Nikita Kitaev,
\u0141ukasz Kaiser, Anselm Levskaya.`),vc=m(),ya=o("p"),yc=t("This model inherits from "),ot=o("a"),bc=t("PreTrainedModel"),kc=t(`. 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.)`),wc=m(),ba=o("p"),zc=t("This model is also a PyTorch "),ka=o("a"),xc=t("torch.nn.Module"),Tc=t(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Mc=m(),K=o("div"),u(wa.$$.fragment),Rc=m(),Os=o("p"),$c=t("The "),rt=o("a"),qc=t("ReformerForMaskedLM"),Ec=t(" forward method, overrides the "),Cn=o("code"),Lc=t("__call__"),Fc=t(" special method."),Pc=m(),u(le.$$.fragment),Cc=m(),An=o("p"),Ac=t("Example:"),jc=m(),u(za.$$.fragment),Ir=m(),Is=o("h2"),me=o("a"),jn=o("span"),u(xa.$$.fragment),Sc=m(),Sn=o("span"),Nc=t("ReformerForSequenceClassification"),Wr=m(),A=o("div"),u(Ta.$$.fragment),Dc=m(),Nn=o("p"),Hc=t(`Reformer Model transformer with a sequence classification/regression head on top (a linear layer on top of the
pooled output) e.g. for GLUE tasks.`),Oc=m(),Ma=o("p"),Ic=t("Reformer was proposed in "),Ra=o("a"),Wc=t("Reformer: The Efficient Transformer"),Qc=t(` by Nikita Kitaev,
\u0141ukasz Kaiser, Anselm Levskaya.`),Kc=m(),$a=o("p"),Uc=t("This model inherits from "),it=o("a"),Bc=t("PreTrainedModel"),Xc=t(`. 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.)`),Vc=m(),qa=o("p"),Gc=t("This model is also a PyTorch "),Ea=o("a"),Jc=t("torch.nn.Module"),Yc=t(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Zc=m(),P=o("div"),u(La.$$.fragment),sh=m(),Ws=o("p"),eh=t("The "),lt=o("a"),ah=t("ReformerForSequenceClassification"),th=t(" forward method, overrides the "),Dn=o("code"),nh=t("__call__"),oh=t(" special method."),rh=m(),u(pe.$$.fragment),ih=m(),Hn=o("p"),lh=t("Example of single-label classification:"),mh=m(),u(Fa.$$.fragment),ph=m(),On=o("p"),ch=t("Example of multi-label classification:"),hh=m(),u(Pa.$$.fragment),Qr=m(),Qs=o("h2"),ce=o("a"),In=o("span"),u(Ca.$$.fragment),dh=m(),Wn=o("span"),gh=t("ReformerForQuestionAnswering"),Kr=m(),j=o("div"),u(Aa.$$.fragment),uh=m(),Ks=o("p"),fh=t(`Reformer Model with a span classification head on top for extractive question-answering tasks like SQuAD / TriviaQA
( a linear layer on top of hidden-states output to compute `),Qn=o("code"),_h=t("span start logits"),vh=t(" and "),Kn=o("code"),yh=t("span end logits"),bh=t("."),kh=m(),ja=o("p"),wh=t("Reformer was proposed in "),Sa=o("a"),zh=t("Reformer: The Efficient Transformer"),xh=t(` by Nikita Kitaev,
\u0141ukasz Kaiser, Anselm Levskaya.`),Th=m(),Na=o("p"),Mh=t("This model inherits from "),mt=o("a"),Rh=t("PreTrainedModel"),$h=t(`. 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.)`),qh=m(),Da=o("p"),Eh=t("This model is also a PyTorch "),Ha=o("a"),Lh=t("torch.nn.Module"),Fh=t(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Ph=m(),U=o("div"),u(Oa.$$.fragment),Ch=m(),Us=o("p"),Ah=t("The "),pt=o("a"),jh=t("ReformerForQuestionAnswering"),Sh=t(" forward method, overrides the "),Un=o("code"),Nh=t("__call__"),Dh=t(" special method."),Hh=m(),u(he.$$.fragment),Oh=m(),Bn=o("p"),Ih=t("Example:"),Wh=m(),u(Ia.$$.fragment),this.h()},l(e){const c=Uu('[data-svelte="svelte-1phssyn"]',document.head);d=r(c,"META",{name:!0,content:!0}),c.forEach(a),M=p(e),g=r(e,"H1",{class:!0});var Wa=i(g);z=r(Wa,"A",{id:!0,class:!0,href:!0});var Xn=i(z);R=r(Xn,"SPAN",{});var Vn=i(R);f(w.$$.fragment,Vn),Vn.forEach(a),Xn.forEach(a),k=p(Wa),L=r(Wa,"SPAN",{});var Gn=i(L);Ti=n(Gn,"Reformer"),Gn.forEach(a),Wa.forEach(a),Zn=p(e),ws=r(e,"P",{});var de=i(ws);Rt=r(de,"STRONG",{});var Xh=i(Rt);Mi=n(Xh,"DISCLAIMER:"),Xh.forEach(a),Ri=n(de," This model is still a work in progress, if you see something strange, file a "),be=r(de,"A",{href:!0,rel:!0});var Vh=i(be);$i=n(Vh,"Github Issue"),Vh.forEach(a),qi=n(de,"."),de.forEach(a),so=p(e),zs=r(e,"H2",{class:!0});var Br=i(zs);Bs=r(Br,"A",{id:!0,class:!0,href:!0});var Gh=i(Bs);$t=r(Gh,"SPAN",{});var Jh=i($t);f(ke.$$.fragment,Jh),Jh.forEach(a),Gh.forEach(a),Ei=p(Br),qt=r(Br,"SPAN",{});var Yh=i(qt);Li=n(Yh,"Overview"),Yh.forEach(a),Br.forEach(a),eo=p(e),Xs=r(e,"P",{});var Xr=i(Xs);Fi=n(Xr,"The Reformer model was proposed in the paper "),we=r(Xr,"A",{href:!0,rel:!0});var Zh=i(we);Pi=n(Zh,"Reformer: The Efficient Transformer"),Zh.forEach(a),Ci=n(Xr," by Nikita Kitaev, \u0141ukasz Kaiser, Anselm Levskaya."),Xr.forEach(a),ao=p(e),Ka=r(e,"P",{});var sd=i(Ka);Ai=n(sd,"The abstract from the paper is the following:"),sd.forEach(a),to=p(e),Ua=r(e,"P",{});var ed=i(Ua);Et=r(ed,"EM",{});var ad=i(Et);ji=n(ad,`Large Transformer models routinely achieve state-of-the-art results on a number of tasks but training these models can
be prohibitively costly, especially on long sequences. We introduce two techniques to improve the efficiency of
Transformers. For one, we replace dot-product attention by one that uses locality-sensitive hashing, changing its
complexity from O(L^2) to O(Llog(L)), where L is the length of the sequence. Furthermore, we use reversible residual
layers instead of the standard residuals, which allows storing activations only once in the training process instead of
N times, where N is the number of layers. The resulting model, the Reformer, performs on par with Transformer models
while being much more memory-efficient and much faster on long sequences.`),ad.forEach(a),ed.forEach(a),no=p(e),is=r(e,"P",{});var ct=i(is);Si=n(ct,"This model was contributed by "),ze=r(ct,"A",{href:!0,rel:!0});var td=i(ze);Ni=n(td,"patrickvonplaten"),td.forEach(a),Di=n(ct,`. The Authors\u2019 code can be
found `),xe=r(ct,"A",{href:!0,rel:!0});var nd=i(xe);Hi=n(nd,"here"),nd.forEach(a),Oi=n(ct,"."),ct.forEach(a),oo=p(e),Te=r(e,"P",{});var Qh=i(Te);Lt=r(Qh,"STRONG",{});var od=i(Lt);Ii=n(od,"Note"),od.forEach(a),Wi=n(Qh,":"),Qh.forEach(a),ro=p(e),Ba=r(e,"UL",{});var rd=i(Ba);ls=r(rd,"LI",{});var Qa=i(ls);Qi=n(Qa,"Reformer does "),Ft=r(Qa,"STRONG",{});var id=i(Ft);Ki=n(id,"not"),id.forEach(a),Ui=n(Qa," work with "),Pt=r(Qa,"EM",{});var ld=i(Pt);Bi=n(ld,"torch.nn.DataParallel"),ld.forEach(a),Xi=n(Qa," due to a bug in PyTorch, see "),Me=r(Qa,"A",{href:!0,rel:!0});var md=i(Me);Vi=n(md,"issue #36035"),md.forEach(a),Qa.forEach(a),rd.forEach(a),io=p(e),xs=r(e,"H2",{class:!0});var Vr=i(xs);Vs=r(Vr,"A",{id:!0,class:!0,href:!0});var pd=i(Vs);Ct=r(pd,"SPAN",{});var cd=i(Ct);f(Re.$$.fragment,cd),cd.forEach(a),pd.forEach(a),Gi=p(Vr),At=r(Vr,"SPAN",{});var hd=i(At);Ji=n(hd,"Axial Positional Encodings"),hd.forEach(a),Vr.forEach(a),lo=p(e),$=r(e,"P",{});var E=i($);Yi=n(E,"Axial Positional Encodings were first implemented in Google\u2019s "),$e=r(E,"A",{href:!0,rel:!0});var dd=i($e);Zi=n(dd,"trax library"),dd.forEach(a),sl=n(E,`
and developed by the authors of this model\u2019s paper. In models that are treating very long input sequences, the
conventional position id encodings store an embedings vector of size `),mo=T(E),po=n(E," being the "),jt=r(E,"CODE",{});var gd=i(jt);el=n(gd,"config.hidden_size"),gd.forEach(a),al=n(E,` for
every position `),co=T(E),ho=n(E,", with "),go=T(E),uo=n(E," being "),St=r(E,"CODE",{});var ud=i(St);tl=n(ud,"config.max_embedding_size"),ud.forEach(a),nl=n(E,`. This means that having
a sequence length of `),fo=T(E),_o=n(E," and a "),Nt=r(E,"CODE",{});var fd=i(Nt);ol=n(fd,"config.hidden_size"),fd.forEach(a),rl=n(E," of "),vo=T(E),yo=n(E,`
would result in a position encoding matrix:
`),bo=T(E),E.forEach(a),ko=p(e),Ts=r(e,"P",{});var Jn=i(Ts);il=n(Jn,"which alone has over 500M parameters to store. Axial positional encodings factorize "),wo=T(Jn),zo=n(Jn,` into two matrices:
`),xo=T(Jn),Jn.forEach(a),To=p(e),qe=r(e,"P",{});var Kh=i(qe);ll=n(Kh,`and
`),Mo=T(Kh),Kh.forEach(a),Ro=p(e),Ee=r(e,"P",{});var Uh=i(Ee);ml=n(Uh,`with:
`),$o=T(Uh),Uh.forEach(a),qo=p(e),Le=r(e,"P",{});var Bh=i(Le);pl=n(Bh,`Therefore the following holds:
`),Eo=T(Bh),Bh.forEach(a),Lo=p(e),F=r(e,"P",{});var B=i(F);cl=n(B,"Intuitively, this means that a position embedding vector "),Fo=T(B),Po=n(B,` is now the composition of two
factorized embedding vectors: `),Co=T(B),Ao=n(B,", where as the "),Dt=r(B,"CODE",{});var _d=i(Dt);hl=n(_d,"config.max_embedding_size"),_d.forEach(a),dl=n(B,` dimension
`),jo=T(B),So=n(B," is factorized into "),No=T(B),Do=n(B,`. This design ensures that each position embedding vector
`),Ho=T(B),Oo=n(B," is unique."),B.forEach(a),Io=p(e),ms=r(e,"P",{});var ht=i(ms);gl=n(ht,"Using the above example again, axial position encoding with "),Wo=T(ht),Qo=n(ht,`
can drastically reduced the number of parameters to `),Ko=T(ht),Uo=n(ht," parameters."),ht.forEach(a),Bo=p(e),q=r(e,"P",{});var C=i(q);ul=n(C,"In practice, the parameter "),Ht=r(C,"CODE",{});var vd=i(Ht);fl=n(vd,"config.axial_pos_embds_dim"),vd.forEach(a),_l=n(C," is set to a tuple "),Xo=T(C),Vo=n(C,` which sum has to be
equal to `),Ot=r(C,"CODE",{});var yd=i(Ot);vl=n(yd,"config.hidden_size"),yd.forEach(a),yl=n(C," and "),It=r(C,"CODE",{});var bd=i(It);bl=n(bd,"config.axial_pos_shape"),bd.forEach(a),kl=n(C," is set to a tuple "),Go=T(C),Jo=n(C,` which
product has to be equal to `),Wt=r(C,"CODE",{});var kd=i(Wt);wl=n(kd,"config.max_embedding_size"),kd.forEach(a),zl=n(C,", which during training has to be equal to the "),Qt=r(C,"EM",{});var wd=i(Qt);xl=n(wd,`sequence
length`),wd.forEach(a),Tl=n(C," of the "),Kt=r(C,"CODE",{});var zd=i(Kt);Ml=n(zd,"input_ids"),zd.forEach(a),Rl=n(C,"."),C.forEach(a),Yo=p(e),Ms=r(e,"H2",{class:!0});var Gr=i(Ms);Gs=r(Gr,"A",{id:!0,class:!0,href:!0});var xd=i(Gs);Ut=r(xd,"SPAN",{});var Td=i(Ut);f(Fe.$$.fragment,Td),Td.forEach(a),xd.forEach(a),$l=p(Gr),Bt=r(Gr,"SPAN",{});var Md=i(Bt);ql=n(Md,"LSH Self Attention"),Md.forEach(a),Gr.forEach(a),Zo=p(e),Z=r(e,"P",{});var ge=i(Z);El=n(ge,`In Locality sensitive hashing (LSH) self attention the key and query projection weights are tied. Therefore, the key
query embedding vectors are also tied. LSH self attention uses the locality sensitive hashing mechanism proposed in
`),Pe=r(ge,"A",{href:!0,rel:!0});var Rd=i(Pe);Ll=n(Rd,"Practical and Optimal LSH for Angular Distance"),Rd.forEach(a),Fl=n(ge,` to assign each of the tied key
query embedding vectors to one of `),Xt=r(ge,"CODE",{});var $d=i(Xt);Pl=n($d,"config.num_buckets"),$d.forEach(a),Cl=n(ge,` possible buckets. The premise is that the more \u201Csimilar\u201D
key query embedding vectors (in terms of `),Vt=r(ge,"EM",{});var qd=i(Vt);Al=n(qd,"cosine similarity"),qd.forEach(a),jl=n(ge,`) are to each other, the more likely they are assigned to
the same bucket.`),ge.forEach(a),sr=p(e),S=r(e,"P",{});var ts=i(S);Sl=n(ts,"The accuracy of the LSH mechanism can be improved by increasing "),Gt=r(ts,"CODE",{});var Ed=i(Gt);Nl=n(Ed,"config.num_hashes"),Ed.forEach(a),Dl=n(ts,` or directly the argument
`),Jt=r(ts,"CODE",{});var Ld=i(Jt);Hl=n(Ld,"num_hashes"),Ld.forEach(a),Ol=n(ts,` of the forward function so that the output of the LSH self attention better approximates the output
of the \u201Cnormal\u201D full self attention. The buckets are then sorted and chunked into query key embedding vector chunks
each of length `),Yt=r(ts,"CODE",{});var Fd=i(Yt);Il=n(Fd,"config.lsh_chunk_length"),Fd.forEach(a),Wl=n(ts,`. For each chunk, the query embedding vectors attend to its key vectors
(which are tied to themselves) and to the key embedding vectors of `),Zt=r(ts,"CODE",{});var Pd=i(Zt);Ql=n(Pd,"config.lsh_num_chunks_before"),Pd.forEach(a),Kl=n(ts,` previous
neighboring chunks and `),sn=r(ts,"CODE",{});var Cd=i(sn);Ul=n(Cd,"config.lsh_num_chunks_after"),Cd.forEach(a),Bl=n(ts," following neighboring chunks."),ts.forEach(a),er=p(e),ps=r(e,"P",{});var dt=i(ps);Xl=n(dt,"For more information, see the "),Ce=r(dt,"A",{href:!0,rel:!0});var Ad=i(Ce);Vl=n(Ad,"original Paper"),Ad.forEach(a),Gl=n(dt," or this great "),Ae=r(dt,"A",{href:!0,rel:!0});var jd=i(Ae);Jl=n(jd,"blog post"),jd.forEach(a),Yl=n(dt,"."),dt.forEach(a),ar=p(e),I=r(e,"P",{});var ds=i(I);Zl=n(ds,"Note that "),en=r(ds,"CODE",{});var Sd=i(en);sm=n(Sd,"config.num_buckets"),Sd.forEach(a),em=n(ds," can also be factorized into a list "),tr=T(ds),nr=n(ds,". This way instead of assigning the query key embedding vectors to one of "),or=T(ds),rr=n(ds," they are assigned to one of "),ir=T(ds),lr=n(ds,`. This is crucial for very long sequences to
save memory.`),ds.forEach(a),mr=p(e),cs=r(e,"P",{});var gt=i(cs);am=n(gt,"When training a model from scratch, it is recommended to leave "),an=r(gt,"CODE",{});var Nd=i(an);tm=n(Nd,"config.num_buckets=None"),Nd.forEach(a),nm=n(gt,`, so that depending on the
sequence length a good value for `),tn=r(gt,"CODE",{});var Dd=i(tn);om=n(Dd,"num_buckets"),Dd.forEach(a),rm=n(gt,` is calculated on the fly. This value will then automatically be
saved in the config and should be reused for inference.`),gt.forEach(a),pr=p(e),ss=r(e,"P",{});var ue=i(ss);im=n(ue,`Using LSH self attention, the memory and time complexity of the query-key matmul operation can be reduced from
`),cr=T(ue),hr=n(ue," to "),dr=T(ue),gr=n(ue,`, which usually represents the memory
and time bottleneck in a transformer model, with `),ur=T(ue),fr=n(ue," being the sequence length."),ue.forEach(a),_r=p(e),Rs=r(e,"H2",{class:!0});var Jr=i(Rs);Js=r(Jr,"A",{id:!0,class:!0,href:!0});var Hd=i(Js);nn=r(Hd,"SPAN",{});var Od=i(nn);f(je.$$.fragment,Od),Od.forEach(a),Hd.forEach(a),lm=p(Jr),on=r(Jr,"SPAN",{});var Id=i(on);mm=n(Id,"Local Self Attention"),Id.forEach(a),Jr.forEach(a),vr=p(e),es=r(e,"P",{});var fe=i(es);pm=n(fe,`Local self attention is essentially a \u201Cnormal\u201D self attention layer with key, query and value projections, but is
chunked so that in each chunk of length `),rn=r(fe,"CODE",{});var Wd=i(rn);cm=n(Wd,"config.local_chunk_length"),Wd.forEach(a),hm=n(fe,` the query embedding vectors only attends to
the key embedding vectors in its chunk and to the key embedding vectors of `),ln=r(fe,"CODE",{});var Qd=i(ln);dm=n(Qd,"config.local_num_chunks_before"),Qd.forEach(a),gm=n(fe,`
previous neighboring chunks and `),mn=r(fe,"CODE",{});var Kd=i(mn);um=n(Kd,"config.local_num_chunks_after"),Kd.forEach(a),fm=n(fe," following neighboring chunks."),fe.forEach(a),yr=p(e),as=r(e,"P",{});var _e=i(as);_m=n(_e,`Using Local self attention, the memory and time complexity of the query-key matmul operation can be reduced from
`),br=T(_e),kr=n(_e," to "),wr=T(_e),zr=n(_e,`, which usually represents the memory
and time bottleneck in a transformer model, with `),xr=T(_e),Tr=n(_e," being the sequence length."),_e.forEach(a),Mr=p(e),$s=r(e,"H2",{class:!0});var Yr=i($s);Ys=r(Yr,"A",{id:!0,class:!0,href:!0});var Ud=i(Ys);pn=r(Ud,"SPAN",{});var Bd=i(pn);f(Se.$$.fragment,Bd),Bd.forEach(a),Ud.forEach(a),vm=p(Yr),cn=r(Yr,"SPAN",{});var Xd=i(cn);ym=n(Xd,"Training"),Xd.forEach(a),Yr.forEach(a),Rr=p(e),hs=r(e,"P",{});var ut=i(hs);bm=n(ut,`During training, we must ensure that the sequence length is set to a value that can be divided by the least common
multiple of `),hn=r(ut,"CODE",{});var Vd=i(hn);km=n(Vd,"config.lsh_chunk_length"),Vd.forEach(a),wm=n(ut," and "),dn=r(ut,"CODE",{});var Gd=i(dn);zm=n(Gd,"config.local_chunk_length"),Gd.forEach(a),xm=n(ut,` and that the parameters of the Axial
Positional Encodings are correctly set as described above. Reformer is very memory efficient so that the model can
easily be trained on sequences as long as 64000 tokens.`),ut.forEach(a),$r=p(e),Zs=r(e,"P",{});var Zr=i(Zs);Tm=n(Zr,"For training, the "),Xa=r(Zr,"A",{href:!0});var Jd=i(Xa);Mm=n(Jd,"ReformerModelWithLMHead"),Jd.forEach(a),Rm=n(Zr," should be used as follows:"),Zr.forEach(a),qr=p(e),f(Ne.$$.fragment,e),Er=p(e),qs=r(e,"H2",{class:!0});var si=i(qs);se=r(si,"A",{id:!0,class:!0,href:!0});var Yd=i(se);gn=r(Yd,"SPAN",{});var Zd=i(gn);f(De.$$.fragment,Zd),Zd.forEach(a),Yd.forEach(a),$m=p(si),un=r(si,"SPAN",{});var sg=i(un);qm=n(sg,"ReformerConfig"),sg.forEach(a),si.forEach(a),Lr=p(e),N=r(e,"DIV",{class:!0});var gs=i(N);f(He.$$.fragment,gs),Em=p(gs),Oe=r(gs,"P",{});var ei=i(Oe);Lm=n(ei,"This is the configuration class to store the configuration of a "),Va=r(ei,"A",{href:!0});var eg=i(Va);Fm=n(eg,"ReformerModel"),eg.forEach(a),Pm=n(ei,`. It is used to instantiate a
Reformer model according to the specified arguments, defining the model architecture.`),ei.forEach(a),Cm=p(gs),Es=r(gs,"P",{});var ft=i(Es);Am=n(ft,"Configuration objects inherit from "),Ga=r(ft,"A",{href:!0});var ag=i(Ga);jm=n(ag,"PretrainedConfig"),ag.forEach(a),Sm=n(ft,` and can be used to control the model outputs. Read the
documentation from `),Ja=r(ft,"A",{href:!0});var tg=i(Ja);Nm=n(tg,"PretrainedConfig"),tg.forEach(a),Dm=n(ft," for more information."),ft.forEach(a),Hm=p(gs),fn=r(gs,"P",{});var ng=i(fn);Om=n(ng,"Examples:"),ng.forEach(a),Im=p(gs),f(Ie.$$.fragment,gs),gs.forEach(a),Fr=p(e),Ls=r(e,"H2",{class:!0});var ai=i(Ls);ee=r(ai,"A",{id:!0,class:!0,href:!0});var og=i(ee);_n=r(og,"SPAN",{});var rg=i(_n);f(We.$$.fragment,rg),rg.forEach(a),og.forEach(a),Wm=p(ai),vn=r(ai,"SPAN",{});var ig=i(vn);Qm=n(ig,"ReformerTokenizer"),ig.forEach(a),ai.forEach(a),Pr=p(e),Y=r(e,"DIV",{class:!0});var ve=i(Y);f(Qe.$$.fragment,ve),Km=p(ve),Ke=r(ve,"P",{});var ti=i(Ke);Um=n(ti,"Construct a Reformer tokenizer. Based on "),Ue=r(ti,"A",{href:!0,rel:!0});var lg=i(Ue);Bm=n(lg,"SentencePiece"),lg.forEach(a),Xm=n(ti," ."),ti.forEach(a),Vm=p(ve),Be=r(ve,"P",{});var ni=i(Be);Gm=n(ni,"This tokenizer inherits from "),Ya=r(ni,"A",{href:!0});var mg=i(Ya);Jm=n(mg,"PreTrainedTokenizer"),mg.forEach(a),Ym=n(ni,` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),ni.forEach(a),Zm=p(ve),Za=r(ve,"DIV",{class:!0});var pg=i(Za);f(Xe.$$.fragment,pg),pg.forEach(a),ve.forEach(a),Cr=p(e),Fs=r(e,"H2",{class:!0});var oi=i(Fs);ae=r(oi,"A",{id:!0,class:!0,href:!0});var cg=i(ae);yn=r(cg,"SPAN",{});var hg=i(yn);f(Ve.$$.fragment,hg),hg.forEach(a),cg.forEach(a),sp=p(oi),bn=r(oi,"SPAN",{});var dg=i(bn);ep=n(dg,"ReformerTokenizerFast"),dg.forEach(a),oi.forEach(a),Ar=p(e),rs=r(e,"DIV",{class:!0});var _t=i(rs);f(Ge.$$.fragment,_t),ap=p(_t),Ps=r(_t,"P",{});var vt=i(Ps);tp=n(vt,"Construct a \u201Cfast\u201D Reformer tokenizer (backed by HuggingFace\u2019s "),kn=r(vt,"EM",{});var gg=i(kn);np=n(gg,"tokenizers"),gg.forEach(a),op=n(vt,` library). Based on
`),Je=r(vt,"A",{href:!0,rel:!0});var ug=i(Je);rp=n(ug,"Unigram"),ug.forEach(a),ip=n(vt,"."),vt.forEach(a),lp=p(_t),Ye=r(_t,"P",{});var ri=i(Ye);mp=n(ri,"This tokenizer inherits from "),st=r(ri,"A",{href:!0});var fg=i(st);pp=n(fg,"PreTrainedTokenizerFast"),fg.forEach(a),cp=n(ri,` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),ri.forEach(a),_t.forEach(a),jr=p(e),Cs=r(e,"H2",{class:!0});var ii=i(Cs);te=r(ii,"A",{id:!0,class:!0,href:!0});var _g=i(te);wn=r(_g,"SPAN",{});var vg=i(wn);f(Ze.$$.fragment,vg),vg.forEach(a),_g.forEach(a),hp=p(ii),zn=r(ii,"SPAN",{});var yg=i(zn);dp=n(yg,"ReformerModel"),yg.forEach(a),ii.forEach(a),Sr=p(e),D=r(e,"DIV",{class:!0});var us=i(D);f(sa.$$.fragment,us),gp=p(us),ea=r(us,"P",{});var li=i(ea);up=n(li,`The bare Reformer Model transformer outputting raw hidden-stateswithout any specific head on top.
Reformer was proposed in `),aa=r(li,"A",{href:!0,rel:!0});var bg=i(aa);fp=n(bg,"Reformer: The Efficient Transformer"),bg.forEach(a),_p=n(li,` by Nikita Kitaev,
\u0141ukasz Kaiser, Anselm Levskaya.`),li.forEach(a),vp=p(us),ta=r(us,"P",{});var mi=i(ta);yp=n(mi,"This model inherits from "),et=r(mi,"A",{href:!0});var kg=i(et);bp=n(kg,"PreTrainedModel"),kg.forEach(a),kp=n(mi,`. 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.forEach(a),wp=p(us),na=r(us,"P",{});var pi=i(na);zp=n(pi,"This model is also a PyTorch "),oa=r(pi,"A",{href:!0,rel:!0});var wg=i(oa);xp=n(wg,"torch.nn.Module"),wg.forEach(a),Tp=n(pi,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),pi.forEach(a),Mp=p(us),W=r(us,"DIV",{class:!0});var fs=i(W);f(ra.$$.fragment,fs),Rp=p(fs),As=r(fs,"P",{});var yt=i(As);$p=n(yt,"The "),at=r(yt,"A",{href:!0});var zg=i(at);qp=n(zg,"ReformerModel"),zg.forEach(a),Ep=n(yt," forward method, overrides the "),xn=r(yt,"CODE",{});var xg=i(xn);Lp=n(xg,"__call__"),xg.forEach(a),Fp=n(yt," special method."),yt.forEach(a),Pp=p(fs),f(ne.$$.fragment,fs),Cp=p(fs),Tn=r(fs,"P",{});var Tg=i(Tn);Ap=n(Tg,"Example:"),Tg.forEach(a),jp=p(fs),f(ia.$$.fragment,fs),fs.forEach(a),us.forEach(a),Nr=p(e),js=r(e,"H2",{class:!0});var ci=i(js);oe=r(ci,"A",{id:!0,class:!0,href:!0});var Mg=i(oe);Mn=r(Mg,"SPAN",{});var Rg=i(Mn);f(la.$$.fragment,Rg),Rg.forEach(a),Mg.forEach(a),Sp=p(ci),Rn=r(ci,"SPAN",{});var $g=i(Rn);Np=n($g,"ReformerModelWithLMHead"),$g.forEach(a),ci.forEach(a),Dr=p(e),H=r(e,"DIV",{class:!0});var _s=i(H);f(ma.$$.fragment,_s),Dp=p(_s),Ss=r(_s,"P",{});var bt=i(Ss);Hp=n(bt,"Reformer Model with a "),$n=r(bt,"CODE",{});var qg=i($n);Op=n(qg,"language modeling"),qg.forEach(a),Ip=n(bt,` head on top.
Reformer was proposed in `),pa=r(bt,"A",{href:!0,rel:!0});var Eg=i(pa);Wp=n(Eg,"Reformer: The Efficient Transformer"),Eg.forEach(a),Qp=n(bt,` by Nikita Kitaev,
\u0141ukasz Kaiser, Anselm Levskaya.`),bt.forEach(a),Kp=p(_s),ca=r(_s,"P",{});var hi=i(ca);Up=n(hi,"This model inherits from "),tt=r(hi,"A",{href:!0});var Lg=i(tt);Bp=n(Lg,"PreTrainedModel"),Lg.forEach(a),Xp=n(hi,`. 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.)`),hi.forEach(a),Vp=p(_s),ha=r(_s,"P",{});var di=i(ha);Gp=n(di,"This model is also a PyTorch "),da=r(di,"A",{href:!0,rel:!0});var Fg=i(da);Jp=n(Fg,"torch.nn.Module"),Fg.forEach(a),Yp=n(di,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),di.forEach(a),Zp=p(_s),Q=r(_s,"DIV",{class:!0});var vs=i(Q);f(ga.$$.fragment,vs),sc=p(vs),Ns=r(vs,"P",{});var kt=i(Ns);ec=n(kt,"The "),nt=r(kt,"A",{href:!0});var Pg=i(nt);ac=n(Pg,"ReformerModelWithLMHead"),Pg.forEach(a),tc=n(kt," forward method, overrides the "),qn=r(kt,"CODE",{});var Cg=i(qn);nc=n(Cg,"__call__"),Cg.forEach(a),oc=n(kt," special method."),kt.forEach(a),rc=p(vs),f(re.$$.fragment,vs),ic=p(vs),En=r(vs,"P",{});var Ag=i(En);lc=n(Ag,"Example:"),Ag.forEach(a),mc=p(vs),f(ua.$$.fragment,vs),vs.forEach(a),_s.forEach(a),Hr=p(e),Ds=r(e,"H2",{class:!0});var gi=i(Ds);ie=r(gi,"A",{id:!0,class:!0,href:!0});var jg=i(ie);Ln=r(jg,"SPAN",{});var Sg=i(Ln);f(fa.$$.fragment,Sg),Sg.forEach(a),jg.forEach(a),pc=p(gi),Fn=r(gi,"SPAN",{});var Ng=i(Fn);cc=n(Ng,"ReformerForMaskedLM"),Ng.forEach(a),gi.forEach(a),Or=p(e),O=r(e,"DIV",{class:!0});var ys=i(O);f(_a.$$.fragment,ys),hc=p(ys),Hs=r(ys,"P",{});var wt=i(Hs);dc=n(wt,"Reformer Model with a "),Pn=r(wt,"CODE",{});var Dg=i(Pn);gc=n(Dg,"language modeling"),Dg.forEach(a),uc=n(wt,` head on top.
Reformer was proposed in `),va=r(wt,"A",{href:!0,rel:!0});var Hg=i(va);fc=n(Hg,"Reformer: The Efficient Transformer"),Hg.forEach(a),_c=n(wt,` by Nikita Kitaev,
\u0141ukasz Kaiser, Anselm Levskaya.`),wt.forEach(a),vc=p(ys),ya=r(ys,"P",{});var ui=i(ya);yc=n(ui,"This model inherits from "),ot=r(ui,"A",{href:!0});var Og=i(ot);bc=n(Og,"PreTrainedModel"),Og.forEach(a),kc=n(ui,`. 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.)`),ui.forEach(a),wc=p(ys),ba=r(ys,"P",{});var fi=i(ba);zc=n(fi,"This model is also a PyTorch "),ka=r(fi,"A",{href:!0,rel:!0});var Ig=i(ka);xc=n(Ig,"torch.nn.Module"),Ig.forEach(a),Tc=n(fi,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),fi.forEach(a),Mc=p(ys),K=r(ys,"DIV",{class:!0});var bs=i(K);f(wa.$$.fragment,bs),Rc=p(bs),Os=r(bs,"P",{});var zt=i(Os);$c=n(zt,"The "),rt=r(zt,"A",{href:!0});var Wg=i(rt);qc=n(Wg,"ReformerForMaskedLM"),Wg.forEach(a),Ec=n(zt," forward method, overrides the "),Cn=r(zt,"CODE",{});var Qg=i(Cn);Lc=n(Qg,"__call__"),Qg.forEach(a),Fc=n(zt," special method."),zt.forEach(a),Pc=p(bs),f(le.$$.fragment,bs),Cc=p(bs),An=r(bs,"P",{});var Kg=i(An);Ac=n(Kg,"Example:"),Kg.forEach(a),jc=p(bs),f(za.$$.fragment,bs),bs.forEach(a),ys.forEach(a),Ir=p(e),Is=r(e,"H2",{class:!0});var _i=i(Is);me=r(_i,"A",{id:!0,class:!0,href:!0});var Ug=i(me);jn=r(Ug,"SPAN",{});var Bg=i(jn);f(xa.$$.fragment,Bg),Bg.forEach(a),Ug.forEach(a),Sc=p(_i),Sn=r(_i,"SPAN",{});var Xg=i(Sn);Nc=n(Xg,"ReformerForSequenceClassification"),Xg.forEach(a),_i.forEach(a),Wr=p(e),A=r(e,"DIV",{class:!0});var ns=i(A);f(Ta.$$.fragment,ns),Dc=p(ns),Nn=r(ns,"P",{});var Vg=i(Nn);Hc=n(Vg,`Reformer Model transformer with a sequence classification/regression head on top (a linear layer on top of the
pooled output) e.g. for GLUE tasks.`),Vg.forEach(a),Oc=p(ns),Ma=r(ns,"P",{});var vi=i(Ma);Ic=n(vi,"Reformer was proposed in "),Ra=r(vi,"A",{href:!0,rel:!0});var Gg=i(Ra);Wc=n(Gg,"Reformer: The Efficient Transformer"),Gg.forEach(a),Qc=n(vi,` by Nikita Kitaev,
\u0141ukasz Kaiser, Anselm Levskaya.`),vi.forEach(a),Kc=p(ns),$a=r(ns,"P",{});var yi=i($a);Uc=n(yi,"This model inherits from "),it=r(yi,"A",{href:!0});var Jg=i(it);Bc=n(Jg,"PreTrainedModel"),Jg.forEach(a),Xc=n(yi,`. 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.)`),yi.forEach(a),Vc=p(ns),qa=r(ns,"P",{});var bi=i(qa);Gc=n(bi,"This model is also a PyTorch "),Ea=r(bi,"A",{href:!0,rel:!0});var Yg=i(Ea);Jc=n(Yg,"torch.nn.Module"),Yg.forEach(a),Yc=n(bi,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),bi.forEach(a),Zc=p(ns),P=r(ns,"DIV",{class:!0});var X=i(P);f(La.$$.fragment,X),sh=p(X),Ws=r(X,"P",{});var xt=i(Ws);eh=n(xt,"The "),lt=r(xt,"A",{href:!0});var Zg=i(lt);ah=n(Zg,"ReformerForSequenceClassification"),Zg.forEach(a),th=n(xt," forward method, overrides the "),Dn=r(xt,"CODE",{});var su=i(Dn);nh=n(su,"__call__"),su.forEach(a),oh=n(xt," special method."),xt.forEach(a),rh=p(X),f(pe.$$.fragment,X),ih=p(X),Hn=r(X,"P",{});var eu=i(Hn);lh=n(eu,"Example of single-label classification:"),eu.forEach(a),mh=p(X),f(Fa.$$.fragment,X),ph=p(X),On=r(X,"P",{});var au=i(On);ch=n(au,"Example of multi-label classification:"),au.forEach(a),hh=p(X),f(Pa.$$.fragment,X),X.forEach(a),ns.forEach(a),Qr=p(e),Qs=r(e,"H2",{class:!0});var ki=i(Qs);ce=r(ki,"A",{id:!0,class:!0,href:!0});var tu=i(ce);In=r(tu,"SPAN",{});var nu=i(In);f(Ca.$$.fragment,nu),nu.forEach(a),tu.forEach(a),dh=p(ki),Wn=r(ki,"SPAN",{});var ou=i(Wn);gh=n(ou,"ReformerForQuestionAnswering"),ou.forEach(a),ki.forEach(a),Kr=p(e),j=r(e,"DIV",{class:!0});var os=i(j);f(Aa.$$.fragment,os),uh=p(os),Ks=r(os,"P",{});var Tt=i(Ks);fh=n(Tt,`Reformer Model with a span classification head on top for extractive question-answering tasks like SQuAD / TriviaQA
( a linear layer on top of hidden-states output to compute `),Qn=r(Tt,"CODE",{});var ru=i(Qn);_h=n(ru,"span start logits"),ru.forEach(a),vh=n(Tt," and "),Kn=r(Tt,"CODE",{});var iu=i(Kn);yh=n(iu,"span end logits"),iu.forEach(a),bh=n(Tt,"."),Tt.forEach(a),kh=p(os),ja=r(os,"P",{});var wi=i(ja);wh=n(wi,"Reformer was proposed in "),Sa=r(wi,"A",{href:!0,rel:!0});var lu=i(Sa);zh=n(lu,"Reformer: The Efficient Transformer"),lu.forEach(a),xh=n(wi,` by Nikita Kitaev,
\u0141ukasz Kaiser, Anselm Levskaya.`),wi.forEach(a),Th=p(os),Na=r(os,"P",{});var zi=i(Na);Mh=n(zi,"This model inherits from "),mt=r(zi,"A",{href:!0});var mu=i(mt);Rh=n(mu,"PreTrainedModel"),mu.forEach(a),$h=n(zi,`. 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.)`),zi.forEach(a),qh=p(os),Da=r(os,"P",{});var xi=i(Da);Eh=n(xi,"This model is also a PyTorch "),Ha=r(xi,"A",{href:!0,rel:!0});var pu=i(Ha);Lh=n(pu,"torch.nn.Module"),pu.forEach(a),Fh=n(xi,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),xi.forEach(a),Ph=p(os),U=r(os,"DIV",{class:!0});var ks=i(U);f(Oa.$$.fragment,ks),Ch=p(ks),Us=r(ks,"P",{});var Mt=i(Us);Ah=n(Mt,"The "),pt=r(Mt,"A",{href:!0});var cu=i(pt);jh=n(cu,"ReformerForQuestionAnswering"),cu.forEach(a),Sh=n(Mt," forward method, overrides the "),Un=r(Mt,"CODE",{});var hu=i(Un);Nh=n(hu,"__call__"),hu.forEach(a),Dh=n(Mt," special method."),Mt.forEach(a),Hh=p(ks),f(he.$$.fragment,ks),Oh=p(ks),Bn=r(ks,"P",{});var du=i(Bn);Ih=n(du,"Example:"),du.forEach(a),Wh=p(ks),f(Ia.$$.fragment,ks),ks.forEach(a),os.forEach(a),this.h()},h(){l(d,"name","hf:doc:metadata"),l(d,"content",JSON.stringify(Zu)),l(z,"id","reformer"),l(z,"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(z,"href","#reformer"),l(g,"class","relative group"),l(be,"href","https://github.com/huggingface/transformers/issues/new?assignees=&labels=&template=bug-report.md&title"),l(be,"rel","nofollow"),l(Bs,"id","overview"),l(Bs,"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(Bs,"href","#overview"),l(zs,"class","relative group"),l(we,"href","https://arxiv.org/abs/2001.04451.pdf"),l(we,"rel","nofollow"),l(ze,"href","https://huggingface.co/patrickvonplaten"),l(ze,"rel","nofollow"),l(xe,"href","https://github.com/google/trax/tree/master/trax/models/reformer"),l(xe,"rel","nofollow"),l(Me,"href","https://github.com/pytorch/pytorch/issues/36035"),l(Me,"rel","nofollow"),l(Vs,"id","axial-positional-encodings"),l(Vs,"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(Vs,"href","#axial-positional-encodings"),l(xs,"class","relative group"),l($e,"href","https://github.com/google/trax/blob/4d99ad4965bab1deba227539758d59f0df0fef48/trax/layers/research/position_encodings.py#L29"),l($e,"rel","nofollow"),mo.a=po,co.a=ho,go.a=uo,fo.a=_o,vo.a=yo,bo.a=null,wo.a=zo,xo.a=null,Mo.a=null,$o.a=null,Eo.a=null,Fo.a=Po,Co.a=Ao,jo.a=So,No.a=Do,Ho.a=Oo,Wo.a=Qo,Ko.a=Uo,Xo.a=Vo,Go.a=Jo,l(Gs,"id","lsh-self-attention"),l(Gs,"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(Gs,"href","#lsh-self-attention"),l(Ms,"class","relative group"),l(Pe,"href","https://arxiv.org/abs/1509.02897"),l(Pe,"rel","nofollow"),l(Ce,"href","https://arxiv.org/abs/2001.04451"),l(Ce,"rel","nofollow"),l(Ae,"href","https://www.pragmatic.ml/reformer-deep-dive/"),l(Ae,"rel","nofollow"),tr.a=nr,or.a=rr,ir.a=lr,cr.a=hr,dr.a=gr,ur.a=fr,l(Js,"id","local-self-attention"),l(Js,"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(Js,"href","#local-self-attention"),l(Rs,"class","relative group"),br.a=kr,wr.a=zr,xr.a=Tr,l(Ys,"id","training"),l(Ys,"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(Ys,"href","#training"),l($s,"class","relative group"),l(Xa,"href","/docs/transformers/pr_15839/en/model_doc/reformer#transformers.ReformerModelWithLMHead"),l(se,"id","transformers.ReformerConfig"),l(se,"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(se,"href","#transformers.ReformerConfig"),l(qs,"class","relative group"),l(Va,"href","/docs/transformers/pr_15839/en/model_doc/reformer#transformers.ReformerModel"),l(Ga,"href","/docs/transformers/pr_15839/en/main_classes/configuration#transformers.PretrainedConfig"),l(Ja,"href","/docs/transformers/pr_15839/en/main_classes/configuration#transformers.PretrainedConfig"),l(N,"class","docstring"),l(ee,"id","transformers.ReformerTokenizer"),l(ee,"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(ee,"href","#transformers.ReformerTokenizer"),l(Ls,"class","relative group"),l(Ue,"href","https://github.com/google/sentencepiece"),l(Ue,"rel","nofollow"),l(Ya,"href","/docs/transformers/pr_15839/en/main_classes/tokenizer#transformers.PreTrainedTokenizer"),l(Za,"class","docstring"),l(Y,"class","docstring"),l(ae,"id","transformers.ReformerTokenizerFast"),l(ae,"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(ae,"href","#transformers.ReformerTokenizerFast"),l(Fs,"class","relative group"),l(Je,"href","https://huggingface.co/docs/tokenizers/python/latest/components.html?highlight=unigram#models"),l(Je,"rel","nofollow"),l(st,"href","/docs/transformers/pr_15839/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast"),l(rs,"class","docstring"),l(te,"id","transformers.ReformerModel"),l(te,"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(te,"href","#transformers.ReformerModel"),l(Cs,"class","relative group"),l(aa,"href","https://arxiv.org/abs/2001.04451"),l(aa,"rel","nofollow"),l(et,"href","/docs/transformers/pr_15839/en/main_classes/model#transformers.PreTrainedModel"),l(oa,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(oa,"rel","nofollow"),l(at,"href","/docs/transformers/pr_15839/en/model_doc/reformer#transformers.ReformerModel"),l(W,"class","docstring"),l(D,"class","docstring"),l(oe,"id","transformers.ReformerModelWithLMHead"),l(oe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(oe,"href","#transformers.ReformerModelWithLMHead"),l(js,"class","relative group"),l(pa,"href","https://arxiv.org/abs/2001.04451"),l(pa,"rel","nofollow"),l(tt,"href","/docs/transformers/pr_15839/en/main_classes/model#transformers.PreTrainedModel"),l(da,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(da,"rel","nofollow"),l(nt,"href","/docs/transformers/pr_15839/en/model_doc/reformer#transformers.ReformerModelWithLMHead"),l(Q,"class","docstring"),l(H,"class","docstring"),l(ie,"id","transformers.ReformerForMaskedLM"),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.ReformerForMaskedLM"),l(Ds,"class","relative group"),l(va,"href","https://arxiv.org/abs/2001.04451"),l(va,"rel","nofollow"),l(ot,"href","/docs/transformers/pr_15839/en/main_classes/model#transformers.PreTrainedModel"),l(ka,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(ka,"rel","nofollow"),l(rt,"href","/docs/transformers/pr_15839/en/model_doc/reformer#transformers.ReformerForMaskedLM"),l(K,"class","docstring"),l(O,"class","docstring"),l(me,"id","transformers.ReformerForSequenceClassification"),l(me,"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(me,"href","#transformers.ReformerForSequenceClassification"),l(Is,"class","relative group"),l(Ra,"href","https://arxiv.org/abs/2001.04451"),l(Ra,"rel","nofollow"),l(it,"href","/docs/transformers/pr_15839/en/main_classes/model#transformers.PreTrainedModel"),l(Ea,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(Ea,"rel","nofollow"),l(lt,"href","/docs/transformers/pr_15839/en/model_doc/reformer#transformers.ReformerForSequenceClassification"),l(P,"class","docstring"),l(A,"class","docstring"),l(ce,"id","transformers.ReformerForQuestionAnswering"),l(ce,"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(ce,"href","#transformers.ReformerForQuestionAnswering"),l(Qs,"class","relative group"),l(Sa,"href","https://arxiv.org/abs/2001.04451"),l(Sa,"rel","nofollow"),l(mt,"href","/docs/transformers/pr_15839/en/main_classes/model#transformers.PreTrainedModel"),l(Ha,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(Ha,"rel","nofollow"),l(pt,"href","/docs/transformers/pr_15839/en/model_doc/reformer#transformers.ReformerForQuestionAnswering"),l(U,"class","docstring"),l(j,"class","docstring")},m(e,c){s(document.head,d),h(e,M,c),h(e,g,c),s(g,z),s(z,R),_(w,R,null),s(g,k),s(g,L),s(L,Ti),h(e,Zn,c),h(e,ws,c),s(ws,Rt),s(Rt,Mi),s(ws,Ri),s(ws,be),s(be,$i),s(ws,qi),h(e,so,c),h(e,zs,c),s(zs,Bs),s(Bs,$t),_(ke,$t,null),s(zs,Ei),s(zs,qt),s(qt,Li),h(e,eo,c),h(e,Xs,c),s(Xs,Fi),s(Xs,we),s(we,Pi),s(Xs,Ci),h(e,ao,c),h(e,Ka,c),s(Ka,Ai),h(e,to,c),h(e,Ua,c),s(Ua,Et),s(Et,ji),h(e,no,c),h(e,is,c),s(is,Si),s(is,ze),s(ze,Ni),s(is,Di),s(is,xe),s(xe,Hi),s(is,Oi),h(e,oo,c),h(e,Te,c),s(Te,Lt),s(Lt,Ii),s(Te,Wi),h(e,ro,c),h(e,Ba,c),s(Ba,ls),s(ls,Qi),s(ls,Ft),s(Ft,Ki),s(ls,Ui),s(ls,Pt),s(Pt,Bi),s(ls,Xi),s(ls,Me),s(Me,Vi),h(e,io,c),h(e,xs,c),s(xs,Vs),s(Vs,Ct),_(Re,Ct,null),s(xs,Gi),s(xs,At),s(At,Ji),h(e,lo,c),h(e,$,c),s($,Yi),s($,$e),s($e,Zi),s($,sl),mo.m(gu,$),s($,po),s($,jt),s(jt,el),s($,al),co.m(uu,$),s($,ho),go.m(fu,$),s($,uo),s($,St),s(St,tl),s($,nl),fo.m(_u,$),s($,_o),s($,Nt),s(Nt,ol),s($,rl),vo.m(vu,$),s($,yo),bo.m(yu,$),h(e,ko,c),h(e,Ts,c),s(Ts,il),wo.m(bu,Ts),s(Ts,zo),xo.m(ku,Ts),h(e,To,c),h(e,qe,c),s(qe,ll),Mo.m(wu,qe),h(e,Ro,c),h(e,Ee,c),s(Ee,ml),$o.m(zu,Ee),h(e,qo,c),h(e,Le,c),s(Le,pl),Eo.m(xu,Le),h(e,Lo,c),h(e,F,c),s(F,cl),Fo.m(Tu,F),s(F,Po),Co.m(Mu,F),s(F,Ao),s(F,Dt),s(Dt,hl),s(F,dl),jo.m(Ru,F),s(F,So),No.m($u,F),s(F,Do),Ho.m(qu,F),s(F,Oo),h(e,Io,c),h(e,ms,c),s(ms,gl),Wo.m(Eu,ms),s(ms,Qo),Ko.m(Lu,ms),s(ms,Uo),h(e,Bo,c),h(e,q,c),s(q,ul),s(q,Ht),s(Ht,fl),s(q,_l),Xo.m(Fu,q),s(q,Vo),s(q,Ot),s(Ot,vl),s(q,yl),s(q,It),s(It,bl),s(q,kl),Go.m(Pu,q),s(q,Jo),s(q,Wt),s(Wt,wl),s(q,zl),s(q,Qt),s(Qt,xl),s(q,Tl),s(q,Kt),s(Kt,Ml),s(q,Rl),h(e,Yo,c),h(e,Ms,c),s(Ms,Gs),s(Gs,Ut),_(Fe,Ut,null),s(Ms,$l),s(Ms,Bt),s(Bt,ql),h(e,Zo,c),h(e,Z,c),s(Z,El),s(Z,Pe),s(Pe,Ll),s(Z,Fl),s(Z,Xt),s(Xt,Pl),s(Z,Cl),s(Z,Vt),s(Vt,Al),s(Z,jl),h(e,sr,c),h(e,S,c),s(S,Sl),s(S,Gt),s(Gt,Nl),s(S,Dl),s(S,Jt),s(Jt,Hl),s(S,Ol),s(S,Yt),s(Yt,Il),s(S,Wl),s(S,Zt),s(Zt,Ql),s(S,Kl),s(S,sn),s(sn,Ul),s(S,Bl),h(e,er,c),h(e,ps,c),s(ps,Xl),s(ps,Ce),s(Ce,Vl),s(ps,Gl),s(ps,Ae),s(Ae,Jl),s(ps,Yl),h(e,ar,c),h(e,I,c),s(I,Zl),s(I,en),s(en,sm),s(I,em),tr.m(Cu,I),s(I,nr),or.m(Au,I),s(I,rr),ir.m(ju,I),s(I,lr),h(e,mr,c),h(e,cs,c),s(cs,am),s(cs,an),s(an,tm),s(cs,nm),s(cs,tn),s(tn,om),s(cs,rm),h(e,pr,c),h(e,ss,c),s(ss,im),cr.m(Su,ss),s(ss,hr),dr.m(Nu,ss),s(ss,gr),ur.m(Du,ss),s(ss,fr),h(e,_r,c),h(e,Rs,c),s(Rs,Js),s(Js,nn),_(je,nn,null),s(Rs,lm),s(Rs,on),s(on,mm),h(e,vr,c),h(e,es,c),s(es,pm),s(es,rn),s(rn,cm),s(es,hm),s(es,ln),s(ln,dm),s(es,gm),s(es,mn),s(mn,um),s(es,fm),h(e,yr,c),h(e,as,c),s(as,_m),br.m(Hu,as),s(as,kr),wr.m(Ou,as),s(as,zr),xr.m(Iu,as),s(as,Tr),h(e,Mr,c),h(e,$s,c),s($s,Ys),s(Ys,pn),_(Se,pn,null),s($s,vm),s($s,cn),s(cn,ym),h(e,Rr,c),h(e,hs,c),s(hs,bm),s(hs,hn),s(hn,km),s(hs,wm),s(hs,dn),s(dn,zm),s(hs,xm),h(e,$r,c),h(e,Zs,c),s(Zs,Tm),s(Zs,Xa),s(Xa,Mm),s(Zs,Rm),h(e,qr,c),_(Ne,e,c),h(e,Er,c),h(e,qs,c),s(qs,se),s(se,gn),_(De,gn,null),s(qs,$m),s(qs,un),s(un,qm),h(e,Lr,c),h(e,N,c),_(He,N,null),s(N,Em),s(N,Oe),s(Oe,Lm),s(Oe,Va),s(Va,Fm),s(Oe,Pm),s(N,Cm),s(N,Es),s(Es,Am),s(Es,Ga),s(Ga,jm),s(Es,Sm),s(Es,Ja),s(Ja,Nm),s(Es,Dm),s(N,Hm),s(N,fn),s(fn,Om),s(N,Im),_(Ie,N,null),h(e,Fr,c),h(e,Ls,c),s(Ls,ee),s(ee,_n),_(We,_n,null),s(Ls,Wm),s(Ls,vn),s(vn,Qm),h(e,Pr,c),h(e,Y,c),_(Qe,Y,null),s(Y,Km),s(Y,Ke),s(Ke,Um),s(Ke,Ue),s(Ue,Bm),s(Ke,Xm),s(Y,Vm),s(Y,Be),s(Be,Gm),s(Be,Ya),s(Ya,Jm),s(Be,Ym),s(Y,Zm),s(Y,Za),_(Xe,Za,null),h(e,Cr,c),h(e,Fs,c),s(Fs,ae),s(ae,yn),_(Ve,yn,null),s(Fs,sp),s(Fs,bn),s(bn,ep),h(e,Ar,c),h(e,rs,c),_(Ge,rs,null),s(rs,ap),s(rs,Ps),s(Ps,tp),s(Ps,kn),s(kn,np),s(Ps,op),s(Ps,Je),s(Je,rp),s(Ps,ip),s(rs,lp),s(rs,Ye),s(Ye,mp),s(Ye,st),s(st,pp),s(Ye,cp),h(e,jr,c),h(e,Cs,c),s(Cs,te),s(te,wn),_(Ze,wn,null),s(Cs,hp),s(Cs,zn),s(zn,dp),h(e,Sr,c),h(e,D,c),_(sa,D,null),s(D,gp),s(D,ea),s(ea,up),s(ea,aa),s(aa,fp),s(ea,_p),s(D,vp),s(D,ta),s(ta,yp),s(ta,et),s(et,bp),s(ta,kp),s(D,wp),s(D,na),s(na,zp),s(na,oa),s(oa,xp),s(na,Tp),s(D,Mp),s(D,W),_(ra,W,null),s(W,Rp),s(W,As),s(As,$p),s(As,at),s(at,qp),s(As,Ep),s(As,xn),s(xn,Lp),s(As,Fp),s(W,Pp),_(ne,W,null),s(W,Cp),s(W,Tn),s(Tn,Ap),s(W,jp),_(ia,W,null),h(e,Nr,c),h(e,js,c),s(js,oe),s(oe,Mn),_(la,Mn,null),s(js,Sp),s(js,Rn),s(Rn,Np),h(e,Dr,c),h(e,H,c),_(ma,H,null),s(H,Dp),s(H,Ss),s(Ss,Hp),s(Ss,$n),s($n,Op),s(Ss,Ip),s(Ss,pa),s(pa,Wp),s(Ss,Qp),s(H,Kp),s(H,ca),s(ca,Up),s(ca,tt),s(tt,Bp),s(ca,Xp),s(H,Vp),s(H,ha),s(ha,Gp),s(ha,da),s(da,Jp),s(ha,Yp),s(H,Zp),s(H,Q),_(ga,Q,null),s(Q,sc),s(Q,Ns),s(Ns,ec),s(Ns,nt),s(nt,ac),s(Ns,tc),s(Ns,qn),s(qn,nc),s(Ns,oc),s(Q,rc),_(re,Q,null),s(Q,ic),s(Q,En),s(En,lc),s(Q,mc),_(ua,Q,null),h(e,Hr,c),h(e,Ds,c),s(Ds,ie),s(ie,Ln),_(fa,Ln,null),s(Ds,pc),s(Ds,Fn),s(Fn,cc),h(e,Or,c),h(e,O,c),_(_a,O,null),s(O,hc),s(O,Hs),s(Hs,dc),s(Hs,Pn),s(Pn,gc),s(Hs,uc),s(Hs,va),s(va,fc),s(Hs,_c),s(O,vc),s(O,ya),s(ya,yc),s(ya,ot),s(ot,bc),s(ya,kc),s(O,wc),s(O,ba),s(ba,zc),s(ba,ka),s(ka,xc),s(ba,Tc),s(O,Mc),s(O,K),_(wa,K,null),s(K,Rc),s(K,Os),s(Os,$c),s(Os,rt),s(rt,qc),s(Os,Ec),s(Os,Cn),s(Cn,Lc),s(Os,Fc),s(K,Pc),_(le,K,null),s(K,Cc),s(K,An),s(An,Ac),s(K,jc),_(za,K,null),h(e,Ir,c),h(e,Is,c),s(Is,me),s(me,jn),_(xa,jn,null),s(Is,Sc),s(Is,Sn),s(Sn,Nc),h(e,Wr,c),h(e,A,c),_(Ta,A,null),s(A,Dc),s(A,Nn),s(Nn,Hc),s(A,Oc),s(A,Ma),s(Ma,Ic),s(Ma,Ra),s(Ra,Wc),s(Ma,Qc),s(A,Kc),s(A,$a),s($a,Uc),s($a,it),s(it,Bc),s($a,Xc),s(A,Vc),s(A,qa),s(qa,Gc),s(qa,Ea),s(Ea,Jc),s(qa,Yc),s(A,Zc),s(A,P),_(La,P,null),s(P,sh),s(P,Ws),s(Ws,eh),s(Ws,lt),s(lt,ah),s(Ws,th),s(Ws,Dn),s(Dn,nh),s(Ws,oh),s(P,rh),_(pe,P,null),s(P,ih),s(P,Hn),s(Hn,lh),s(P,mh),_(Fa,P,null),s(P,ph),s(P,On),s(On,ch),s(P,hh),_(Pa,P,null),h(e,Qr,c),h(e,Qs,c),s(Qs,ce),s(ce,In),_(Ca,In,null),s(Qs,dh),s(Qs,Wn),s(Wn,gh),h(e,Kr,c),h(e,j,c),_(Aa,j,null),s(j,uh),s(j,Ks),s(Ks,fh),s(Ks,Qn),s(Qn,_h),s(Ks,vh),s(Ks,Kn),s(Kn,yh),s(Ks,bh),s(j,kh),s(j,ja),s(ja,wh),s(ja,Sa),s(Sa,zh),s(ja,xh),s(j,Th),s(j,Na),s(Na,Mh),s(Na,mt),s(mt,Rh),s(Na,$h),s(j,qh),s(j,Da),s(Da,Eh),s(Da,Ha),s(Ha,Lh),s(Da,Fh),s(j,Ph),s(j,U),_(Oa,U,null),s(U,Ch),s(U,Us),s(Us,Ah),s(Us,pt),s(pt,jh),s(Us,Sh),s(Us,Un),s(Un,Nh),s(Us,Dh),s(U,Hh),_(he,U,null),s(U,Oh),s(U,Bn),s(Bn,Ih),s(U,Wh),_(Ia,U,null),Ur=!0},p(e,[c]){const Wa={};c&2&&(Wa.$$scope={dirty:c,ctx:e}),ne.$set(Wa);const Xn={};c&2&&(Xn.$$scope={dirty:c,ctx:e}),re.$set(Xn);const Vn={};c&2&&(Vn.$$scope={dirty:c,ctx:e}),le.$set(Vn);const Gn={};c&2&&(Gn.$$scope={dirty:c,ctx:e}),pe.$set(Gn);const de={};c&2&&(de.$$scope={dirty:c,ctx:e}),he.$set(de)},i(e){Ur||(v(w.$$.fragment,e),v(ke.$$.fragment,e),v(Re.$$.fragment,e),v(Fe.$$.fragment,e),v(je.$$.fragment,e),v(Se.$$.fragment,e),v(Ne.$$.fragment,e),v(De.$$.fragment,e),v(He.$$.fragment,e),v(Ie.$$.fragment,e),v(We.$$.fragment,e),v(Qe.$$.fragment,e),v(Xe.$$.fragment,e),v(Ve.$$.fragment,e),v(Ge.$$.fragment,e),v(Ze.$$.fragment,e),v(sa.$$.fragment,e),v(ra.$$.fragment,e),v(ne.$$.fragment,e),v(ia.$$.fragment,e),v(la.$$.fragment,e),v(ma.$$.fragment,e),v(ga.$$.fragment,e),v(re.$$.fragment,e),v(ua.$$.fragment,e),v(fa.$$.fragment,e),v(_a.$$.fragment,e),v(wa.$$.fragment,e),v(le.$$.fragment,e),v(za.$$.fragment,e),v(xa.$$.fragment,e),v(Ta.$$.fragment,e),v(La.$$.fragment,e),v(pe.$$.fragment,e),v(Fa.$$.fragment,e),v(Pa.$$.fragment,e),v(Ca.$$.fragment,e),v(Aa.$$.fragment,e),v(Oa.$$.fragment,e),v(he.$$.fragment,e),v(Ia.$$.fragment,e),Ur=!0)},o(e){y(w.$$.fragment,e),y(ke.$$.fragment,e),y(Re.$$.fragment,e),y(Fe.$$.fragment,e),y(je.$$.fragment,e),y(Se.$$.fragment,e),y(Ne.$$.fragment,e),y(De.$$.fragment,e),y(He.$$.fragment,e),y(Ie.$$.fragment,e),y(We.$$.fragment,e),y(Qe.$$.fragment,e),y(Xe.$$.fragment,e),y(Ve.$$.fragment,e),y(Ge.$$.fragment,e),y(Ze.$$.fragment,e),y(sa.$$.fragment,e),y(ra.$$.fragment,e),y(ne.$$.fragment,e),y(ia.$$.fragment,e),y(la.$$.fragment,e),y(ma.$$.fragment,e),y(ga.$$.fragment,e),y(re.$$.fragment,e),y(ua.$$.fragment,e),y(fa.$$.fragment,e),y(_a.$$.fragment,e),y(wa.$$.fragment,e),y(le.$$.fragment,e),y(za.$$.fragment,e),y(xa.$$.fragment,e),y(Ta.$$.fragment,e),y(La.$$.fragment,e),y(pe.$$.fragment,e),y(Fa.$$.fragment,e),y(Pa.$$.fragment,e),y(Ca.$$.fragment,e),y(Aa.$$.fragment,e),y(Oa.$$.fragment,e),y(he.$$.fragment,e),y(Ia.$$.fragment,e),Ur=!1},d(e){a(d),e&&a(M),e&&a(g),b(w),e&&a(Zn),e&&a(ws),e&&a(so),e&&a(zs),b(ke),e&&a(eo),e&&a(Xs),e&&a(ao),e&&a(Ka),e&&a(to),e&&a(Ua),e&&a(no),e&&a(is),e&&a(oo),e&&a(Te),e&&a(ro),e&&a(Ba),e&&a(io),e&&a(xs),b(Re),e&&a(lo),e&&a($),e&&a(ko),e&&a(Ts),e&&a(To),e&&a(qe),e&&a(Ro),e&&a(Ee),e&&a(qo),e&&a(Le),e&&a(Lo),e&&a(F),e&&a(Io),e&&a(ms),e&&a(Bo),e&&a(q),e&&a(Yo),e&&a(Ms),b(Fe),e&&a(Zo),e&&a(Z),e&&a(sr),e&&a(S),e&&a(er),e&&a(ps),e&&a(ar),e&&a(I),e&&a(mr),e&&a(cs),e&&a(pr),e&&a(ss),e&&a(_r),e&&a(Rs),b(je),e&&a(vr),e&&a(es),e&&a(yr),e&&a(as),e&&a(Mr),e&&a($s),b(Se),e&&a(Rr),e&&a(hs),e&&a($r),e&&a(Zs),e&&a(qr),b(Ne,e),e&&a(Er),e&&a(qs),b(De),e&&a(Lr),e&&a(N),b(He),b(Ie),e&&a(Fr),e&&a(Ls),b(We),e&&a(Pr),e&&a(Y),b(Qe),b(Xe),e&&a(Cr),e&&a(Fs),b(Ve),e&&a(Ar),e&&a(rs),b(Ge),e&&a(jr),e&&a(Cs),b(Ze),e&&a(Sr),e&&a(D),b(sa),b(ra),b(ne),b(ia),e&&a(Nr),e&&a(js),b(la),e&&a(Dr),e&&a(H),b(ma),b(ga),b(re),b(ua),e&&a(Hr),e&&a(Ds),b(fa),e&&a(Or),e&&a(O),b(_a),b(wa),b(le),b(za),e&&a(Ir),e&&a(Is),b(xa),e&&a(Wr),e&&a(A),b(Ta),b(La),b(pe),b(Fa),b(Pa),e&&a(Qr),e&&a(Qs),b(Ca),e&&a(Kr),e&&a(j),b(Aa),b(Oa),b(he),b(Ia)}}}const Zu={local:"reformer",sections:[{local:"overview",title:"Overview"},{local:"axial-positional-encodings",title:"Axial Positional Encodings"},{local:"lsh-self-attention",title:"LSH Self Attention"},{local:"local-self-attention",title:"Local Self Attention"},{local:"training",title:"Training"},{local:"transformers.ReformerConfig",title:"ReformerConfig"},{local:"transformers.ReformerTokenizer",title:"ReformerTokenizer"},{local:"transformers.ReformerTokenizerFast",title:"ReformerTokenizerFast"},{local:"transformers.ReformerModel",title:"ReformerModel"},{local:"transformers.ReformerModelWithLMHead",title:"ReformerModelWithLMHead"},{local:"transformers.ReformerForMaskedLM",title:"ReformerForMaskedLM"},{local:"transformers.ReformerForSequenceClassification",title:"ReformerForSequenceClassification"},{local:"transformers.ReformerForQuestionAnswering",title:"ReformerForQuestionAnswering"}],title:"Reformer"};function sf(J,d,M){let{fw:g}=d;return J.$$set=z=>{"fw"in z&&M(0,g=z.fw)},[g]}class lf extends Wu{constructor(d){super();Qu(this,d,sf,Yu,Ku,{fw:0})}}export{lf as default,Zu as metadata};
