CAODH / EquiScore

MIT License
46 stars 3 forks source link

The part about network equivariance that I don't understand. #8

Open Ahafigure opened 1 week ago

Ahafigure commented 1 week ago

I have a question that I don't quite understand. In the MultiHeadAttentionLayer module, when calculating the distance gate, you need to normalize full_g.ndata['coors'] first and then use DGL's u_sub_v to get the difference between src and dst. However, the difference vector obtained this way is not the actual distance in the spatial coordinates, meaning it will vary according to the coordinate system, thus not satisfying equivariance. If I don't add self.coor_norm, would that be correct?

Ahafigure commented 1 week ago

I don't understand why mean(-2) is needed here. My understanding is that the tensor returned from self.atom_encoder has dimensions (Batch, Nodes, Channels), and adding mean(-2) transforms it into (Batch, Channels). However, the network can still run normally. I don't understand why it works this way.

h = g.ndata['x'] h = self.atom_encoder(h.long()).mean(-2)