tglite.TBatch¶
- class tglite.TBatch(g: TGraph, range: Tuple[int, int])¶
Represents a batch of temporal edges to process. A thin wrapper with a TGraph reference and without actually materializing any arrays until they are needed.
Get graph data¶
Returns the TGraph. |
|
Get the negative nodes. |
|
|
Returns edge ids of the batch. |
|
Returns the edges in the batch as a two-column ndarray, where the first column represents the source |
|
Returns a node index array: [src, des(, neg)] if reverse is False or [des, src(, src)] if reverse is True. |
|
Returns timestamps corresponding to the nodes. It retrieves timestamps of the batch edges (as the timestamps for source nodes), |
Get TBlock¶
|
Creates the head TBlock of the batch, including negative nodes if set. |
|
Creates the head TBlock with batch edges as neighbors (excluding negative nodes). |
Split data¶
|
Splits the data into multiple arrays, with each array containing a number of rows equal to the batch size. |