import{s as ve,n as Se,o as be}from"../chunks/scheduler.53228c21.js";import{S as _e,i as $e,e as a,s as n,c as V,h as xe,a as d,d as r,b as i,f as A,g as T,j as h,k as q,l as c,m as s,n as D,t as E,o as M,p as L}from"../chunks/index.100fac89.js";import{C as we}from"../chunks/CopyLLMTxtMenu.9360b11d.js";import{D as oe}from"../chunks/Docstring.22cc8849.js";import{H as ge,E as ye}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.c9001d7a.js";function Ce(ae){let p,B,j,O,g,G,v,K,S,de='<code>ScoreSdeVpScheduler</code> is a variance preserving stochastic differential equation (SDE) scheduler.  It was introduced in the <a href="https://huggingface.co/papers/2011.13456" rel="nofollow">Score-Based Generative Modeling through Stochastic Differential Equations</a> paper by Yang Song, Jascha Sohl-Dickstein, Diederik P. Kingma, Abhishek Kumar, Stefano Ermon, Ben Poole.',N,b,ce="The abstract from the paper is:",U,_,le="<em>Creating noise from data is easy; creating data from noise is generative modeling. We present a stochastic differential equation (SDE) that smoothly transforms a complex data distribution to a known prior distribution by slowly injecting noise, and a corresponding reverse-time SDE that transforms the prior distribution back into the data distribution by slowly removing the noise. Crucially, the reverse-time SDE depends only on the time-dependent gradient field (\\aka, score) of the perturbed data distribution. By leveraging advances in score-based generative modeling, we can accurately estimate these scores with neural networks, and use numerical SDE solvers to generate samples. We show that this framework encapsulates previous approaches in score-based generative modeling and diffusion probabilistic modeling, allowing for new sampling procedures and new modeling capabilities. In particular, we introduce a predictor-corrector framework to correct errors in the evolution of the discretized reverse-time SDE. We also derive an equivalent neural ODE that samples from the same distribution as the SDE, but additionally enables exact likelihood computation, and improved sampling efficiency. In addition, we provide a new way to solve inverse problems with score-based models, as demonstrated with experiments on class-conditional generation, image inpainting, and colorization. Combined with multiple architectural improvements, we achieve record-breaking performance for unconditional image generation on CIFAR-10 with an Inception score of 9.89 and FID of 2.20, a competitive likelihood of 2.99 bits/dim, and demonstrate high fidelity generation of 1024 x 1024 images for the first time from a score-based generative model.</em>",W,m,pe="<p>🚧 This scheduler is under construction!</p>",F,$,R,o,x,ee,k,me="<code>ScoreSdeVpScheduler</code> is a variance preserving stochastic differential equation (SDE) scheduler.",te,P,ue=`This model inherits from <a href="/docs/diffusers/main/en/api/schedulers/overview#diffusers.SchedulerMixin">SchedulerMixin</a> and <a href="/docs/diffusers/main/en/api/configuration#diffusers.ConfigMixin">ConfigMixin</a>. Check the superclass documentation for the generic
methods the library implements for all schedulers such as loading and saving.`,re,u,w,se,H,fe="Sets the continuous timesteps used for the diffusion chain (to be run before inference).",ne,f,y,ie,I,he=`Predict the sample from the previous timestep by reversing the SDE. This function propagates the diffusion
process from the learned model outputs (most often the predicted noise).`,J,C,Q,z,Y;return g=new we({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),v=new ge({props:{title:"ScoreSdeVpScheduler",local:"scoresdevpscheduler",headingTag:"h1"}}),$=new ge({props:{title:"ScoreSdeVpScheduler",local:"diffusers.schedulers.ScoreSdeVpScheduler",headingTag:"h2"}}),x=new oe({props:{name:"class diffusers.schedulers.ScoreSdeVpScheduler",anchor:"diffusers.schedulers.ScoreSdeVpScheduler",parameters:[{name:"num_train_timesteps",val:" = 2000"},{name:"beta_min",val:" = 0.1"},{name:"beta_max",val:" = 20"},{name:"sampling_eps",val:" = 0.001"}],parametersDescription:[{anchor:"diffusers.schedulers.ScoreSdeVpScheduler.num_train_timesteps",description:`<strong>num_train_timesteps</strong> (<code>int</code>, defaults to 2000) &#x2014;
The number of diffusion steps to train the model.`,name:"num_train_timesteps"},{anchor:"diffusers.schedulers.ScoreSdeVpScheduler.beta_min",description:"<strong>beta_min</strong> (<code>int</code>, defaults to 0.1) &#x2014;",name:"beta_min"},{anchor:"diffusers.schedulers.ScoreSdeVpScheduler.beta_max",description:"<strong>beta_max</strong> (<code>int</code>, defaults to 20) &#x2014;",name:"beta_max"},{anchor:"diffusers.schedulers.ScoreSdeVpScheduler.sampling_eps",description:`<strong>sampling_eps</strong> (<code>int</code>, defaults to 1e-3) &#x2014;
The end value of sampling where timesteps decrease progressively from 1 to epsilon.`,name:"sampling_eps"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/schedulers/deprecated/scheduling_sde_vp.py#L27"}}),w=new oe({props:{name:"set_timesteps",anchor:"diffusers.schedulers.ScoreSdeVpScheduler.set_timesteps",parameters:[{name:"num_inference_steps",val:""},{name:"device",val:": typing.Union[str, torch.device] = None"}],parametersDescription:[{anchor:"diffusers.schedulers.ScoreSdeVpScheduler.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.schedulers.ScoreSdeVpScheduler.set_timesteps.device",description:`<strong>device</strong> (<code>str</code> or <code>torch.device</code>, <em>optional</em>) &#x2014;
The device to which the timesteps should be moved to. If <code>None</code>, the timesteps are not moved.`,name:"device"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/schedulers/deprecated/scheduling_sde_vp.py#L51"}}),y=new oe({props:{name:"step_pred",anchor:"diffusers.schedulers.ScoreSdeVpScheduler.step_pred",parameters:[{name:"score",val:""},{name:"x",val:""},{name:"t",val:""},{name:"generator",val:" = None"}],parametersDescription:[{anchor:"diffusers.schedulers.ScoreSdeVpScheduler.step_pred.score",description:"<strong>score</strong> () &#x2014;",name:"score"},{anchor:"diffusers.schedulers.ScoreSdeVpScheduler.step_pred.x",description:"<strong>x</strong> () &#x2014;",name:"x"},{anchor:"diffusers.schedulers.ScoreSdeVpScheduler.step_pred.t",description:"<strong>t</strong> () &#x2014;",name:"t"},{anchor:"diffusers.schedulers.ScoreSdeVpScheduler.step_pred.generator",description:`<strong>generator</strong> (<code>torch.Generator</code>, <em>optional</em>) &#x2014;
A random number generator.`,name:"generator"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/schedulers/deprecated/scheduling_sde_vp.py#L63"}}),C=new ye({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/schedulers/score_sde_vp.md"}}),{c(){p=a("meta"),B=n(),j=a("p"),O=n(),V(g.$$.fragment),G=n(),V(v.$$.fragment),K=n(),S=a("p"),S.innerHTML=de,N=n(),b=a("p"),b.textContent=ce,U=n(),_=a("p"),_.innerHTML=le,W=n(),m=a("blockquote"),m.innerHTML=pe,F=n(),V($.$$.fragment),R=n(),o=a("div"),V(x.$$.fragment),ee=n(),k=a("p"),k.innerHTML=me,te=n(),P=a("p"),P.innerHTML=ue,re=n(),u=a("div"),V(w.$$.fragment),se=n(),H=a("p"),H.textContent=fe,ne=n(),f=a("div"),V(y.$$.fragment),ie=n(),I=a("p"),I.textContent=he,J=n(),V(C.$$.fragment),Q=n(),z=a("p"),this.h()},l(e){const t=xe("svelte-u9bgzb",document.head);p=d(t,"META",{name:!0,content:!0}),t.forEach(r),B=i(e),j=d(e,"P",{}),A(j).forEach(r),O=i(e),T(g.$$.fragment,e),G=i(e),T(v.$$.fragment,e),K=i(e),S=d(e,"P",{"data-svelte-h":!0}),h(S)!=="svelte-am1tgf"&&(S.innerHTML=de),N=i(e),b=d(e,"P",{"data-svelte-h":!0}),h(b)!=="svelte-1cwsb16"&&(b.textContent=ce),U=i(e),_=d(e,"P",{"data-svelte-h":!0}),h(_)!=="svelte-omf9ly"&&(_.innerHTML=le),W=i(e),m=d(e,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),h(m)!=="svelte-10uoocp"&&(m.innerHTML=pe),F=i(e),T($.$$.fragment,e),R=i(e),o=d(e,"DIV",{class:!0});var l=A(o);T(x.$$.fragment,l),ee=i(l),k=d(l,"P",{"data-svelte-h":!0}),h(k)!=="svelte-ij3gjh"&&(k.innerHTML=me),te=i(l),P=d(l,"P",{"data-svelte-h":!0}),h(P)!=="svelte-linuuh"&&(P.innerHTML=ue),re=i(l),u=d(l,"DIV",{class:!0});var X=A(u);T(w.$$.fragment,X),se=i(X),H=d(X,"P",{"data-svelte-h":!0}),h(H)!=="svelte-8cg672"&&(H.textContent=fe),X.forEach(r),ne=i(l),f=d(l,"DIV",{class:!0});var Z=A(f);T(y.$$.fragment,Z),ie=i(Z),I=d(Z,"P",{"data-svelte-h":!0}),h(I)!=="svelte-hi84tp"&&(I.textContent=he),Z.forEach(r),l.forEach(r),J=i(e),T(C.$$.fragment,e),Q=i(e),z=d(e,"P",{}),A(z).forEach(r),this.h()},h(){q(p,"name","hf:doc:metadata"),q(p,"content",Ve),q(m,"class","warning"),q(u,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),q(f,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),q(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(e,t){c(document.head,p),s(e,B,t),s(e,j,t),s(e,O,t),D(g,e,t),s(e,G,t),D(v,e,t),s(e,K,t),s(e,S,t),s(e,N,t),s(e,b,t),s(e,U,t),s(e,_,t),s(e,W,t),s(e,m,t),s(e,F,t),D($,e,t),s(e,R,t),s(e,o,t),D(x,o,null),c(o,ee),c(o,k),c(o,te),c(o,P),c(o,re),c(o,u),D(w,u,null),c(u,se),c(u,H),c(o,ne),c(o,f),D(y,f,null),c(f,ie),c(f,I),s(e,J,t),D(C,e,t),s(e,Q,t),s(e,z,t),Y=!0},p:Se,i(e){Y||(E(g.$$.fragment,e),E(v.$$.fragment,e),E($.$$.fragment,e),E(x.$$.fragment,e),E(w.$$.fragment,e),E(y.$$.fragment,e),E(C.$$.fragment,e),Y=!0)},o(e){M(g.$$.fragment,e),M(v.$$.fragment,e),M($.$$.fragment,e),M(x.$$.fragment,e),M(w.$$.fragment,e),M(y.$$.fragment,e),M(C.$$.fragment,e),Y=!1},d(e){e&&(r(B),r(j),r(O),r(G),r(K),r(S),r(N),r(b),r(U),r(_),r(W),r(m),r(F),r(R),r(o),r(J),r(Q),r(z)),r(p),L(g,e),L(v,e),L($,e),L(x),L(w),L(y),L(C,e)}}}const Ve='{"title":"ScoreSdeVpScheduler","local":"scoresdevpscheduler","sections":[{"title":"ScoreSdeVpScheduler","local":"diffusers.schedulers.ScoreSdeVpScheduler","sections":[],"depth":2}],"depth":1}';function Te(ae){return be(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Pe extends _e{constructor(p){super(),$e(this,p,Te,Ce,ve,{})}}export{Pe as component};
