MCPcopy Create free account
hub / github.com/drinkingcoder/FlowFormer-Official / forward

Method forward

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

Source from the content-addressed store, hash-verified

43
44
45 def forward(self, h, x):
46 # horizontal
47 hx = torch.cat([h, x], dim=1)
48 z = torch.sigmoid(self.convz1(hx))
49 r = torch.sigmoid(self.convr1(hx))
50 q = torch.tanh(self.convq1(torch.cat([r*h, x], dim=1)))
51 h = (1-z) * h + z * q
52
53 # vertical
54 hx = torch.cat([h, x], dim=1)
55 z = torch.sigmoid(self.convz2(hx))
56 r = torch.sigmoid(self.convr2(hx))
57 q = torch.tanh(self.convq2(torch.cat([r*h, x], dim=1)))
58 h = (1-z) * h + z * q
59
60 return h
61
62class SmallMotionEncoder(nn.Module):
63 def __init__(self, args):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected