ner.nn.models.ffnn module#
- class ner.nn.models.ffnn.FFNN(embedding_dim: int, hidden_dim: int, output_dim: int, num_layers: int = 1)#
Bases:
Module
A multi-layer feed-forward neural network that applies a linear transformation, followed by a ReLU nonlinearity, at each layer.
- Parameters:
- forward(embeddings: Tensor) Tensor #
Computes a forward pass through each of the network layers using the given input embeddings.
- Parameters:
- embeddings
torch.Tensor
Input tensor of embeddings of shape
(batch_size, max_length, embedding_dim)
.
- embeddings
- Returns:
torch.Tensor
Output tensor resulting from forward pass of shape
(batch_size, max_length, output_dim)
.