GNNBenchmarkValidator<T>
Models & Types · AiDotNet.Validation
Validates GNN implementations against expected benchmarks and behaviors.
For Beginners
Why benchmark validation matters:
Purpose of Validation:
- Ensure implementations are correct
- Compare against published results
- Detect regressions when code changes
- Verify performance claims
Common Validation Checks:
1. Sanity Checks:
- Model can overfit small dataset (proves it can learn)
- Predictions change after training (proves parameters update)
- Gradients flow correctly (no vanishing/exploding)
2. Architecture Tests:
- Layer output shapes correct
- Adjacency matrix handling works
- Pooling produces fixed-size outputs
3. Benchmark Comparisons:
- Cora node classification: Should reach ~80% accuracy
- ZINC generation: Should produce valid molecules
- Link prediction AUC: Should beat random (>0.5)
4. Invariance Tests:
- Node permutation invariance (reordering shouldn’t change result)
- Edge order independence
- Batch independence
Example Usage:
var validator = new GNNBenchmarkValidator<double>();
// Test node classification
var nodeResults = validator.ValidateNodeClassification();
// Result is available in the returned value
// Test graph classification
var graphResults = validator.ValidateGraphClassification();
// Result is available in the returned value
How It Works
This class provides validation methods to ensure GNN implementations meet academic standards and reproduce expected results on standard benchmarks.
Constructors
| Constructor | Summary |
|---|---|
GNNBenchmarkValidator() |
Methods
| Method | Summary |
|---|---|
Dictionary<string, double> ValidateGraphGeneration() |
Validates graph generation produces valid molecules. |
GraphClassificationResults<T> ValidateGraphClassification(MolecularDataset<T> datasetType) |
Validates graph classification on molecular dataset. |
LinkPredictionResults<T> ValidateLinkPrediction() |
Validates link prediction on citation network. |
NodeClassificationResults<T> ValidateNodeClassification(CitationDataset<T> datasetType) |
Validates node classification on citation network. |
bool ValidatePermutationInvariance() |
Validates permutation invariance (node order shouldn’t matter). |