Created
September 28, 2021 11:35
-
-
Save youben11/e73814385a18c5e3e9a8e4581c23cb21 to your computer and use it in GitHub Desktop.
This file contains 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
HIDDEN_SIZE = 100 | |
class Model(torch.nn.Module): | |
def __init__(self): | |
super().__init__() | |
self.lstm = torch.nn.LSTM(input_size=300, hidden_size=HIDDEN_SIZE) | |
self.fc = torch.nn.Linear(HIDDEN_SIZE, 1) | |
self.sigmoid = torch.nn.Sigmoid() | |
def forward(self, x): | |
_, (x, _) = self.lstm(x) | |
x = self.fc(x) | |
return self.sigmoid(x) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment