Network handles forward for all solvers

This commit is contained in:
Dario Coscia
2023-11-09 15:16:57 +01:00
committed by Nicola Demo
parent 4844640727
commit c90301c204
5 changed files with 63 additions and 67 deletions

View File

@@ -83,13 +83,7 @@ class PINN(SolverInterface):
:return: PINN solution.
:rtype: torch.Tensor
"""
# extract torch.Tensor from corresponding label
x = x.extract(self.problem.input_variables).as_subclass(torch.Tensor)
# perform forward pass (using torch.Tensor) + converting to LabelTensor
output = self.neural_net(x).as_subclass(LabelTensor)
# set the labels for LabelTensor
output.labels = self.problem.output_variables
return output
return self.neural_net(x)
def configure_optimizers(self):
"""