From 4b5ee22d8df9e4dbc648adad075edb5b93db6560 Mon Sep 17 00:00:00 2001 From: Saswat Susmoy Date: Wed, 17 Jun 2026 02:14:40 +0530 Subject: [PATCH 1/3] chore(ctesn): add discussion-stub for PR3 CTESN model MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Skeleton-only placeholder so the draft PR exists as a discussion vehicle. No include, no export, no tests — the body errors with a clear message directing the user to the (not-yet-implemented) extension constructor. Open design questions are tracked in the PR description. Stacked on PR #450; will be rebased onto master once that merges. --- src/extensions/ctesn.jl | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 src/extensions/ctesn.jl diff --git a/src/extensions/ctesn.jl b/src/extensions/ctesn.jl new file mode 100644 index 000000000..3660e8dad --- /dev/null +++ b/src/extensions/ctesn.jl @@ -0,0 +1,41 @@ +@doc raw""" + CTESN(in_dims, res_dims, out_dims; kwargs...) + +Continuous-Time Echo State Network ([Anantharaman2021](@cite)). **Work in progress +— PR3 of the SciML 2026 fellowship roadmap (#397).** This is a stub: the real +constructor lives in the `RCODEReservoirExt` package extension and will be +filled in once the design questions on the open pull request are resolved. + +`CTESN <: AbstractSciMLProblemReservoir`, so it reuses the continuous-time +`_collectstates` / `_predict` machinery landed in PR #450 (`add-ode-reservoir-ext`). +It specialises that machinery to a concrete reservoir ODE. + +The canonical reservoir ODE from [Anantharaman2021](@cite) eq. (3) is: + +```math +\dot{\mathbf{r}}(t) = \tanh\!\left(A\,\mathbf{r}(t) + W_{\text{hyb}}\,\mathbf{x}(t)\right) +``` + +with no leak term and no bias — `f = tanh`, `g = id` hardcoded by the paper. +The implementation may also expose an opt-in leaky form +`ṙ = -α r + tanh(W_in u(t) + W_r r + b)` (the continuous limit of the +discrete leaky ESN of [Lukosevicius2012](@cite)); see the PR thread for the +default-form decision. + +!!! note + This constructor errors unless the `RCODEReservoirExt` extension is loaded + (`SciMLBase` + `DataInterpolations`) **and** a concrete `OrdinaryDiffEq` + solver package is available for `args[1]`. + +## Status + +- PR3 work in progress on branch `add-ctesn`, stacked on top of PR #450 + (`add-ode-reservoir-ext`). Will be rebased onto `master` once PR #450 merges. +- Open design questions are in the pull-request description. +""" +CTESN(::Any...) = error( + "CTESN requires the RCODEReservoirExt extension and an OrdinaryDiffEq " * + "solver package. Load `SciMLBase`, `DataInterpolations`, and a solver " * + "package (e.g. `OrdinaryDiffEqTsit5`) to enable it. PR3 is a " * + "work-in-progress — the real constructor is not yet wired up." +) From b2f9883a0dca3abd2a9c578774f98de422e00853 Mon Sep 17 00:00:00 2001 From: Saswat Susmoy Date: Thu, 18 Jun 2026 01:21:23 +0530 Subject: [PATCH 2/3] =?UTF-8?q?refactor(stub):=20rename=20CTESN=20?= =?UTF-8?q?=E2=86=92=20ContinuousESN=20per=20PR3=20design=20discussion?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Francesco's call on #456: drop the CTESN name (which referred to the Anantharaman 2021 parametric-surrogate paper) and ship instead a thin wrapper around the Lukoševičius 2012 §3.2.6 eq (5) leaky-integrator continuous ESN. Stub file moves from `src/extensions/` to `src/models/` to sit alongside ESN as a semantic sibling; docstring rewritten to reflect the new scope (leaky-integrator default, parametric-surrogate CTESN explicitly out of scope). --- src/{extensions/ctesn.jl => models/continuous_esn.jl} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/{extensions/ctesn.jl => models/continuous_esn.jl} (100%) diff --git a/src/extensions/ctesn.jl b/src/models/continuous_esn.jl similarity index 100% rename from src/extensions/ctesn.jl rename to src/models/continuous_esn.jl From 63249085c2d0721f88390039f217ec1e8afae5fb Mon Sep 17 00:00:00 2001 From: Saswat Susmoy Date: Thu, 18 Jun 2026 01:22:29 +0530 Subject: [PATCH 3/3] docs(continuous-esn): rewrite stub docstring for ContinuousESN scope MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Prior commit captured only the file rename — the docstring content update was on disk but not staged. This commit folds in the actual docstring rewrite: references Lukoševičius 2012 §3.2.6 eq (5) as the canonical ODE, explains how the discrete leak rate α maps to the continuous Euler step, and explicitly distinguishes from the Anantharaman 2021 parametric-surrogate CTESN. --- src/models/continuous_esn.jl | 55 ++++++++++++++++++++---------------- 1 file changed, 31 insertions(+), 24 deletions(-) diff --git a/src/models/continuous_esn.jl b/src/models/continuous_esn.jl index 3660e8dad..a47fecaaa 100644 --- a/src/models/continuous_esn.jl +++ b/src/models/continuous_esn.jl @@ -1,26 +1,33 @@ @doc raw""" - CTESN(in_dims, res_dims, out_dims; kwargs...) + ContinuousESN(in_dims, res_dims, out_dims; kwargs...) -Continuous-Time Echo State Network ([Anantharaman2021](@cite)). **Work in progress -— PR3 of the SciML 2026 fellowship roadmap (#397).** This is a stub: the real -constructor lives in the `RCODEReservoirExt` package extension and will be -filled in once the design questions on the open pull request are resolved. +Continuous-time leaky-integrator Echo State Network ([Lukosevicius2012](@cite) +§3.2.6, eq 5). **Work in progress — PR3 of the SciML 2026 fellowship roadmap +(#397).** This is a stub; the real constructor lives in the `RCODEReservoirExt` +package extension and will be filled in once the design is settled. -`CTESN <: AbstractSciMLProblemReservoir`, so it reuses the continuous-time -`_collectstates` / `_predict` machinery landed in PR #450 (`add-ode-reservoir-ext`). -It specialises that machinery to a concrete reservoir ODE. - -The canonical reservoir ODE from [Anantharaman2021](@cite) eq. (3) is: +`ContinuousESN <: AbstractSciMLProblemReservoir`, so it reuses the +continuous-time `_collectstates` / `_predict` machinery landed in PR #450 +(`add-ode-reservoir-ext`) and pre-bakes the leaky-integrator reservoir ODE +of [Lukosevicius2012](@cite) eq (5): ```math -\dot{\mathbf{r}}(t) = \tanh\!\left(A\,\mathbf{r}(t) + W_{\text{hyb}}\,\mathbf{x}(t)\right) +\dot{\mathbf{x}}(t) = -\mathbf{x}(t) + \tanh\!\left( + \mathbf{W}^{\text{in}}\,\mathbf{u}(t) + \mathbf{W}_r\,\mathbf{x}(t) + \mathbf{b} +\right) ``` -with no leak term and no bias — `f = tanh`, `g = id` hardcoded by the paper. -The implementation may also expose an opt-in leaky form -`ṙ = -α r + tanh(W_in u(t) + W_r r + b)` (the continuous limit of the -discrete leaky ESN of [Lukosevicius2012](@cite)); see the PR thread for the -default-form decision. +The leak rate `α` familiar from the discrete leaky ESN is, in the continuous +formulation, exactly the Euler discretisation step: take `Δt = α` and the +update collapses to `x(n+1) = (1-α)x(n) + α·tanh(W_in u(n+1) + W_r x(n) + b)`. +It is therefore controlled in `ContinuousESN` via the integration `tspan` and +the input-window count, not as a separate parameter of the ODE. + +This is *not* a port of the parametric-surrogate CTESN of +[Anantharaman2021](@cite); that model uses +`\dot{\mathbf{r}} = \tanh(A\,\mathbf{r} + W_{\text{hyb}}\,\mathbf{x}(t))` without +a decay term and is trained via RBF interpolation of `W_out(p)` over a +parameter space. It would land as a separate type in a future PR. !!! note This constructor errors unless the `RCODEReservoirExt` extension is loaded @@ -29,13 +36,13 @@ default-form decision. ## Status -- PR3 work in progress on branch `add-ctesn`, stacked on top of PR #450 - (`add-ode-reservoir-ext`). Will be rebased onto `master` once PR #450 merges. -- Open design questions are in the pull-request description. +- PR3 work in progress on branch `add-ctesn`, stacked on top of PR #450. + Will be rebased onto `master` once #450 merges. +- Open design questions tracked in the pull-request description. """ -CTESN(::Any...) = error( - "CTESN requires the RCODEReservoirExt extension and an OrdinaryDiffEq " * - "solver package. Load `SciMLBase`, `DataInterpolations`, and a solver " * - "package (e.g. `OrdinaryDiffEqTsit5`) to enable it. PR3 is a " * - "work-in-progress — the real constructor is not yet wired up." +ContinuousESN(::Any...) = error( + "ContinuousESN requires the RCODEReservoirExt extension and an " * + "OrdinaryDiffEq solver package. Load `SciMLBase`, `DataInterpolations`, " * + "and a solver package (e.g. `OrdinaryDiffEqTsit5`) to enable it. PR3 is " * + "a work-in-progress — the real constructor is not yet wired up." )