MCPcopy Create free account
hub / github.com/drinkingcoder/NeuralMarker / forward

Method forward

core/update.py:55–70  ·  view source on GitHub ↗
(self, h, x)

Source from the content-addressed store, hash-verified

53
54
55 def forward(self, h, x):
56 # horizontal
57 hx = torch.cat([h, x], dim=1)
58 z = torch.sigmoid(self.convz1(hx))
59 r = torch.sigmoid(self.convr1(hx))
60 q = torch.tanh(self.convq1(torch.cat([r*h, x], dim=1)))
61 h = (1-z) * h + z * q
62
63 # vertical
64 hx = torch.cat([h, x], dim=1)
65 z = torch.sigmoid(self.convz2(hx))
66 r = torch.sigmoid(self.convr2(hx))
67 q = torch.tanh(self.convq2(torch.cat([r*h, x], dim=1)))
68 h = (1-z) * h + z * q
69
70 return h
71
72class SmallMotionEncoder(nn.Module):
73 def __init__(self, args):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected