Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion MessageFunction.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def m_mpnn(self, h_v, h_w, e_vw, opt={}):
edge_output = self.learn_modules[0](e_vw)
edge_output = edge_output.view(-1, self.args['out'], self.args['in'])

h_w_rows = h_w[..., None].expand(h_w.size(0), h_v.size(1), h_w.size(1)).contiguous()
h_w_rows = h_w[..., None].expand(h_w.size(0), h_w.size(1), h_v.size(1)).contiguous()

h_w_rows = h_w_rows.view(-1, self.args['in'])

Expand Down
2 changes: 1 addition & 1 deletion ReadoutFunction.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def r_mpnn(self, h):
nn_res = nn.Sigmoid()(self.learn_modules[0](torch.cat([h[0][i,:,:], h[-1][i,:,:]], 1)))*self.learn_modules[1](h[-1][i,:,:])

# Delete virtual nodes
nn_res = (torch.sum(h[0][i,:,:],1).expand_as(nn_res)>0).type_as(nn_res)* nn_res
nn_res = (torch.sum(h[0][i,:,:],1)[...,None].expand_as(nn_res)>0).type_as(nn_res)* nn_res

aux[i,:] = torch.sum(nn_res,0)

Expand Down
2 changes: 1 addition & 1 deletion models/MPNN.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def forward(self, g, h_in, e):
h_t = self.u[0].forward(h[t], m)

# Delete virtual nodes
h_t = (torch.sum(h_in, 2).expand_as(h_t) > 0).type_as(h_t) * h_t
h_t = (torch.sum(h_in, 2)[..., None].expand_as(h_t) > 0).type_as(h_t) * h_t
h.append(h_t)

# Readout
Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ torch
torchvision
numpy
wget
networkx
networkx=1.11
joblib
tensorboard
tensorboard_logger