diff --git a/CHANGELOG.md b/CHANGELOG.md index f2fc4308e..6a56ff986 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,8 @@ breaking release). ### Removed (breaking) +- **The Hamiltonian and the Lagrangian neural networks move to two new packages, and SymbolicNeuralNetworks and Symbolics leave `[deps]` and `[compat]`.** [HamiltonianNeuralNetworks.jl](https://github.com/JuliaGML/HamiltonianNeuralNetworks.jl) takes `HamiltonianArchitecture`, `StandardHamiltonianArchitecture`, `GeneralizedHamiltonianArchitecture`, `HNNLoss`, `SymplecticEulerLoss` and `SymbolicPullback(::HamiltonianArchitecture)`, with their tests, the architecture page and the tutorial of the Hamiltonian neural network, and the scripts `hnn_pendulum.jl`, `hnn_pendulum_simulation.jl` and `symplectic_euler_loss_modified_hamiltonian.jl`. [LagrangianNeuralNetworks.jl](https://github.com/JuliaGML/LagrangianNeuralNetworks.jl) takes `LagrangianNeuralNetwork`, `LNNLoss` and `VariationalMidpointLoss`, with their tests, the architecture page of the Lagrangian neural network and the script `lnn_pendulum.jl`. GeometricMachineLearning no longer defines or exports these names, nor re-exports `SymbolicPullback`, and `scripts/utilities/plots.jl` and `scripts/utilities/data_problem.jl`, which only those scripts included, go with them, as do `∇H`, `dH` and `get_data_set` of `scripts/utilities/pendulum.jl`, which only `hnn_pendulum.jl` and `hnn_pendulum_simulation.jl` called. Migrate code that uses these names to `using GeometricMachineLearning, HamiltonianNeuralNetworks` or `using GeometricMachineLearning, LagrangianNeuralNetworks`; `DataLoader`, `Batch` and `train!` stay here. Known issues C7 and K15 are in HamiltonianNeuralNetworks.jl now; C20, a missing Knet.jl example of the Hamiltonian neural network, and K21, the field name `act` of `LagrangianNeuralNetwork`, leave this package's `KNOWN_ISSUES.md` because the code they describe leaves it; neither new package records them yet. Where another entry of this section names these types, losses or `SymbolicPullback`, that part describes code that ships in the two new packages, not in GeometricMachineLearning, and the `SymbolicNeuralNetworks` bound of the `[compat]` entry below does not apply. + - **`NetworkLoss(::TransformerIntegrator, prediction_window)` is gone; the default loss is `NetworkLoss(nn.architecture, batch)`.** `train!`'s default is now the two-argument `NetworkLoss(arch, batch)`, so a transformer's prediction window comes from the `Batch` it trains on instead of from the architecture. The old method took `prediction_window = 1`, which against `Batch`'s default `seq_length` was a conflict; `NetworkLoss(transformer, Batch(seq, pred))` replaces it, and `NetworkLoss(transformer, n::Integer)` is a `MethodError`. Migrate `NetworkLoss(transformer)` and `NetworkLoss(transformer, n)` to `NetworkLoss(transformer, batch)` or `TransformerLoss(batch)`. - **`train!`'s `pullback` keyword is gone.** `loss` takes a `NetworkLoss` or an `AbstractPullback`, and a `NetworkLoss` is trained through a `ZygotePullback`. Migrate `train!(nn, o, dl, batch, n; loss = HNNLoss(arch), pullback = SymbolicPullback(arch))` to `train!(nn, o, dl, batch, n; loss = SymbolicPullback(arch))`. `train!` builds the pullback once per call, not once per step. @@ -122,11 +124,11 @@ breaking release). - `Pkg.test()` no longer runs the doctests. `test/quality/doctests.jl` is now the group `doctests`, which an empty `ARGS` does not run; `Pkg.test(test_args = ["doctests"])` runs it. In CI the Doctests job stays their runner, so the test matrix no longer runs them a second time. - **CI uploads coverage from the `Julia 1 - ubuntu-latest` job instead of `Julia min`, and a test job saves the Julia cache only when it succeeds.** -- **The package needs Julia 1.12 or later** (`[compat] julia = "1.12"`, was `"1.11"`). On Julia 1.11.9, the gradient of an `LNNLoss` with respect to the network parameters stops with `StackOverflowError` in type inference ("Internal error: during type inference of … Encountered stack overflow") on macOS and Windows; the `Julia min` job on Linux passes. The overflow comes from SymbolicUtils 4.49.0, whose `rrule` for `SymbolicUtils.Code.create_array` returns an exactly typed tuple of tangents, one per array element; Zygote's reverse pass through the generated Hessian of `lagrangian_acceleration` is then inferred far deeper. With the 4.48.0 rule restored, or in a task with a 64 MB stack, the same gradient passes on 1.11.9; Julia 1.12.7 and 1.13.1 pass it on the root task. This closes #327: the `Julia min` jobs on macOS and Windows had failed in the *Lagrangian Neural Network* testset since 2026-10-01, and every testset after it was never run there. +- **The package needs Julia 1.12 or later** (`[compat] julia = "1.12"`, was `"1.11"`). The floor comes from `[compat] GeometricOptimizers = "0.9"`, whose v0.9.0 `Project.toml` has `julia = "1.12"`. It also closes #327, a `StackOverflowError` in type inference of the gradient of an `LNNLoss` on Julia 1.11.9, where the overflow came from SymbolicUtils 4.49.0's `rrule` for `SymbolicUtils.Code.create_array`; it failed the `Julia min` jobs on macOS and Windows in the *Lagrangian Neural Network* testset from 2026-10-01, and every testset after it never ran there. That loss now ships in LagrangianNeuralNetworks.jl, not here, so the floor does not rest on it. - **`test/Project.toml` has no `[compat]` entry for a dependency of the package.** The entries for AbstractNeuralNetworks, GeometricOptimizers, KernelAbstractions, LinearAlgebra, NeuralNetworkParameters, Random and Zygote are gone: the test environment contains the package, so the bounds of `Project.toml` apply there, and an entry in `test/Project.toml` can only repeat or narrow them. `NeuralNetworkParameters = "0.3"` was narrower than the package's `"0.3, 0.4"`. -- **The test suite follows one flat layout.** `test/runtests.jl` is one list of `@safetestset "