Skip to content

language_model_head

allennlp_models.lm.modules.language_model_heads.language_model_head

[SOURCE]


LanguageModelHead#

class LanguageModelHead(torch.nn.Module,  Registrable)

A LanguageModelHead encapsulates a function that goes from some hidden state to logits over a vocabulary.

get_input_dim#

class LanguageModelHead(torch.nn.Module,  Registrable):
 | ...
 | def get_input_dim(self) -> int

get_output_dim#

class LanguageModelHead(torch.nn.Module,  Registrable):
 | ...
 | def get_output_dim(self) -> int

forward#

class LanguageModelHead(torch.nn.Module,  Registrable):
 | ...
 | def forward(self, hidden_states: torch.Tensor) -> torch.Tensor