def forward_all(self, z, edge_index):
     adj = torch.eye(z.shape[0])
     for i in range(0, len(edge_index[0])):
         dist = -1*hyperboloid_dist(z[edge_index[0][i]], z[edge_index[1][i]], self.radius)
         probs = 1. / (torch.exp((dist - self.r) / self.t) + 1)
         adj[edge_index[0][i]][edge_index[1][i]] = probs
     return adj
 def forward_all(self, z, edge_index):
     adj = torch.eye(z.shape[0])
     dist = 1./hyperboloid_dist(z[edge_index[0]], z[edge_index[1]], self.radius)
     scores = torch.sigmoid(self.p) * F.softmax(dist)
     probs = scores * 1. / max(scores)
     for i in range(0, len(edge_index[0])):
         adj[edge_index[0][i]][edge_index[1][i]] = probs[i]
     return adj
 def forward(self, z, edge_index):
     z_mu0 = inverse_exp_map_mu0(z, self.radius)
     dist = -1*hyperboloid_dist(z[edge_index[0]], z[edge_index[1]],
                                self.radius).squeeze()
     r_gnn = self.r(z_mu0, edge_index)
     t_gnn = self.t(z_mu0, edge_index)
     inp_r = torch.cat((r_gnn[edge_index[0]],r_gnn[edge_index[1]]), dim=1)
     inp_t = torch.cat((t_gnn[edge_index[0]],t_gnn[edge_index[1]]), dim=1)
     r = self.r_mlp(inp_r).squeeze()
     t = self.t_mlp(inp_t).squeeze()
     probs = torch.sigmoid((dist - r) / t)
     return probs.squeeze()
 def forward_all(self, z, edge_index):
     adj = torch.eye(z.shape[0])
     z_mu0 = inverse_exp_map_mu0(z, self.radius)
     dist = -1*hyperboloid_dist(z[edge_index[0]], z[edge_index[1]], self.radius)
     r_gnn = self.r(z_mu0, edge_index)
     t_gnn = self.t(z_mu0, edge_index)
     inp_r = torch.cat((r_gnn[edge_index[0]],r_gnn[edge_index[1]]), dim=1)
     inp_t = torch.cat((t_gnn[edge_index[0]],t_gnn[edge_index[1]]), dim=1)
     r = self.r_mlp(inp_r).squeeze()
     t = self.t_mlp(inp_r).squeeze()
     probs = torch.sigmoid((dist - r) / t)
     for i in range(0, len(edge_index[0])):
         adj[edge_index[0][i]][edge_index[1][i]] = probs[i]
     return adj
 def forward(self, z, edge_index):
     dist = 1./hyperboloid_dist(z[edge_index[0]], z[edge_index[1]], self.radius)
     scores = torch.sigmoid(self.p) * F.softmax(dist)
     probs = scores * 1. / max(scores)
     return probs.squeeze()
 def forward_all(self, z):
     dist = -1*hyperboloid_dist(z, z.t(), self.radius)
     scores = torch.tanh(dist)
     return scores.squeeze()
 def forward(self, z, edge_index):
     dist = -1*hyperboloid_dist(z[edge_index[0]], z[edge_index[1]], self.radius)
     scores = torch.tanh(dist)
     return scores.squeeze()
 def forward(self, z, edge_index):
     dist = hyperboloid_dist(z[edge_index[0]], z[edge_index[1]], self.radius)
     probs = 1. / (torch.exp((dist - self.r) / self.t) + 1)
     return probs.squeeze()