MCPcopy Create free account
hub / github.com/PythonOT/POT / Potential

Class Potential

examples/backends/plot_stoch_continuous_ot_pytorch.py:72–83  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

70
71
72class 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
86u = Potential().double()

Calls

no outgoing calls

Tested by

no test coverage detected