SingleSolverInterface#
- class SingleSolverInterface(problem, model, optimizer=None, scheduler=None, weighting=None, use_lt=True)[source]#
Bases:
SolverInterfaceBase class for PINA solvers using a single
torch.nn.Module.Initialization of the
SingleSolverInterfaceclass.- Parameters:
problem (AbstractProblem) – The problem to be solved.
model (torch.nn.Module) – The neural network model to be used.
optimizer (Optimizer) – The optimizer to be used. If
None, thetorch.optim.Adamoptimizer is used. Default isNone.scheduler (Scheduler) – The scheduler to be used. If
None, thetorch.optim.lr_scheduler.ConstantLRscheduler is used. Default isNone.weighting (WeightingInterface) – The weighting schema to be used. If
None, no weighting schema is used. Default isNone.use_lt (bool) – If
True, the solver uses LabelTensors as input.
- forward(x)[source]#
Forward pass implementation.
- Parameters:
x (torch.Tensor | LabelTensor | Graph | Data) – Input tensor.
- Returns:
Solver solution.
- Return type:
torch.Tensor | LabelTensor | Graph | Data
- property model#
The model used for training.
- Returns:
The model used for training.
- Return type:
- property scheduler#
The scheduler used for training.
- Returns:
The scheduler used for training.
- Return type: