Skip to content

Commit 3a7a4a0

Browse files
dario-cosciandem0
authored andcommitted
update doc
1 parent 69283e7 commit 3a7a4a0

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

docs/source/_rst/_code.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,3 +248,4 @@ Losses and Weightings
248248
PowerLoss <loss/powerloss.rst>
249249
WeightingInterface <loss/weighting_interface.rst>
250250
ScalarWeighting <loss/scalar_weighting.rst>
251+
NeuralTangentKernelWeighting <loss/ntk_weighting.rst>

pina/loss/ntk_weighting.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ class NeuralTangentKernelWeighting(WeightingInterface):
1717
Paris Perdikaris. *When and why PINNs fail to train:
1818
A neural tangent kernel perspective*. Journal of
1919
Computational Physics 449 (2022): 110768.
20-
DOI: `10.1016/j.jcp.2021.110768 <https://doi.org/10.1016/j.jcp.2021.110768>`_.
21-
22-
20+
DOI: `10.1016 <https://doi.org/10.1016/j.jcp.2021.110768>`_.
2321
2422
"""
2523

@@ -29,6 +27,8 @@ def __init__(self, model, alpha=0.5):
2927
3028
:param torch.nn.Module model: The neural network model.
3129
:param float alpha: The alpha parameter.
30+
31+
:raises ValueError: If ``alpha`` is not between 0 and 1 (inclusive).
3232
"""
3333

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

4444
def aggregate(self, losses):
4545
"""
46-
Weights the losses according to the Neural Tangent Kernel
46+
Weight the losses according to the Neural Tangent Kernel
4747
algorithm.
4848
4949
:param dict(torch.Tensor) input: The dictionary of losses.

0 commit comments

Comments
 (0)