Update embeddings in a sparse manner Sparse embeddings are updated in mini batches. We maintain gradient states for each embedding so they can be updated separately. Parameters ---------- idx : tensor Index of the embeddings to be updated.
(self, idx, grad, emb)
| 434 | |
| 435 | @abstractmethod |
| 436 | def update(self, idx, grad, emb): |
| 437 | """Update embeddings in a sparse manner |
| 438 | Sparse embeddings are updated in mini batches. We maintain gradient states for |
| 439 | each embedding so they can be updated separately. |
| 440 | |
| 441 | Parameters |
| 442 | ---------- |
| 443 | idx : tensor |
| 444 | Index of the embeddings to be updated. |
| 445 | grad : tensor |
| 446 | Gradient of each embedding. |
| 447 | emb : dgl.nn.NodeEmbedding |
| 448 | Sparse node embedding to update. |
| 449 | """ |
| 450 | |
| 451 | def zero_grad(self): |
| 452 | """clean grad cache""" |
no outgoing calls
no test coverage detected