Skip to content

Commit

Permalink
Merge pull request #144 from NeuroDiffGym/elaine-custom_loss
Browse files Browse the repository at this point in the history
fixed h1_semi_norm loss function by converting gradient from list to …
  • Loading branch information
shuheng-liu authored Sep 23, 2021
2 parents 2d14c3d + 72d6dfb commit 7bb802a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions neurodiffeq/losses.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ def _h1_norm(residual, funcs, coords):

def _h1_semi_norm(residual, funcs, coords):
g = grad(residual, *coords)
g = torch.cat(g)
return (g ** 2).mean()


Expand Down

0 comments on commit 7bb802a

Please sign in to comment.