Conversation
…ly have Two call sites in the dormant-ratio / effective-rank logging path cannot bind: * world_model.py imports compute_effective_rank(singular_values) but calls it as calculate_effective_rank(model, inputs, representation_layer_name=...), which raises TypeError. world_model_multitask.py already imports and calls calculate_effective_rank with exactly these arguments. * muzero.py passes percentage= to calculate_dormant_ratio, whose threshold argument is named dormant_threshold. Both world_model.py and world_model_multitask.py already use dormant_threshold=. Signed-off-by: Tai An <antai12232931@outlook.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.
Two call sites in the "logging for analysis" path raise
TypeErrorthe moment the metric is enabled. Both are single-token mismatches against helpers that the sibling file already calls correctly.1.
world_model.pycalls the wrong*_effective_ranklzero/model/utils.pyhas two similarly named helpers:world_model.pyimports the first one and calls it with the second one's arguments:world_model_multitask.py:1878— the sibling implementation of the same block — already does it right:So this changes the import and the two call sites to
calculate_effective_rank.compute_effective_rankis not used anywhere else inworld_model.py, and is still used internally bycalculate_effective_rank(utils.py:133).2.
muzero.pypassespercentage=tocalculate_dormant_ratiomuzero.py:434and:505passpercentage=self._cfg.dormant_threshold. The config key is already calleddormant_threshold; only the keyword is stale.world_model.py:2507andworld_model_multitask.py:1869both usedormant_threshold=.This is gated on
if self._cfg.calculate_dormant_ratio:(defaultFalse), which is why it has stayed unnoticed — but turning that analysis flag on crashes the learn step immediately.Verification
lzero/model/utils.pywas loaded verbatim viaimportlib(not through thelzeropackage, so noditkneeded) and both call sites were replayed against a smallnn.Moduleon CPU:Both patched calls return a real number rather than merely binding, so the helpers do run end to end (forward hook fires, SVD computed).
No functional change anywhere else;
compute_average_weight_magnitudeand the surrounding logging are untouched.🤖 Generated with Claude Code