Residual-Based Attention Mixin#

Module for the residual-based attention mixin class.

class ResidualBasedAttentionMixin[source]

Bases: object

Mixin that augments the residual loss with an attention mechanism based on the residual values.

The attention weights are computed as a function of the residuals, and they are used to weight the contribution of each condition to the overall loss. This allows the solver to focus more on conditions with larger residuals, potentially improving convergence and accuracy.

Designed to be used in combination with any solver inheriting from BaseSolver.