Buckets:
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[[diffusers.models.activations.GELU]]
diffusers.models.activations.GELU[[diffusers.models.activations.GELU]]
diffusers.models.activations.GELU(dim_in: int, dim_out: int, approximate: str = 'none', bias: bool = True)
Tham số:
dim_in (int) : Số lượng kênh trong đầu vào.
dim_out (int) : Số lượng kênh trong đầu ra.
approximate (str, tùy chọn, mặc định là "none") : Nếu là "tanh", hãy sử dụng xấp xỉ tanh.
bias (bool, mặc định là True) : Có sử dụng bias trong lớp tuyến tính hay không.
Hàm kích hoạt GELU với hỗ trợ xấp xỉ tanh bằng approximate="tanh".
GEGLU[[diffusers.models.activations.GEGLU]]
diffusers.models.activations.GEGLU[[diffusers.models.activations.GEGLU]]
diffusers.models.activations.GEGLU(dim_in: int, dim_out: int, bias: bool = True)
Tham số:
dim_in (int) : Số lượng kênh trong đầu vào.
dim_out (int) : Số lượng kênh trong đầu ra.
bias (bool, mặc định là True) : Có sử dụng bias trong lớp tuyến tính hay không.
Một biến thể của hàm kích hoạt gated linear unit.
ApproximateGELU[[diffusers.models.activations.ApproximateGELU]]
diffusers.models.activations.ApproximateGELU[[diffusers.models.activations.ApproximateGELU]]
diffusers.models.activations.ApproximateGELU(dim_in: int, dim_out: int, bias: bool = True)
Tham số:
dim_in (int) : Số lượng kênh trong đầu vào.
dim_out (int) : Số lượng kênh trong đầu ra.
bias (bool, mặc định là True) : Có sử dụng bias trong lớp tuyến tính hay không.
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[[diffusers.models.activations.SwiGLU]]
diffusers.models.activations.SwiGLU[[diffusers.models.activations.SwiGLU]]
diffusers.models.activations.SwiGLU(dim_in: int, dim_out: int, bias: bool = True)
Tham số:
dim_in (int) : Số lượng kênh trong đầu vào.
dim_out (int) : Số lượng kênh trong đầu ra.
bias (bool, mặc định là True) : Có sử dụng bias trong lớp tuyến tính hay không.
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[[diffusers.models.activations.FP32SiLU]]
diffusers.models.activations.FP32SiLU[[diffusers.models.activations.FP32SiLU]]
diffusers.models.activations.FP32SiLU()
Hàm kích hoạt SiLU với đầu vào được chuyển lên torch.float32.
LinearActivation[[diffusers.models.activations.LinearActivation]]
diffusers.models.activations.LinearActivation[[diffusers.models.activations.LinearActivation]]
diffusers.models.activations.LinearActivation(dim_in: int, dim_out: int, bias: bool = True, activation: str = 'silu')
Xet Storage Details
- Size:
- 3.88 kB
- Xet hash:
- 13634f4a07cebdf6480158d70619f8b82da5f4cc042f04a607298ddd37a841d3
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.