You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
BaseSolver, SingleModelSolver, MultiModelSolver, and EnsembleSolver are base classes that aggregate one or more mixins into a single behavioral unit. They are intended to be specialized by concrete solver implementations that inherit from them.
@GiovanniCanali I write here as I see stuff but I did not finish full review:
I would divide mixing and solvers in the doc
2. Why are the mixing classes with `_`? They are not private; people will use them.
3. Why do we remove the reduction in the loss [here](https://github.com/GiovanniCanali/PINA/blob/ea9d2443bd288da0bc4aa1f6dbc66c8db3584b3c/pina/_src/solver/base_solver.py#L126-L134)?
4. The [_EnsembleMixin forward](https://github.com/GiovanniCanali/PINA/blob/ea9d2443bd288da0bc4aa1f6dbc66c8db3584b3c/pina/_src/solver/mixin/ensemble_mixin.py#L5) shuould call the forward super of [_MultiModelMixin](https://github.com/GiovanniCanali/PINA/blob/solver_mixin/pina/_src/solver/mixin/multi_model_mixin.py) and mean the super forward result.
5. How do you envision the integration of weighting, both per residual sample and per conditional components?
6. I would remove typechecker to a safer approach, like [pydantic](https://pydantic.dev/docs/) models.
The loss reduction is stored in self._reduction and removed from self._loss_fn. This separates loss computation into two steps: first, tensor_loss is computed from the residuals; then, the reduction is applied to obtain scalar_loss. See _loss_from_residual and _apply_reduction in BaseSolver.
While your reasoning is correct, I would keep the forward logics separate because merging it looks more error-prone. Also, since this is only a two-line function, I do not think it introduces a meaningful code-duplication issue.
Per-condition weighting is handled by ConditionAggregatorMixin and works as it did in the previous version. Point-wise weights, such as those used in residual-based attention, are handled by dedicated mixins.
I did not get your point, can you explain this better?
I agree on the remaining two points, I'll fix them soon
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
0.3Related to 0.3 releaseenhancementNew feature or requestpr-to-reviewLabel for PR that are ready to been reviewed
2 participants
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.
Description
This PR fixes #777
TODO list:
Checklist