pyGAT
pyGAT copied to clipboard
code question
can U explain the following code?
& what's the meaning of -9e15 and adj? zero_vec = -9e15*torch.ones_like(e) attention = torch.where(adj > 0, e, zero_vec)
e to the power of -inf approach zero, so e to the power of -9e15 equals zero. torch.where helps you select the value of an element between matrix e and zero_vec.
thx
why not just use 0
Because the number is passed to softmax and e^0=1