Equation#

class Equation(equation)[source]#

Bases: EquationInterface

Implementation of the Equation class. Every equation passed to a Condition object must be either an instance of Equation or SystemEquation.

Initialization of the Equation class.

Parameters:

equation (Callable) – A torch callable function used to compute the residual of a mathematical equation.

Raises:

ValueError – If the equation is not a callable function.

residual(input_, output_, params_=None)[source]#

Compute the residual of the equation.

Parameters:
  • input (LabelTensor) – Input points where the equation is evaluated.

  • output (LabelTensor) – Output tensor, eventually produced by a torch.nn.Module instance.

  • params (dict) – Dictionary of unknown parameters, associated with a InverseProblem instance. If the equation is not related to a InverseProblem instance, the parameters must be initialized to None. Default is None.

Returns:

The computed residual of the equation.

Return type:

LabelTensor