Skip to content

Evaluate a single control vector on every model in robust optimization - #174

Merged
rolfjl merged 1 commit into
Python-Ensemble-Toolbox:mainfrom
MathiasMNilsen:fix-robust-evaluation
Oct 9, 2026
Merged

rolfjl merged 1 commit into
Python-Ensemble-Toolbox:mainfrom
MathiasMNilsen:fix-robust-evaluation

Conversation

@MathiasMNilsen

Copy link
Copy Markdown
Contributor

With num_models > 1, GaussianEnsemble.function built one simulator input for a single control vector but asked for num_models members, so _simulator_input raised IndexError. Repeat the control vector once per model and pair each copy with its own model index; the pairing that _aux_input sets for the gradient ensemble ([0, 0, 1, 1, ...]) would also have sent the copies to the wrong models.

Add tests for both the single-point evaluation and the gradient pairing.

With num_models > 1, GaussianEnsemble.function built one simulator input
for a single control vector but asked for num_models members, so
_simulator_input raised IndexError. Repeat the control vector once per
model and pair each copy with its own model index; the pairing that
_aux_input sets for the gradient ensemble ([0, 0, 1, 1, ...]) would also
have sent the copies to the wrong models.

Add tests for both the single-point evaluation and the gradient pairing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rolfjl
rolfjl merged commit c4b58ad into Python-Ensemble-Toolbox:main Oct 9, 2026
4 checks passed
@MathiasMNilsen
MathiasMNilsen deleted the fix-robust-evaluation branch October 9, 2026 07:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants