import{S as Tu,i as $u,s as Mu,e as o,k as h,w as y,t,Y as M,M as Ru,c as r,d as a,m as d,a as i,x as k,h as n,Z as R,b as m,G as s,g,y as w,q as x,o as z,B as T,v as qu,L as Le}from"../../chunks/vendor-hf-doc-builder.js";import{T as Ct}from"../../chunks/Tip-hf-doc-builder.js";import{D as K}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Qs}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as U}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Ee}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Eu($){let c,v,u,f,b;return f=new Qs({props:{code:`from transformers import ReformerConfig, ReformerModel

# Initializing a Reformer configuration
configuration = ReformerConfig()

# Initializing a Reformer model (with random weights)
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> ReformerConfig, ReformerModel

<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 (with random weights)</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`}}),{c(){c=o("p"),v=t("Examples:"),u=h(),y(f.$$.fragment)},l(l){c=r(l,"P",{});var _=i(c);v=n(_,"Examples:"),_.forEach(a),u=d(l),k(f.$$.fragment,l)},m(l,_){g(l,c,_),s(c,v),g(l,u,_),w(f,l,_),b=!0},p:Le,i(l){b||(x(f.$$.fragment,l),b=!0)},o(l){z(f.$$.fragment,l),b=!1},d(l){l&&a(c),l&&a(u),T(f,l)}}}function Lu($){let c,v,u,f,b;return{c(){c=o("p"),v=t("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=o("code"),f=t("Module"),b=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(l){c=r(l,"P",{});var _=i(c);v=n(_,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=r(_,"CODE",{});var A=i(u);f=n(A,"Module"),A.forEach(a),b=n(_,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),_.forEach(a)},m(l,_){g(l,c,_),s(c,v),s(c,u),s(u,f),s(c,b)},d(l){l&&a(c)}}}function Au($){let c,v,u,f,b;return f=new Qs({props:{code:`from transformers import AutoTokenizer, ReformerModel
import torch

tokenizer = AutoTokenizer.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> AutoTokenizer, 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 = AutoTokenizer.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`}}),{c(){c=o("p"),v=t("Example:"),u=h(),y(f.$$.fragment)},l(l){c=r(l,"P",{});var _=i(c);v=n(_,"Example:"),_.forEach(a),u=d(l),k(f.$$.fragment,l)},m(l,_){g(l,c,_),s(c,v),g(l,u,_),w(f,l,_),b=!0},p:Le,i(l){b||(x(f.$$.fragment,l),b=!0)},o(l){z(f.$$.fragment,l),b=!1},d(l){l&&a(c),l&&a(u),T(f,l)}}}function Fu($){let c,v,u,f,b;return{c(){c=o("p"),v=t("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=o("code"),f=t("Module"),b=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(l){c=r(l,"P",{});var _=i(c);v=n(_,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=r(_,"CODE",{});var A=i(u);f=n(A,"Module"),A.forEach(a),b=n(_,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),_.forEach(a)},m(l,_){g(l,c,_),s(c,v),s(c,u),s(u,f),s(c,b)},d(l){l&&a(c)}}}function Pu($){let c,v,u,f,b;return f=new Qs({props:{code:`import torch
from transformers import AutoTokenizer, ReformerModelWithLMHead

tokenizer = AutoTokenizer.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> AutoTokenizer, ReformerModelWithLMHead

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.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`}}),{c(){c=o("p"),v=t("Example:"),u=h(),y(f.$$.fragment)},l(l){c=r(l,"P",{});var _=i(c);v=n(_,"Example:"),_.forEach(a),u=d(l),k(f.$$.fragment,l)},m(l,_){g(l,c,_),s(c,v),g(l,u,_),w(f,l,_),b=!0},p:Le,i(l){b||(x(f.$$.fragment,l),b=!0)},o(l){z(f.$$.fragment,l),b=!1},d(l){l&&a(c),l&&a(u),T(f,l)}}}function Cu($){let c,v,u,f,b;return{c(){c=o("p"),v=t("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=o("code"),f=t("Module"),b=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(l){c=r(l,"P",{});var _=i(c);v=n(_,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=r(_,"CODE",{});var A=i(u);f=n(A,"Module"),A.forEach(a),b=n(_,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),_.forEach(a)},m(l,_){g(l,c,_),s(c,v),s(c,u),s(u,f),s(c,b)},d(l){l&&a(c)}}}function ju($){let c,v;return{c(){c=o("p"),v=t(`This example uses a false checkpoint since we don\u2019t have any available pretrained model for the masked language
modeling task with the Reformer architecture.`)},l(u){c=r(u,"P",{});var f=i(c);v=n(f,`This example uses a false checkpoint since we don\u2019t have any available pretrained model for the masked language
modeling task with the Reformer architecture.`),f.forEach(a)},m(u,f){g(u,c,f),s(c,v)},d(u){u&&a(c)}}}function Su($){let c,v,u,f,b;return f=new Qs({props:{code:`import torch
from transformers import AutoTokenizer, ReformerForMaskedLM

tokenizer = AutoTokenizer.from_pretrained("hf-internal-testing/tiny-random-reformer")
model = ReformerForMaskedLM.from_pretrained("hf-internal-testing/tiny-random-reformer")

# add mask_token
tokenizer.add_special_tokens({"mask_token": "[MASK]"})
inputs = tokenizer("The capital of France is [MASK].", return_tensors="pt")

# resize model's embedding matrix
model.resize_token_embeddings(new_num_tokens=model.config.vocab_size + 1)
with torch.no_grad():
    logits = model(**inputs).logits

# retrieve index of [MASK]
mask_token_index = (inputs.input_ids == tokenizer.mask_token_id)[0].nonzero(as_tuple=True)[0]

predicted_token_id = logits[0, mask_token_index].argmax(axis=-1)
predicted_token = tokenizer.decode(predicted_token_id)`,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> AutoTokenizer, ReformerForMaskedLM

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;hf-internal-testing/tiny-random-reformer&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ReformerForMaskedLM.from_pretrained(<span class="hljs-string">&quot;hf-internal-testing/tiny-random-reformer&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># add mask_token</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer.add_special_tokens({<span class="hljs-string">&quot;mask_token&quot;</span>: <span class="hljs-string">&quot;[MASK]&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><span class="hljs-comment"># resize model&#x27;s embedding matrix</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model.resize_token_embeddings(new_num_tokens=model.config.vocab_size + <span class="hljs-number">1</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    logits = model(**inputs).logits

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># retrieve index of [MASK]</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>mask_token_index = (inputs.input_ids == tokenizer.mask_token_id)[<span class="hljs-number">0</span>].nonzero(as_tuple=<span class="hljs-literal">True</span>)[<span class="hljs-number">0</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_token_id = logits[<span class="hljs-number">0</span>, mask_token_index].argmax(axis=-<span class="hljs-number">1</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_token = tokenizer.decode(predicted_token_id)`}}),{c(){c=o("p"),v=t("Example:"),u=h(),y(f.$$.fragment)},l(l){c=r(l,"P",{});var _=i(c);v=n(_,"Example:"),_.forEach(a),u=d(l),k(f.$$.fragment,l)},m(l,_){g(l,c,_),s(c,v),g(l,u,_),w(f,l,_),b=!0},p:Le,i(l){b||(x(f.$$.fragment,l),b=!0)},o(l){z(f.$$.fragment,l),b=!1},d(l){l&&a(c),l&&a(u),T(f,l)}}}function Ou($){let c,v;return c=new Qs({props:{code:`labels = tokenizer("The capital of France is Paris.", return_tensors="pt")["input_ids"]
# mask labels of non-[MASK] tokens
labels = torch.where(
    inputs.input_ids == tokenizer.mask_token_id, labels[:, : inputs["input_ids"].shape[-1]], -100
)

outputs = model(**inputs, labels=labels)
loss = round(outputs.loss.item(), 2)`,highlighted:`<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><span class="hljs-comment"># mask labels of non-[MASK] tokens</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>labels = torch.where(
<span class="hljs-meta">... </span>    inputs.input_ids == tokenizer.mask_token_id, labels[:, : inputs[<span class="hljs-string">&quot;input_ids&quot;</span>].shape[-<span class="hljs-number">1</span>]], -<span class="hljs-number">100</span>
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs, labels=labels)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = <span class="hljs-built_in">round</span>(outputs.loss.item(), <span class="hljs-number">2</span>)`}}),{c(){y(c.$$.fragment)},l(u){k(c.$$.fragment,u)},m(u,f){w(c,u,f),v=!0},p:Le,i(u){v||(x(c.$$.fragment,u),v=!0)},o(u){z(c.$$.fragment,u),v=!1},d(u){T(c,u)}}}function Nu($){let c,v,u,f,b;return{c(){c=o("p"),v=t("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=o("code"),f=t("Module"),b=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(l){c=r(l,"P",{});var _=i(c);v=n(_,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=r(_,"CODE",{});var A=i(u);f=n(A,"Module"),A.forEach(a),b=n(_,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),_.forEach(a)},m(l,_){g(l,c,_),s(c,v),s(c,u),s(u,f),s(c,b)},d(l){l&&a(c)}}}function Du($){let c,v,u,f,b;return f=new Qs({props:{code:`import torch
from transformers import AutoTokenizer, ReformerForSequenceClassification

tokenizer = AutoTokenizer.from_pretrained("google/reformer-crime-and-punishment")
model = ReformerForSequenceClassification.from_pretrained("google/reformer-crime-and-punishment")

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

with torch.no_grad():
    logits = model(**inputs).logits

predicted_class_id = logits.argmax().item()
label = model.config.id2label[predicted_class_id]`,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> AutoTokenizer, ReformerForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.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>)

<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><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    logits = model(**inputs).logits

<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_class_id = logits.argmax().item()
<span class="hljs-meta">&gt;&gt;&gt; </span>label = model.config.id2label[predicted_class_id]`}}),{c(){c=o("p"),v=t("Example of single-label classification:"),u=h(),y(f.$$.fragment)},l(l){c=r(l,"P",{});var _=i(c);v=n(_,"Example of single-label classification:"),_.forEach(a),u=d(l),k(f.$$.fragment,l)},m(l,_){g(l,c,_),s(c,v),g(l,u,_),w(f,l,_),b=!0},p:Le,i(l){b||(x(f.$$.fragment,l),b=!0)},o(l){z(f.$$.fragment,l),b=!1},d(l){l&&a(c),l&&a(u),T(f,l)}}}function Hu($){let c,v;return c=new Qs({props:{code:`# To train a model on \`num_labels\` classes, you can pass \`num_labels=num_labels\` to \`.from_pretrained(...)\`
num_labels = len(model.config.id2label)
model = ReformerForSequenceClassification.from_pretrained(
    "google/reformer-crime-and-punishment", num_labels=num_labels
)

labels = torch.tensor(1)
loss = model(**inputs, labels=labels).loss`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># To train a model on \`num_labels\` classes, you can pass \`num_labels=num_labels\` to \`.from_pretrained(...)\`</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>num_labels = <span class="hljs-built_in">len</span>(model.config.id2label)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ReformerForSequenceClassification.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;google/reformer-crime-and-punishment&quot;</span>, num_labels=num_labels
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>labels = torch.tensor(<span class="hljs-number">1</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(**inputs, labels=labels).loss`}}),{c(){y(c.$$.fragment)},l(u){k(c.$$.fragment,u)},m(u,f){w(c,u,f),v=!0},p:Le,i(u){v||(x(c.$$.fragment,u),v=!0)},o(u){z(c.$$.fragment,u),v=!1},d(u){T(c,u)}}}function Iu($){let c,v,u,f,b;return{c(){c=o("p"),v=t("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=o("code"),f=t("Module"),b=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(l){c=r(l,"P",{});var _=i(c);v=n(_,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=r(_,"CODE",{});var A=i(u);f=n(A,"Module"),A.forEach(a),b=n(_,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),_.forEach(a)},m(l,_){g(l,c,_),s(c,v),s(c,u),s(u,f),s(c,b)},d(l){l&&a(c)}}}function Wu($){let c,v,u,f,b;return f=new Qs({props:{code:`from transformers import AutoTokenizer, ReformerForQuestionAnswering
import torch

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

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

predict_answer_tokens = inputs.input_ids[0, answer_start_index : answer_end_index + 1]

# target is "nice puppet"
target_start_index = torch.tensor([14])
target_end_index = torch.tensor([15])

outputs = model(**inputs, start_positions=target_start_index, end_positions=target_end_index)
loss = outputs.loss`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, ReformerForQuestionAnswering
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;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><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    outputs = model(**inputs)

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

<span class="hljs-meta">&gt;&gt;&gt; </span>predict_answer_tokens = inputs.input_ids[<span class="hljs-number">0</span>, answer_start_index : answer_end_index + <span class="hljs-number">1</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># target is &quot;nice puppet&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>target_start_index = torch.tensor([<span class="hljs-number">14</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>target_end_index = torch.tensor([<span class="hljs-number">15</span>])

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