SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2603.01657 · 2026

FreeGNN: Continual Source-Free Graph Neural Network Adaptation for Renewable Energy Forecasting

Abderaouf Bahi, Mohamed Ferrag, Amel Ourici, Ibtissem Gasmi, Aida Derrab, Warda Deghmane

arXiv · PDF · Open in the Atlas

Code that ran

4 of 4 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (4 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 4 have no contract verdict; 0 failures of our instrument; 0 no recorded run), measured 2026-11-22; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2603.01657.json · badge: /api/ran/2603.01657.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
AraoufBh/FreeGNN community
Papers with Code archive
4 ran · 0 no recorded run
FunctionStatusWhere it lives
FreeGNN Ran
ran on a synthesized input · constructed an object; no result was computed
AraoufBh/FreeGNN/models/freegnn_backbone.py
code served (permissive licence) · get_code("ad7ef84c54738217")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, FreeGNN: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# Parameters for FreeGNN.__init__
input_dim = 3
hidden_dim = 4

ARGS = {
    'input_dim': input_dim,
    'hidden_dim': hidden_dim,
}

# Verify the model can be instantiated and forward pass works
model = nn.Module.__new__(type('FreeGNN', (nn.Module,), {
    '__init__': lambda self, input_dim, hidden_dim: (
        super(type(self), self).__init__(),
        setattr(self, 'temporal', nn.Module.__new__(type('TemporalEncoder', (nn.Module,), {
            '__init__': lambda s, input_dim, hidden_dim: (
                super(type(s), s).__init__(),
                setattr(s, 'gru', nn.GRU(input_dim, hidden_dim, batch_first=True))
            ),
            'forward': lambda s, x: (
                (lambda B, N, T, F: (
                    lambda x_reshaped: (
                        (lambda out, _: out[:, -1, :].reshape(B, N, -1))(
                            s.gru(x_reshaped)
                        )
                    )(x.reshape(B * N, T, F))
                ))(*x.shape)
            )
        }))(input_dim, hidden_dim)),
        setattr(self, 'graph', nn.Module.__new__(type('GraphLayer', (nn.Module,), {
            '__init__': lambda s, in_dim, out_dim: (
                super(type(s), s).__init__(),
                setattr(s, 'linear', nn.Linear(in_dim, out_dim))
            ),
            'forward': lambda s, h, A: s.linear(torch.matmul(A, h))
        }))(hidden_dim, hidden_dim)),
        setattr(self, 'head', nn.Module.__new__(type('PredictionHead', (nn.Module,), {
            '__init__': lambda s, hidden_dim, out_dim=1: (
                super(type(s), s).__init__(),
                setattr(s, 'mlp', nn.Sequential(
                    nn.Linear(hidden_dim, hidden_dim),
                    nn.ReLU(),
                    nn.Linear(hidden_dim, out_dim)
                ))
            ),
            'forward': lambda s, h: s.mlp(h)
        }))(hidden_dim))
    )[0],
    'forward': lambda self, x, A: self.head(self.graph(self.temporal(x), A))
}))

# Create test data
batch_size = 2
num_nodes = 3
time_steps = 5
feature_dim = input_dim

x = torch.randn(batch_size, num_nodes, time_steps, feature_dim)
A = torch.randn(num_nodes, num_nodes)

ARGS = {
    'input_dim': input_dim,
    'hidden_dim': hidden_dim,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type FreeGNN — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a FreeGNN output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
GraphLayer Ran
ran on a synthesized input · constructed an object; no result was computed
AraoufBh/FreeGNN/models/freegnn_backbone.py
code served (permissive licence) · get_code("756566dc798a5996")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, GraphLayer: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

class GraphLayer(nn.Module):

    def __init__(self, in_dim, out_dim):
        super().__init__()
        self.linear = nn.Linear(in_dim, out_dim)

    def forward(self, h, A):
        Ah = torch.matmul(A, h)
        out = self.linear(Ah)
        return out

# Construct arguments for GraphLayer instantiation
in_dim = 4
out_dim = 3

ARGS = {
    "in_dim": in_dim,
    "out_dim": out_dim
}

# Create instance to verify it works
graph_layer = GraphLayer(**ARGS)

# Verify forward pass works with example inputs
batch_size = 2
h = torch.randn(batch_size, in_dim)  # feature dimension matches in_dim
A = torch.randn(batch_size, batch_size)  # adjacency matrix
output = graph_layer(h, A)
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type GraphLayer — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a GraphLayer output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
PredictionHead Ran
ran on a synthesized input · constructed an object; no result was computed
AraoufBh/FreeGNN/models/freegnn_backbone.py
code served (permissive licence) · get_code("c4dc96f3137abc2b")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, PredictionHead: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

ARGS = {
    "hidden_dim": 4,
    "out_dim": 1,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type PredictionHead — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a PredictionHead output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
TemporalEncoder Ran
ran on a synthesized input · constructed an object; no result was computed
AraoufBh/FreeGNN/models/freegnn_backbone.py
code served (permissive licence) · get_code("82f408b526b7e0bd")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, TemporalEncoder: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# TemporalEncoder expects:
# - input_dim: int, the feature dimension F
# - hidden_dim: int, the hidden dimension of the GRU

# From the forward method, we can see:
# - x has shape (B, N, T, F)
# - B = batch size
# - N = number of sequences
# - T = temporal dimension
# - F = feature dimension (input_dim)
# The GRU processes (B*N, T, F) -> (B*N, T, hidden_dim)

input_dim = 4
hidden_dim = 3

ARGS = {
    "input_dim": input_dim,
    "hidden_dim": hidden_dim,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type TemporalEncoder — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a TemporalEncoder output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block

Also present in other papers' code

Of 4 samples lifted from this paper's linked repositories, 4 carry a function identity and 0 do not. Of the 4 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 4 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Accurate forecasting of renewable energy generation is essential for efficient grid management and sustainable power planning. However, traditional supervised models often require access to labeled data from the target site, which may be unavailable due to privacy, cost, or logistical constraints. In this work, we propose FreeGNN, a Continual Source-Free Graph Domain Adaptation framework that enables adaptive forecasting on unseen renewable energy sites without requiring source data or target labels. Our approach integrates a spatio-temporal Graph Neural Network (GNN) backbone with a teacher-student strategy, a memory replay mechanism to mitigate catastrophic forgetting, graph-based regularization to preserve spatial correlations, and a drift-aware weighting scheme to dynamically adjust adaptation strength during streaming updates. This combination allows the model to continuously adapt to non-stationary environmental conditions while maintaining robustness and stability. We conduct extensive experiments on three real-world datasets: GEFCom2012, Solar PV, and Wind SCADA, encompassing multiple sites, temporal resolutions, and meteorological features. The ablation study confirms that each component-memory, graph regularization, drift-aware adaptation, and teacher-student strategy-contributes significantly to overall performance. The experiments show that FreeGNN achieves an MAE of 5.237 and an RMSE of 7.123 on the GEFCom dataset, an MAE of 1.107 and an RMSE of 1.512 on the Solar PV dataset, and an MAE of 0.382 and an RMSE of 0.523 on the Wind SCADA dataset. These results demonstrate its ability to achieve accurate and robust forecasts in a source-free, continual learning setting, highlighting its potential for real-world deployment in adaptive renewable energy systems. For reproducibility, implementation details are available at https://github.com/AraoufBh/FreeGNN.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2603.01657")
get_code_for_paper("2603.01657")
have("2603.01657")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2603.01657.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2603.01657.svg)](https://syntology.ai/paper/2603.01657)

Connect an agent — have() is free.