torchcell.viz.visual_graph_degen.VisGraphDegen

class VisGraphDegen(adj_matrix: Tensor, node_features: Tensor)[source]

Bases: object

Compute and log graph oversmoothing/oversquashing diagnostics to wandb.

static compute_smoothness(X: Tensor) → Tensor[source]

Return Frobenius norm of node features centered on their mean (oversmoothing).

static local_bottleneck_score(adj_matrix: Tensor, node_features: Tensor, k: int = 3) → Tensor[source]

Return ratio of feature diversity after k hops to one hop (oversquashing).

log_metrics(wandb_key_prefix: str = 'train_sample') → None[source]

Compute and log oversmoothing and oversquashing metrics to wandb.