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 n,d as t,m as u,a as r,x as A,h as i,b as l,G as e,g as v,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(ns){let w,be,T,J,ne,q,Oe,re,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,nt,rt,he,ot,it,fe,lt,ct,Y,ut,dt,Z,pt,ht,ee,ft,mt,_t,te,Mt,F,gt,vt,g,O,wt,X,Tt,me,yt,Ct,It,_e,Jt,xt,h,z,Ut,B,bt,Me,jt,Et,At,ge,$t,St,ve,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/main/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/main/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/main/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/main/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/main/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"),ne=a("span"),E(q.$$.fragment),Oe=c(),re=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"),nt=o("__init__"),rt=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"),Mt=o("For more details, see the original paper: "),F=a("a"),gt=o("https://arxiv.org/abs/2111.14822"),vt=c(),g=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 "),Me=a("code"),jt=o("t-1"),Et=o(". I.e. Equation (11)."),At=c(),ge=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(),ve=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 M=Ps('[data-svelte="svelte-1phssyn"]',document.head);w=n(M,"META",{name:!0,content:!0}),M.forEach(t),be=u(s),T=n(s,"H1",{class:!0});var Qe=r(T);J=n(Qe,"A",{id:!0,class:!0,href:!0});var rs=r(J);ne=n(rs,"SPAN",{});var os=r(ne);A(q.$$.fragment,os),os.forEach(t),rs.forEach(t),Oe=u(Qe),re=n(Qe,"SPAN",{});var is=r(re);Xe=i(is,"VQDiffusionScheduler"),is.forEach(t),Qe.forEach(t),je=u(s),y=n(s,"H2",{class:!0});var De=r(y);x=n(De,"A",{id:!0,class:!0,href:!0});var ls=r(x);oe=n(ls,"SPAN",{});var cs=r(oe);A(V.$$.fragment,cs),cs.forEach(t),ls.forEach(t),ze=u(De),ie=n(De,"SPAN",{});var us=r(ie);Be=i(us,"Overview"),us.forEach(t),De.forEach(t),Ee=u(s),k=n(s,"P",{});var ts=r(k);He=i(ts,"Original paper can be found "),L=n(ts,"A",{href:!0,rel:!0});var ds=r(L);Re=i(ds,"here"),ds.forEach(t),ts.forEach(t),Ae=u(s),C=n(s,"H2",{class:!0});var qe=r(C);U=n(qe,"A",{id:!0,class:!0,href:!0});var ps=r(U);le=n(ps,"SPAN",{});var hs=r(le);A(P.$$.fragment,hs),hs.forEach(t),ps.forEach(t),We=u(qe),ce=n(qe,"SPAN",{});var fs=r(ce);Ge=i(fs,"VQDiffusionScheduler"),fs.forEach(t),qe.forEach(t),$e=u(s),d=n(s,"DIV",{class:!0});var f=r(d);A(N.$$.fragment,f),Ke=u(f),ue=n(f,"P",{});var ms=r(ue);Ye=i(ms,"The VQ-diffusion transformer outputs predicted probabilities of the initial unnoised image."),ms.forEach(t),Ze=u(f),de=n(f,"P",{});var _s=r(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=n(f,"P",{});var m=r(p);K=n(m,"A",{href:!0});var Ms=r(K);st=i(Ms,"~ConfigMixin"),Ms.forEach(t),at=i(m," takes care of storing all config attributes that are passed in the scheduler\u2019s "),pe=n(m,"CODE",{});var gs=r(pe);nt=i(gs,"__init__"),gs.forEach(t),rt=i(m,`
function, such as `),he=n(m,"CODE",{});var vs=r(he);ot=i(vs,"num_train_timesteps"),vs.forEach(t),it=i(m,". They can be accessed via "),fe=n(m,"CODE",{});var ws=r(fe);lt=i(ws,"scheduler.config.num_train_timesteps"),ws.forEach(t),ct=i(m,`.
`),Y=n(m,"A",{href:!0});var Ts=r(Y);ut=i(Ts,"SchedulerMixin"),Ts.forEach(t),dt=i(m," provides general loading and saving functionality via the "),Z=n(m,"A",{href:!0});var ys=r(Z);pt=i(ys,"SchedulerMixin.save_pretrained()"),ys.forEach(t),ht=i(m,` and
`),ee=n(m,"A",{href:!0});var Cs=r(ee);ft=i(Cs,"from_pretrained()"),Cs.forEach(t),mt=i(m," functions."),m.forEach(t),_t=u(f),te=n(f,"P",{});var ss=r(te);Mt=i(ss,"For more details, see the original paper: "),F=n(ss,"A",{href:!0,rel:!0});var Is=r(F);gt=i(Is,"https://arxiv.org/abs/2111.14822"),Is.forEach(t),ss.forEach(t),vt=u(f),g=n(f,"DIV",{class:!0});var se=r(g);A(O.$$.fragment,se),wt=u(se),X=n(se,"P",{});var Ve=r(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=n(Ve,"CODE",{});var Js=r(me);yt=i(Js,"x_t"),Js.forEach(t),Ct=i(Ve,"."),Ve.forEach(t),It=u(se),_e=n(se,"P",{});var xs=r(_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=n(f,"DIV",{class:!0});var _=r(h);A(z.$$.fragment,_),Ut=u(_),B=n(_,"P",{});var ke=r(B);bt=i(ke,"Calculates the log probabilities for the predicted classes of the image at timestep "),Me=n(ke,"CODE",{});var Us=r(Me);jt=i(Us,"t-1"),Us.forEach(t),Et=i(ke,". I.e. Equation (11)."),ke.forEach(t),At=u(_),ge=n(_,"P",{});var bs=r(ge);$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(_),ve=n(_,"P",{});var js=r(ve);Qt=i(js,"Equation (11) stated in terms of forward probabilities via Equation (5):"),js.forEach(t),Dt=u(_),we=n(_,"P",{});var Es=r(we);qt=i(Es,"Where:"),Es.forEach(t),Vt=u(_),Te=n(_,"UL",{});var As=r(Te);H=n(As,"LI",{});var Le=r(H);kt=i(Le,"the sum is over x"),ye=n(Le,"EM",{});var $s=r(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=n(_,"P",{});var ae=r(I);Ft=i(ae,"p(x"),Ce=n(ae,"EM",{});var Ss=r(Ce);Ot=i(Ss,"{t-1} | x_t) = sum( q(x_t | x"),Ss.forEach(t),Xt=i(ae,"{t-1}) "),Ie=n(ae,"EM",{});var Qs=r(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=n(f,"DIV",{class:!0});var Pe=r(b);A(R.$$.fragment,Pe),Rt=u(Pe),Je=n(Pe,"P",{});var Ds=r(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=n(f,"DIV",{class:!0});var Ne=r(j);A(W.$$.fragment,Ne),Kt=u(Ne),G=n(Ne,"P",{});var Fe=r(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=n(Fe,"CODE",{});var qs=r(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/main/en/api/configuration#diffusers.ConfigMixin"),l(Y,"href","/docs/diffusers/main/en/api/schedulers/overview#diffusers.SchedulerMixin"),l(Z,"href","/docs/diffusers/main/en/api/schedulers/overview#diffusers.SchedulerMixin.save_pretrained"),l(ee,"href","/docs/diffusers/main/en/api/schedulers/overview#diffusers.SchedulerMixin.from_pretrained"),l(F,"href","https://arxiv.org/abs/2111.14822"),l(F,"rel","nofollow"),l(g,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(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,M){e(document.head,w),v(s,be,M),v(s,T,M),e(T,J),e(J,ne),$(q,ne,null),e(T,Oe),e(T,re),e(re,Xe),v(s,je,M),v(s,y,M),e(y,x),e(x,oe),$(V,oe,null),e(y,ze),e(y,ie),e(ie,Be),v(s,Ee,M),v(s,k,M),e(k,He),e(k,L),e(L,Re),v(s,Ae,M),v(s,C,M),e(C,U),e(U,le),$(P,le,null),e(C,We),e(C,ce),e(ce,Ge),v(s,$e,M),v(s,d,M),$(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,nt),e(p,rt),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,Mt),e(te,F),e(F,gt),e(d,vt),e(d,g),$(O,g,null),e(g,wt),e(g,X),e(X,Tt),e(X,me),e(me,yt),e(X,Ct),e(g,It),e(g,_e),e(_e,Jt),e(d,xt),e(d,h),$(z,h,null),e(h,Ut),e(h,B),e(B,bt),e(B,Me),e(Me,jt),e(B,Et),e(h,At),e(h,ge),e(ge,$t),e(h,St),e(h,ve),e(ve,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(ns){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};
