You are viewing main version, which requires installation from source. If you'd like
regular pip install, checkout the latest stable version (v0.42.1).
激活函数
用于支持 🤗 Diffusers 中各种模型的自定义激活函数。
GELU
类 diffusers.models.activations.GELU
< source >( dim_in: intdim_out: intapproximate: str = 'none'bias: bool = True )
支持使用 approximate="tanh" 进行 tanh 近似的 GELU 激活函数。
GEGLU
类 diffusers.models.activations.GEGLU
< source >( dim_in: intdim_out: intbias: bool = True )
门控线性单元激活函数的变体。
ApproximateGELU
类 diffusers.models.activations.ApproximateGELU
< source >( dim_in: intdim_out: intbias: bool = True )
高斯误差线性单元(GELU)的近似形式。更多详情请参阅此论文的第 2 节。
SwiGLU
类 diffusers.models.activations.SwiGLU
< source >( dim_in: intdim_out: intbias: bool = True )
门控线性单元激活函数的变体。它与GEGLU类似,但使用 SiLU / Swish 代替 GeLU。
FP32SiLU
输入被上转换为 torch.float32 的 SiLU 激活函数。
LinearActivation
类 diffusers.models.activations.LinearActivation
< source >( dim_in: intdim_out: intbias: bool = Trueactivation: str = 'silu' )