primal And Reverse Derivative
fun primalAndReverseDerivative(x: DTensor, f: (DTensor) -> DTensor): Pair<DTensor, DTensor>
Content copied to clipboard
Reverse Derivative for a function from DTensor to DTensor.
fun primalAndReverseDerivative(x: DScalar, f: (DScalar) -> DScalar): Pair<DScalar, DScalar>
Content copied to clipboard
Reverse derivative of a function from DScalar to DScalar.
fun primalAndReverseDerivative(inputs: List<DTensor>, f: (List<DTensor>) -> DTensor): Pair<DTensor, List<DTensor>>
Content copied to clipboard
The Reverse derivative of a multivariate function.
fun primalAndReverseDerivative(inputs: List<DScalar>, f: (List<DScalar>) -> DScalar): Pair<DScalar, List<DScalar>>
Content copied to clipboard
fun primalAndReverseDerivative(x: DTensor, y: DTensor, f: (DTensor, DTensor) -> DTensor): Pair<DTensor, Pair<DTensor, DTensor>>
Content copied to clipboard
The Reverse derivative of a multivariate tensor function.
fun primalAndReverseDerivative(x: DScalar, y: DScalar, f: (DScalar, DScalar) -> DScalar): Pair<DScalar, Pair<DScalar, DScalar>>
Content copied to clipboard
The Reverse derivative of a multivariate scalar function.
fun <Input : Any, Output : Any, Derivative : Any> primalAndReverseDerivative(x: Input, f: (Input) -> Output, wrapInput: (Input, Wrapper) -> Input? = null, wrapOutput: (Output, Wrapper) -> Output? = null, extractDerivative: (Input, Output, (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.