🎨 Format Python code with psf/black

This commit is contained in:
ndem0
2024-10-10 16:46:27 +00:00
committed by Nicola Demo
parent 53605d5a09
commit 1f6ea277ad

View File

@@ -158,7 +158,11 @@ class RBAPINN(PINN):
residual = self.compute_residual(samples=samples, equation=equation) residual = self.compute_residual(samples=samples, equation=equation)
cond = self.current_condition_name cond = self.current_condition_name
r_norm = self.eta * torch.abs(residual) / (torch.max(torch.abs(residual))+1e-12) r_norm = (
self.eta
* torch.abs(residual)
/ (torch.max(torch.abs(residual)) + 1e-12)
)
self.weights[cond] = (self.gamma * self.weights[cond] + r_norm).detach() self.weights[cond] = (self.gamma * self.weights[cond] + r_norm).detach()
loss_value = self._vectorial_loss( loss_value = self._vectorial_loss(