import{S as Vs,i as ks,s as Ls,e as a,k as c,w as E,t as o,M as Ps,c as r,d as t,m as u,a as n,x as A,h as i,b as l,G as e,g,y as $,L as Ns,q as S,o as Q,B as D,v as Fs}from"../../../chunks/vendor-hf-doc-builder.js";import{D as Ue}from"../../../chunks/Docstring-hf-doc-builder.js";import{I as as}from"../../../chunks/IconCopyLink-hf-doc-builder.js";function Os(rs){let w,be,T,J,re,q,Oe,ne,Xe,je,y,x,oe,V,ze,ie,Be,Ee,k,He,L,Re,Ae,C,U,le,P,We,ce,Ge,$e,d,N,Ke,ue,Ye,Ze,de,et,tt,p,K,st,at,pe,rt,nt,he,ot,it,fe,lt,ct,Y,ut,dt,Z,pt,ht,ee,ft,mt,_t,te,vt,F,Mt,gt,M,O,wt,X,Tt,me,yt,Ct,It,_e,Jt,xt,h,z,Ut,B,bt,ve,jt,Et,At,Me,$t,St,ge,Qt,Dt,we,qt,Vt,Te,H,kt,ye,Lt,Pt,Nt,I,Ft,Ce,Ot,Xt,Ie,zt,Bt,Ht,b,R,Rt,Je,Wt,Gt,j,W,Kt,G,Yt,xe,Zt,es,Se;return q=new as({}),V=new as({}),P=new as({}),N=new Ue({props:{name:"class diffusers.VQDiffusionScheduler",anchor:"diffusers.VQDiffusionScheduler",parameters:[{name:"num_vec_classes",val:": int"},{name:"num_train_timesteps",val:": int = 100"},{name:"alpha_cum_start",val:": float = 0.99999"},{name:"alpha_cum_end",val:": float = 9e-06"},{name:"gamma_cum_start",val:": float = 9e-06"},{name:"gamma_cum_end",val:": float = 0.99999"}],parametersDescription:[{anchor:"diffusers.VQDiffusionScheduler.num_vec_classes",description:`<strong>num_vec_classes</strong> (<code>int</code>) &#x2014;
The number of classes of the vector embeddings of the latent pixels. Includes the class for the masked
latent pixel.`,name:"num_vec_classes"},{anchor:"diffusers.VQDiffusionScheduler.num_train_timesteps",description:`<strong>num_train_timesteps</strong> (<code>int</code>) &#x2014;
Number of diffusion steps used to train the model.`,name:"num_train_timesteps"},{anchor:"diffusers.VQDiffusionScheduler.alpha_cum_start",description:`<strong>alpha_cum_start</strong> (<code>float</code>) &#x2014;
The starting cumulative alpha value.`,name:"alpha_cum_start"},{anchor:"diffusers.VQDiffusionScheduler.alpha_cum_end",description:`<strong>alpha_cum_end</strong> (<code>float</code>) &#x2014;
The ending cumulative alpha value.`,name:"alpha_cum_end"},{anchor:"diffusers.VQDiffusionScheduler.gamma_cum_start",description:`<strong>gamma_cum_start</strong> (<code>float</code>) &#x2014;
The starting cumulative gamma value.`,name:"gamma_cum_start"},{anchor:"diffusers.VQDiffusionScheduler.gamma_cum_end",description:`<strong>gamma_cum_end</strong> (<code>float</code>) &#x2014;
The ending cumulative gamma value.`,name:"gamma_cum_end"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/schedulers/scheduling_vq_diffusion.py#L106"}}),O=new Ue({props:{name:"log_Q_t_transitioning_to_known_class",anchor:"diffusers.VQDiffusionScheduler.log_Q_t_transitioning_to_known_class",parameters:[{name:"t",val:": torch.int32"},{name:"x_t",val:": LongTensor"},{name:"log_onehot_x_t",val:": FloatTensor"},{name:"cumulative",val:": bool"}],parametersDescription:[{anchor:"diffusers.VQDiffusionScheduler.log_Q_t_transitioning_to_known_class.t",description:`<strong>t</strong> (torch.Long) &#x2014;
The timestep that determines which transition matrix is used.`,name:"t"},{anchor:"diffusers.VQDiffusionScheduler.log_Q_t_transitioning_to_known_class.x_t",description:`<strong>x_t</strong> (<code>torch.LongTensor</code> of shape <code>(batch size, num latent pixels)</code>) &#x2014;
The classes of each latent pixel at time <code>t</code>.`,name:"x_t"},{anchor:"diffusers.VQDiffusionScheduler.log_Q_t_transitioning_to_known_class.log_onehot_x_t",description:`<strong>log_onehot_x_t</strong> (<code>torch.FloatTensor</code> of shape <code>(batch size, num classes, num latent pixels)</code>) &#x2014;
The log one-hot vectors of <code>x_t</code>`,name:"log_onehot_x_t"},{anchor:"diffusers.VQDiffusionScheduler.log_Q_t_transitioning_to_known_class.cumulative",description:`<strong>cumulative</strong> (<code>bool</code>) &#x2014;
If cumulative is <code>False</code>, we use the single step transition matrix <code>t-1</code>-&gt;<code>t</code>. If cumulative is <code>True</code>,
we use the cumulative transition matrix <code>0</code>-&gt;<code>t</code>.`,name:"cumulative"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/schedulers/scheduling_vq_diffusion.py#L379",returnDescription:`
<p>Each <em>column</em> of the returned matrix is a <em>row</em> of log probabilities of the complete probability
transition matrix.</p>
<p>When non cumulative, returns <code>self.num_classes - 1</code> rows because the initial latent pixel cannot be
masked.</p>
<p>Where:</p>
<ul>
<li><code>q_n</code> is the probability distribution for the forward process of the <code>n</code>th latent pixel.</li>
<li>C_0 is a class of a latent pixel embedding</li>
<li>C_k is the class of the masked latent pixel</li>
</ul>
<p>non-cumulative result (omitting logarithms):</p>

	<CodeBlock 
		code={\`cV8wKHhfdCUyMCU3QyUyMHhfJTdCdC0xJTdEJTIwJTNEJTIwQ18wKSUyMC4uLiUyMHFfbih4X3QlMjAlN0MlMjB4XyU3QnQtMSU3RCUyMCUzRCUyMENfMCklMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAuJTIwJTIwJTIwJTIwJTIwJTIwLiUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMC4lMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAuJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwLiUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMC4lMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAuJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwLiUyMCUyMCUyMCUyMCUyMC4lMEFxXzAoeF90JTIwJTdDJTIweF8lN0J0LTElN0QlMjAlM0QlMjBDX2spJTIwLi4uJTIwcV9uKHhfdCUyMCU3QyUyMHhfJTdCdC0xJTdEJTIwJTNEJTIwQ19rKQ==\`}
		highlighted={\`q<span class="hljs-constructor">_0(<span class="hljs-params">x_t</span> | <span class="hljs-params">x_</span>{<span class="hljs-params">t</span>-1\\} = C_0)</span><span class="hljs-operator"> ... </span>q<span class="hljs-constructor">_n(<span class="hljs-params">x_t</span> | <span class="hljs-params">x_</span>{<span class="hljs-params">t</span>-1\\} = C_0)</span>
          .      .                     .
          .               .            .
          .                      .     .
q<span class="hljs-constructor">_0(<span class="hljs-params">x_t</span> | <span class="hljs-params">x_</span>{<span class="hljs-params">t</span>-1\\} = C_k)</span><span class="hljs-operator"> ... </span>q<span class="hljs-constructor">_n(<span class="hljs-params">x_t</span> | <span class="hljs-params">x_</span>{<span class="hljs-params">t</span>-1\\} = C_k)</span>\`}
	/>
<p>cumulative result (omitting logarithms):</p>

	<CodeBlock 
		code={\`cV8wX2N1bXVsYXRpdmUoeF90JTIwJTdDJTIweF8wJTIwJTNEJTIwQ18wKSUyMCUyMCUyMCUyMC4uLiUyMCUyMHFfbl9jdW11bGF0aXZlKHhfdCUyMCU3QyUyMHhfMCUyMCUzRCUyMENfMCklMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAuJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwLiUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMC4lMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAuJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwLiUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMC4lMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAuJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwLiUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMC4lMEFxXzBfY3VtdWxhdGl2ZSh4X3QlMjAlN0MlMjB4XzAlMjAlM0QlMjBDXyU3QmstMSU3RCklMjAuLi4lMjBxX25fY3VtdWxhdGl2ZSh4X3QlMjAlN0MlMjB4XzAlMjAlM0QlMjBDXyU3QmstMSU3RCk=\`}
		highlighted={\`q<span class="hljs-constructor">_0_cumulative(<span class="hljs-params">x_t</span> | <span class="hljs-params">x_0</span> = C_0)</span><span class="hljs-operator">    ...  </span>q<span class="hljs-constructor">_n_cumulative(<span class="hljs-params">x_t</span> | <span class="hljs-params">x_0</span> = C_0)</span>
          .               .                          .
          .                        .                 .
          .                               .          .
q<span class="hljs-constructor">_0_cumulative(<span class="hljs-params">x_t</span> | <span class="hljs-params">x_0</span> = C_{<span class="hljs-params">k</span>-1\\})</span><span class="hljs-operator"> ... </span>q<span class="hljs-constructor">_n_cumulative(<span class="hljs-params">x_t</span> | <span class="hljs-params">x_0</span> = C_{<span class="hljs-params">k</span>-1\\})</span>\`}
	/>
`,returnType:`
<p><code>torch.FloatTensor</code> of shape <code>(batch size, num classes - 1, num latent pixels)</code></p>
`}}),z=new Ue({props:{name:"q_posterior",anchor:"diffusers.VQDiffusionScheduler.q_posterior",parameters:[{name:"log_p_x_0",val:""},{name:"x_t",val:""},{name:"t",val:""}],parametersDescription:[{anchor:"diffusers.VQDiffusionScheduler.q_posterior.t",description:`<strong>t</strong> (torch.Long) &#x2014;
The timestep that determines which transition matrix is used.`,name:"t"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/schedulers/scheduling_vq_diffusion.py#L260",returnDescription:`
<p>The log probabilities for the predicted classes of the image at timestep <code>t-1</code>. I.e. Equation (11).</p>
`,returnType:`
<p><code>torch.FloatTensor</code> of shape <code>(batch size, num classes, num latent pixels)</code></p>
`}}),R=new Ue({props:{name:"set_timesteps",anchor:"diffusers.VQDiffusionScheduler.set_timesteps",parameters:[{name:"num_inference_steps",val:": int"},{name:"device",val:": typing.Union[str, torch.device] = None"}],parametersDescription:[{anchor:"diffusers.VQDiffusionScheduler.set_timesteps.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>) &#x2014;
the number of diffusion steps used when generating samples with a pre-trained model.`,name:"num_inference_steps"},{anchor:"diffusers.VQDiffusionScheduler.set_timesteps.device",description:`<strong>device</strong> (<code>str</code> or <code>torch.device</code>) &#x2014;
device to place the timesteps and the diffusion process parameters (alpha, beta, gamma) on.`,name:"device"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/schedulers/scheduling_vq_diffusion.py#L190"}}),W=new Ue({props:{name:"step",anchor:"diffusers.VQDiffusionScheduler.step",parameters:[{name:"model_output",val:": FloatTensor"},{name:"timestep",val:": torch.int64"},{name:"sample",val:": LongTensor"},{name:"generator",val:": typing.Optional[torch._C.Generator] = None"},{name:"return_dict",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.VQDiffusionScheduler.step.t",description:`<strong>t</strong> (<code>torch.long</code>) &#x2014;
The timestep that determines which transition matrices are used.</p>
<p>x_t &#x2014; (<code>torch.LongTensor</code> of shape <code>(batch size, num latent pixels)</code>):
The classes of each latent pixel at time <code>t</code></p>
<p>generator &#x2014; (<code>torch.Generator</code> or None):
RNG for the noise applied to p(x_{t-1} | x_t) before it is sampled from.`,name:"t"},{anchor:"diffusers.VQDiffusionScheduler.step.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>) &#x2014;
option for returning tuple rather than VQDiffusionSchedulerOutput class`,name:"return_dict"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/schedulers/scheduling_vq_diffusion.py#L212",returnDescription:`
<p><code>~schedulers.scheduling_utils.VQDiffusionSchedulerOutput</code> if <code>return_dict</code> is True, otherwise a <code>tuple</code>.
When returning a tuple, the first element is the sample tensor.</p>
`,returnType:`
<p><code>~schedulers.scheduling_utils.VQDiffusionSchedulerOutput</code> or <code>tuple</code></p>
`}}),{c(){w=a("meta"),be=c(),T=a("h1"),J=a("a"),re=a("span"),E(q.$$.fragment),Oe=c(),ne=a("span"),Xe=o("VQDiffusionScheduler"),je=c(),y=a("h2"),x=a("a"),oe=a("span"),E(V.$$.fragment),ze=c(),ie=a("span"),Be=o("Overview"),Ee=c(),k=a("p"),He=o("Original paper can be found "),L=a("a"),Re=o("here"),Ae=c(),C=a("h2"),U=a("a"),le=a("span"),E(P.$$.fragment),We=c(),ce=a("span"),Ge=o("VQDiffusionScheduler"),$e=c(),d=a("div"),E(N.$$.fragment),Ke=c(),ue=a("p"),Ye=o("The VQ-diffusion transformer outputs predicted probabilities of the initial unnoised image."),Ze=c(),de=a("p"),et=o(`The VQ-diffusion scheduler converts the transformer\u2019s output into a sample for the unnoised image at the previous
diffusion timestep.`),tt=c(),p=a("p"),K=a("a"),st=o("~ConfigMixin"),at=o(" takes care of storing all config attributes that are passed in the scheduler\u2019s "),pe=a("code"),rt=o("__init__"),nt=o(`
function, such as `),he=a("code"),ot=o("num_train_timesteps"),it=o(". They can be accessed via "),fe=a("code"),lt=o("scheduler.config.num_train_timesteps"),ct=o(`.
`),Y=a("a"),ut=o("SchedulerMixin"),dt=o(" provides general loading and saving functionality via the "),Z=a("a"),pt=o("SchedulerMixin.save_pretrained()"),ht=o(` and
`),ee=a("a"),ft=o("from_pretrained()"),mt=o(" functions."),_t=c(),te=a("p"),vt=o("For more details, see the original paper: "),F=a("a"),Mt=o("https://arxiv.org/abs/2111.14822"),gt=c(),M=a("div"),E(O.$$.fragment),wt=c(),X=a("p"),Tt=o(`Returns the log probabilities of the rows from the (cumulative or non-cumulative) transition matrix for each
latent pixel in `),me=a("code"),yt=o("x_t"),Ct=o("."),It=c(),_e=a("p"),Jt=o(`See equation (7) for the complete non-cumulative transition matrix. The complete cumulative transition matrix
is the same structure except the parameters (alpha, beta, gamma) are the cumulative analogs.`),xt=c(),h=a("div"),E(z.$$.fragment),Ut=c(),B=a("p"),bt=o("Calculates the log probabilities for the predicted classes of the image at timestep "),ve=a("code"),jt=o("t-1"),Et=o(". I.e. Equation (11)."),At=c(),Me=a("p"),$t=o(`Instead of directly computing equation (11), we use Equation (5) to restate Equation (11) in terms of only
forward probabilities.`),St=c(),ge=a("p"),Qt=o("Equation (11) stated in terms of forward probabilities via Equation (5):"),Dt=c(),we=a("p"),qt=o("Where:"),Vt=c(),Te=a("ul"),H=a("li"),kt=o("the sum is over x"),ye=a("em"),Lt=o("0 = {C_0 \u2026 C"),Pt=o("{k-1}} (classes for x_0)"),Nt=c(),I=a("p"),Ft=o("p(x"),Ce=a("em"),Ot=o("{t-1} | x_t) = sum( q(x_t | x"),Xt=o("{t-1}) "),Ie=a("em"),zt=o("q(x_{t-1} | x_0)"),Bt=o(" p(x_0) / q(x_t | x_0) )"),Ht=c(),b=a("div"),E(R.$$.fragment),Rt=c(),Je=a("p"),Wt=o("Sets the discrete timesteps used for the diffusion chain. Supporting function to be run before inference."),Gt=c(),j=a("div"),E(W.$$.fragment),Kt=c(),G=a("p"),Yt=o(`Predict the sample at the previous timestep via the reverse transition distribution i.e. Equation (11). See the
docstring for `),xe=a("code"),Zt=o("self.q_posterior"),es=o(" for more in depth docs on how Equation (11) is computed."),this.h()},l(s){const v=Ps('[data-svelte="svelte-1phssyn"]',document.head);w=r(v,"META",{name:!0,content:!0}),v.forEach(t),be=u(s),T=r(s,"H1",{class:!0});var Qe=n(T);J=r(Qe,"A",{id:!0,class:!0,href:!0});var ns=n(J);re=r(ns,"SPAN",{});var os=n(re);A(q.$$.fragment,os),os.forEach(t),ns.forEach(t),Oe=u(Qe),ne=r(Qe,"SPAN",{});var is=n(ne);Xe=i(is,"VQDiffusionScheduler"),is.forEach(t),Qe.forEach(t),je=u(s),y=r(s,"H2",{class:!0});var De=n(y);x=r(De,"A",{id:!0,class:!0,href:!0});var ls=n(x);oe=r(ls,"SPAN",{});var cs=n(oe);A(V.$$.fragment,cs),cs.forEach(t),ls.forEach(t),ze=u(De),ie=r(De,"SPAN",{});var us=n(ie);Be=i(us,"Overview"),us.forEach(t),De.forEach(t),Ee=u(s),k=r(s,"P",{});var ts=n(k);He=i(ts,"Original paper can be found "),L=r(ts,"A",{href:!0,rel:!0});var ds=n(L);Re=i(ds,"here"),ds.forEach(t),ts.forEach(t),Ae=u(s),C=r(s,"H2",{class:!0});var qe=n(C);U=r(qe,"A",{id:!0,class:!0,href:!0});var ps=n(U);le=r(ps,"SPAN",{});var hs=n(le);A(P.$$.fragment,hs),hs.forEach(t),ps.forEach(t),We=u(qe),ce=r(qe,"SPAN",{});var fs=n(ce);Ge=i(fs,"VQDiffusionScheduler"),fs.forEach(t),qe.forEach(t),$e=u(s),d=r(s,"DIV",{class:!0});var f=n(d);A(N.$$.fragment,f),Ke=u(f),ue=r(f,"P",{});var ms=n(ue);Ye=i(ms,"The VQ-diffusion transformer outputs predicted probabilities of the initial unnoised image."),ms.forEach(t),Ze=u(f),de=r(f,"P",{});var _s=n(de);et=i(_s,`The VQ-diffusion scheduler converts the transformer\u2019s output into a sample for the unnoised image at the previous
diffusion timestep.`),_s.forEach(t),tt=u(f),p=r(f,"P",{});var m=n(p);K=r(m,"A",{href:!0});var vs=n(K);st=i(vs,"~ConfigMixin"),vs.forEach(t),at=i(m," takes care of storing all config attributes that are passed in the scheduler\u2019s "),pe=r(m,"CODE",{});var Ms=n(pe);rt=i(Ms,"__init__"),Ms.forEach(t),nt=i(m,`
function, such as `),he=r(m,"CODE",{});var gs=n(he);ot=i(gs,"num_train_timesteps"),gs.forEach(t),it=i(m,". They can be accessed via "),fe=r(m,"CODE",{});var ws=n(fe);lt=i(ws,"scheduler.config.num_train_timesteps"),ws.forEach(t),ct=i(m,`.
`),Y=r(m,"A",{href:!0});var Ts=n(Y);ut=i(Ts,"SchedulerMixin"),Ts.forEach(t),dt=i(m," provides general loading and saving functionality via the "),Z=r(m,"A",{href:!0});var ys=n(Z);pt=i(ys,"SchedulerMixin.save_pretrained()"),ys.forEach(t),ht=i(m,` and
`),ee=r(m,"A",{href:!0});var Cs=n(ee);ft=i(Cs,"from_pretrained()"),Cs.forEach(t),mt=i(m," functions."),m.forEach(t),_t=u(f),te=r(f,"P",{});var ss=n(te);vt=i(ss,"For more details, see the original paper: "),F=r(ss,"A",{href:!0,rel:!0});var Is=n(F);Mt=i(Is,"https://arxiv.org/abs/2111.14822"),Is.forEach(t),ss.forEach(t),gt=u(f),M=r(f,"DIV",{class:!0});var se=n(M);A(O.$$.fragment,se),wt=u(se),X=r(se,"P",{});var Ve=n(X);Tt=i(Ve,`Returns the log probabilities of the rows from the (cumulative or non-cumulative) transition matrix for each
latent pixel in `),me=r(Ve,"CODE",{});var Js=n(me);yt=i(Js,"x_t"),Js.forEach(t),Ct=i(Ve,"."),Ve.forEach(t),It=u(se),_e=r(se,"P",{});var xs=n(_e);Jt=i(xs,`See equation (7) for the complete non-cumulative transition matrix. The complete cumulative transition matrix
is the same structure except the parameters (alpha, beta, gamma) are the cumulative analogs.`),xs.forEach(t),se.forEach(t),xt=u(f),h=r(f,"DIV",{class:!0});var _=n(h);A(z.$$.fragment,_),Ut=u(_),B=r(_,"P",{});var ke=n(B);bt=i(ke,"Calculates the log probabilities for the predicted classes of the image at timestep "),ve=r(ke,"CODE",{});var Us=n(ve);jt=i(Us,"t-1"),Us.forEach(t),Et=i(ke,". I.e. Equation (11)."),ke.forEach(t),At=u(_),Me=r(_,"P",{});var bs=n(Me);$t=i(bs,`Instead of directly computing equation (11), we use Equation (5) to restate Equation (11) in terms of only
forward probabilities.`),bs.forEach(t),St=u(_),ge=r(_,"P",{});var js=n(ge);Qt=i(js,"Equation (11) stated in terms of forward probabilities via Equation (5):"),js.forEach(t),Dt=u(_),we=r(_,"P",{});var Es=n(we);qt=i(Es,"Where:"),Es.forEach(t),Vt=u(_),Te=r(_,"UL",{});var As=n(Te);H=r(As,"LI",{});var Le=n(H);kt=i(Le,"the sum is over x"),ye=r(Le,"EM",{});var $s=n(ye);Lt=i($s,"0 = {C_0 \u2026 C"),$s.forEach(t),Pt=i(Le,"{k-1}} (classes for x_0)"),Le.forEach(t),As.forEach(t),Nt=u(_),I=r(_,"P",{});var ae=n(I);Ft=i(ae,"p(x"),Ce=r(ae,"EM",{});var Ss=n(Ce);Ot=i(Ss,"{t-1} | x_t) = sum( q(x_t | x"),Ss.forEach(t),Xt=i(ae,"{t-1}) "),Ie=r(ae,"EM",{});var Qs=n(Ie);zt=i(Qs,"q(x_{t-1} | x_0)"),Qs.forEach(t),Bt=i(ae," p(x_0) / q(x_t | x_0) )"),ae.forEach(t),_.forEach(t),Ht=u(f),b=r(f,"DIV",{class:!0});var Pe=n(b);A(R.$$.fragment,Pe),Rt=u(Pe),Je=r(Pe,"P",{});var Ds=n(Je);Wt=i(Ds,"Sets the discrete timesteps used for the diffusion chain. Supporting function to be run before inference."),Ds.forEach(t),Pe.forEach(t),Gt=u(f),j=r(f,"DIV",{class:!0});var Ne=n(j);A(W.$$.fragment,Ne),Kt=u(Ne),G=r(Ne,"P",{});var Fe=n(G);Yt=i(Fe,`Predict the sample at the previous timestep via the reverse transition distribution i.e. Equation (11). See the
docstring for `),xe=r(Fe,"CODE",{});var qs=n(xe);Zt=i(qs,"self.q_posterior"),qs.forEach(t),es=i(Fe," for more in depth docs on how Equation (11) is computed."),Fe.forEach(t),Ne.forEach(t),f.forEach(t),this.h()},h(){l(w,"name","hf:doc:metadata"),l(w,"content",JSON.stringify(Xs)),l(J,"id","vqdiffusionscheduler"),l(J,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(J,"href","#vqdiffusionscheduler"),l(T,"class","relative group"),l(x,"id","overview"),l(x,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(x,"href","#overview"),l(y,"class","relative group"),l(L,"href","https://arxiv.org/abs/2111.14822"),l(L,"rel","nofollow"),l(U,"id","diffusers.VQDiffusionScheduler"),l(U,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(U,"href","#diffusers.VQDiffusionScheduler"),l(C,"class","relative group"),l(K,"href","/docs/diffusers/v0.19.0/en/api/configuration#diffusers.ConfigMixin"),l(Y,"href","/docs/diffusers/v0.19.0/en/api/schedulers/overview#diffusers.SchedulerMixin"),l(Z,"href","/docs/diffusers/v0.19.0/en/api/schedulers/overview#diffusers.SchedulerMixin.save_pretrained"),l(ee,"href","/docs/diffusers/v0.19.0/en/api/schedulers/overview#diffusers.SchedulerMixin.from_pretrained"),l(F,"href","https://arxiv.org/abs/2111.14822"),l(F,"rel","nofollow"),l(M,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(h,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(b,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(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(s,v){e(document.head,w),g(s,be,v),g(s,T,v),e(T,J),e(J,re),$(q,re,null),e(T,Oe),e(T,ne),e(ne,Xe),g(s,je,v),g(s,y,v),e(y,x),e(x,oe),$(V,oe,null),e(y,ze),e(y,ie),e(ie,Be),g(s,Ee,v),g(s,k,v),e(k,He),e(k,L),e(L,Re),g(s,Ae,v),g(s,C,v),e(C,U),e(U,le),$(P,le,null),e(C,We),e(C,ce),e(ce,Ge),g(s,$e,v),g(s,d,v),$(N,d,null),e(d,Ke),e(d,ue),e(ue,Ye),e(d,Ze),e(d,de),e(de,et),e(d,tt),e(d,p),e(p,K),e(K,st),e(p,at),e(p,pe),e(pe,rt),e(p,nt),e(p,he),e(he,ot),e(p,it),e(p,fe),e(fe,lt),e(p,ct),e(p,Y),e(Y,ut),e(p,dt),e(p,Z),e(Z,pt),e(p,ht),e(p,ee),e(ee,ft),e(p,mt),e(d,_t),e(d,te),e(te,vt),e(te,F),e(F,Mt),e(d,gt),e(d,M),$(O,M,null),e(M,wt),e(M,X),e(X,Tt),e(X,me),e(me,yt),e(X,Ct),e(M,It),e(M,_e),e(_e,Jt),e(d,xt),e(d,h),$(z,h,null),e(h,Ut),e(h,B),e(B,bt),e(B,ve),e(ve,jt),e(B,Et),e(h,At),e(h,Me),e(Me,$t),e(h,St),e(h,ge),e(ge,Qt),e(h,Dt),e(h,we),e(we,qt),e(h,Vt),e(h,Te),e(Te,H),e(H,kt),e(H,ye),e(ye,Lt),e(H,Pt),e(h,Nt),e(h,I),e(I,Ft),e(I,Ce),e(Ce,Ot),e(I,Xt),e(I,Ie),e(Ie,zt),e(I,Bt),e(d,Ht),e(d,b),$(R,b,null),e(b,Rt),e(b,Je),e(Je,Wt),e(d,Gt),e(d,j),$(W,j,null),e(j,Kt),e(j,G),e(G,Yt),e(G,xe),e(xe,Zt),e(G,es),Se=!0},p:Ns,i(s){Se||(S(q.$$.fragment,s),S(V.$$.fragment,s),S(P.$$.fragment,s),S(N.$$.fragment,s),S(O.$$.fragment,s),S(z.$$.fragment,s),S(R.$$.fragment,s),S(W.$$.fragment,s),Se=!0)},o(s){Q(q.$$.fragment,s),Q(V.$$.fragment,s),Q(P.$$.fragment,s),Q(N.$$.fragment,s),Q(O.$$.fragment,s),Q(z.$$.fragment,s),Q(R.$$.fragment,s),Q(W.$$.fragment,s),Se=!1},d(s){t(w),s&&t(be),s&&t(T),D(q),s&&t(je),s&&t(y),D(V),s&&t(Ee),s&&t(k),s&&t(Ae),s&&t(C),D(P),s&&t($e),s&&t(d),D(N),D(O),D(z),D(R),D(W)}}}const Xs={local:"vqdiffusionscheduler",sections:[{local:"overview",title:"Overview"},{local:"diffusers.VQDiffusionScheduler",title:"VQDiffusionScheduler"}],title:"VQDiffusionScheduler"};function zs(rs){return Fs(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ws extends Vs{constructor(w){super();ks(this,w,zs,Os,Ls,{})}}export{Ws as default,Xs as metadata};
