Problem#

class pinnx.problem.Problem(approximator=None, loss_fn='MSE', loss_weights=None)[source]#

Base Problem Class.

A problem is defined by the approximator and the loss function.

approximator#

The approximator.

loss_fn#

The loss function.

loss_weights#

A list specifying scalar coefficients (Python floats) to weight the loss contributions. The loss value that will be minimized by the trainer will then be the weighted sum of all individual losses, weighted by the loss_weights coefficients.

define_approximator(approximator)[source]#

Define the approximator.

Parameters:

approximator (Module) – The approximator.

Return type:

Problem

losses(inputs, outputs, targets, **kwargs)[source]#

Return a list of losses, i.e., constraints.

losses_test(inputs, outputs, targets, **kwargs)[source]#

Return a list of losses for test dataset, i.e., constraints.

losses_train(inputs, outputs, targets, **kwargs)[source]#

Return a list of losses for training dataset, i.e., constraints.

abstractmethod test()[source]#

Return a test dataset.

Return type:

Union[Tuple[Any, Any], Tuple[Any, Any, Any]]

abstractmethod train_next_batch(batch_size=None)[source]#

Return a training dataset of the size batch_size.

Return type:

Union[Tuple[Any, Any], Tuple[Any, Any, Any]]