I am trying to implement D^{-1/2}AD^{-1/2}H using update_all
. So far the message and reduce functions I were only able to come up with are
mess_f = fn.v_mul_u('deg', 'h', 'm')
reduce_f = fn.sum('m', 'h')
g_water.update_all(mess_f, reduce_f)
In which
g_water.ndata['h'] = torch.tensor([1,0,0,0,0]).float()
g_water.ndata['deg'] = 1/torch.sqrt(g_water.in_degrees())
I think what I am implementing is D^{-1/2}AH. A naive thing I thought of is mess_f = fn.u_mul_v(fn.v_mul_u('deg', 'h', 'm'), 'deg', 'm')
, but of course it wouldn’t work with DGL.
How do I implement this?