Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

solution_mappings ignored for ensemble_sample #449

Closed
fivegrant opened this issue Jan 9, 2024 · 3 comments · Fixed by #471
Closed

solution_mappings ignored for ensemble_sample #449

fivegrant opened this issue Jan 9, 2024 · 3 comments · Fixed by #471
Labels
integration Tasks for integration with TA4

Comments

@fivegrant
Copy link
Collaborator

fivegrant commented Jan 9, 2024

ensemble_sample doesn't seem to use the provided solution_mappings. Therefore, ensemble_sample will only work with an ensemble containing identical models.

If you grep for solution_mappings, it seems it's not used, only instantiated:

pyciemss/ensemble/compiled_dynamics.py:21:        solution_mappings: List[
pyciemss/ensemble/compiled_dynamics.py:28:        self.solution_mappings = solution_mappings
pyciemss/ensemble/compiled_dynamics.py:58:    def _load_from_list(cls, srcs: list, dirichlet_alpha, solution_mappings):
pyciemss/ensemble/compiled_dynamics.py:60:        return cls(dynamics_models, dirichlet_alpha, solution_mappings)
pyciemss/interfaces.py:32:    solution_mappings: List[
pyciemss/interfaces.py:54:    solution_mappings: List[Callable[[Dict[str, torch.Tensor]], Dict[str, torch.Tensor]]]
pyciemss/interfaces.py:99:        model_paths_or_jsons, dirichlet_alpha, solution_mappings
tests/test_interfaces.py:26:    solution_mappings = [lambda x: x, lambda x: {k: 2 * v for k, v in x.items()}]
tests/test_interfaces.py:27:    return ensemble_sample(model_paths_or_jsons, solution_mappings, *args, **kwargs)
docs/source/interfaces.ipynb:653:    "solution_mappings = [lambda x : x, lambda x : x] # Conveniently, these two models operate on exactly the same state space, with the same names.\n",
docs/source/interfaces.ipynb:655:    "ensemble_result = pyciemss.ensemble_sample(model_paths, solution_mappings, end_time, logging_step_size, num_samples, start_time=start_time)\n",

Furthermore, solution_mappings are not found in Mira, ChiRho, PyTorch, or Pyro.

@fivegrant fivegrant added the integration Tasks for integration with TA4 label Jan 9, 2024
@fivegrant
Copy link
Collaborator Author

This issue causes ensemble-simulate in the service refactor to break when using solution_mappings

@mwdchang
Copy link

mwdchang commented Feb 9, 2024

@SamWitty are there any updates on this issue?

@SamWitty
Copy link
Contributor

SamWitty commented Feb 9, 2024

Sorry, this slipped through the cracks. I see the missing code in PyCIEMSS and will resolve on Monday.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integration Tasks for integration with TA4
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants