Skip to content

Test ModelingToolkitNeuralNets terms and fix the compiled ODE path - #678

Merged
utkuyilmaz1903 merged 1 commit into
SciML:masterfrom
utkuyilmaz1903:mtknn-array-discretization
Sep 5, 2026
Merged

utkuyilmaz1903 merged 1 commit into
SciML:masterfrom
utkuyilmaz1903:mtknn-array-discretization

Conversation

@utkuyilmaz1903

Copy link
Copy Markdown
Member

Follow-up to #675. The tests there used a stand-in for the MTKNN callable; this adds the real package and fixes a bug it turned up.

New NeuralNets test group with its own env (same setup as QA) so Lux only gets loaded there. Heat equation with a SymbolicNeuralNetwork term:

interior array eqs
NN(u, θ)[1] 1 matches the pointwise NN([u], θ)[1] form to 7e-12
21 → 81 grid points 1 interior stays at 54 nodes (pointwise 703 → 2923)
same NN in two fields 2
NN([u, v], θ)[i] 0 falls back, still solves

mtkcompile was failing on these terms. @register_array_symbolic with size but no ndims makes promote_symtype return Array{Real}, which blows up in alias elimination (_numeric_or_arrnumeric_type). Added ndims to both registrations. The parameterized heat tests in Discretization now also go through mtkcompile → ODEProblem; fails on master, passes here, agrees with the DAE path to 1e-11.

Still open: NN([u, v], θ) falls back, and the network is called per grid point rather than batched.

@utkuyilmaz1903
utkuyilmaz1903 marked this pull request as ready for review September 5, 2026 14:16
@utkuyilmaz1903
utkuyilmaz1903 merged commit ebe5c08 into SciML:master Sep 5, 2026
72 checks passed
@utkuyilmaz1903
utkuyilmaz1903 deleted the mtknn-array-discretization branch September 5, 2026 14:16
ChrisRackauckas added a commit that referenced this pull request Sep 7, 2026
- Trim the array-form capability list from MOLFiniteDifference. (#673)
- Stop infinite expansion when a PDE unknown is missing from the system. (#674)
- Support vector-valued functions in ArrayDiscretization (#675)
- Test ModelingToolkitNeuralNets terms and fix the compiled ODE path (#678)
- Add a tutorial on training a neural network term in a PDE (#679)
- Stack vector field inputs and batch network calls in ArrayDiscretization (#680)
- Add a tutorial on learning the Brusselator reaction with a neural network (#681)
- Stack scalar inputs with field slices in ArrayDiscretization (#682)
- Test callable diffusion coefficients (#683)
- Reconstruct array observables once per PDE field (#676)



Agent-Harness: Claude Code
Agent-Model: claude-opus-5[1m]
Claude-Session: https://claude.ai/code/session_014FEzNTLFutCmTEAZ3zBg5R

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants