The GNN class accepts a number of optional hyperparameters that fine-tune training, the network architecture, and other behaviors. Each parameter has a sensible default, so you only need to set the ones relevant to your task. The sections below group them by role.
Device to perform training, inference, and feature extraction. One of "cuda" or "cpu". Default: "cuda". If your predictive reasoner instance does not have a GPU, the system automatically falls back to "cpu", so this setting is safe to leave at its default.
Whether to apply label smoothing (for classification). Default: False.
label_smoothing_alpha
float
Smoothing parameter α ∈ (0, 1). Default: 0.1.
clamp_min
int
Specifies the lower bound of the model’s output distribution in percentile terms (0–100). A value of 0 means no lower percentile cutoff is applied, while higher values restrict predictions to exclude the lowest portion of the output distribution. Default: 0.
clamp_max
int
Specifies the higher bound of the model’s output distribution in percentile terms (0–100). A value of 100 means no higher percentile cutoff is applied, while lower values restrict predictions to exclude the highest portion of the output distribution. Default: 100.
Hyperparameters are passed as keyword arguments when constructing the GNN. A common pattern is to collect them in a dictionary and unpack it with **, which keeps the tuning knobs separate from the structural arguments and makes the configuration easy to tweak between runs:
train_config = {
"device": "cuda",
"n_epochs": 10,
"train_batch_size": 256,
"lr": 0.001,
"head_layers": 2,
"label_smoothing": True,
"patience": 5,
}
gnn = GNN(
exp_database="EXPERIMENTS_DB",
exp_schema="MODEL_REGISTRY",
graph=gnn_graph,
property_transformer=pt,
train=Train,
validation=Validation,
task_type="binary_classification",
eval_metric="roc_auc",
**train_config,
)
gnn.fit()
You can also pass each hyperparameter directly as a keyword argument — the dictionary is just a convenience.