File tree Expand file tree Collapse file tree
pina/solver/physics_informed_solver Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -114,6 +114,22 @@ def test_step(self, batch):
114114 """
115115 return super ().test_step (batch , loss_residuals = self ._residual_loss )
116116
117+ def loss_data (self , input , target ):
118+ """
119+ Compute the data loss for the PINN solver by evaluating the loss
120+ between the network's output and the true solution. This method should
121+ be overridden by the derived class.
122+ :param LabelTensor input: The input to the neural network.
123+ :param LabelTensor target: The target to compare with the
124+ network's output.
125+ :return: The supervised loss, averaged over the number of observations.
126+ :rtype: LabelTensor
127+ """
128+ raise NotImplementedError (
129+ "PINN is being used in a supervised learning context, but the "
130+ "'loss_data' method has not been implemented. "
131+ )
132+
117133 @abstractmethod
118134 def loss_phys (self , samples , equation ):
119135 """
You can’t perform that action at this time.
0 commit comments