Skip to content

Commit 3921f53

Browse files
authored
More docs (#186)
1 parent 3415139 commit 3921f53

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

pyadjoint/reduced_functional.py

+13-1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,14 @@ class ReducedFunctional(object):
5555
respect to which to take the derivative. By default, the derivative
5656
is taken with respect to all controls. If present, it overwrites
5757
derivative_cb_pre and derivative_cb_post.
58+
scale (float): A scaling factor applied to the functional and its
59+
gradient with respect to the control.
60+
tape (Tape): A tape object that the reduced functional will use to
61+
evaluate the functional and its gradients (or derivatives).
62+
eval_cb_pre (function): Callback function before evaluating the
63+
functional. Input is a list of Controls.
64+
eval_cb_pos (function): Callback function after evaluating the
65+
functional. Inputs are the functional value and a list of Controls.
5866
derivative_cb_pre (function): Callback function before evaluating
5967
derivatives. Input is a list of Controls.
6068
Should return a list of Controls (usually the same
@@ -64,6 +72,10 @@ class ReducedFunctional(object):
6472
list of functional derivatives, list of functional values.
6573
Should return a list of derivatives (usually the same
6674
list as the input) to be returned from self.derivative.
75+
hessian_cb_pre (function): Callback function before evaluating the Hessian.
76+
Input is a list of Controls.
77+
hessian_cb_post (function): Callback function after evaluating the Hessian.
78+
Inputs are the functional, a list of Hessian, and controls.
6779
"""
6880

6981
def __init__(self, functional, controls,
@@ -211,7 +223,7 @@ def __call__(self, values):
211223
raise TypeError(
212224
f"The control at index {i} must be an `OverloadedType` object "
213225
f"with the same type as the control, which is {control_type}"
214-
)
226+
)
215227
# Call callback.
216228
self.eval_cb_pre(self.controls.delist(values))
217229

0 commit comments

Comments
 (0)