API reference

Auto-generated reference for the public surface of GraphNetz. The reference is organised by module so deep links stay stable as the package grows; the top-level convenience imports below cover everything you’ll typically need.

Top-level convenience imports

Importable directly from graphnetz:

Models

GCN

Two-layer Graph Convolutional Network.

GAT

Two-layer Graph Attention Network.

GIN

Graph Isomorphism Network for graph-level prediction.

GraphSAGE

Two-layer GraphSAGE for node-level prediction.

GraphTransformer

Two-layer graph transformer based on TransformerConv.

DGI

Deep Graph Infomax for unsupervised node representation learning.

Datasets

CATEGORIES

dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object's (key, value) pairs dict(iterable) -> new dictionary initialized as if via: d = {} for k, v in iterable: d[k] = v dict(**kwargs) -> new dictionary initialized with the name=value pairs in the keyword argument list. For example: dict(one=1, two=2).

Netz

Netzschleuder network dataset.

download_all_networks_netz

Download and process every network in a Netzschleuder dataset.

list_datasets

Return loader names organized by category and task.

Benchmark

BENCHMARK_TASKS

dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object's (key, value) pairs dict(iterable) -> new dictionary initialized as if via: d = {} for k, v in iterable: d[k] = v dict(**kwargs) -> new dictionary initialized with the name=value pairs in the keyword argument list. For example: dict(one=1, two=2).

BenchmarkReport

Structured outcome of a multi-seed benchmark run.

ModelSpec

How to instantiate a model and which task tasks it supports.

Task

A single benchmark task_type: a dataset loader plus its training task.

iter_benchmark_tasks

Flatten BENCHMARK_TASKS to a list, optionally filtered by category/task.

plot_benchmark

Grouped bar chart with mean ± CI error bars.

register_model

Register a model with the benchmark dispatcher.

register_task

Register task under category in BENCHMARK_TASKS.

run_benchmark

Run a benchmark across one or more (model, task, seed) combinations.

task_from_dataset

Wrap an already-loaded dataset as a Task.

unregister_task

Remove a previously registered task; returns it, or None if absent.

Training utilities

train_node_classification

Train a node classifier with Planetoid-style train/val/test masks.

train_graph_classification

Train a graph-level classifier.

train_graph_regression

Train a graph-level regressor (MSE loss, MAE on val).

train_link_prediction

Train a link predictor with binary cross-entropy on RandomLinkSplit.

train_dgi

Train a Deep Graph Infomax model (unsupervised).

train_node_degree_regression

Self-supervised node-level regression: predict log node degree.

train_relational_link_prediction

Train a relational link predictor (DistMult) on knowledge graph triples.

Plotting

figure

Create a sized figure.

panel_label

Add a bold panel label (a, b, ...) to an axis.

plot_grouped_bars

Grouped bar chart from a {group: {series: value}} mapping.

plot_history

Plot a training history dict.

save_figure

Save fig to one path stem in multiple formats; returns the saved paths.

set_plot_style

Apply the rcParams and color cycle.