Skip to content

stats precomp - #34

Merged
leoglonz merged 6 commits into
mhpi:masterfrom
leoglonz:master
Jun 8, 2026
Merged

stats precomp#34
leoglonz merged 6 commits into
mhpi:masterfrom
leoglonz:master

Conversation

@leoglonz

@leoglonz leoglonz commented Jun 8, 2026

Copy link
Copy Markdown
Member

Issue Addressed

Fixes a runtime AttributeError in _normalize and adds norm stats precomputation to reduce per-step overhead in the MTS BMI.

Description

  • Precompute normalization statistics at init (_precompute_norm_stats): converts all norm_stats mean/std lists from JSON into numpy arrays once during initialize(), rather than on every call to _normalize.
  • Robust _normalize: wraps stat lookups in np.asarray() so the method handles both pre-converted arrays and raw lists (e.g., when norm_stats is set directly in tests), fixing an AttributeError: 'list' object has no attribute 'ndim'.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Code cleanup/refactor
  • Documentation update

Other (please specify):

Checklist

  • Branch is up to date with master
  • Updated tests or added new tests
  • Tests & pre-commit hooks pass
  • Updated documentation (if applicable)
  • Code follows established style and conventions

@leoglonz leoglonz self-assigned this Jun 8, 2026
@leoglonz leoglonz added bug Something isn't working enhancement New feature or request labels Jun 8, 2026
@leoglonz leoglonz changed the title Update nn structure stats precomp Jun 8, 2026
@leoglonz
leoglonz merged commit 6d4bb68 into mhpi:master Jun 8, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant