| DoubleVectorParameterizedDelegateGradientWithRespectToParams Method |
Method for calculating the gradient with respect to the parameters while keeping x
fixed at the specified value.
Namespace: CenterSpace.NMath.CoreAssembly: NMath (in NMath.dll) Version: 7.4
Syntax public override void GradientWithRespectToParams(
DoubleVector parameters,
DoubleVector x,
ref DoubleVector grad
)
Public Overrides Sub GradientWithRespectToParams (
parameters As DoubleVector,
x As DoubleVector,
ByRef grad As DoubleVector
)
public:
virtual void GradientWithRespectToParams(
DoubleVector^ parameters,
DoubleVector^ x,
DoubleVector^% grad
) override
abstract GradientWithRespectToParams :
parameters : DoubleVector *
x : DoubleVector *
grad : DoubleVector byref -> unit
override GradientWithRespectToParams :
parameters : DoubleVector *
x : DoubleVector *
grad : DoubleVector byref -> unit
Parameters
- parameters DoubleVector
- The gradient with respect to the parameters will be evaluated
at this point.
- x DoubleVector
- The point to fix x to.
- grad DoubleVector
- On entry a vector of the correct size (same as the number of parameters). On
exit contains the values of the gradient.
Exceptions Exception | Condition |
---|
InvalidArgumentException | Thrown if the length of the input gradient vector
is not equal to the length of the vector of parameter values. |
Remarks For example, if
f(x1, x2: a, b) = a*cos(b*x1) + b*sin(a*x2)
is a function parameterized on a and b, then for a fixed values of x1 and x2 we can think
of f as being a function of a and b. We can then take the partial derivatives of f
with respect to a and b to form the gradient with respect to the parameters:
grad(a,b) = { fa(a,b), fb(a,b) } = { cos(b*x1) + b*x2*cos(a*x2), -x1*a*sin(b*x1) + sin(a*x2) }.
See Also