scglue.models.data.GraphDataset¶
-
class
scglue.models.data.
GraphDataset
(graph, vertices, edge_weight, edge_sign, neg_samples=1, weighted_sampling=True, deemphasize_loops=True, getitem_size=1)[source]¶ Bases:
Generic
[torch.utils.data.dataset.T_co
]Dataset for graphs with support for negative sampling
- Parameters
graph (
Graph
) – Graph objectvertices (
Index
) – Indexer of graph verticesedge_weight (
str
) – Key of edge attribute for edge weightedge_sign (
str
) – Key of edge attribute for edge signneg_samples (
int
) – Number of negative samples per edgeweighted_sampling (
bool
) – Whether to do negative sampling based on vertex importancedeemphasize_loops (
bool
) – Whether to deemphasize self-loops when computing vertex importancegetitem_size (
int
) – Unitary fetch size for each __getitem__ call
Note
Custom shuffling performs negative sampling.
Methods
Accept shuffling result
Convert graph object to graph triplet
Propose shuffling using a given random seed
Attributes
logger