Activation functions¶
Customized activation functions for supporting various models in 🤗 Diffusers.
mindone.diffusers.models.activations.sigmoid(x)
¶
A numerically stable version of the logistic sigmoid function.
Source code in mindone/diffusers/models/activations.py
19 20 21 22 23 24 25 |
|
mindone.diffusers.models.activations.SiLU
¶
Bases: Cell
Source code in mindone/diffusers/models/activations.py
28 29 30 |
|
mindone.diffusers.models.activations.FP32SiLU
¶
Bases: Cell
SiLU activation function with input upcasted to mindspore.float32.
Source code in mindone/diffusers/models/activations.py
33 34 35 36 37 38 39 40 41 42 |
|
mindone.diffusers.models.activations.GELU
¶
Bases: Cell
GELU activation function with tanh approximation support with approximate="tanh"
.
PARAMETER | DESCRIPTION |
---|---|
dim_in |
The number of channels in the input.
TYPE:
|
dim_out |
The number of channels in the output.
TYPE:
|
approximate |
If
TYPE:
|
bias |
Whether to use a bias in the linear layer.
TYPE:
|
Source code in mindone/diffusers/models/activations.py
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
|
mindone.diffusers.models.activations.GEGLU
¶
Bases: Cell
A variant of the gated linear unit activation function.
PARAMETER | DESCRIPTION |
---|---|
dim_in |
The number of channels in the input.
TYPE:
|
dim_out |
The number of channels in the output.
TYPE:
|
bias |
Whether to use a bias in the linear layer.
TYPE:
|
Source code in mindone/diffusers/models/activations.py
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 |
|
mindone.diffusers.models.activations.ApproximateGELU
¶
Bases: Cell
The approximate form of the Gaussian Error Linear Unit (GELU). For more details, see section 2 of this paper.
PARAMETER | DESCRIPTION |
---|---|
dim_in |
The number of channels in the input.
TYPE:
|
dim_out |
The number of channels in the output.
TYPE:
|
bias |
Whether to use a bias in the linear layer.
TYPE:
|
Source code in mindone/diffusers/models/activations.py
140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 |
|