Documentation ¶
Overview ¶
Package sgu implements the Spatial Gating Unit (SGU). Reference: `Pay Attention to MLPs` by Liu et al, 2021 (https://arxiv.org/pdf/2105.08050.pdf)
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Model ¶
type Model struct { nn.BaseModel Config Config Norm *layernorm.Model Proj *conv1x1.Model Act *activation.Model }
Model contains the serializable parameters.
func (*Model) Forward ¶
Forward performs the forward step for each input node and returns the result.
func (*Model) Initialize ¶
Initialize set the projection weights as near-zero values and the biases as ones to improve training stability.
Click to show internal directories.
Click to hide internal directories.