| 70 | |
| 71 | |
| 72 | class Potential(torch.nn.Module): |
| 73 | def __init__(self): |
| 74 | super(Potential, self).__init__() |
| 75 | self.fc1 = nn.Linear(2, 200) |
| 76 | self.fc2 = nn.Linear(200, 1) |
| 77 | self.relu = torch.nn.ReLU() # instead of Heaviside step fn |
| 78 | |
| 79 | def forward(self, x): |
| 80 | output = self.fc1(x) |
| 81 | output = self.relu(output) # instead of Heaviside step fn |
| 82 | output = self.fc2(output) |
| 83 | return output.ravel() |
| 84 | |
| 85 | |
| 86 | u = Potential().double() |
no outgoing calls
no test coverage detected