| 60 | # ``Layer`` class. |
| 61 | # |
| 62 | class Layer(torch.nn.Module): |
| 63 | def __init__(self): |
| 64 | super().__init__() |
| 65 | self.linear1 = torch.nn.Linear(10, 10) |
| 66 | self.relu1 = torch.nn.ReLU() |
| 67 | self.linear2 = torch.nn.Linear(10, 10) |
| 68 | self.relu2 = torch.nn.ReLU() |
| 69 | |
| 70 | def forward(self, x): |
| 71 | a = self.linear1(x) |
| 72 | a = self.relu1(a) |
| 73 | a = torch.sigmoid(a) |
| 74 | b = self.linear2(a) |
| 75 | b = self.relu2(b) |
| 76 | return b |
| 77 | |
| 78 | |
| 79 | class Model(torch.nn.Module): |