MCPcopy Create free account
hub / github.com/anton-jeran/MESH2IR / forward

Method forward

evaluate/model.py:131–163  ·  view source on GitHub ↗
(self, data)

Source from the content-addressed store, hash-verified

129 # self.act2 = torch.nn.ReLU()
130
131 def forward(self, data):
132 x, edge_index, batch = data.pos, data.edge_index, data.batch
133 # x = self.item_embedding(x)
134 # x = x.squeeze(1)
135 # print("batch ",batch)
136 x = F.relu(self.conv1(x, edge_index))
137 x, edge_index, _, batch, _ ,_= self.pool1(x, edge_index, None, batch)
138 x1 = torch.cat([gmp(x, batch), gap(x, batch)], dim=1)
139
140 x = F.relu(self.conv2(x, edge_index))
141
142 x, edge_index, _, batch, _,_ = self.pool2(x, edge_index, None, batch)
143 x2 = torch.cat([gmp(x, batch), gap(x, batch)], dim=1)
144
145 x = F.relu(self.conv3(x, edge_index))
146
147 x, edge_index, _, batch, _,_ = self.pool3(x, edge_index, None, batch)
148 x3 = torch.cat([gmp(x, batch), gap(x, batch)], dim=1)
149 # print("x1 shape ", x1.shape)
150 # print("x2 shape ", x2.shape)
151 # print("x3 shape ", x3.shape)
152 x = x1 + x2 + x3
153
154 x = self.lin1(x)
155 x = self.act1(x)
156 # print("x shape1 ", x.shape)
157 # x = self.lin2(x)
158 # x = self.act2(x)
159 x = F.dropout(x, p=0.5, training=self.training)
160 # print("x shape2 ", x.shape)
161 x = torch.sigmoid(self.lin2(x)).squeeze(1)
162 # print("x shape3 ", x.shape)
163 return x
164
165
166

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected