primal And Forward Derivative
fun primalAndForwardDerivative(x: DTensor, f: (DTensor) -> DTensor): Pair<DTensor, DTensor>
Content copied to clipboard
Forward derivative of a function from DTensor to DTensor.
fun primalAndForwardDerivative(x: DScalar, f: (DScalar) -> DScalar): Pair<DScalar, DScalar>
Content copied to clipboard
Forward derivative of a function from DScalar to DScalar.
fun primalAndForwardDerivative(inputs: List<DTensor>, f: (List<DTensor>) -> DTensor): Pair<DTensor, List<DTensor>>
Content copied to clipboard
The forward derivative of a multivariate function.
fun primalAndForwardDerivative(x: DTensor, y: DTensor, f: (DTensor, DTensor) -> DTensor): Pair<DTensor, Pair<DTensor, DTensor>>
Content copied to clipboard
The forward derivative of a multivariate tensor function.
fun primalAndForwardDerivative(inputs: List<DScalar>, f: (List<DScalar>) -> DScalar): Pair<DScalar, List<DScalar>>
Content copied to clipboard
fun primalAndForwardDerivative(x: DScalar, y: DScalar, f: (DScalar, DScalar) -> DScalar): Pair<DScalar, Pair<DScalar, DScalar>>
Content copied to clipboard
The forward derivative of a multivariate scalar function.
fun <Input : Any, Output : Any, Derivative : Any> primalAndForwardDerivative(x: Input, f: (Input) -> Output, wrapInput: (Input, Wrapper) -> Input? = null, wrapOutput: (Output, Wrapper) -> Output? = null, extractDerivative: (Input, Output, extractor: (input: DTensor, output: DTensor) -> DTensor) -> Derivative): Pair<Output, Derivative>
Content copied to clipboard
Evaluate the function, and return a pair containing its result (primal) and the derivative. This version supports user-defined types for input and output of the function.