Physics Informed Ensemble Solver#
Module for the physics-informed ensemble solver class.
- class PhysicsInformedEnsembleSolver(problem, models, optimizers=None, schedulers=None, weighting=None, loss=None)[source]
Bases:
PhysicsInformedMixin,EnsembleSolverEnsemble-model solver for physics-informed learning problems.
This solver approximates the solution of a differential problem using an ensemble of models. It is intended for problems whose conditions may include supervised data, equation residuals evaluated on input points, and equation residuals sampled from domains.
Given an ensemble of models \(\{\mathcal{M}_j\}_{j=1}^{M}\), the predicted solution of each model is
\[\hat{\mathbf{u}}^{(j)}(\mathbf{x}) = \mathcal{M}_j(\mathbf{x}), \qquad j = 1, \ldots, M.\]The solver minimizes the residuals of the differential operators defining the problem for each model in the ensemble. For a problem with governing equation operator \(\mathcal{A}\) in the domain \(\Omega\) and boundary operator \(\mathcal{B}\) on the boundary \(\partial\Omega\), the objective can be written as
\[\mathcal{L}_{\mathrm{problem}} = \frac{1}{M} \sum_{j=1}^{M} \left[ \frac{1}{N_{\Omega}} \sum_{i=1}^{N_{\Omega}} \mathcal{L} \left( \mathcal{A}[\hat{\mathbf{u}}^{(j)}](\mathbf{x}_i) \right) + \frac{1}{N_{\partial\Omega}} \sum_{i=1}^{N_{\partial\Omega}} \mathcal{L} \left( \mathcal{B}[\hat{\mathbf{u}}^{(j)}](\mathbf{x}_i) \right) \right],\]where \(\mathcal{L}\) is the selected loss function, typically the mean squared error.
Initialization of the
PhysicsInformedEnsembleSolverclass.- Parameters:
problem (BaseProblem) – The problem to be solved.
models (torch.nn.Module | list[torch.nn.Module]) – The model or list of models used by the solver.
optimizers (TorchOptimizer | list[TorchOptimizer]) – The optimizer or list of optimizers used by the solver. If
None, thetorch.optim.Adamoptimizer with a learning rate of0.001is used for each model. Default isNone.schedulers (TorchScheduler | list[TorchScheduler]) – The scheduler or list of schedulers used by the solver. If
None, thetorch.optim.lr_scheduler.ConstantLRscheduler with a factor of1.0is used for each model. Default isNone.weighting (BaseWeighting) – The weighting strategy used to combine condition losses. If
None, no weighting is applied. Default isNone.loss – The loss function used to compute residual losses. If
None,torch.nn.MSELossis used. Default isNone.