mr2.nn.GEGLU
- class mr2.nn.GEGLU[source]
Bases:
ModuleGated linear unit activation function.
References
..[GLU] Shazeer, N. (2020). GLU variants improve transformer. https://arxiv.org/abs/2002.05202
- __init__(n_channels_in: int, n_channels_out: int | None = None, features_last: bool = False)[source]
Initialize the GEGLU activation function.
- Parameters:
n_channels_in (
int) – The number of input features/channels.n_channels_out (
int|None, default:None) – The number of output features/channels. If None, the number of output features is the same as the number of input features.features_last (
bool, default:False) – If True, the channel dimension is the last dimension, else in the second dimension.