module Make: functor (M : MatrixSig) -> functor (A : NdarraySig with type elt = M.elt and type arr = M.arr) -> sig .. end
| Parameters: |
M |
: |
MatrixSig
|
A |
: |
NdarraySig with type elt = M.elt and type arr = M.arr
|
|
type arr = A.arr
type mat = M.mat
type elt = M.elt
type padding = A.padding
type trace_op
type t =
| |
F of float |
| |
Arr of arr |
| |
Mat of mat |
| |
DF of t * t * int |
| |
DR of t * t Pervasives.ref * trace_op * int Pervasives.ref * int |
module Maths: sig .. end
module Mat: sig .. end
module Arr: sig .. end
val diff : (t -> t) ->
t -> t
diff f x returns the exat derivative of a function
f : scalar -> scalar
at point
x. Simply calling
diff f will return its derivative function
g
of the same type, i.e.
g : scalar -> scalar.
Keep calling this function will give you higher-order derivatives of f, i.e.
f |> diff |> diff |> diff |> ...
val diff' : (t -> t) ->
t ->
t * t
similar to diff, but return (f x, diff f x).
val grad : (t -> t) ->
t -> t
gradient of f : (vector -> scalar) at x, reverse ad.
val grad' : (t -> t) ->
t ->
t * t
similar to grad, but return (f x, grad f x).
val jacobian : (t -> t) ->
t -> t
jacobian of f : (vector -> vector) at x, both x and y are row vectors.
val jacobian' : (t -> t) ->
t ->
t * t
similar to jacobian, but return (f x, jacobian f x)
val jacobianv : (t -> t) ->
t ->
t -> t
jacobian vector product of f : (vector -> vector) at x along v,
forward ad. Namely, it calcultes (jacobian x) v
val jacobianv' : (t -> t) ->
t ->
t ->
t * t
similar to jacobianv', but return (f x, jacobianv f x v)
val jacobianTv : (t -> t) ->
t ->
t -> t
transposed jacobian vector product of f : (vector -> vector) at x
along v, backward ad. Namely, it calculates transpose ((jacobianv f x v)).
val jacobianTv' : (t -> t) ->
t ->
t ->
t * t
similar to jacobianTv, but return (f x, transpose (jacobianv f x v))
val hessian : (t -> t) ->
t -> t
hessian of f : (scalar -> scalar) at x.
val hessian' : (t -> t) ->
t ->
t * t
simiarl to hessian, but return (f x, hessian f x)
val hessianv : (t -> t) ->
t ->
t -> t
hessian vector product of f : (scalar -> scalar) at x along v.
Namely, it calculates (hessian x) v.
val hessianv' : (t -> t) ->
t ->
t ->
t * t
similar to hessianv, but return (f x, hessianv f x v).
val laplacian : (t -> t) ->
t -> t
laplacian of f : (scalar -> scalar) at x.
val laplacian' : (t -> t) ->
t ->
t * t
simiar to laplacian, but return (f x, laplacian f x).
val gradhessian : (t -> t) ->
t ->
t * t
return (grad f x, hessian f x), f : (scalar -> scalar)
val gradhessian' : (t -> t) ->
t ->
t * t *
t
return (f x, grad f x, hessian f x)
val gradhessianv : (t -> t) ->
t ->
t ->
t * t
return (grad f x v, hessian f x v)
val gradhessianv' : (t -> t) ->
t ->
t ->
t * t *
t
return (f x, grad f x v, hessian f x v)
val pack_flt : elt -> t
val unpack_flt : t -> elt
val pack_arr : arr -> t
val unpack_arr : t -> arr
val pack_mat : mat -> t
val unpack_mat : t -> mat
val tag : unit -> int
val primal : t -> t
val primal' : t -> t
val adjval : t -> t
val adjref : t -> t Pervasives.ref
val tangent : t -> t
val make_forward : t ->
t -> int -> t
val make_reverse : t -> int -> t
val reverse_prop : t -> t -> unit
val type_info : t -> string
val shape : t -> int array
val clip_by_l2norm : elt ->
t -> t