Arcana models: encoders

Submodules

arcana.models.encoders.additive_encoder module

Additive encoder module for the ARCANA project.

class arcana.models.encoders.additive_encoder.AdditiveEncoder(*args: Any, **kwargs: Any)

Bases: BaseEncoder

Additive encoder module

forward(x_tensor, lengths)

Forward pass to be implemented by subclass for additive encoder

Parameters:
  • x_tensor (torch.Tensor) – input tensor

  • lengths (torch.Tensor) – lengths of the input sequences

Returns:
  • outputs (torch.Tensor) – output tensor

  • self.hidden (torch.Tensor) – hidden state

  • self.cell (torch.Tensor) – cell state

arcana.models.encoders.base_encoder module

Base encoder class

class arcana.models.encoders.base_encoder.BaseEncoder(*args: Any, **kwargs: Any)

Bases: Module

Base encoder module

forward(x_tensor, lengths)

Forward pass to be implemented by subclass

reset_hidden_state()

Reset the hidden state of the LSTM

arcana.models.encoders.multihead_encoder module

Multihead encoder module for the ARCANA project.

class arcana.models.encoders.multihead_encoder.MultiheadEncoder(*args: Any, **kwargs: Any)

Bases: BaseEncoder

Multihead encoder module

forward(x_tensor, lengths)

Forward pass to be implemented by subclass

Module contents