Skip to content

Commit

Permalink
modify code
Browse files Browse the repository at this point in the history
  • Loading branch information
Jerry-Jzy committed Dec 23, 2024
1 parent 66682a4 commit a9a9932
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions deepxde/data/pde_operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,9 +275,13 @@ def forward_call(trunk_input):
)
if not isinstance(f, (list, tuple)):
f = [f]
error_f = [fi[:, bcs_start[-1] :] for fi in f]
error_f = [fi[:, bcs_start[-1]:] for fi in f]
# Each error has the shape (N1, ~N2)
losses = [loss_fn(bkd.zeros_like(error), error) for error in error_f]
for error in error_f:
error_i = []
for i in range(error.shape[0]):
error_i.append(loss_fn(bkd.zeros_like(error[i]), error[i]))
losses.append(bkd.reduce_mean(bkd.stack(error_i, 0)))

# BC loss
error_bc = []
Expand Down

0 comments on commit a9a9932

Please sign in to comment.