Module Badiff.BTypeName
Re-define usual operators to compute values and derivatives for elements of type T.t in backward mode.
- parameter T
module of operators over the underlying type on which we perform automatic differentiation
Parameters
Signature
include Fadbad__.Types.OpS with type elt = T.elt and type scalar = T.scalar
type ttype elt= T.eltType of values: this is the type that the user should use with
makeand that will be returned byget
type scalar= T.scalarType of scalars
Constructors
val integer : int -> tWrap an integer
val zero : unit -> tConstruct a fresh value corresponding to 0
val one : unit -> tConstruct a fresh value corresponding to 1
val two : unit -> tConstruct a fresh value corresponding to 2
Destructors
Arithmetic operators
val (+) : t -> t -> tval (+=) : t -> t -> tval (-) : t -> t -> tval (-=) : t -> t -> tval (*) : t -> t -> tval (*=) : t -> t -> tval (/) : t -> t -> tval (/=) : t -> t -> tval (**) : t -> t -> tval inv : t -> tval sqr : t -> tval sqrt : t -> tval log : t -> tval exp : t -> tval sin : t -> tval cos : t -> tval tan : t -> tval asin : t -> tval acos : t -> tval atan : t -> t
Scalar operators
Comparison operators
Operators
Additionnal constructors
Accessors
Automatic Differentiation
val diff : t -> int -> int -> unitdiff x i nassignsias index of variablexout ofn
val d : t -> int -> eltd f iretrieves the derivative of variable of indexiin computationfas anelt. Must be called afterdiffandcompute.
Printers
val fprint : Stdlib.Format.formatter -> t -> unit