Skip to content

Commit a68a0eb

Browse files
authored
callback FirstDerivative: Add arguments from the parent class (#1991)
1 parent f7ae7e0 commit a68a0eb

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

deepxde/callbacks.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -463,13 +463,24 @@ class FirstDerivative(OperatorPredictor):
463463
464464
Args:
465465
x: The input data.
466+
component_x (int): Input component for the derivative (default: 0).
467+
component_y (int): Output component for the derivative (default: 0).
468+
period (int): Interval (number of epochs) between checking values.
469+
filename (string): Output the values to the file `filename`.
470+
The file is kept open to allow instances to be re-used.
471+
If ``None``, output to the screen.
472+
precision (int): The precision of variables to display.
466473
"""
467474

468-
def __init__(self, x, component_x=0, component_y=0):
475+
def __init__(
476+
self, x, component_x=0, component_y=0, period=1, filename=None, precision=2
477+
):
469478
def first_derivative(x, y):
470479
return grad.jacobian(y, x, i=component_y, j=component_x)
471480

472-
super().__init__(x, first_derivative)
481+
super().__init__(
482+
x, first_derivative, period=period, filename=filename, precision=precision
483+
)
473484

474485

475486
class MovieDumper(Callback):

0 commit comments

Comments
 (0)