Created
July 11, 2019 13:34
-
-
Save andreaschandra/692d0b0c9ae871501db7f1b69fab4f5c 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 Classifier(nn.Module): | |
def __init__(self): | |
super(Classifier, self).__init__() | |
self.NeurlNet = nn.Sequential( | |
nn.Linear(50, 40), | |
nn.ReLU(), | |
nn.Linear(40, 30), | |
nn.ReLU(), | |
nn.Linear(30, 1) | |
) | |
def forward(self, input_, apply_sigmoid=False): | |
x = self.NeurlNet(input_) | |
x = x.squeeze() | |
if apply_sigmoid: | |
x = torch.sigmoid(x) | |
return x |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment