SingleSolverInterface#

class SingleSolverInterface(problem, model, optimizer=None, scheduler=None, weighting=None, use_lt=True)[source]#

Bases: SolverInterface

Base class for PINA solvers using a single torch.nn.Module.

Initialization of the SingleSolverInterface class.

Parameters:
forward(x)[source]#

Forward pass implementation.

Parameters:

x (torch.Tensor | LabelTensor) – Input tensor.

Returns:

Solver solution.

Return type:

torch.Tensor | LabelTensor

configure_optimizers()[source]#

Optimizer configuration for the solver.

Returns:

The optimizer and the scheduler

Return type:

tuple[list[Optimizer], list[Scheduler]]

property model#

The model used for training.

Returns:

The model used for training.

Return type:

torch.nn.Module

property scheduler#

The scheduler used for training.

Returns:

The scheduler used for training.

Return type:

Scheduler

property optimizer#

The optimizer used for training.

Returns:

The optimizer used for training.

Return type:

Optimizer