Skip to content

Instantly share code, notes, and snippets.

@LucaHermes
LucaHermes / label_informativeness.py
Last active April 27, 2024 09:40
Code to compute label informativeness given an edge index and node labels as proposed by Platonov et al. (2022) Characterizing Graph Datasets for Node Classification: Beyond Homophily-Heterophily Dichotomy
from scipy.stats import entropy
import numpy as np
def label_informativeness(edge_index, labels):
'''
Computes the label informativeness metric proposed in
Platonov et al. (2022)
Characterizing Graph Datasets for Node Classification:
Beyond Homophily-Heterophily Dichotomy
https://arxiv.org/abs/2209.06177
@LucaHermes
LucaHermes / run_sweep_with_seeds.py
Last active June 8, 2022 08:26
Script to run wandb sweeps with a number of different seeds: Given some seeds, this sweep controller samples a model configuration and starts one run per seed with the exact same setup. I made this for a model that had a high variance to get somewhat reliable values for every configuration.
'''
Wandb Sweep: Multiple seeds same config/parameters
Script to run wandb sweeps with a number of different seeds:
Given some seeds, this sweep controller samples a model configuration and starts one run per seed with the exact same setup.
I made this for a model that had a high variance to get somewhat reliable values for every configuration.
In order to group the runs with the different seeds in the wandb webapp, an additional value 'sweep_step_id' is passed
that is the same for each configuration.
To execute, run