Buckets:
| import{s as Pt,n as Dt,o as Ct}from"../chunks/scheduler.8c3d61f6.js";import{S as Ht,i as Mt,g as o,s as n,r as d,A as qt,h as r,f as i,c as a,j as _,u as m,x as R,k as x,y as p,a as s,v as l,d as f,t as c,w as u}from"../chunks/index.da70eac4.js";import{D as B}from"../chunks/Docstring.567bc132.js";import{H as V,E as It}from"../chunks/index.5d4ab994.js";function Ft(Gt){let v,N,J,Q,G,X,U,Ut="Customized activation functions for supporting various models in 🤗 Diffusers.",Y,E,Z,g,w,$t,W,Et="GELU activation function with tanh approximation support with <code>approximate="tanh"</code>.",tt,T,et,h,y,bt,z,wt='A <a href="https://arxiv.org/abs/2002.05202" rel="nofollow">variant</a> of the gated linear unit activation function.',it,A,st,$,S,Lt,j,Tt=`The approximate form of the Gaussian Error Linear Unit (GELU). For more details, see section 2 of this | |
| <a href="https://arxiv.org/abs/1606.08415" rel="nofollow">paper</a>.`,nt,P,at,b,D,_t,k,yt=`A <a href="https://arxiv.org/abs/2002.05202" rel="nofollow">variant</a> of the gated linear unit activation function. It’s similar to <code>GEGLU</code> | |
| but uses SiLU / Swish instead of GeLU.`,ot,C,rt,L,H,xt,O,At="SiLU activation function with input upcasted to torch.float32.",dt,M,mt,q,I,lt,F,ft,K,ct;return G=new V({props:{title:"Activation functions",local:"activation-functions",headingTag:"h1"}}),E=new V({props:{title:"GELU",local:"diffusers.models.activations.GELU",headingTag:"h2"}}),w=new B({props:{name:"class diffusers.models.activations.GELU",anchor:"diffusers.models.activations.GELU",parameters:[{name:"dim_in",val:": int"},{name:"dim_out",val:": int"},{name:"approximate",val:": str = 'none'"},{name:"bias",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.models.activations.GELU.dim_in",description:"<strong>dim_in</strong> (<code>int</code>) — The number of channels in the input.",name:"dim_in"},{anchor:"diffusers.models.activations.GELU.dim_out",description:"<strong>dim_out</strong> (<code>int</code>) — The number of channels in the output.",name:"dim_out"},{anchor:"diffusers.models.activations.GELU.approximate",description:"<strong>approximate</strong> (<code>str</code>, <em>optional</em>, defaults to <code>"none"</code>) — If <code>"tanh"</code>, use tanh approximation.",name:"approximate"},{anchor:"diffusers.models.activations.GELU.bias",description:"<strong>bias</strong> (<code>bool</code>, defaults to True) — Whether to use a bias in the linear layer.",name:"bias"}],source:"https://github.com/huggingface/diffusers/blob/vr_11234/src/diffusers/models/activations.py#L65"}}),T=new V({props:{title:"GEGLU",local:"diffusers.models.activations.GEGLU",headingTag:"h2"}}),y=new B({props:{name:"class diffusers.models.activations.GEGLU",anchor:"diffusers.models.activations.GEGLU",parameters:[{name:"dim_in",val:": int"},{name:"dim_out",val:": int"},{name:"bias",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.models.activations.GEGLU.dim_in",description:"<strong>dim_in</strong> (<code>int</code>) — The number of channels in the input.",name:"dim_in"},{anchor:"diffusers.models.activations.GEGLU.dim_out",description:"<strong>dim_out</strong> (<code>int</code>) — The number of channels in the output.",name:"dim_out"},{anchor:"diffusers.models.activations.GEGLU.bias",description:"<strong>bias</strong> (<code>bool</code>, defaults to True) — Whether to use a bias in the linear layer.",name:"bias"}],source:"https://github.com/huggingface/diffusers/blob/vr_11234/src/diffusers/models/activations.py#L93"}}),A=new V({props:{title:"ApproximateGELU",local:"diffusers.models.activations.ApproximateGELU",headingTag:"h2"}}),S=new B({props:{name:"class diffusers.models.activations.ApproximateGELU",anchor:"diffusers.models.activations.ApproximateGELU",parameters:[{name:"dim_in",val:": int"},{name:"dim_out",val:": int"},{name:"bias",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.models.activations.ApproximateGELU.dim_in",description:"<strong>dim_in</strong> (<code>int</code>) — The number of channels in the input.",name:"dim_in"},{anchor:"diffusers.models.activations.ApproximateGELU.dim_out",description:"<strong>dim_out</strong> (<code>int</code>) — The number of channels in the output.",name:"dim_out"},{anchor:"diffusers.models.activations.ApproximateGELU.bias",description:"<strong>bias</strong> (<code>bool</code>, defaults to True) — Whether to use a bias in the linear layer.",name:"bias"}],source:"https://github.com/huggingface/diffusers/blob/vr_11234/src/diffusers/models/activations.py#L149"}}),P=new V({props:{title:"SwiGLU",local:"diffusers.models.activations.SwiGLU",headingTag:"h2"}}),D=new B({props:{name:"class diffusers.models.activations.SwiGLU",anchor:"diffusers.models.activations.SwiGLU",parameters:[{name:"dim_in",val:": int"},{name:"dim_out",val:": int"},{name:"bias",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.models.activations.SwiGLU.dim_in",description:"<strong>dim_in</strong> (<code>int</code>) — The number of channels in the input.",name:"dim_in"},{anchor:"diffusers.models.activations.SwiGLU.dim_out",description:"<strong>dim_out</strong> (<code>int</code>) — The number of channels in the output.",name:"dim_out"},{anchor:"diffusers.models.activations.SwiGLU.bias",description:"<strong>bias</strong> (<code>bool</code>, defaults to True) — Whether to use a bias in the linear layer.",name:"bias"}],source:"https://github.com/huggingface/diffusers/blob/vr_11234/src/diffusers/models/activations.py#L126"}}),C=new V({props:{title:"FP32SiLU",local:"diffusers.models.activations.FP32SiLU",headingTag:"h2"}}),H=new B({props:{name:"class diffusers.models.activations.FP32SiLU",anchor:"diffusers.models.activations.FP32SiLU",parameters:[],source:"https://github.com/huggingface/diffusers/blob/vr_11234/src/diffusers/models/activations.py#L53"}}),M=new V({props:{title:"LinearActivation",local:"diffusers.models.activations.LinearActivation",headingTag:"h2"}}),I=new B({props:{name:"class diffusers.models.activations.LinearActivation",anchor:"diffusers.models.activations.LinearActivation",parameters:[{name:"dim_in",val:": int"},{name:"dim_out",val:": int"},{name:"bias",val:": bool = True"},{name:"activation",val:": str = 'silu'"}],source:"https://github.com/huggingface/diffusers/blob/vr_11234/src/diffusers/models/activations.py#L169"}}),F=new It({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/activations.md"}}),{c(){v=o("meta"),N=n(),J=o("p"),Q=n(),d(G.$$.fragment),X=n(),U=o("p"),U.textContent=Ut,Y=n(),d(E.$$.fragment),Z=n(),g=o("div"),d(w.$$.fragment),$t=n(),W=o("p"),W.innerHTML=Et,tt=n(),d(T.$$.fragment),et=n(),h=o("div"),d(y.$$.fragment),bt=n(),z=o("p"),z.innerHTML=wt,it=n(),d(A.$$.fragment),st=n(),$=o("div"),d(S.$$.fragment),Lt=n(),j=o("p"),j.innerHTML=Tt,nt=n(),d(P.$$.fragment),at=n(),b=o("div"),d(D.$$.fragment),_t=n(),k=o("p"),k.innerHTML=yt,ot=n(),d(C.$$.fragment),rt=n(),L=o("div"),d(H.$$.fragment),xt=n(),O=o("p"),O.textContent=At,dt=n(),d(M.$$.fragment),mt=n(),q=o("div"),d(I.$$.fragment),lt=n(),d(F.$$.fragment),ft=n(),K=o("p"),this.h()},l(t){const e=qt("svelte-u9bgzb",document.head);v=r(e,"META",{name:!0,content:!0}),e.forEach(i),N=a(t),J=r(t,"P",{}),_(J).forEach(i),Q=a(t),m(G.$$.fragment,t),X=a(t),U=r(t,"P",{"data-svelte-h":!0}),R(U)!=="svelte-us8qu2"&&(U.textContent=Ut),Y=a(t),m(E.$$.fragment,t),Z=a(t),g=r(t,"DIV",{class:!0});var ut=_(g);m(w.$$.fragment,ut),$t=a(ut),W=r(ut,"P",{"data-svelte-h":!0}),R(W)!=="svelte-1uqox6j"&&(W.innerHTML=Et),ut.forEach(i),tt=a(t),m(T.$$.fragment,t),et=a(t),h=r(t,"DIV",{class:!0});var pt=_(h);m(y.$$.fragment,pt),bt=a(pt),z=r(pt,"P",{"data-svelte-h":!0}),R(z)!=="svelte-120b58p"&&(z.innerHTML=wt),pt.forEach(i),it=a(t),m(A.$$.fragment,t),st=a(t),$=r(t,"DIV",{class:!0});var vt=_($);m(S.$$.fragment,vt),Lt=a(vt),j=r(vt,"P",{"data-svelte-h":!0}),R(j)!=="svelte-1e2dlz3"&&(j.innerHTML=Tt),vt.forEach(i),nt=a(t),m(P.$$.fragment,t),at=a(t),b=r(t,"DIV",{class:!0});var gt=_(b);m(D.$$.fragment,gt),_t=a(gt),k=r(gt,"P",{"data-svelte-h":!0}),R(k)!=="svelte-2syixw"&&(k.innerHTML=yt),gt.forEach(i),ot=a(t),m(C.$$.fragment,t),rt=a(t),L=r(t,"DIV",{class:!0});var ht=_(L);m(H.$$.fragment,ht),xt=a(ht),O=r(ht,"P",{"data-svelte-h":!0}),R(O)!=="svelte-6fp500"&&(O.textContent=At),ht.forEach(i),dt=a(t),m(M.$$.fragment,t),mt=a(t),q=r(t,"DIV",{class:!0});var St=_(q);m(I.$$.fragment,St),St.forEach(i),lt=a(t),m(F.$$.fragment,t),ft=a(t),K=r(t,"P",{}),_(K).forEach(i),this.h()},h(){x(v,"name","hf:doc:metadata"),x(v,"content",Vt),x(g,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(h,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x($,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(b,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(t,e){p(document.head,v),s(t,N,e),s(t,J,e),s(t,Q,e),l(G,t,e),s(t,X,e),s(t,U,e),s(t,Y,e),l(E,t,e),s(t,Z,e),s(t,g,e),l(w,g,null),p(g,$t),p(g,W),s(t,tt,e),l(T,t,e),s(t,et,e),s(t,h,e),l(y,h,null),p(h,bt),p(h,z),s(t,it,e),l(A,t,e),s(t,st,e),s(t,$,e),l(S,$,null),p($,Lt),p($,j),s(t,nt,e),l(P,t,e),s(t,at,e),s(t,b,e),l(D,b,null),p(b,_t),p(b,k),s(t,ot,e),l(C,t,e),s(t,rt,e),s(t,L,e),l(H,L,null),p(L,xt),p(L,O),s(t,dt,e),l(M,t,e),s(t,mt,e),s(t,q,e),l(I,q,null),s(t,lt,e),l(F,t,e),s(t,ft,e),s(t,K,e),ct=!0},p:Dt,i(t){ct||(f(G.$$.fragment,t),f(E.$$.fragment,t),f(w.$$.fragment,t),f(T.$$.fragment,t),f(y.$$.fragment,t),f(A.$$.fragment,t),f(S.$$.fragment,t),f(P.$$.fragment,t),f(D.$$.fragment,t),f(C.$$.fragment,t),f(H.$$.fragment,t),f(M.$$.fragment,t),f(I.$$.fragment,t),f(F.$$.fragment,t),ct=!0)},o(t){c(G.$$.fragment,t),c(E.$$.fragment,t),c(w.$$.fragment,t),c(T.$$.fragment,t),c(y.$$.fragment,t),c(A.$$.fragment,t),c(S.$$.fragment,t),c(P.$$.fragment,t),c(D.$$.fragment,t),c(C.$$.fragment,t),c(H.$$.fragment,t),c(M.$$.fragment,t),c(I.$$.fragment,t),c(F.$$.fragment,t),ct=!1},d(t){t&&(i(N),i(J),i(Q),i(X),i(U),i(Y),i(Z),i(g),i(tt),i(et),i(h),i(it),i(st),i($),i(nt),i(at),i(b),i(ot),i(rt),i(L),i(dt),i(mt),i(q),i(lt),i(ft),i(K)),i(v),u(G,t),u(E,t),u(w),u(T,t),u(y),u(A,t),u(S),u(P,t),u(D),u(C,t),u(H),u(M,t),u(I),u(F,t)}}}const Vt='{"title":"Activation functions","local":"activation-functions","sections":[{"title":"GELU","local":"diffusers.models.activations.GELU","sections":[],"depth":2},{"title":"GEGLU","local":"diffusers.models.activations.GEGLU","sections":[],"depth":2},{"title":"ApproximateGELU","local":"diffusers.models.activations.ApproximateGELU","sections":[],"depth":2},{"title":"SwiGLU","local":"diffusers.models.activations.SwiGLU","sections":[],"depth":2},{"title":"FP32SiLU","local":"diffusers.models.activations.FP32SiLU","sections":[],"depth":2},{"title":"LinearActivation","local":"diffusers.models.activations.LinearActivation","sections":[],"depth":2}],"depth":1}';function Wt(Gt){return Ct(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Rt extends Ht{constructor(v){super(),Mt(this,v,Wt,Ft,Pt,{})}}export{Rt as component}; | |
Xet Storage Details
- Size:
- 11.4 kB
- Xet hash:
- 0feb3e3bf2cc5a41d2ea18828e346d1fd77c53356437cead551879881d3d367b
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.