PointWiseFeedForward
- class rectools.models.nn.transformers.net_blocks.PointWiseFeedForward(n_factors: int, n_factors_ff: int, dropout_rate: float, activation: Module, bias: bool = True)[source]
Bases:
ModuleFeed-Forward network to introduce nonlinearity into the transformer model. This implementation is the one used by SASRec authors.
- Parameters
n_factors (int) – Latent embeddings size.
n_factors_ff (int) – How many hidden units to use in the network.
dropout_rate (float) – Probability of a hidden unit to be zeroed.
activation (torch.nn.Module) – Activation function module.
bias (bool, default
True) – IfTrue, add bias to linear layers.
Methods
forward(seqs)Forward pass.
Attributes