flambe.nlp.classification.model
¶
Module Contents¶
-
class
flambe.nlp.classification.model.
TextClassifier
(embedder: Embedder, output_layer: Module, dropout: float = 0)[source]¶ Bases:
flambe.nn.Module
Implements a standard classifier.
The classifier is composed of an encoder module, followed by a fully connected output layer, with a dropout layer in between.
-
drop
¶ the dropout layer
Type: nn.Dropout
-
forward
(self, data: Tensor, target: Optional[Tensor] = None)[source]¶ Run a forward pass through the network.
Parameters: - data (Tensor) – The input data
- target (Tensor, optional) – The input targets, optional
Returns: The output predictions, and optionally the targets
Return type: Union[Tensor, Tuple[Tensor, Tensor]
-