Skip to content

Commit

Permalink
refactor code of BC loss
Browse files Browse the repository at this point in the history
  • Loading branch information
Jerry-Jzy committed Dec 18, 2024
1 parent 292d05e commit 85c8d2e
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions deepxde/data/pde_operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,10 +294,8 @@ def forward_call(trunk_input):
end,
aux_var=model.net.auxiliary_vars[i][:, None],
)
error.append(error_i)
error = bkd.stack(error, 0)
loss = loss_fn(bkd.zeros_like(error), error)
losses.append(loss)
error.append(loss_fn(bkd.zeros_like(error_i), error_i))
losses.append(bkd.reduce_mean(bkd.stack(error, 0)))
return losses

def losses_train(self, targets, outputs, loss_fn, inputs, model, aux=None):
Expand Down

0 comments on commit 85c8d2e

Please sign in to comment.