Repository navigation
Optional range-aware neuron split for signed inputs (ref #107) - #124
Merged
Merged
Conversation
A split of a connection from an input can now be fit to the input range with MutationConfig::split_input_range (lo, hi): the [0, 1] rule is rescaled to u = (s - lo) / (hi - lo), giving weight a/r into the new neuron, bias θ - a·lo/r, weight r·w out of it and lo·w added to the bias of the destination. Splits of connections between CTRNN neurons keep the plain rule (their signal is σ(y + θ) in (0, 1)). The default (0, 1) is the existing rule: results and the long-run identity hash are unchanged. split_probe now evolves XOR with inputs presented as [lo, hi] for [0,1], [-1,1], [-3,3], [-10,10] and compares six split rules (mean |Δoutput| and share of splits that drop fitness). xor_bench gets keys splitlo/splithi (split range) and inlo/inhi (signed XOR inputs); the lunar lander config file exposes split_input_range. The rescaled rule is much more neutral on signed inputs but is not a faster search on XOR in [-1, 1], so it stays opt-in; measurements in src/genome.rs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
What changes
MutationConfig::split_input_range: (f64, f64)with buildersplit_input_range(lo, hi)(it panics on an empty or non-finite range). It applies only to a split of a connection from an input. The [0,1] rule (5, −2.5) is rescaled to u = (s−lo)/(hi−lo): weight a/r into the new neuron, bias θ − a·lo/r, weight r·w out of it (clipped to weight_max), and lo·w added to the destination's bias (clipped to bias_max). Splits between CTRNN neurons keep the plain rule, because their signal σ(y+θ) is always in (0,1).long_run_identityhash is unchanged.examples/split_probe.rs: evolves XOR with inputs presented in [0,1], [-1,1], [-3,3] and [-10,10], and compares 6 split rules (mean |Δoutput| on patterns and grid, % of splits that drop fitness).xor_bench: new keyssplitlo/splithi(split range) andinlo/inhi(present the XOR inputs as signed values).split_input_range(the default is unchanged).SPLIT_INPUT_WEIGHTinsrc/genome.rs.Measurement (full table on #107)
split_probe 50 1 2 3 4 5), share of splits that drop fitness by > 0.5, current → range-aware: [-1,1] 21.3 % → 7.1 %, [-3,3] 9.6 % → 2.1 %, [-10,10] 6.4 % → 4.2 %. The [0,1] case is identical.xor_bench 50 500 init reset=1 seed=1/101/201/301), medians:Verification
tests/split_input_range_tests.rs(defaults, rescaled weights and biases, neuron-source splits untouched, limits, mean output change on signed grids) and newtests/xor_bench_tests.rscases. All were red before the change.cargo fmt --check,cargo clippy --release --all-targets -- -D warnings(default and--all-featureswith the pyo3 stub),cargo build --release --examples,cargo check --features openai --examples,cargo test --release --no-fail-fastall pass, includinglong_run_identity_tests.ref #107
Part of epic #55
🤖 Generated with Claude Code