Skip to content

edsnlp.pipes.trainable.layers.text_cnn

TextCnn [source]

Bases: Module

Parameters

PARAMETER DESCRIPTION
input_size

Size of the input embeddings

TYPE: int

output_size

Size of the output embeddings Defaults to the input_size

TYPE: Optional[int] DEFAULT: None

out_channels

Number of channels

TYPE: Optional[int] DEFAULT: None

kernel_sizes

Window size of each kernel

TYPE: Sequence[int] DEFAULT: (3, 4, 5)

activation

Activation function to use

TYPE: ActivationFunction DEFAULT: 'relu'

residual

Whether to use residual connections

TYPE: bool DEFAULT: True

normalize

Whether to normalize before or after the residual connection

TYPE: Literal['pre', 'post', 'none'] DEFAULT: 'pre'