dicee.models.flock_walks

Flock’s non-backtracking walk and recording protocol in PyTorch.

Semantics follow jw9730/flock at f35103d25a78bdf4075de5c673a51de4979aa4d7. The RNG is PyTorch’s CPU generator, not the reference C++ per-walk MT19937. Walk records can be supplied explicitly to compare neural computations exactly.

Classes

WalkGraph

CPU CSR context, kept outside a model's transferable parameters.

Functions

compiled_walk_nodes()

anonymize(values[, missing_id, missing_name])

Assign 1-based names in order of discovery, independently in each row.

Module Contents

dicee.models.flock_walks.compiled_walk_nodes()[source]
dicee.models.flock_walks.anonymize(values, missing_id=None, missing_name=None)[source]

Assign 1-based names in order of discovery, independently in each row.

class dicee.models.flock_walks.WalkGraph[source]

CPU CSR context, kept outside a model’s transferable parameters.

edge_index: torch.Tensor
edge_type: torch.Tensor
num_nodes: int
num_types: int
compile_sampler: bool = True
__post_init__()[source]
walk(prefix, length, remove_loops, generator=None, prefix_types=None)[source]

Sample uniform neighbors, then a uniform typed edge in either direction.

parse_types(walks, generator=None)[source]
sample(heads, tails, walk_num, length, refinements, generator=None)[source]

Return seven official-format records of shape [T,B,3N or 4N,L].