Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/source/_rst/_code.rst
Original file line number Diff line number Diff line change
Expand Up @@ -248,3 +248,4 @@ Losses and Weightings
PowerLoss <loss/powerloss.rst>
WeightingInterface <loss/weighting_interface.rst>
ScalarWeighting <loss/scalar_weighting.rst>
NeuralTangentKernelWeighting <loss/ntk_weighting.rst>
8 changes: 4 additions & 4 deletions pina/loss/ntk_weighting.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ class NeuralTangentKernelWeighting(WeightingInterface):
Paris Perdikaris. *When and why PINNs fail to train:
A neural tangent kernel perspective*. Journal of
Computational Physics 449 (2022): 110768.
DOI: `10.1016/j.jcp.2021.110768 <https://doi.org/10.1016/j.jcp.2021.110768>`_.


DOI: `10.1016 <https://doi.org/10.1016/j.jcp.2021.110768>`_.

"""

Expand All @@ -29,6 +27,8 @@ def __init__(self, model, alpha=0.5):

:param torch.nn.Module model: The neural network model.
:param float alpha: The alpha parameter.

:raises ValueError: If ``alpha`` is not between 0 and 1 (inclusive).
"""

super().__init__()
Expand All @@ -43,7 +43,7 @@ def __init__(self, model, alpha=0.5):

def aggregate(self, losses):
"""
Weights the losses according to the Neural Tangent Kernel
Weight the losses according to the Neural Tangent Kernel
algorithm.

:param dict(torch.Tensor) input: The dictionary of losses.
Expand Down
Loading