Equation#
- class Equation(equation)[source]#
Bases:
EquationInterface
Implementation of the Equation class. Every
equation
passed to aCondition
object must be either an instance ofEquation
orSystemEquation
.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 aInverseProblem
instance, the parameters must be initialized toNone
. Default isNone
.
- Returns:
The computed residual of the equation.
- Return type: