We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sorry to bother you, I am confused that why edge_weights divided by edge_weights.mean()?
def drop_edge_weighted(edge_index, edge_weights, p: float, threshold: float = 1.): edge_weights = edge_weights / edge_weights.mean() * p edge_weights = edge_weights.where(edge_weights < threshold, torch.ones_like(edge_weights) * threshold) sel_mask = torch.bernoulli(1. - edge_weights).to(torch.bool) return edge_index[:, sel_mask]
def drop_edge_weighted(edge_index, edge_weights, p: float, threshold: float = 1.):
edge_weights = edge_weights / edge_weights.mean() * p
edge_weights = edge_weights.where(edge_weights < threshold, torch.ones_like(edge_weights) * threshold)
sel_mask = torch.bernoulli(1. - edge_weights).to(torch.bool)
return edge_index[:, sel_mask]
The text was updated successfully, but these errors were encountered:
Linyxus
No branches or pull requests
Sorry to bother you, I am confused that why edge_weights divided by edge_weights.mean()?
def drop_edge_weighted(edge_index, edge_weights, p: float, threshold: float = 1.):
edge_weights = edge_weights / edge_weights.mean() * p
edge_weights = edge_weights.where(edge_weights < threshold, torch.ones_like(edge_weights) * threshold)
sel_mask = torch.bernoulli(1. - edge_weights).to(torch.bool)
return edge_index[:, sel_mask]
The text was updated successfully, but these errors were encountered: