Diffusers documentation
Hàm kích hoạt
Hàm kích hoạt
Các hàm kích hoạt tùy chỉnh để hỗ trợ nhiều mô hình khác nhau trong 🤗 Diffusers.
GELU
lớp diffusers.models.activations.GELU
< source >( dim_in: intdim_out: intapproximate: str = 'none'bias: bool = True )
Hàm kích hoạt GELU với hỗ trợ xấp xỉ tanh bằng approximate="tanh".
GEGLU
lớp diffusers.models.activations.GEGLU
< source >( dim_in: intdim_out: intbias: bool = True )
Một biến thể của hàm kích hoạt gated linear unit.
ApproximateGELU
lớp diffusers.models.activations.ApproximateGELU
< source >( dim_in: intdim_out: intbias: bool = True )
Dạng xấp xỉ của Gaussian Error Linear Unit (GELU). Để biết thêm chi tiết, hãy xem mục 2 của bài báo này.
SwiGLU
lớp diffusers.models.activations.SwiGLU
< source >( dim_in: intdim_out: intbias: bool = True )
Một biến thể của hàm kích hoạt gated linear unit. Nó tương tự GEGLU nhưng sử dụng SiLU / Swish thay vì GeLU.
FP32SiLU
Hàm kích hoạt SiLU với đầu vào được chuyển lên torch.float32.
LinearActivation
lớp diffusers.models.activations.LinearActivation
< source >( dim_in: intdim_out: intbias: bool = Trueactivation: str = 'silu' )