LinearDropout

class LinearDropout(entity_embedding_dim, literal_embedding_dim, input_dropout=0.0, activation=None, activation_kwargs=None)[source]

Bases: torch.nn.modules.container.Sequential

A sequential module that has a linear layer, dropout later, and optional activation layer.

Instantiate the torch.nn.Sequential.

Parameters
  • entity_embedding_dim (int) – The dimension of the entity representations to which literals are concatenated

  • literal_embedding_dim (int) – The dimension of the literals that are concatenated

  • input_dropout (float) – The dropout probability of an element to be zeroed.

  • activation (Union[str, Module, Type[Module], None]) – An optional, pre-instantiated activation module, like torch.nn.Tanh.

  • activation_kwargs (Optional[Mapping[str, Any]]) – Keyword arguments to pass during instantiation of the activation module