MCPcopy Create free account
hub / github.com/FinancialComputingUCL/LOBFrame / forward

Method forward

models/CompleteHCNN/complete_hcnn.py:109–135  ·  view source on GitHub ↗
(self, x)

Source from the content-addressed store, hash-verified

107 self.fc1 = nn.Linear(32, 3)
108
109 def forward(self, x):
110 x_tetrahedra = x[:, :, :, self.tetrahedra]
111 x_triangles = x[:, :, :, self.triangles]
112 x_edges = x[:, :, :, self.edges]
113
114 x_tetrahedra = self.conv1_tetrahedra(x_tetrahedra)
115 x_triangles = self.conv1_triangles(x_triangles)
116 x_edges = self.conv1_edges(x_edges)
117
118 x_tetrahedra = self.conv2_tetrahedra(x_tetrahedra)
119 x_triangles = self.conv2_triangles(x_triangles)
120 x_edges = self.conv2_edges(x_edges)
121
122 x_tetrahedra = self.conv3_tetrahedra(x_tetrahedra)
123 x_triangles = self.conv3_triangles(x_triangles)
124 x_edges = self.conv3_edges(x_edges)
125
126 x = torch.cat((x_tetrahedra, x_triangles, x_edges), dim=1)
127
128 x = x.permute(0, 2, 1, 3)
129 x = torch.reshape(x, (-1, x.shape[1], x.shape[2]))
130
131 x, _ = self.lstm(x)
132 x = x[:, -1, :]
133 logits = self.fc1(x)
134
135 return logits

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected