Equation#
- class Equation(equation)[source]#
Bases:
EquationInterfaceImplementation of the Equation class. Every
equationpassed to aConditionobject must be either an instance ofEquationorSystemEquation.Initialization of the
Equationclass.- Parameters:
equation (Callable) – A
torchcallable 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.Moduleinstance.params (dict) – Dictionary of unknown parameters, associated with a
InverseProbleminstance. If the equation is not related to aInverseProbleminstance, the parameters must be initialized toNone. Default isNone.
- Returns:
The computed residual of the equation.
- Return type:
- Raises:
RuntimeError – If the underlying equation signature length is not 2 (direct problem) or 3 (inverse problem).