Created
September 10, 2019 17:20
-
-
Save epwalsh/9339806ef92ba3a5bd473e8beac83996 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CopyNetSeq2Seq(Model): | |
# snip... | |
def _get_generation_scores(self, state: Dict[str, torch.Tensor]) -> torch.Tensor: | |
# `self._output_generation_layer` is just a PyTorch linear layer with an input | |
# dimension equal to the decoder hidden state size, and an output dimension | |
# equal to the size of the target vocabulary. | |
return self._output_generation_layer(state["decoder_hidden"]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment