MCPcopy Create free account
hub / github.com/IntelligentSystemsLab/ST-EVCDP / forward

Method forward

baselines.py:132–155  ·  view source on GitHub ↗
(self, occ, prc)

Source from the content-addressed store, hash-verified

130 self.LeakyReLU = nn.LeakyReLU()
131
132 def forward(self, occ, prc): # occ.shape = [batch, node, seq]
133 x = torch.stack([occ, prc], dim=3)
134 x = self.encoder(x)
135 x = torch.squeeze(x)
136
137 # first layer
138 atts_mat = self.gat_l1(x) # attention matrix, dense(nodes, nodes)
139 occ_conv1 = torch.matmul(atts_mat, x) # (b, n, s)
140 occ_conv1 = self.dropout(self.LeakyReLU(self.gcn(occ_conv1)))
141
142 # second layer
143 atts_mat2 = self.gat_l2(occ_conv1) # attention matrix, dense(nodes, nodes)
144 occ_conv2 = torch.matmul(atts_mat2, occ_conv1) # (b, n, s)
145 occ_conv2 = self.dropout(self.LeakyReLU(self.gcn(occ_conv2)))
146
147 # lstm
148 x = occ_conv2.transpose(1, 2)
149 x, _ = self.lstm(x)
150 x = x.transpose(x, 1, 2)
151
152 # decode
153 x = self.decoder(x)
154 x = torch.squeeze(x)
155 return x
156
157
158class TPA(nn.Module):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected