Last active
October 25, 2017 12:14
-
-
Save dmesquita/072b5999a022ec42ea12b149033de9d6 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
import torch | |
from torch.autograd import Variable | |
import torch.nn as nn | |
import torch.nn.functional as F | |
class OurNet(nn.Module): | |
def __init__(self, input_size, hidden_size, num_classes): | |
super(Net, self).__init__() | |
self.layer_1 = nn.Linear(n_inputs,hidden_size, bias=True) | |
self.relu = nn.ReLU() | |
self.layer_2 = nn.Linear(hidden_size, hidden_size, bias=True) | |
self.output_layer = nn.Linear(hidden_size, num_classes, bias=True) | |
def forward(self, x): | |
out = self.layer_1(x) | |
out = self.relu(out) | |
out = self.layer_2(out) | |
out = self.relu(out) | |
out = self.output_layer(out) | |
return out |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment