Test the (q,) NeuralNetworkIntegrator iterate method - #309
Merged
Merged
Conversation
No test called it, so codecov/patch reported 0% of the diff covered. The assertion reuses the docstring's ResNet example with a (q = ics,) initial condition; the expected trajectory is the closed form of x -> 2x, 3x, 2x + 1 per row, not a recomputation. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #309 +/- ##
==========================================
+ Coverage 86.07% 86.14% +0.06%
==========================================
Files 76 76
Lines 3016 3016
==========================================
+ Hits 2596 2598 +2
+ Misses 420 418 -2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
#308 rewrote the signature of the
iteratemethod for aNeuralNetworkIntegratoron(q,)initial conditions, but no test called that method, socodecov/patchon #308 reported 0% of the diff covered. This PR adds one assertion to the "Layer and architecture docstring examples" testset: the docstring'sResNet, run from(q = [1, 1, 1],)for four points, must return(q = [1 2 4 8; 1 3 9 27; 1 3 7 15],).The expected trajectory is the closed form of x ↦ x + Wx + b with W = diag(1, 2, 1), b = (0, 0, 1), not a recomputation. A CHANGELOG entry is under [Unreleased] → Added.
The branch name is the one #308 used: its commits are already in
main, and againstmainthis PR is the test and its CHANGELOG line only.Pre-PR verification
Fixed: the missing CHANGELOG entry for the new test.
Unresolved: none.
Pre-existing, not in this diff (nits):
iteratedocstring insrc/architectures/neural_network_integrator.jlgives the example ResNet as x ↦ Wx + b. The network computes x + Wx + b, which the doctest output and both tests show:nn([1, 1, 1]) == [2, 3, 3], not[1, 2, 2].icsas "aNamedTupleof two vectors", but its example passes a vector.Checked and clean:
which(iterate, …)for a(q = Vector,)argument resolves to the(q,)method. The testset passes 5/5 on Julia 1.13.0 and 1.14.0-DEV.3309.Aqua.test_piraciesreports the 3 known methods insrc/layers/resnet.jlthattest/aqua.jlasserts.@NamedTuple{q::Matrix{Int64}}.fatou lintis clean on the changed file, and the hunk has no allocating construct.Not checked: the 1.10 LTS floor (CI's
minjob covers it), a docs build (no docs or docstring change), and the full suite (left to CI).🤖 Generated with Claude Code