diff --git a/docs/owl-base/Owl_algodiff_check/Make/argument-1-AD/index.html b/docs/owl-base/Owl_algodiff_check/Make/argument-1-AD/index.html index 64ca52bd0..4122984b5 100644 --- a/docs/owl-base/Owl_algodiff_check/Make/argument-1-AD/index.html +++ b/docs/owl-base/Owl_algodiff_check/Make/argument-1-AD/index.html @@ -1,5 +1,5 @@ -AD (owl-base.Owl_algodiff_check.Make.AD)

Parameter Make.AD

include Owl_algodiff_core_sig.Sig
Type definition
include Owl_algodiff_types_sig.Sig with type elt := A.elt and type arr := A.arr
type t =
  1. | F of A.elt
  2. | Arr of A.arr
  3. | DF of t * t * int
  4. | DR of t * t Stdlib.ref * op * int Stdlib.ref * int * int Stdlib.ref
and adjoint = t -> t Stdlib.ref -> (t * t) list -> (t * t) list
and register = t list -> t list
and label = string * t list
and op = adjoint * register * label
Core functions
val tag : unit -> int

TODO

val primal : t -> t

TODO

val primal' : t -> t

TODO

val zero : t -> t

TODO

val reset_zero : t -> t

TODO

val tangent : t -> t

TODO

val adjref : t -> t Stdlib.ref

TODO

val adjval : t -> t

TODO

val shape : t -> int array

TODO

val is_float : t -> bool

TODO

val is_arr : t -> bool

TODO

val row_num : t -> int

number of rows

val col_num : t -> int

number of columns

val numel : t -> int

number of elements

val clip_by_value : amin:A.elt -> amax:A.elt -> t -> t

other functions, without tracking gradient

val clip_by_l2norm : A.elt -> t -> t

other functions, without tracking gradient

val copy_primal' : t -> t

TODO

val tile : t -> int array -> t

TODO

val repeat : t -> int array -> t

TODO

val pack_elt : A.elt -> t

convert from elt type to t type.

val unpack_elt : t -> A.elt

convert from t type to elt type.

val pack_flt : float -> t

convert from float type to t type.

val _f : float -> t

A shortcut function for F A.(float_to_elt x).

val unpack_flt : t -> float

convert from t type to float type.

val pack_arr : A.arr -> t

convert from arr type to t type.

val unpack_arr : t -> A.arr

convert from t type to arr type.

val deep_info : t -> string

TODO

val type_info : t -> string

TODO

val error_binop : string -> t -> t -> 'a

TODO

val error_uniop : string -> t -> 'a

TODO

val make_forward : t -> t -> int -> t

make_forward p t i construct a forward algodiff data type DF, consisting of primal p, tangent t, and tag i.

val make_reverse : t -> int -> t

make_reverse p i construct a reverse algodiff data type DR, consisting of primal, adjoint, op, fanout, tag, and tracker.

val reverse_prop : t -> t -> unit

reverse_prop f x performs reverse propagation for function f using the output value x.

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

similar 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)

include Owl_algodiff_ops_sig.Sig +AD (owl-base.Owl_algodiff_check.Make.AD)

Parameter Make.AD

include Owl_algodiff_core_sig.Sig
Type definition
include Owl_algodiff_types_sig.Sig with type elt := A.elt and type arr := A.arr
type t =
  1. | F of A.elt
  2. | Arr of A.arr
  3. | DF of t * t * int
  4. | DR of t * t Stdlib.ref * op * int Stdlib.ref * int * int Stdlib.ref
and adjoint = t -> t Stdlib.ref -> (t * t) list -> (t * t) list
and register = t list -> t list
and label = string * t list
and op = adjoint * register * label
Core functions
val tag : unit -> int

start global tagging counter

val primal : t -> t

get primal component of DF or DR type

val primal' : t -> t

iteratively get primal component of DF or DR type until the component itself is not DF/DR

val zero : t -> t

return a zero value, which type decided by the input value

val reset_zero : t -> t

reset_zero x iteratively resets all elements included in x

val tangent : t -> t

get the tangent component of input, if the data type is suitable

val adjref : t -> t Stdlib.ref

get the adjref component of input, if the data type is suitable

val adjval : t -> t

get the adjval component of input, if the data type is suitableTODO

val shape : t -> int array

get the shape of primal' value of input

val is_float : t -> bool

check if input is of float value; if input is of type DF/DR, check its primal' value

val is_arr : t -> bool

check if input is of ndarray value; if input is of type DF/DR, check its primal' value

val row_num : t -> int

get the shape of primal' value of input; and then get the first dimension

val col_num : t -> int

get the shape of primal' value of input; and then get the second dimension

val numel : t -> int

for ndarray type input, return its total number of elements.

val clip_by_value : amin:A.elt -> amax:A.elt -> t -> t

other functions, without tracking gradient

val clip_by_l2norm : A.elt -> t -> t

other functions, without tracking gradient

val copy_primal' : t -> t

if primal' value of input is ndarray, copy its value in a new AD type ndarray

val tile : t -> int array -> t

if primal' value of input is ndarray, apply the tile function

val repeat : t -> int array -> t

if primal' value of input is ndarray, apply the repeat function

val pack_elt : A.elt -> t

convert from elt type to t type.

val unpack_elt : t -> A.elt

convert from t type to elt type.

val pack_flt : float -> t

convert from float type to t type.

val _f : float -> t

A shortcut function for F A.(float_to_elt x).

val unpack_flt : t -> float

convert from t type to float type.

val pack_arr : A.arr -> t

convert from arr type to t type.

val unpack_arr : t -> A.arr

convert from t type to arr type.

val deep_info : t -> string
val type_info : t -> string
val error_binop : string -> t -> t -> 'a
val error_uniop : string -> t -> 'a
val make_forward : t -> t -> int -> t

make_forward p t i construct a forward algodiff data type DF, consisting of primal p, tangent t, and tag i.

val make_reverse : t -> int -> t

make_reverse p i construct a reverse algodiff data type DR, consisting of primal, adjoint, op, fanout, tag, and tracker.

val reverse_prop : t -> t -> unit

reverse_prop f x performs reverse propagation for function f using the output value x.

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

similar 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)

include Owl_algodiff_ops_sig.Sig with type t := t and type elt := A.elt and type arr := A.arr diff --git a/docs/owl-base/Owl_algodiff_core/Make/index.html b/docs/owl-base/Owl_algodiff_core/Make/index.html index 7af95d99e..d820af632 100644 --- a/docs/owl-base/Owl_algodiff_core/Make/index.html +++ b/docs/owl-base/Owl_algodiff_core/Make/index.html @@ -1,3 +1,3 @@ Make (owl-base.Owl_algodiff_core.Make)

Module Owl_algodiff_core.Make

Parameters

Signature

module A : - Owl_types_ndarray_algodiff.Sig with type arr = A.arr with type elt = A.elt
Type definition
include Owl_algodiff_types_sig.Sig with type elt := A.elt and type arr := A.arr
type t =
  1. | F of A.elt
  2. | Arr of A.arr
  3. | DF of t * t * int
  4. | DR of t * t Stdlib.ref * op * int Stdlib.ref * int * int Stdlib.ref
and adjoint = t -> t Stdlib.ref -> (t * t) list -> (t * t) list
and register = t list -> t list
and label = string * t list
and op = adjoint * register * label
Core functions
val tag : unit -> int

TODO

val primal : t -> t

TODO

val primal' : t -> t

TODO

val zero : t -> t

TODO

val reset_zero : t -> t

TODO

val tangent : t -> t

TODO

val adjref : t -> t Stdlib.ref

TODO

val adjval : t -> t

TODO

val shape : t -> int array

TODO

val is_float : t -> bool

TODO

val is_arr : t -> bool

TODO

val row_num : t -> int

number of rows

val col_num : t -> int

number of columns

val numel : t -> int

number of elements

val clip_by_value : amin:A.elt -> amax:A.elt -> t -> t

other functions, without tracking gradient

val clip_by_l2norm : A.elt -> t -> t

other functions, without tracking gradient

val copy_primal' : t -> t

TODO

val tile : t -> int array -> t

TODO

val repeat : t -> int array -> t

TODO

val pack_elt : A.elt -> t

convert from elt type to t type.

val unpack_elt : t -> A.elt

convert from t type to elt type.

val pack_flt : float -> t

convert from float type to t type.

val _f : float -> t

A shortcut function for F A.(float_to_elt x).

val unpack_flt : t -> float

convert from t type to float type.

val pack_arr : A.arr -> t

convert from arr type to t type.

val unpack_arr : t -> A.arr

convert from t type to arr type.

val deep_info : t -> string

TODO

val type_info : t -> string

TODO

val error_binop : string -> t -> t -> 'a

TODO

val error_uniop : string -> t -> 'a

TODO

+ Owl_types_ndarray_algodiff.Sig with type arr = A.arr with type elt = A.elt
Type definition
include Owl_algodiff_types_sig.Sig with type elt := A.elt and type arr := A.arr
type t =
  1. | F of A.elt
  2. | Arr of A.arr
  3. | DF of t * t * int
  4. | DR of t * t Stdlib.ref * op * int Stdlib.ref * int * int Stdlib.ref
and adjoint = t -> t Stdlib.ref -> (t * t) list -> (t * t) list
and register = t list -> t list
and label = string * t list
and op = adjoint * register * label
Core functions
val tag : unit -> int

start global tagging counter

val primal : t -> t

get primal component of DF or DR type

val primal' : t -> t

iteratively get primal component of DF or DR type until the component itself is not DF/DR

val zero : t -> t

return a zero value, which type decided by the input value

val reset_zero : t -> t

reset_zero x iteratively resets all elements included in x

val tangent : t -> t

get the tangent component of input, if the data type is suitable

val adjref : t -> t Stdlib.ref

get the adjref component of input, if the data type is suitable

val adjval : t -> t

get the adjval component of input, if the data type is suitableTODO

val shape : t -> int array

get the shape of primal' value of input

val is_float : t -> bool

check if input is of float value; if input is of type DF/DR, check its primal' value

val is_arr : t -> bool

check if input is of ndarray value; if input is of type DF/DR, check its primal' value

val row_num : t -> int

get the shape of primal' value of input; and then get the first dimension

val col_num : t -> int

get the shape of primal' value of input; and then get the second dimension

val numel : t -> int

for ndarray type input, return its total number of elements.

val clip_by_value : amin:A.elt -> amax:A.elt -> t -> t

other functions, without tracking gradient

val clip_by_l2norm : A.elt -> t -> t

other functions, without tracking gradient

val copy_primal' : t -> t

if primal' value of input is ndarray, copy its value in a new AD type ndarray

val tile : t -> int array -> t

if primal' value of input is ndarray, apply the tile function

val repeat : t -> int array -> t

if primal' value of input is ndarray, apply the repeat function

val pack_elt : A.elt -> t

convert from elt type to t type.

val unpack_elt : t -> A.elt

convert from t type to elt type.

val pack_flt : float -> t

convert from float type to t type.

val _f : float -> t

A shortcut function for F A.(float_to_elt x).

val unpack_flt : t -> float

convert from t type to float type.

val pack_arr : A.arr -> t

convert from arr type to t type.

val unpack_arr : t -> A.arr

convert from t type to arr type.

val deep_info : t -> string
val type_info : t -> string
val error_binop : string -> t -> t -> 'a
val error_uniop : string -> t -> 'a
diff --git a/docs/owl-base/Owl_algodiff_core_sig/module-type-Sig/index.html b/docs/owl-base/Owl_algodiff_core_sig/module-type-Sig/index.html index 831966975..cc34a2f94 100644 --- a/docs/owl-base/Owl_algodiff_core_sig/module-type-Sig/index.html +++ b/docs/owl-base/Owl_algodiff_core_sig/module-type-Sig/index.html @@ -1,2 +1,2 @@ -Sig (owl-base.Owl_algodiff_core_sig.Sig)

Module type Owl_algodiff_core_sig.Sig

Type definition
include Owl_algodiff_types_sig.Sig with type elt := A.elt and type arr := A.arr
type t =
  1. | F of A.elt
  2. | Arr of A.arr
  3. | DF of t * t * int
  4. | DR of t * t Stdlib.ref * op * int Stdlib.ref * int * int Stdlib.ref
and adjoint = t -> t Stdlib.ref -> (t * t) list -> (t * t) list
and register = t list -> t list
and label = string * t list
and op = adjoint * register * label
Core functions
val tag : unit -> int

TODO

val primal : t -> t

TODO

val primal' : t -> t

TODO

val zero : t -> t

TODO

val reset_zero : t -> t

TODO

val tangent : t -> t

TODO

val adjref : t -> t Stdlib.ref

TODO

val adjval : t -> t

TODO

val shape : t -> int array

TODO

val is_float : t -> bool

TODO

val is_arr : t -> bool

TODO

val row_num : t -> int

number of rows

val col_num : t -> int

number of columns

val numel : t -> int

number of elements

val clip_by_value : amin:A.elt -> amax:A.elt -> t -> t

other functions, without tracking gradient

val clip_by_l2norm : A.elt -> t -> t

other functions, without tracking gradient

val copy_primal' : t -> t

TODO

val tile : t -> int array -> t

TODO

val repeat : t -> int array -> t

TODO

val pack_elt : A.elt -> t

convert from elt type to t type.

val unpack_elt : t -> A.elt

convert from t type to elt type.

val pack_flt : float -> t

convert from float type to t type.

val _f : float -> t

A shortcut function for F A.(float_to_elt x).

val unpack_flt : t -> float

convert from t type to float type.

val pack_arr : A.arr -> t

convert from arr type to t type.

val unpack_arr : t -> A.arr

convert from t type to arr type.

val deep_info : t -> string

TODO

val type_info : t -> string

TODO

val error_binop : string -> t -> t -> 'a

TODO

val error_uniop : string -> t -> 'a

TODO

+Sig (owl-base.Owl_algodiff_core_sig.Sig)

Module type Owl_algodiff_core_sig.Sig

Type definition
include Owl_algodiff_types_sig.Sig with type elt := A.elt and type arr := A.arr
type t =
  1. | F of A.elt
  2. | Arr of A.arr
  3. | DF of t * t * int
  4. | DR of t * t Stdlib.ref * op * int Stdlib.ref * int * int Stdlib.ref
and adjoint = t -> t Stdlib.ref -> (t * t) list -> (t * t) list
and register = t list -> t list
and label = string * t list
and op = adjoint * register * label
Core functions
val tag : unit -> int

start global tagging counter

val primal : t -> t

get primal component of DF or DR type

val primal' : t -> t

iteratively get primal component of DF or DR type until the component itself is not DF/DR

val zero : t -> t

return a zero value, which type decided by the input value

val reset_zero : t -> t

reset_zero x iteratively resets all elements included in x

val tangent : t -> t

get the tangent component of input, if the data type is suitable

val adjref : t -> t Stdlib.ref

get the adjref component of input, if the data type is suitable

val adjval : t -> t

get the adjval component of input, if the data type is suitableTODO

val shape : t -> int array

get the shape of primal' value of input

val is_float : t -> bool

check if input is of float value; if input is of type DF/DR, check its primal' value

val is_arr : t -> bool

check if input is of ndarray value; if input is of type DF/DR, check its primal' value

val row_num : t -> int

get the shape of primal' value of input; and then get the first dimension

val col_num : t -> int

get the shape of primal' value of input; and then get the second dimension

val numel : t -> int

for ndarray type input, return its total number of elements.

val clip_by_value : amin:A.elt -> amax:A.elt -> t -> t

other functions, without tracking gradient

val clip_by_l2norm : A.elt -> t -> t

other functions, without tracking gradient

val copy_primal' : t -> t

if primal' value of input is ndarray, copy its value in a new AD type ndarray

val tile : t -> int array -> t

if primal' value of input is ndarray, apply the tile function

val repeat : t -> int array -> t

if primal' value of input is ndarray, apply the repeat function

val pack_elt : A.elt -> t

convert from elt type to t type.

val unpack_elt : t -> A.elt

convert from t type to elt type.

val pack_flt : float -> t

convert from float type to t type.

val _f : float -> t

A shortcut function for F A.(float_to_elt x).

val unpack_flt : t -> float

convert from t type to float type.

val pack_arr : A.arr -> t

convert from arr type to t type.

val unpack_arr : t -> A.arr

convert from t type to arr type.

val deep_info : t -> string
val type_info : t -> string
val error_binop : string -> t -> t -> 'a
val error_uniop : string -> t -> 'a
diff --git a/docs/owl-base/Owl_algodiff_generic/Make/index.html b/docs/owl-base/Owl_algodiff_generic/Make/index.html index 1c250b4f1..30de0b00f 100644 --- a/docs/owl-base/Owl_algodiff_generic/Make/index.html +++ b/docs/owl-base/Owl_algodiff_generic/Make/index.html @@ -2,7 +2,7 @@ Make (owl-base.Owl_algodiff_generic.Make)

Module Owl_algodiff_generic.Make

Parameters

Signature

include Owl_algodiff_core_sig.Sig with type A.arr = A.arr with type A.elt = A.elt
module A : - Owl_types_ndarray_algodiff.Sig with type arr = A.arr with type elt = A.elt
Type definition
include Owl_algodiff_types_sig.Sig with type elt := A.elt and type arr := A.arr
type t =
  1. | F of A.elt
  2. | Arr of A.arr
  3. | DF of t * t * int
  4. | DR of t * t Stdlib.ref * op * int Stdlib.ref * int * int Stdlib.ref
and adjoint = t -> t Stdlib.ref -> (t * t) list -> (t * t) list
and register = t list -> t list
and label = string * t list
and op = adjoint * register * label
Core functions
val tag : unit -> int

TODO

val primal : t -> t

TODO

val primal' : t -> t

TODO

val zero : t -> t

TODO

val reset_zero : t -> t

TODO

val tangent : t -> t

TODO

val adjref : t -> t Stdlib.ref

TODO

val adjval : t -> t

TODO

val shape : t -> int array

TODO

val is_float : t -> bool

TODO

val is_arr : t -> bool

TODO

val row_num : t -> int

number of rows

val col_num : t -> int

number of columns

val numel : t -> int

number of elements

val clip_by_value : amin:A.elt -> amax:A.elt -> t -> t

other functions, without tracking gradient

val clip_by_l2norm : A.elt -> t -> t

other functions, without tracking gradient

val copy_primal' : t -> t

TODO

val tile : t -> int array -> t

TODO

val repeat : t -> int array -> t

TODO

val pack_elt : A.elt -> t

convert from elt type to t type.

val unpack_elt : t -> A.elt

convert from t type to elt type.

val pack_flt : float -> t

convert from float type to t type.

val _f : float -> t

A shortcut function for F A.(float_to_elt x).

val unpack_flt : t -> float

convert from t type to float type.

val pack_arr : A.arr -> t

convert from arr type to t type.

val unpack_arr : t -> A.arr

convert from t type to arr type.

val deep_info : t -> string

TODO

val type_info : t -> string

TODO

val error_binop : string -> t -> t -> 'a

TODO

val error_uniop : string -> t -> 'a

TODO

val make_forward : t -> t -> int -> t

make_forward p t i construct a forward algodiff data type DF, consisting of primal p, tangent t, and tag i.

val make_reverse : t -> int -> t

make_reverse p i construct a reverse algodiff data type DR, consisting of primal, adjoint, op, fanout, tag, and tracker.

val reverse_prop : t -> t -> unit

reverse_prop f x performs reverse propagation for function f using the output value x.

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

similar 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)

Type definition
include Owl_algodiff_types_sig.Sig with type elt := A.elt and type arr := A.arr
type t =
  1. | F of A.elt
  2. | Arr of A.arr
  3. | DF of t * t * int
  4. | DR of t * t Stdlib.ref * op * int Stdlib.ref * int * int Stdlib.ref
and adjoint = t -> t Stdlib.ref -> (t * t) list -> (t * t) list
and register = t list -> t list
and label = string * t list
and op = adjoint * register * label
Core functions
val tag : unit -> int

start global tagging counter

val primal : t -> t

get primal component of DF or DR type

val primal' : t -> t

iteratively get primal component of DF or DR type until the component itself is not DF/DR

val zero : t -> t

return a zero value, which type decided by the input value

val reset_zero : t -> t

reset_zero x iteratively resets all elements included in x

val tangent : t -> t

get the tangent component of input, if the data type is suitable

val adjref : t -> t Stdlib.ref

get the adjref component of input, if the data type is suitable

val adjval : t -> t

get the adjval component of input, if the data type is suitableTODO

val shape : t -> int array

get the shape of primal' value of input

val is_float : t -> bool

check if input is of float value; if input is of type DF/DR, check its primal' value

val is_arr : t -> bool

check if input is of ndarray value; if input is of type DF/DR, check its primal' value

val row_num : t -> int

get the shape of primal' value of input; and then get the first dimension

val col_num : t -> int

get the shape of primal' value of input; and then get the second dimension

val numel : t -> int

for ndarray type input, return its total number of elements.

val clip_by_value : amin:A.elt -> amax:A.elt -> t -> t

other functions, without tracking gradient

val clip_by_l2norm : A.elt -> t -> t

other functions, without tracking gradient

val copy_primal' : t -> t

if primal' value of input is ndarray, copy its value in a new AD type ndarray

val tile : t -> int array -> t

if primal' value of input is ndarray, apply the tile function

val repeat : t -> int array -> t

if primal' value of input is ndarray, apply the repeat function

val pack_elt : A.elt -> t

convert from elt type to t type.

val unpack_elt : t -> A.elt

convert from t type to elt type.

val pack_flt : float -> t

convert from float type to t type.

val _f : float -> t

A shortcut function for F A.(float_to_elt x).

val unpack_flt : t -> float

convert from t type to float type.

val pack_arr : A.arr -> t

convert from arr type to t type.

val unpack_arr : t -> A.arr

convert from t type to arr type.

val deep_info : t -> string
val type_info : t -> string
val error_binop : string -> t -> t -> 'a
val error_uniop : string -> t -> 'a
val make_forward : t -> t -> int -> t

make_forward p t i construct a forward algodiff data type DF, consisting of primal p, tangent t, and tag i.

val make_reverse : t -> int -> t

make_reverse p i construct a reverse algodiff data type DR, consisting of primal, adjoint, op, fanout, tag, and tracker.

val reverse_prop : t -> t -> unit

reverse_prop f x performs reverse propagation for function f using the output value x.

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

similar 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)

include Owl_algodiff_ops_sig.Sig with type t := t and type elt := A.elt and type arr := A.arr diff --git a/docs/owl-base/Owl_algodiff_generic_sig/module-type-Sig/index.html b/docs/owl-base/Owl_algodiff_generic_sig/module-type-Sig/index.html index 14201a47b..545da5e2c 100644 --- a/docs/owl-base/Owl_algodiff_generic_sig/module-type-Sig/index.html +++ b/docs/owl-base/Owl_algodiff_generic_sig/module-type-Sig/index.html @@ -1,5 +1,5 @@ -Sig (owl-base.Owl_algodiff_generic_sig.Sig)

Module type Owl_algodiff_generic_sig.Sig

include Owl_algodiff_core_sig.Sig
Type definition
include Owl_algodiff_types_sig.Sig with type elt := A.elt and type arr := A.arr
type t =
  1. | F of A.elt
  2. | Arr of A.arr
  3. | DF of t * t * int
  4. | DR of t * t Stdlib.ref * op * int Stdlib.ref * int * int Stdlib.ref
and adjoint = t -> t Stdlib.ref -> (t * t) list -> (t * t) list
and register = t list -> t list
and label = string * t list
and op = adjoint * register * label
Core functions
val tag : unit -> int

TODO

val primal : t -> t

TODO

val primal' : t -> t

TODO

val zero : t -> t

TODO

val reset_zero : t -> t

TODO

val tangent : t -> t

TODO

val adjref : t -> t Stdlib.ref

TODO

val adjval : t -> t

TODO

val shape : t -> int array

TODO

val is_float : t -> bool

TODO

val is_arr : t -> bool

TODO

val row_num : t -> int

number of rows

val col_num : t -> int

number of columns

val numel : t -> int

number of elements

val clip_by_value : amin:A.elt -> amax:A.elt -> t -> t

other functions, without tracking gradient

val clip_by_l2norm : A.elt -> t -> t

other functions, without tracking gradient

val copy_primal' : t -> t

TODO

val tile : t -> int array -> t

TODO

val repeat : t -> int array -> t

TODO

val pack_elt : A.elt -> t

convert from elt type to t type.

val unpack_elt : t -> A.elt

convert from t type to elt type.

val pack_flt : float -> t

convert from float type to t type.

val _f : float -> t

A shortcut function for F A.(float_to_elt x).

val unpack_flt : t -> float

convert from t type to float type.

val pack_arr : A.arr -> t

convert from arr type to t type.

val unpack_arr : t -> A.arr

convert from t type to arr type.

val deep_info : t -> string

TODO

val type_info : t -> string

TODO

val error_binop : string -> t -> t -> 'a

TODO

val error_uniop : string -> t -> 'a

TODO

val make_forward : t -> t -> int -> t

make_forward p t i construct a forward algodiff data type DF, consisting of primal p, tangent t, and tag i.

val make_reverse : t -> int -> t

make_reverse p i construct a reverse algodiff data type DR, consisting of primal, adjoint, op, fanout, tag, and tracker.

val reverse_prop : t -> t -> unit

reverse_prop f x performs reverse propagation for function f using the output value x.

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

similar 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)

include Owl_algodiff_ops_sig.Sig +Sig (owl-base.Owl_algodiff_generic_sig.Sig)

Module type Owl_algodiff_generic_sig.Sig

include Owl_algodiff_core_sig.Sig
Type definition
include Owl_algodiff_types_sig.Sig with type elt := A.elt and type arr := A.arr
type t =
  1. | F of A.elt
  2. | Arr of A.arr
  3. | DF of t * t * int
  4. | DR of t * t Stdlib.ref * op * int Stdlib.ref * int * int Stdlib.ref
and adjoint = t -> t Stdlib.ref -> (t * t) list -> (t * t) list
and register = t list -> t list
and label = string * t list
and op = adjoint * register * label
Core functions
val tag : unit -> int

start global tagging counter

val primal : t -> t

get primal component of DF or DR type

val primal' : t -> t

iteratively get primal component of DF or DR type until the component itself is not DF/DR

val zero : t -> t

return a zero value, which type decided by the input value

val reset_zero : t -> t

reset_zero x iteratively resets all elements included in x

val tangent : t -> t

get the tangent component of input, if the data type is suitable

val adjref : t -> t Stdlib.ref

get the adjref component of input, if the data type is suitable

val adjval : t -> t

get the adjval component of input, if the data type is suitableTODO

val shape : t -> int array

get the shape of primal' value of input

val is_float : t -> bool

check if input is of float value; if input is of type DF/DR, check its primal' value

val is_arr : t -> bool

check if input is of ndarray value; if input is of type DF/DR, check its primal' value

val row_num : t -> int

get the shape of primal' value of input; and then get the first dimension

val col_num : t -> int

get the shape of primal' value of input; and then get the second dimension

val numel : t -> int

for ndarray type input, return its total number of elements.

val clip_by_value : amin:A.elt -> amax:A.elt -> t -> t

other functions, without tracking gradient

val clip_by_l2norm : A.elt -> t -> t

other functions, without tracking gradient

val copy_primal' : t -> t

if primal' value of input is ndarray, copy its value in a new AD type ndarray

val tile : t -> int array -> t

if primal' value of input is ndarray, apply the tile function

val repeat : t -> int array -> t

if primal' value of input is ndarray, apply the repeat function

val pack_elt : A.elt -> t

convert from elt type to t type.

val unpack_elt : t -> A.elt

convert from t type to elt type.

val pack_flt : float -> t

convert from float type to t type.

val _f : float -> t

A shortcut function for F A.(float_to_elt x).

val unpack_flt : t -> float

convert from t type to float type.

val pack_arr : A.arr -> t

convert from arr type to t type.

val unpack_arr : t -> A.arr

convert from t type to arr type.

val deep_info : t -> string
val type_info : t -> string
val error_binop : string -> t -> t -> 'a
val error_uniop : string -> t -> 'a
val make_forward : t -> t -> int -> t

make_forward p t i construct a forward algodiff data type DF, consisting of primal p, tangent t, and tag i.

val make_reverse : t -> int -> t

make_reverse p i construct a reverse algodiff data type DR, consisting of primal, adjoint, op, fanout, tag, and tracker.

val reverse_prop : t -> t -> unit

reverse_prop f x performs reverse propagation for function f using the output value x.

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

similar 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)

include Owl_algodiff_ops_sig.Sig with type t := t and type elt := A.elt and type arr := A.arr diff --git a/docs/owl-base/Owl_algodiff_graph_convert/Make/argument-1-Core/index.html b/docs/owl-base/Owl_algodiff_graph_convert/Make/argument-1-Core/index.html index 05115d4fe..1aa73b66b 100644 --- a/docs/owl-base/Owl_algodiff_graph_convert/Make/argument-1-Core/index.html +++ b/docs/owl-base/Owl_algodiff_graph_convert/Make/argument-1-Core/index.html @@ -1,2 +1,2 @@ -Core (owl-base.Owl_algodiff_graph_convert.Make.Core)

Parameter Make.Core

Type definition
include Owl_algodiff_types_sig.Sig with type elt := A.elt and type arr := A.arr
type t =
  1. | F of A.elt
  2. | Arr of A.arr
  3. | DF of t * t * int
  4. | DR of t * t Stdlib.ref * op * int Stdlib.ref * int * int Stdlib.ref
and adjoint = t -> t Stdlib.ref -> (t * t) list -> (t * t) list
and register = t list -> t list
and label = string * t list
and op = adjoint * register * label
Core functions
val tag : unit -> int

TODO

val primal : t -> t

TODO

val primal' : t -> t

TODO

val zero : t -> t

TODO

val reset_zero : t -> t

TODO

val tangent : t -> t

TODO

val adjref : t -> t Stdlib.ref

TODO

val adjval : t -> t

TODO

val shape : t -> int array

TODO

val is_float : t -> bool

TODO

val is_arr : t -> bool

TODO

val row_num : t -> int

number of rows

val col_num : t -> int

number of columns

val numel : t -> int

number of elements

val clip_by_value : amin:A.elt -> amax:A.elt -> t -> t

other functions, without tracking gradient

val clip_by_l2norm : A.elt -> t -> t

other functions, without tracking gradient

val copy_primal' : t -> t

TODO

val tile : t -> int array -> t

TODO

val repeat : t -> int array -> t

TODO

val pack_elt : A.elt -> t

convert from elt type to t type.

val unpack_elt : t -> A.elt

convert from t type to elt type.

val pack_flt : float -> t

convert from float type to t type.

val _f : float -> t

A shortcut function for F A.(float_to_elt x).

val unpack_flt : t -> float

convert from t type to float type.

val pack_arr : A.arr -> t

convert from arr type to t type.

val unpack_arr : t -> A.arr

convert from t type to arr type.

val deep_info : t -> string

TODO

val type_info : t -> string

TODO

val error_binop : string -> t -> t -> 'a

TODO

val error_uniop : string -> t -> 'a

TODO

+Core (owl-base.Owl_algodiff_graph_convert.Make.Core)

Parameter Make.Core

Type definition
include Owl_algodiff_types_sig.Sig with type elt := A.elt and type arr := A.arr
type t =
  1. | F of A.elt
  2. | Arr of A.arr
  3. | DF of t * t * int
  4. | DR of t * t Stdlib.ref * op * int Stdlib.ref * int * int Stdlib.ref
and adjoint = t -> t Stdlib.ref -> (t * t) list -> (t * t) list
and register = t list -> t list
and label = string * t list
and op = adjoint * register * label
Core functions
val tag : unit -> int

start global tagging counter

val primal : t -> t

get primal component of DF or DR type

val primal' : t -> t

iteratively get primal component of DF or DR type until the component itself is not DF/DR

val zero : t -> t

return a zero value, which type decided by the input value

val reset_zero : t -> t

reset_zero x iteratively resets all elements included in x

val tangent : t -> t

get the tangent component of input, if the data type is suitable

val adjref : t -> t Stdlib.ref

get the adjref component of input, if the data type is suitable

val adjval : t -> t

get the adjval component of input, if the data type is suitableTODO

val shape : t -> int array

get the shape of primal' value of input

val is_float : t -> bool

check if input is of float value; if input is of type DF/DR, check its primal' value

val is_arr : t -> bool

check if input is of ndarray value; if input is of type DF/DR, check its primal' value

val row_num : t -> int

get the shape of primal' value of input; and then get the first dimension

val col_num : t -> int

get the shape of primal' value of input; and then get the second dimension

val numel : t -> int

for ndarray type input, return its total number of elements.

val clip_by_value : amin:A.elt -> amax:A.elt -> t -> t

other functions, without tracking gradient

val clip_by_l2norm : A.elt -> t -> t

other functions, without tracking gradient

val copy_primal' : t -> t

if primal' value of input is ndarray, copy its value in a new AD type ndarray

val tile : t -> int array -> t

if primal' value of input is ndarray, apply the tile function

val repeat : t -> int array -> t

if primal' value of input is ndarray, apply the repeat function

val pack_elt : A.elt -> t

convert from elt type to t type.

val unpack_elt : t -> A.elt

convert from t type to elt type.

val pack_flt : float -> t

convert from float type to t type.

val _f : float -> t

A shortcut function for F A.(float_to_elt x).

val unpack_flt : t -> float

convert from t type to float type.

val pack_arr : A.arr -> t

convert from arr type to t type.

val unpack_arr : t -> A.arr

convert from t type to arr type.

val deep_info : t -> string
val type_info : t -> string
val error_binop : string -> t -> t -> 'a
val error_uniop : string -> t -> 'a
diff --git a/docs/owl-base/Owl_algodiff_ops/Make/argument-1-Core/index.html b/docs/owl-base/Owl_algodiff_ops/Make/argument-1-Core/index.html index eee55e17e..6f9ff432b 100644 --- a/docs/owl-base/Owl_algodiff_ops/Make/argument-1-Core/index.html +++ b/docs/owl-base/Owl_algodiff_ops/Make/argument-1-Core/index.html @@ -1,2 +1,2 @@ -Core (owl-base.Owl_algodiff_ops.Make.Core)

Parameter Make.Core

Type definition
include Owl_algodiff_types_sig.Sig with type elt := A.elt and type arr := A.arr
type t =
  1. | F of A.elt
  2. | Arr of A.arr
  3. | DF of t * t * int
  4. | DR of t * t Stdlib.ref * op * int Stdlib.ref * int * int Stdlib.ref
and adjoint = t -> t Stdlib.ref -> (t * t) list -> (t * t) list
and register = t list -> t list
and label = string * t list
and op = adjoint * register * label
Core functions
val tag : unit -> int

TODO

val primal : t -> t

TODO

val primal' : t -> t

TODO

val zero : t -> t

TODO

val reset_zero : t -> t

TODO

val tangent : t -> t

TODO

val adjref : t -> t Stdlib.ref

TODO

val adjval : t -> t

TODO

val shape : t -> int array

TODO

val is_float : t -> bool

TODO

val is_arr : t -> bool

TODO

val row_num : t -> int

number of rows

val col_num : t -> int

number of columns

val numel : t -> int

number of elements

val clip_by_value : amin:A.elt -> amax:A.elt -> t -> t

other functions, without tracking gradient

val clip_by_l2norm : A.elt -> t -> t

other functions, without tracking gradient

val copy_primal' : t -> t

TODO

val tile : t -> int array -> t

TODO

val repeat : t -> int array -> t

TODO

val pack_elt : A.elt -> t

convert from elt type to t type.

val unpack_elt : t -> A.elt

convert from t type to elt type.

val pack_flt : float -> t

convert from float type to t type.

val _f : float -> t

A shortcut function for F A.(float_to_elt x).

val unpack_flt : t -> float

convert from t type to float type.

val pack_arr : A.arr -> t

convert from arr type to t type.

val unpack_arr : t -> A.arr

convert from t type to arr type.

val deep_info : t -> string

TODO

val type_info : t -> string

TODO

val error_binop : string -> t -> t -> 'a

TODO

val error_uniop : string -> t -> 'a

TODO

+Core (owl-base.Owl_algodiff_ops.Make.Core)

Parameter Make.Core

Type definition
include Owl_algodiff_types_sig.Sig with type elt := A.elt and type arr := A.arr
type t =
  1. | F of A.elt
  2. | Arr of A.arr
  3. | DF of t * t * int
  4. | DR of t * t Stdlib.ref * op * int Stdlib.ref * int * int Stdlib.ref
and adjoint = t -> t Stdlib.ref -> (t * t) list -> (t * t) list
and register = t list -> t list
and label = string * t list
and op = adjoint * register * label
Core functions
val tag : unit -> int

start global tagging counter

val primal : t -> t

get primal component of DF or DR type

val primal' : t -> t

iteratively get primal component of DF or DR type until the component itself is not DF/DR

val zero : t -> t

return a zero value, which type decided by the input value

val reset_zero : t -> t

reset_zero x iteratively resets all elements included in x

val tangent : t -> t

get the tangent component of input, if the data type is suitable

val adjref : t -> t Stdlib.ref

get the adjref component of input, if the data type is suitable

val adjval : t -> t

get the adjval component of input, if the data type is suitableTODO

val shape : t -> int array

get the shape of primal' value of input

val is_float : t -> bool

check if input is of float value; if input is of type DF/DR, check its primal' value

val is_arr : t -> bool

check if input is of ndarray value; if input is of type DF/DR, check its primal' value

val row_num : t -> int

get the shape of primal' value of input; and then get the first dimension

val col_num : t -> int

get the shape of primal' value of input; and then get the second dimension

val numel : t -> int

for ndarray type input, return its total number of elements.

val clip_by_value : amin:A.elt -> amax:A.elt -> t -> t

other functions, without tracking gradient

val clip_by_l2norm : A.elt -> t -> t

other functions, without tracking gradient

val copy_primal' : t -> t

if primal' value of input is ndarray, copy its value in a new AD type ndarray

val tile : t -> int array -> t

if primal' value of input is ndarray, apply the tile function

val repeat : t -> int array -> t

if primal' value of input is ndarray, apply the repeat function

val pack_elt : A.elt -> t

convert from elt type to t type.

val unpack_elt : t -> A.elt

convert from t type to elt type.

val pack_flt : float -> t

convert from float type to t type.

val _f : float -> t

A shortcut function for F A.(float_to_elt x).

val unpack_flt : t -> float

convert from t type to float type.

val pack_arr : A.arr -> t

convert from arr type to t type.

val unpack_arr : t -> A.arr

convert from t type to arr type.

val deep_info : t -> string
val type_info : t -> string
val error_binop : string -> t -> t -> 'a
val error_uniop : string -> t -> 'a
diff --git a/docs/owl-base/Owl_algodiff_ops_builder/Make/argument-1-Core/index.html b/docs/owl-base/Owl_algodiff_ops_builder/Make/argument-1-Core/index.html index 431c1f0b6..88d8b892a 100644 --- a/docs/owl-base/Owl_algodiff_ops_builder/Make/argument-1-Core/index.html +++ b/docs/owl-base/Owl_algodiff_ops_builder/Make/argument-1-Core/index.html @@ -1,2 +1,2 @@ -Core (owl-base.Owl_algodiff_ops_builder.Make.Core)

Parameter Make.Core

Type definition
include Owl_algodiff_types_sig.Sig with type elt := A.elt and type arr := A.arr
type t =
  1. | F of A.elt
  2. | Arr of A.arr
  3. | DF of t * t * int
  4. | DR of t * t Stdlib.ref * op * int Stdlib.ref * int * int Stdlib.ref
and adjoint = t -> t Stdlib.ref -> (t * t) list -> (t * t) list
and register = t list -> t list
and label = string * t list
and op = adjoint * register * label
Core functions
val tag : unit -> int

TODO

val primal : t -> t

TODO

val primal' : t -> t

TODO

val zero : t -> t

TODO

val reset_zero : t -> t

TODO

val tangent : t -> t

TODO

val adjref : t -> t Stdlib.ref

TODO

val adjval : t -> t

TODO

val shape : t -> int array

TODO

val is_float : t -> bool

TODO

val is_arr : t -> bool

TODO

val row_num : t -> int

number of rows

val col_num : t -> int

number of columns

val numel : t -> int

number of elements

val clip_by_value : amin:A.elt -> amax:A.elt -> t -> t

other functions, without tracking gradient

val clip_by_l2norm : A.elt -> t -> t

other functions, without tracking gradient

val copy_primal' : t -> t

TODO

val tile : t -> int array -> t

TODO

val repeat : t -> int array -> t

TODO

val pack_elt : A.elt -> t

convert from elt type to t type.

val unpack_elt : t -> A.elt

convert from t type to elt type.

val pack_flt : float -> t

convert from float type to t type.

val _f : float -> t

A shortcut function for F A.(float_to_elt x).

val unpack_flt : t -> float

convert from t type to float type.

val pack_arr : A.arr -> t

convert from arr type to t type.

val unpack_arr : t -> A.arr

convert from t type to arr type.

val deep_info : t -> string

TODO

val type_info : t -> string

TODO

val error_binop : string -> t -> t -> 'a

TODO

val error_uniop : string -> t -> 'a

TODO

+Core (owl-base.Owl_algodiff_ops_builder.Make.Core)

Parameter Make.Core

Type definition
include Owl_algodiff_types_sig.Sig with type elt := A.elt and type arr := A.arr
type t =
  1. | F of A.elt
  2. | Arr of A.arr
  3. | DF of t * t * int
  4. | DR of t * t Stdlib.ref * op * int Stdlib.ref * int * int Stdlib.ref
and adjoint = t -> t Stdlib.ref -> (t * t) list -> (t * t) list
and register = t list -> t list
and label = string * t list
and op = adjoint * register * label
Core functions
val tag : unit -> int

start global tagging counter

val primal : t -> t

get primal component of DF or DR type

val primal' : t -> t

iteratively get primal component of DF or DR type until the component itself is not DF/DR

val zero : t -> t

return a zero value, which type decided by the input value

val reset_zero : t -> t

reset_zero x iteratively resets all elements included in x

val tangent : t -> t

get the tangent component of input, if the data type is suitable

val adjref : t -> t Stdlib.ref

get the adjref component of input, if the data type is suitable

val adjval : t -> t

get the adjval component of input, if the data type is suitableTODO

val shape : t -> int array

get the shape of primal' value of input

val is_float : t -> bool

check if input is of float value; if input is of type DF/DR, check its primal' value

val is_arr : t -> bool

check if input is of ndarray value; if input is of type DF/DR, check its primal' value

val row_num : t -> int

get the shape of primal' value of input; and then get the first dimension

val col_num : t -> int

get the shape of primal' value of input; and then get the second dimension

val numel : t -> int

for ndarray type input, return its total number of elements.

val clip_by_value : amin:A.elt -> amax:A.elt -> t -> t

other functions, without tracking gradient

val clip_by_l2norm : A.elt -> t -> t

other functions, without tracking gradient

val copy_primal' : t -> t

if primal' value of input is ndarray, copy its value in a new AD type ndarray

val tile : t -> int array -> t

if primal' value of input is ndarray, apply the tile function

val repeat : t -> int array -> t

if primal' value of input is ndarray, apply the repeat function

val pack_elt : A.elt -> t

convert from elt type to t type.

val unpack_elt : t -> A.elt

convert from t type to elt type.

val pack_flt : float -> t

convert from float type to t type.

val _f : float -> t

A shortcut function for F A.(float_to_elt x).

val unpack_flt : t -> float

convert from t type to float type.

val pack_arr : A.arr -> t

convert from arr type to t type.

val unpack_arr : t -> A.arr

convert from t type to arr type.

val deep_info : t -> string
val type_info : t -> string
val error_binop : string -> t -> t -> 'a
val error_uniop : string -> t -> 'a
diff --git a/docs/owl-base/Owl_algodiff_reverse/Make/argument-1-C/index.html b/docs/owl-base/Owl_algodiff_reverse/Make/argument-1-C/index.html index a225a2dfc..e5ad85038 100644 --- a/docs/owl-base/Owl_algodiff_reverse/Make/argument-1-C/index.html +++ b/docs/owl-base/Owl_algodiff_reverse/Make/argument-1-C/index.html @@ -1,2 +1,2 @@ -C (owl-base.Owl_algodiff_reverse.Make.C)

Parameter Make.C

include Owl_algodiff_core_sig.Sig
Type definition
include Owl_algodiff_types_sig.Sig with type elt := A.elt and type arr := A.arr
type t =
  1. | F of A.elt
  2. | Arr of A.arr
  3. | DF of t * t * int
  4. | DR of t * t Stdlib.ref * op * int Stdlib.ref * int * int Stdlib.ref
and adjoint = t -> t Stdlib.ref -> (t * t) list -> (t * t) list
and register = t list -> t list
and label = string * t list
and op = adjoint * register * label
Core functions
val tag : unit -> int

TODO

val primal : t -> t

TODO

val primal' : t -> t

TODO

val zero : t -> t

TODO

val reset_zero : t -> t

TODO

val tangent : t -> t

TODO

val adjref : t -> t Stdlib.ref

TODO

val adjval : t -> t

TODO

val shape : t -> int array

TODO

val is_float : t -> bool

TODO

val is_arr : t -> bool

TODO

val row_num : t -> int

number of rows

val col_num : t -> int

number of columns

val numel : t -> int

number of elements

val clip_by_value : amin:A.elt -> amax:A.elt -> t -> t

other functions, without tracking gradient

val clip_by_l2norm : A.elt -> t -> t

other functions, without tracking gradient

val copy_primal' : t -> t

TODO

val tile : t -> int array -> t

TODO

val repeat : t -> int array -> t

TODO

val pack_elt : A.elt -> t

convert from elt type to t type.

val unpack_elt : t -> A.elt

convert from t type to elt type.

val pack_flt : float -> t

convert from float type to t type.

val _f : float -> t

A shortcut function for F A.(float_to_elt x).

val unpack_flt : t -> float

convert from t type to float type.

val pack_arr : A.arr -> t

convert from arr type to t type.

val unpack_arr : t -> A.arr

convert from t type to arr type.

val deep_info : t -> string

TODO

val type_info : t -> string

TODO

val error_binop : string -> t -> t -> 'a

TODO

val error_uniop : string -> t -> 'a

TODO

val reverse_add : t -> t -> t
+C (owl-base.Owl_algodiff_reverse.Make.C)

Parameter Make.C

include Owl_algodiff_core_sig.Sig
Type definition
include Owl_algodiff_types_sig.Sig with type elt := A.elt and type arr := A.arr
type t =
  1. | F of A.elt
  2. | Arr of A.arr
  3. | DF of t * t * int
  4. | DR of t * t Stdlib.ref * op * int Stdlib.ref * int * int Stdlib.ref
and adjoint = t -> t Stdlib.ref -> (t * t) list -> (t * t) list
and register = t list -> t list
and label = string * t list
and op = adjoint * register * label
Core functions
val tag : unit -> int

start global tagging counter

val primal : t -> t

get primal component of DF or DR type

val primal' : t -> t

iteratively get primal component of DF or DR type until the component itself is not DF/DR

val zero : t -> t

return a zero value, which type decided by the input value

val reset_zero : t -> t

reset_zero x iteratively resets all elements included in x

val tangent : t -> t

get the tangent component of input, if the data type is suitable

val adjref : t -> t Stdlib.ref

get the adjref component of input, if the data type is suitable

val adjval : t -> t

get the adjval component of input, if the data type is suitableTODO

val shape : t -> int array

get the shape of primal' value of input

val is_float : t -> bool

check if input is of float value; if input is of type DF/DR, check its primal' value

val is_arr : t -> bool

check if input is of ndarray value; if input is of type DF/DR, check its primal' value

val row_num : t -> int

get the shape of primal' value of input; and then get the first dimension

val col_num : t -> int

get the shape of primal' value of input; and then get the second dimension

val numel : t -> int

for ndarray type input, return its total number of elements.

val clip_by_value : amin:A.elt -> amax:A.elt -> t -> t

other functions, without tracking gradient

val clip_by_l2norm : A.elt -> t -> t

other functions, without tracking gradient

val copy_primal' : t -> t

if primal' value of input is ndarray, copy its value in a new AD type ndarray

val tile : t -> int array -> t

if primal' value of input is ndarray, apply the tile function

val repeat : t -> int array -> t

if primal' value of input is ndarray, apply the repeat function

val pack_elt : A.elt -> t

convert from elt type to t type.

val unpack_elt : t -> A.elt

convert from t type to elt type.

val pack_flt : float -> t

convert from float type to t type.

val _f : float -> t

A shortcut function for F A.(float_to_elt x).

val unpack_flt : t -> float

convert from t type to float type.

val pack_arr : A.arr -> t

convert from arr type to t type.

val unpack_arr : t -> A.arr

convert from t type to arr type.

val deep_info : t -> string
val type_info : t -> string
val error_binop : string -> t -> t -> 'a
val error_uniop : string -> t -> 'a
val reverse_add : t -> t -> t
diff --git a/docs/owl-base/Owl_computation_cpu_engine/Make_Nested/argument-1-Graph/Optimiser/Operator/Symbol/Shape/Type/Device/index.html b/docs/owl-base/Owl_computation_cpu_engine/Make_Nested/argument-1-Graph/Optimiser/Operator/Symbol/Shape/Type/Device/index.html index 428d80057..963bdad87 100644 --- a/docs/owl-base/Owl_computation_cpu_engine/Make_Nested/argument-1-Graph/Optimiser/Operator/Symbol/Shape/Type/Device/index.html +++ b/docs/owl-base/Owl_computation_cpu_engine/Make_Nested/argument-1-Graph/Optimiser/Operator/Symbol/Shape/Type/Device/index.html @@ -1,2 +1,2 @@ -Device (owl-base.Owl_computation_cpu_engine.Make_Nested.Graph.Optimiser.Operator.Symbol.Shape.Type.Device)

Module Type.Device

Type definition
type device

TODO

type value

TODO

Core functions
val make_device : unit -> device

TODO

val arr_to_value : A.arr -> value

TODO

val value_to_arr : value -> A.arr

TODO

val elt_to_value : A.elt -> value

TODO

val value_to_elt : value -> A.elt

TODO

val value_to_float : value -> float

TODO

val is_arr : value -> bool

TODO

val is_elt : value -> bool

TODO

+Device (owl-base.Owl_computation_cpu_engine.Make_Nested.Graph.Optimiser.Operator.Symbol.Shape.Type.Device)

Module Type.Device

Type definition
type device
type value
Core functions
val make_device : unit -> device
val arr_to_value : A.arr -> value
val value_to_arr : value -> A.arr
val elt_to_value : A.elt -> value
val value_to_elt : value -> A.elt
val value_to_float : value -> float
val is_arr : value -> bool
val is_elt : value -> bool
diff --git a/docs/owl-base/Owl_computation_cpu_engine/Make_Nested/argument-1-Graph/Optimiser/Operator/Symbol/index.html b/docs/owl-base/Owl_computation_cpu_engine/Make_Nested/argument-1-Graph/Optimiser/Operator/Symbol/index.html index 9b54a442b..f7c8aacee 100644 --- a/docs/owl-base/Owl_computation_cpu_engine/Make_Nested/argument-1-Graph/Optimiser/Operator/Symbol/index.html +++ b/docs/owl-base/Owl_computation_cpu_engine/Make_Nested/argument-1-Graph/Optimiser/Operator/Symbol/index.html @@ -1,5 +1,5 @@ -Symbol (owl-base.Owl_computation_cpu_engine.Make_Nested.Graph.Optimiser.Operator.Symbol)

Module Operator.Symbol

Core functions
val op_to_str : Shape.Type.op -> string

TODO

val is_random_variable : Shape.Type.op -> bool

TODO

val refnum : 'a Owl_graph.node -> int

TODO

val node_shape : Shape.Type.attr Owl_graph.node -> int array

TODO

val node_numel : Shape.Type.attr Owl_graph.node -> int

TODO

val is_shape_unknown : Shape.Type.attr Owl_graph.node -> bool

TODO

val infer_shape_graph : Shape.Type.attr Owl_graph.node array -> unit

TODO

val shape_to_str : int array option array -> string

TODO

val node_to_str : Shape.Type.attr Owl_graph.node -> string

TODO

val node_to_arr : Shape.Type.t -> Shape.Type.arr

TODO

val arr_to_node : Shape.Type.arr -> Shape.Type.t

TODO

val node_to_elt : Shape.Type.t -> Shape.Type.elt

TODO

val elt_to_node : Shape.Type.elt -> Shape.Type.t

TODO

val make_node : +Symbol (owl-base.Owl_computation_cpu_engine.Make_Nested.Graph.Optimiser.Operator.Symbol)

Module Operator.Symbol

Core functions
val op_to_str : Shape.Type.op -> string

return the name of the operator as string

val is_random_variable : Shape.Type.op -> bool

check if operator is randon variable

val refnum : 'a Owl_graph.node -> int

return the reference number of the given node

val node_shape : Shape.Type.attr Owl_graph.node -> int array

return the shape of a node

val node_numel : Shape.Type.attr Owl_graph.node -> int

return the number of elements of a node

val is_shape_unknown : Shape.Type.attr Owl_graph.node -> bool

check if the shape of the input node is unknown

val infer_shape_graph : Shape.Type.attr Owl_graph.node array -> unit

automatically infer the shape of input node according to its descendents' shapes

val shape_to_str : int array option array -> string

helper function; return the input array in string format.

val node_to_str : Shape.Type.attr Owl_graph.node -> string

print node's information to string

val node_to_arr : Shape.Type.t -> Shape.Type.arr

Wrap computation graph node in an array type

val arr_to_node : Shape.Type.arr -> Shape.Type.t

Unwrap the array type to get the computation graph node within

val node_to_elt : Shape.Type.t -> Shape.Type.elt

Wrap computation graph node in an Elt type

val elt_to_node : Shape.Type.elt -> Shape.Type.t

Unwrap the Elt type to get the computation graph node within

val make_node : ?name:string -> ?value:Shape.Type.Device.value array -> ?shape:int array option array -> @@ -7,11 +7,11 @@ ?reuse:bool -> ?state:Shape.Type.state -> Shape.Type.op -> - Shape.Type.attr Owl_graph.node

TODO

val make_then_connect : + Shape.Type.attr Owl_graph.node

crate a computation graph node

val make_then_connect : ?shape:int array option array -> Shape.Type.op -> Shape.Type.attr Owl_graph.node array -> - Shape.Type.attr Owl_graph.node

TODO

val var_arr : ?shape:int array -> string -> Shape.Type.arr

TODO

val var_elt : string -> Shape.Type.elt

TODO

val const_arr : string -> Shape.Type.Device.A.arr -> Shape.Type.arr

TODO

val const_elt : string -> Shape.Type.Device.A.elt -> Shape.Type.elt

TODO

val new_block_id : unit -> int

new_block_id () returns an unused block id.

val make_empty_block : ?block_id:int -> int -> Shape.Type.block

make_empty_block s returns an empty block of memory of size s.

val make_value_block : + Shape.Type.attr Owl_graph.node

make nodes and then connect parents and children

val var_arr : ?shape:int array -> string -> Shape.Type.arr

creat a node and wrap in Arr type

val var_elt : string -> Shape.Type.elt

creat a node and wrap in Elt type

val const_arr : string -> Shape.Type.Device.A.arr -> Shape.Type.arr

get ndarray value from input and create an node and wrap in Arr type

val const_elt : string -> Shape.Type.Device.A.elt -> Shape.Type.elt

get value from input and create an node and wrap in Elt type

val new_block_id : unit -> int

new_block_id () returns an unused block id.

val make_empty_block : ?block_id:int -> int -> Shape.Type.block

make_empty_block s returns an empty block of memory of size s.

val make_value_block : Shape.Type.Device.value -> Shape.Type.attr Owl_graph.node -> unit

make_value_block value node creates a block of memory initialised with value and links the new block to node.

get_block node returns the memory block allocated to node. If no block is allocated, throws an exception.

val add_node_to_block : @@ -23,6 +23,6 @@ unit

Update the node that is currently using the block of memory.

val get_block_id : Shape.Type.attr Owl_graph.node -> int

get_block_id node returns the id of the block assigned to node. If node has not been assigned yet, returns -1.

val set_value : Shape.Type.attr Owl_graph.node -> Shape.Type.Device.value array -> - unit

TODO

val set_operator : Shape.Type.attr Owl_graph.node -> Shape.Type.op -> unit

TODO

TODO

val set_reuse : Shape.Type.attr Owl_graph.node -> bool -> unit

TODO

val get_reuse : Shape.Type.attr Owl_graph.node -> bool

TODO

val is_shared : Shape.Type.attr Owl_graph.node -> bool

TODO

val get_shared_nodes : + unit

set the arrays of value to cgraph node

get the arrays of value of cgraph node

val set_operator : Shape.Type.attr Owl_graph.node -> Shape.Type.op -> unit

set the operator of cgraph node

get the operator of cgraph node

val set_reuse : Shape.Type.attr Owl_graph.node -> bool -> unit

set reuse attribute in a node

val get_reuse : Shape.Type.attr Owl_graph.node -> bool

get reuse attribute in a node

val is_shared : Shape.Type.attr Owl_graph.node -> bool

check of the data block of memory is shared in a node

get_shared_nodes node returns the nodes sharing the same block of memory as node.

val is_var : Shape.Type.attr Owl_graph.node -> bool

TODO

val is_const : Shape.Type.attr Owl_graph.node -> bool

TODO

val is_node_arr : Shape.Type.attr Owl_graph.node -> bool

TODO

val is_node_elt : Shape.Type.attr Owl_graph.node -> bool

TODO

val is_assigned : Shape.Type.attr Owl_graph.node -> bool

is_assigned node checks if a block of memory has been assigned to node.

val check_assigned : Shape.Type.attr Owl_graph.node -> unit

check_assigned node throws an exception if node has not been assigned to a block.

val is_valid : Shape.Type.attr Owl_graph.node -> bool

TODO

val validate : Shape.Type.attr Owl_graph.node -> unit

TODO

val invalidate : Shape.Type.attr Owl_graph.node -> unit

TODO

val invalidate_graph : Shape.Type.attr Owl_graph.node -> unit

TODO

val is_freeze : Shape.Type.attr Owl_graph.node -> bool

TODO

val freeze : Shape.Type.attr Owl_graph.node -> unit

TODO

val freeze_descendants : Shape.Type.attr Owl_graph.node array -> unit

TODO

val freeze_ancestors : Shape.Type.attr Owl_graph.node array -> unit

TODO

TODO

TODO

val unsafe_assign_arr : Shape.Type.arr -> Shape.Type.Device.A.arr -> unit

TODO

val assign_arr : Shape.Type.arr -> Shape.Type.Device.A.arr -> unit

TODO

val assign_elt : Shape.Type.elt -> Shape.Type.Device.A.elt -> unit

TODO

val float_to_elt : float -> Shape.Type.elt

TODO

val elt_to_float : Shape.Type.elt -> float

TODO

+ Shape.Type.attr Owl_graph.node array

get_shared_nodes node returns the nodes sharing the same block of memory as node.

val is_var : Shape.Type.attr Owl_graph.node -> bool

check if the node's operator is Var type

val is_const : Shape.Type.attr Owl_graph.node -> bool

check if the node's operator is Const type

val is_node_arr : Shape.Type.attr Owl_graph.node -> bool

check the shape of a node's attr and return if it indicates an ndarray

val is_node_elt : Shape.Type.attr Owl_graph.node -> bool

check the shape of a node's attr and return if it indicates an elt

val is_assigned : Shape.Type.attr Owl_graph.node -> bool

is_assigned node checks if a block of memory has been assigned to node.

val check_assigned : Shape.Type.attr Owl_graph.node -> unit

check_assigned node throws an exception if node has not been assigned to a block.

val is_valid : Shape.Type.attr Owl_graph.node -> bool

check if the state attribute of a node is Valid

val validate : Shape.Type.attr Owl_graph.node -> unit

set Valid to the state attribute of a node

val invalidate : Shape.Type.attr Owl_graph.node -> unit

set Invalid to the state attribute of a node

val invalidate_graph : Shape.Type.attr Owl_graph.node -> unit

iteratively invalidate the nodes in a graph

val is_freeze : Shape.Type.attr Owl_graph.node -> bool

check the freeze attribute of a node

val freeze : Shape.Type.attr Owl_graph.node -> unit

return the freeze attribute of a node

val freeze_descendants : Shape.Type.attr Owl_graph.node array -> unit

iteratively freeze the descendants of a node

val freeze_ancestors : Shape.Type.attr Owl_graph.node array -> unit

iteratively freeze the ancestors of a node

pack an A.arr type input into Arr type

unpack input into A.arr type

pack an A.elt type input into Elt type

unpack input into A.elt type

val unsafe_assign_arr : Shape.Type.arr -> Shape.Type.Device.A.arr -> unit

assign Arr type value

val assign_arr : Shape.Type.arr -> Shape.Type.Device.A.arr -> unit

assign Arr type value

val assign_elt : Shape.Type.elt -> Shape.Type.Device.A.elt -> unit

assign Elt type value

val float_to_elt : float -> Shape.Type.elt

build an Elt type based on float value

val elt_to_float : Shape.Type.elt -> float

retrive a float value from an Elt type value

diff --git a/docs/owl-base/Owl_computation_cpu_engine/Make_Nested/argument-1-Graph/index.html b/docs/owl-base/Owl_computation_cpu_engine/Make_Nested/argument-1-Graph/index.html index 1959f41bc..ebe242204 100644 --- a/docs/owl-base/Owl_computation_cpu_engine/Make_Nested/argument-1-Graph/index.html +++ b/docs/owl-base/Owl_computation_cpu_engine/Make_Nested/argument-1-Graph/index.html @@ -1,33 +1,33 @@ -Graph (owl-base.Owl_computation_cpu_engine.Make_Nested.Graph)

Parameter Make_Nested.Graph

Type definition
type graph

TODO

Core functions
val shape_or_value : Optimiser.Operator.Symbol.Shape.Type.t -> string

TODO

val graph_to_dot : graph -> string

TODO

val graph_to_trace : graph -> string

TODO

val save_graph : 'a -> string -> unit

TODO

val load_graph : string -> 'a * 'b

TODO

val collect_rvs : +Graph (owl-base.Owl_computation_cpu_engine.Make_Nested.Graph)

Parameter Make_Nested.Graph

Type definition
type graph
Core functions
val shape_or_value : Optimiser.Operator.Symbol.Shape.Type.t -> string

print shape for ndarrays, whilst value for scalars

val graph_to_dot : graph -> string

generate a string that can be written to a .dot file to draw the graph

val graph_to_trace : graph -> string

print the graph structure to a string

val save_graph : 'a -> string -> unit

save the graph object to a file with given name, using marshall format

val load_graph : string -> 'a * 'b

load the graph object from a file with given name

val invalidate_rvs : graph -> unit

TODO

traverse each node in the input array, and return the random variable type nodes.

val invalidate_rvs : graph -> unit

TODO

val get_inputs : + graph

Build a graph based on input nodes, output nodes, and graph name

get input nodes of a graph

get output nodes of a graph

val set_node_elt_val : + unit
val is_iopair_safe : 'a Owl_graph.node -> 'a Owl_graph.node -> bool

TODO

val make_iopair : + unit
val is_iopair_safe : 'a Owl_graph.node -> 'a Owl_graph.node -> bool
val update_iopair : graph -> unit

TODO

val remove_unused_iopair : + unit

create an iopair between the input nodes and output nodes in a graph

val update_iopair : graph -> unit
val remove_unused_iopair : 'a Owl_graph.node array -> 'b array -> - 'a Owl_graph.node array * 'b array

TODO

val init_inputs : + 'a Owl_graph.node array * 'b array

remove unuserd iopair from an array of nodes

val optimise : graph -> unit

TODO

+ unit

initialize inputs nodes of a graph with given function f

val optimise : graph -> unit

optimise the graph structure

diff --git a/docs/owl-base/Owl_computation_cpu_eval/Make/argument-1-Graph/Optimiser/Operator/Symbol/Shape/Type/Device/index.html b/docs/owl-base/Owl_computation_cpu_eval/Make/argument-1-Graph/Optimiser/Operator/Symbol/Shape/Type/Device/index.html index 993055c56..fcdbc912a 100644 --- a/docs/owl-base/Owl_computation_cpu_eval/Make/argument-1-Graph/Optimiser/Operator/Symbol/Shape/Type/Device/index.html +++ b/docs/owl-base/Owl_computation_cpu_eval/Make/argument-1-Graph/Optimiser/Operator/Symbol/Shape/Type/Device/index.html @@ -1,2 +1,2 @@ -Device (owl-base.Owl_computation_cpu_eval.Make.Graph.Optimiser.Operator.Symbol.Shape.Type.Device)

Module Type.Device

Type definition
type device

TODO

type value

TODO

Core functions
val make_device : unit -> device

TODO

val arr_to_value : A.arr -> value

TODO

val value_to_arr : value -> A.arr

TODO

val elt_to_value : A.elt -> value

TODO

val value_to_elt : value -> A.elt

TODO

val value_to_float : value -> float

TODO

val is_arr : value -> bool

TODO

val is_elt : value -> bool

TODO

+Device (owl-base.Owl_computation_cpu_eval.Make.Graph.Optimiser.Operator.Symbol.Shape.Type.Device)

Module Type.Device

Type definition
type device
type value
Core functions
val make_device : unit -> device
val arr_to_value : A.arr -> value
val value_to_arr : value -> A.arr
val elt_to_value : A.elt -> value
val value_to_elt : value -> A.elt
val value_to_float : value -> float
val is_arr : value -> bool
val is_elt : value -> bool
diff --git a/docs/owl-base/Owl_computation_cpu_eval/Make/argument-1-Graph/Optimiser/Operator/Symbol/index.html b/docs/owl-base/Owl_computation_cpu_eval/Make/argument-1-Graph/Optimiser/Operator/Symbol/index.html index 0436531cd..a9e81ec71 100644 --- a/docs/owl-base/Owl_computation_cpu_eval/Make/argument-1-Graph/Optimiser/Operator/Symbol/index.html +++ b/docs/owl-base/Owl_computation_cpu_eval/Make/argument-1-Graph/Optimiser/Operator/Symbol/index.html @@ -1,5 +1,5 @@ -Symbol (owl-base.Owl_computation_cpu_eval.Make.Graph.Optimiser.Operator.Symbol)

Module Operator.Symbol

Core functions
val op_to_str : Shape.Type.op -> string

TODO

val is_random_variable : Shape.Type.op -> bool

TODO

val refnum : 'a Owl_graph.node -> int

TODO

val node_shape : Shape.Type.attr Owl_graph.node -> int array

TODO

val node_numel : Shape.Type.attr Owl_graph.node -> int

TODO

val is_shape_unknown : Shape.Type.attr Owl_graph.node -> bool

TODO

val infer_shape_graph : Shape.Type.attr Owl_graph.node array -> unit

TODO

val shape_to_str : int array option array -> string

TODO

val node_to_str : Shape.Type.attr Owl_graph.node -> string

TODO

val node_to_arr : Shape.Type.t -> Shape.Type.arr

TODO

val arr_to_node : Shape.Type.arr -> Shape.Type.t

TODO

val node_to_elt : Shape.Type.t -> Shape.Type.elt

TODO

val elt_to_node : Shape.Type.elt -> Shape.Type.t

TODO

val make_node : +Symbol (owl-base.Owl_computation_cpu_eval.Make.Graph.Optimiser.Operator.Symbol)

Module Operator.Symbol

Core functions
val op_to_str : Shape.Type.op -> string

return the name of the operator as string

val is_random_variable : Shape.Type.op -> bool

check if operator is randon variable

val refnum : 'a Owl_graph.node -> int

return the reference number of the given node

val node_shape : Shape.Type.attr Owl_graph.node -> int array

return the shape of a node

val node_numel : Shape.Type.attr Owl_graph.node -> int

return the number of elements of a node

val is_shape_unknown : Shape.Type.attr Owl_graph.node -> bool

check if the shape of the input node is unknown

val infer_shape_graph : Shape.Type.attr Owl_graph.node array -> unit

automatically infer the shape of input node according to its descendents' shapes

val shape_to_str : int array option array -> string

helper function; return the input array in string format.

val node_to_str : Shape.Type.attr Owl_graph.node -> string

print node's information to string

val node_to_arr : Shape.Type.t -> Shape.Type.arr

Wrap computation graph node in an array type

val arr_to_node : Shape.Type.arr -> Shape.Type.t

Unwrap the array type to get the computation graph node within

val node_to_elt : Shape.Type.t -> Shape.Type.elt

Wrap computation graph node in an Elt type

val elt_to_node : Shape.Type.elt -> Shape.Type.t

Unwrap the Elt type to get the computation graph node within

val make_node : ?name:string -> ?value:Shape.Type.Device.value array -> ?shape:int array option array -> @@ -7,11 +7,11 @@ ?reuse:bool -> ?state:Shape.Type.state -> Shape.Type.op -> - Shape.Type.attr Owl_graph.node

TODO

val make_then_connect : + Shape.Type.attr Owl_graph.node

crate a computation graph node

val make_then_connect : ?shape:int array option array -> Shape.Type.op -> Shape.Type.attr Owl_graph.node array -> - Shape.Type.attr Owl_graph.node

TODO

val var_arr : ?shape:int array -> string -> Shape.Type.arr

TODO

val var_elt : string -> Shape.Type.elt

TODO

val const_arr : string -> Shape.Type.Device.A.arr -> Shape.Type.arr

TODO

val const_elt : string -> Shape.Type.Device.A.elt -> Shape.Type.elt

TODO

val new_block_id : unit -> int

new_block_id () returns an unused block id.

val make_empty_block : ?block_id:int -> int -> Shape.Type.block

make_empty_block s returns an empty block of memory of size s.

val make_value_block : + Shape.Type.attr Owl_graph.node

make nodes and then connect parents and children

val var_arr : ?shape:int array -> string -> Shape.Type.arr

creat a node and wrap in Arr type

val var_elt : string -> Shape.Type.elt

creat a node and wrap in Elt type

val const_arr : string -> Shape.Type.Device.A.arr -> Shape.Type.arr

get ndarray value from input and create an node and wrap in Arr type

val const_elt : string -> Shape.Type.Device.A.elt -> Shape.Type.elt

get value from input and create an node and wrap in Elt type

val new_block_id : unit -> int

new_block_id () returns an unused block id.

val make_empty_block : ?block_id:int -> int -> Shape.Type.block

make_empty_block s returns an empty block of memory of size s.

val make_value_block : Shape.Type.Device.value -> Shape.Type.attr Owl_graph.node -> unit

make_value_block value node creates a block of memory initialised with value and links the new block to node.

get_block node returns the memory block allocated to node. If no block is allocated, throws an exception.

val add_node_to_block : @@ -23,6 +23,6 @@ unit

Update the node that is currently using the block of memory.

val get_block_id : Shape.Type.attr Owl_graph.node -> int

get_block_id node returns the id of the block assigned to node. If node has not been assigned yet, returns -1.

val set_value : Shape.Type.attr Owl_graph.node -> Shape.Type.Device.value array -> - unit

TODO

val set_operator : Shape.Type.attr Owl_graph.node -> Shape.Type.op -> unit

TODO

TODO

val set_reuse : Shape.Type.attr Owl_graph.node -> bool -> unit

TODO

val get_reuse : Shape.Type.attr Owl_graph.node -> bool

TODO

val is_shared : Shape.Type.attr Owl_graph.node -> bool

TODO

val get_shared_nodes : + unit

set the arrays of value to cgraph node

get the arrays of value of cgraph node

val set_operator : Shape.Type.attr Owl_graph.node -> Shape.Type.op -> unit

set the operator of cgraph node

get the operator of cgraph node

val set_reuse : Shape.Type.attr Owl_graph.node -> bool -> unit

set reuse attribute in a node

val get_reuse : Shape.Type.attr Owl_graph.node -> bool

get reuse attribute in a node

val is_shared : Shape.Type.attr Owl_graph.node -> bool

check of the data block of memory is shared in a node

get_shared_nodes node returns the nodes sharing the same block of memory as node.

val is_var : Shape.Type.attr Owl_graph.node -> bool

TODO

val is_const : Shape.Type.attr Owl_graph.node -> bool

TODO

val is_node_arr : Shape.Type.attr Owl_graph.node -> bool

TODO

val is_node_elt : Shape.Type.attr Owl_graph.node -> bool

TODO

val is_assigned : Shape.Type.attr Owl_graph.node -> bool

is_assigned node checks if a block of memory has been assigned to node.

val check_assigned : Shape.Type.attr Owl_graph.node -> unit

check_assigned node throws an exception if node has not been assigned to a block.

val is_valid : Shape.Type.attr Owl_graph.node -> bool

TODO

val validate : Shape.Type.attr Owl_graph.node -> unit

TODO

val invalidate : Shape.Type.attr Owl_graph.node -> unit

TODO

val invalidate_graph : Shape.Type.attr Owl_graph.node -> unit

TODO

val is_freeze : Shape.Type.attr Owl_graph.node -> bool

TODO

val freeze : Shape.Type.attr Owl_graph.node -> unit

TODO

val freeze_descendants : Shape.Type.attr Owl_graph.node array -> unit

TODO

val freeze_ancestors : Shape.Type.attr Owl_graph.node array -> unit

TODO

TODO

TODO

val unsafe_assign_arr : Shape.Type.arr -> Shape.Type.Device.A.arr -> unit

TODO

val assign_arr : Shape.Type.arr -> Shape.Type.Device.A.arr -> unit

TODO

val assign_elt : Shape.Type.elt -> Shape.Type.Device.A.elt -> unit

TODO

val float_to_elt : float -> Shape.Type.elt

TODO

val elt_to_float : Shape.Type.elt -> float

TODO

+ Shape.Type.attr Owl_graph.node array

get_shared_nodes node returns the nodes sharing the same block of memory as node.

val is_var : Shape.Type.attr Owl_graph.node -> bool

check if the node's operator is Var type

val is_const : Shape.Type.attr Owl_graph.node -> bool

check if the node's operator is Const type

val is_node_arr : Shape.Type.attr Owl_graph.node -> bool

check the shape of a node's attr and return if it indicates an ndarray

val is_node_elt : Shape.Type.attr Owl_graph.node -> bool

check the shape of a node's attr and return if it indicates an elt

val is_assigned : Shape.Type.attr Owl_graph.node -> bool

is_assigned node checks if a block of memory has been assigned to node.

val check_assigned : Shape.Type.attr Owl_graph.node -> unit

check_assigned node throws an exception if node has not been assigned to a block.

val is_valid : Shape.Type.attr Owl_graph.node -> bool

check if the state attribute of a node is Valid

val validate : Shape.Type.attr Owl_graph.node -> unit

set Valid to the state attribute of a node

val invalidate : Shape.Type.attr Owl_graph.node -> unit

set Invalid to the state attribute of a node

val invalidate_graph : Shape.Type.attr Owl_graph.node -> unit

iteratively invalidate the nodes in a graph

val is_freeze : Shape.Type.attr Owl_graph.node -> bool

check the freeze attribute of a node

val freeze : Shape.Type.attr Owl_graph.node -> unit

return the freeze attribute of a node

val freeze_descendants : Shape.Type.attr Owl_graph.node array -> unit

iteratively freeze the descendants of a node

val freeze_ancestors : Shape.Type.attr Owl_graph.node array -> unit

iteratively freeze the ancestors of a node

pack an A.arr type input into Arr type

unpack input into A.arr type

pack an A.elt type input into Elt type

unpack input into A.elt type

val unsafe_assign_arr : Shape.Type.arr -> Shape.Type.Device.A.arr -> unit

assign Arr type value

val assign_arr : Shape.Type.arr -> Shape.Type.Device.A.arr -> unit

assign Arr type value

val assign_elt : Shape.Type.elt -> Shape.Type.Device.A.elt -> unit

assign Elt type value

val float_to_elt : float -> Shape.Type.elt

build an Elt type based on float value

val elt_to_float : Shape.Type.elt -> float

retrive a float value from an Elt type value

diff --git a/docs/owl-base/Owl_computation_cpu_eval/Make/argument-1-Graph/index.html b/docs/owl-base/Owl_computation_cpu_eval/Make/argument-1-Graph/index.html index 16220fff3..0a45e105e 100644 --- a/docs/owl-base/Owl_computation_cpu_eval/Make/argument-1-Graph/index.html +++ b/docs/owl-base/Owl_computation_cpu_eval/Make/argument-1-Graph/index.html @@ -1,33 +1,33 @@ -Graph (owl-base.Owl_computation_cpu_eval.Make.Graph)

Parameter Make.Graph

Type definition
type graph

TODO

Core functions
val shape_or_value : Optimiser.Operator.Symbol.Shape.Type.t -> string

TODO

val graph_to_dot : graph -> string

TODO

val graph_to_trace : graph -> string

TODO

val save_graph : 'a -> string -> unit

TODO

val load_graph : string -> 'a * 'b

TODO

val collect_rvs : +Graph (owl-base.Owl_computation_cpu_eval.Make.Graph)

Parameter Make.Graph

Type definition
type graph
Core functions
val shape_or_value : Optimiser.Operator.Symbol.Shape.Type.t -> string

print shape for ndarrays, whilst value for scalars

val graph_to_dot : graph -> string

generate a string that can be written to a .dot file to draw the graph

val graph_to_trace : graph -> string

print the graph structure to a string

val save_graph : 'a -> string -> unit

save the graph object to a file with given name, using marshall format

val load_graph : string -> 'a * 'b

load the graph object from a file with given name

val invalidate_rvs : graph -> unit

TODO

traverse each node in the input array, and return the random variable type nodes.

val invalidate_rvs : graph -> unit

TODO

val get_inputs : + graph

Build a graph based on input nodes, output nodes, and graph name

get input nodes of a graph

get output nodes of a graph

val set_node_elt_val : + unit
val is_iopair_safe : 'a Owl_graph.node -> 'a Owl_graph.node -> bool

TODO

val make_iopair : + unit
val is_iopair_safe : 'a Owl_graph.node -> 'a Owl_graph.node -> bool
val update_iopair : graph -> unit

TODO

val remove_unused_iopair : + unit

create an iopair between the input nodes and output nodes in a graph

val update_iopair : graph -> unit
val remove_unused_iopair : 'a Owl_graph.node array -> 'b array -> - 'a Owl_graph.node array * 'b array

TODO

val init_inputs : + 'a Owl_graph.node array * 'b array

remove unuserd iopair from an array of nodes

val optimise : graph -> unit

TODO

+ unit

initialize inputs nodes of a graph with given function f

val optimise : graph -> unit

optimise the graph structure

diff --git a/docs/owl-base/Owl_computation_cpu_init/Make/argument-1-Graph/Optimiser/Operator/Symbol/Shape/Type/Device/index.html b/docs/owl-base/Owl_computation_cpu_init/Make/argument-1-Graph/Optimiser/Operator/Symbol/Shape/Type/Device/index.html index 7920378fd..5238a2d8c 100644 --- a/docs/owl-base/Owl_computation_cpu_init/Make/argument-1-Graph/Optimiser/Operator/Symbol/Shape/Type/Device/index.html +++ b/docs/owl-base/Owl_computation_cpu_init/Make/argument-1-Graph/Optimiser/Operator/Symbol/Shape/Type/Device/index.html @@ -1,2 +1,2 @@ -Device (owl-base.Owl_computation_cpu_init.Make.Graph.Optimiser.Operator.Symbol.Shape.Type.Device)

Module Type.Device

Type definition
type device

TODO

type value

TODO

Core functions
val make_device : unit -> device

TODO

val arr_to_value : A.arr -> value

TODO

val value_to_arr : value -> A.arr

TODO

val elt_to_value : A.elt -> value

TODO

val value_to_elt : value -> A.elt

TODO

val value_to_float : value -> float

TODO

val is_arr : value -> bool

TODO

val is_elt : value -> bool

TODO

+Device (owl-base.Owl_computation_cpu_init.Make.Graph.Optimiser.Operator.Symbol.Shape.Type.Device)

Module Type.Device

Type definition
type device
type value
Core functions
val make_device : unit -> device
val arr_to_value : A.arr -> value
val value_to_arr : value -> A.arr
val elt_to_value : A.elt -> value
val value_to_elt : value -> A.elt
val value_to_float : value -> float
val is_arr : value -> bool
val is_elt : value -> bool
diff --git a/docs/owl-base/Owl_computation_cpu_init/Make/argument-1-Graph/Optimiser/Operator/Symbol/index.html b/docs/owl-base/Owl_computation_cpu_init/Make/argument-1-Graph/Optimiser/Operator/Symbol/index.html index 0b1f16889..374916467 100644 --- a/docs/owl-base/Owl_computation_cpu_init/Make/argument-1-Graph/Optimiser/Operator/Symbol/index.html +++ b/docs/owl-base/Owl_computation_cpu_init/Make/argument-1-Graph/Optimiser/Operator/Symbol/index.html @@ -1,5 +1,5 @@ -Symbol (owl-base.Owl_computation_cpu_init.Make.Graph.Optimiser.Operator.Symbol)

Module Operator.Symbol

Core functions
val op_to_str : Shape.Type.op -> string

TODO

val is_random_variable : Shape.Type.op -> bool

TODO

val refnum : 'a Owl_graph.node -> int

TODO

val node_shape : Shape.Type.attr Owl_graph.node -> int array

TODO

val node_numel : Shape.Type.attr Owl_graph.node -> int

TODO

val is_shape_unknown : Shape.Type.attr Owl_graph.node -> bool

TODO

val infer_shape_graph : Shape.Type.attr Owl_graph.node array -> unit

TODO

val shape_to_str : int array option array -> string

TODO

val node_to_str : Shape.Type.attr Owl_graph.node -> string

TODO

val node_to_arr : Shape.Type.t -> Shape.Type.arr

TODO

val arr_to_node : Shape.Type.arr -> Shape.Type.t

TODO

val node_to_elt : Shape.Type.t -> Shape.Type.elt

TODO

val elt_to_node : Shape.Type.elt -> Shape.Type.t

TODO

val make_node : +Symbol (owl-base.Owl_computation_cpu_init.Make.Graph.Optimiser.Operator.Symbol)

Module Operator.Symbol

Core functions
val op_to_str : Shape.Type.op -> string

return the name of the operator as string

val is_random_variable : Shape.Type.op -> bool

check if operator is randon variable

val refnum : 'a Owl_graph.node -> int

return the reference number of the given node

val node_shape : Shape.Type.attr Owl_graph.node -> int array

return the shape of a node

val node_numel : Shape.Type.attr Owl_graph.node -> int

return the number of elements of a node

val is_shape_unknown : Shape.Type.attr Owl_graph.node -> bool

check if the shape of the input node is unknown

val infer_shape_graph : Shape.Type.attr Owl_graph.node array -> unit

automatically infer the shape of input node according to its descendents' shapes

val shape_to_str : int array option array -> string

helper function; return the input array in string format.

val node_to_str : Shape.Type.attr Owl_graph.node -> string

print node's information to string

val node_to_arr : Shape.Type.t -> Shape.Type.arr

Wrap computation graph node in an array type

val arr_to_node : Shape.Type.arr -> Shape.Type.t

Unwrap the array type to get the computation graph node within

val node_to_elt : Shape.Type.t -> Shape.Type.elt

Wrap computation graph node in an Elt type

val elt_to_node : Shape.Type.elt -> Shape.Type.t

Unwrap the Elt type to get the computation graph node within

val make_node : ?name:string -> ?value:Shape.Type.Device.value array -> ?shape:int array option array -> @@ -7,11 +7,11 @@ ?reuse:bool -> ?state:Shape.Type.state -> Shape.Type.op -> - Shape.Type.attr Owl_graph.node

TODO

val make_then_connect : + Shape.Type.attr Owl_graph.node

crate a computation graph node

val make_then_connect : ?shape:int array option array -> Shape.Type.op -> Shape.Type.attr Owl_graph.node array -> - Shape.Type.attr Owl_graph.node

TODO

val var_arr : ?shape:int array -> string -> Shape.Type.arr

TODO

val var_elt : string -> Shape.Type.elt

TODO

val const_arr : string -> Shape.Type.Device.A.arr -> Shape.Type.arr

TODO

val const_elt : string -> Shape.Type.Device.A.elt -> Shape.Type.elt

TODO

val new_block_id : unit -> int

new_block_id () returns an unused block id.

val make_empty_block : ?block_id:int -> int -> Shape.Type.block

make_empty_block s returns an empty block of memory of size s.

val make_value_block : + Shape.Type.attr Owl_graph.node

make nodes and then connect parents and children

val var_arr : ?shape:int array -> string -> Shape.Type.arr

creat a node and wrap in Arr type

val var_elt : string -> Shape.Type.elt

creat a node and wrap in Elt type

val const_arr : string -> Shape.Type.Device.A.arr -> Shape.Type.arr

get ndarray value from input and create an node and wrap in Arr type

val const_elt : string -> Shape.Type.Device.A.elt -> Shape.Type.elt

get value from input and create an node and wrap in Elt type

val new_block_id : unit -> int

new_block_id () returns an unused block id.

val make_empty_block : ?block_id:int -> int -> Shape.Type.block

make_empty_block s returns an empty block of memory of size s.

val make_value_block : Shape.Type.Device.value -> Shape.Type.attr Owl_graph.node -> unit

make_value_block value node creates a block of memory initialised with value and links the new block to node.

get_block node returns the memory block allocated to node. If no block is allocated, throws an exception.

val add_node_to_block : @@ -23,6 +23,6 @@ unit

Update the node that is currently using the block of memory.

val get_block_id : Shape.Type.attr Owl_graph.node -> int

get_block_id node returns the id of the block assigned to node. If node has not been assigned yet, returns -1.

val set_value : Shape.Type.attr Owl_graph.node -> Shape.Type.Device.value array -> - unit

TODO

val set_operator : Shape.Type.attr Owl_graph.node -> Shape.Type.op -> unit

TODO

TODO

val set_reuse : Shape.Type.attr Owl_graph.node -> bool -> unit

TODO

val get_reuse : Shape.Type.attr Owl_graph.node -> bool

TODO

val is_shared : Shape.Type.attr Owl_graph.node -> bool

TODO

val get_shared_nodes : + unit

set the arrays of value to cgraph node

get the arrays of value of cgraph node

val set_operator : Shape.Type.attr Owl_graph.node -> Shape.Type.op -> unit

set the operator of cgraph node

get the operator of cgraph node

val set_reuse : Shape.Type.attr Owl_graph.node -> bool -> unit

set reuse attribute in a node

val get_reuse : Shape.Type.attr Owl_graph.node -> bool

get reuse attribute in a node

val is_shared : Shape.Type.attr Owl_graph.node -> bool

check of the data block of memory is shared in a node

get_shared_nodes node returns the nodes sharing the same block of memory as node.

val is_var : Shape.Type.attr Owl_graph.node -> bool

TODO

val is_const : Shape.Type.attr Owl_graph.node -> bool

TODO

val is_node_arr : Shape.Type.attr Owl_graph.node -> bool

TODO

val is_node_elt : Shape.Type.attr Owl_graph.node -> bool

TODO

val is_assigned : Shape.Type.attr Owl_graph.node -> bool

is_assigned node checks if a block of memory has been assigned to node.

val check_assigned : Shape.Type.attr Owl_graph.node -> unit

check_assigned node throws an exception if node has not been assigned to a block.

val is_valid : Shape.Type.attr Owl_graph.node -> bool

TODO

val validate : Shape.Type.attr Owl_graph.node -> unit

TODO

val invalidate : Shape.Type.attr Owl_graph.node -> unit

TODO

val invalidate_graph : Shape.Type.attr Owl_graph.node -> unit

TODO

val is_freeze : Shape.Type.attr Owl_graph.node -> bool

TODO

val freeze : Shape.Type.attr Owl_graph.node -> unit

TODO

val freeze_descendants : Shape.Type.attr Owl_graph.node array -> unit

TODO

val freeze_ancestors : Shape.Type.attr Owl_graph.node array -> unit

TODO

TODO

TODO

val unsafe_assign_arr : Shape.Type.arr -> Shape.Type.Device.A.arr -> unit

TODO

val assign_arr : Shape.Type.arr -> Shape.Type.Device.A.arr -> unit

TODO

val assign_elt : Shape.Type.elt -> Shape.Type.Device.A.elt -> unit

TODO

val float_to_elt : float -> Shape.Type.elt

TODO

val elt_to_float : Shape.Type.elt -> float

TODO

+ Shape.Type.attr Owl_graph.node array

get_shared_nodes node returns the nodes sharing the same block of memory as node.

val is_var : Shape.Type.attr Owl_graph.node -> bool

check if the node's operator is Var type

val is_const : Shape.Type.attr Owl_graph.node -> bool

check if the node's operator is Const type

val is_node_arr : Shape.Type.attr Owl_graph.node -> bool

check the shape of a node's attr and return if it indicates an ndarray

val is_node_elt : Shape.Type.attr Owl_graph.node -> bool

check the shape of a node's attr and return if it indicates an elt

val is_assigned : Shape.Type.attr Owl_graph.node -> bool

is_assigned node checks if a block of memory has been assigned to node.

val check_assigned : Shape.Type.attr Owl_graph.node -> unit

check_assigned node throws an exception if node has not been assigned to a block.

val is_valid : Shape.Type.attr Owl_graph.node -> bool

check if the state attribute of a node is Valid

val validate : Shape.Type.attr Owl_graph.node -> unit

set Valid to the state attribute of a node

val invalidate : Shape.Type.attr Owl_graph.node -> unit

set Invalid to the state attribute of a node

val invalidate_graph : Shape.Type.attr Owl_graph.node -> unit

iteratively invalidate the nodes in a graph

val is_freeze : Shape.Type.attr Owl_graph.node -> bool

check the freeze attribute of a node

val freeze : Shape.Type.attr Owl_graph.node -> unit

return the freeze attribute of a node

val freeze_descendants : Shape.Type.attr Owl_graph.node array -> unit

iteratively freeze the descendants of a node

val freeze_ancestors : Shape.Type.attr Owl_graph.node array -> unit

iteratively freeze the ancestors of a node

pack an A.arr type input into Arr type

unpack input into A.arr type

pack an A.elt type input into Elt type

unpack input into A.elt type

val unsafe_assign_arr : Shape.Type.arr -> Shape.Type.Device.A.arr -> unit

assign Arr type value

val assign_arr : Shape.Type.arr -> Shape.Type.Device.A.arr -> unit

assign Arr type value

val assign_elt : Shape.Type.elt -> Shape.Type.Device.A.elt -> unit

assign Elt type value

val float_to_elt : float -> Shape.Type.elt

build an Elt type based on float value

val elt_to_float : Shape.Type.elt -> float

retrive a float value from an Elt type value

diff --git a/docs/owl-base/Owl_computation_cpu_init/Make/argument-1-Graph/index.html b/docs/owl-base/Owl_computation_cpu_init/Make/argument-1-Graph/index.html index 1a47efab4..eb7644c5f 100644 --- a/docs/owl-base/Owl_computation_cpu_init/Make/argument-1-Graph/index.html +++ b/docs/owl-base/Owl_computation_cpu_init/Make/argument-1-Graph/index.html @@ -1,33 +1,33 @@ -Graph (owl-base.Owl_computation_cpu_init.Make.Graph)

Parameter Make.Graph

Type definition
type graph

TODO

Core functions
val shape_or_value : Optimiser.Operator.Symbol.Shape.Type.t -> string

TODO

val graph_to_dot : graph -> string

TODO

val graph_to_trace : graph -> string

TODO

val save_graph : 'a -> string -> unit

TODO

val load_graph : string -> 'a * 'b

TODO

val collect_rvs : +Graph (owl-base.Owl_computation_cpu_init.Make.Graph)

Parameter Make.Graph

Type definition
type graph
Core functions
val shape_or_value : Optimiser.Operator.Symbol.Shape.Type.t -> string

print shape for ndarrays, whilst value for scalars

val graph_to_dot : graph -> string

generate a string that can be written to a .dot file to draw the graph

val graph_to_trace : graph -> string

print the graph structure to a string

val save_graph : 'a -> string -> unit

save the graph object to a file with given name, using marshall format

val load_graph : string -> 'a * 'b

load the graph object from a file with given name

val invalidate_rvs : graph -> unit

TODO

traverse each node in the input array, and return the random variable type nodes.

val invalidate_rvs : graph -> unit

TODO

val get_inputs : + graph

Build a graph based on input nodes, output nodes, and graph name

get input nodes of a graph

get output nodes of a graph

val set_node_elt_val : + unit
val is_iopair_safe : 'a Owl_graph.node -> 'a Owl_graph.node -> bool

TODO

val make_iopair : + unit
val is_iopair_safe : 'a Owl_graph.node -> 'a Owl_graph.node -> bool
val update_iopair : graph -> unit

TODO

val remove_unused_iopair : + unit

create an iopair between the input nodes and output nodes in a graph

val update_iopair : graph -> unit
val remove_unused_iopair : 'a Owl_graph.node array -> 'b array -> - 'a Owl_graph.node array * 'b array

TODO

val init_inputs : + 'a Owl_graph.node array * 'b array

remove unuserd iopair from an array of nodes

val optimise : graph -> unit

TODO

+ unit

initialize inputs nodes of a graph with given function f

val optimise : graph -> unit

optimise the graph structure

diff --git a/docs/owl-base/Owl_computation_engine/Flatten/argument-1-Engine/Graph/Optimiser/Operator/Symbol/Shape/Type/Device/index.html b/docs/owl-base/Owl_computation_engine/Flatten/argument-1-Engine/Graph/Optimiser/Operator/Symbol/Shape/Type/Device/index.html index be6e51a1b..c3770504c 100644 --- a/docs/owl-base/Owl_computation_engine/Flatten/argument-1-Engine/Graph/Optimiser/Operator/Symbol/Shape/Type/Device/index.html +++ b/docs/owl-base/Owl_computation_engine/Flatten/argument-1-Engine/Graph/Optimiser/Operator/Symbol/Shape/Type/Device/index.html @@ -1,2 +1,2 @@ -Device (owl-base.Owl_computation_engine.Flatten.Engine.Graph.Optimiser.Operator.Symbol.Shape.Type.Device)

Module Type.Device

Type definition
type device

TODO

type value

TODO

Core functions
val make_device : unit -> device

TODO

val arr_to_value : A.arr -> value

TODO

val value_to_arr : value -> A.arr

TODO

val elt_to_value : A.elt -> value

TODO

val value_to_elt : value -> A.elt

TODO

val value_to_float : value -> float

TODO

val is_arr : value -> bool

TODO

val is_elt : value -> bool

TODO

+Device (owl-base.Owl_computation_engine.Flatten.Engine.Graph.Optimiser.Operator.Symbol.Shape.Type.Device)

Module Type.Device

Type definition
type device
type value
Core functions
val make_device : unit -> device
val arr_to_value : A.arr -> value
val value_to_arr : value -> A.arr
val elt_to_value : A.elt -> value
val value_to_elt : value -> A.elt
val value_to_float : value -> float
val is_arr : value -> bool
val is_elt : value -> bool
diff --git a/docs/owl-base/Owl_computation_engine/Flatten/argument-1-Engine/Graph/Optimiser/Operator/Symbol/index.html b/docs/owl-base/Owl_computation_engine/Flatten/argument-1-Engine/Graph/Optimiser/Operator/Symbol/index.html index b01e8c043..1a1549d88 100644 --- a/docs/owl-base/Owl_computation_engine/Flatten/argument-1-Engine/Graph/Optimiser/Operator/Symbol/index.html +++ b/docs/owl-base/Owl_computation_engine/Flatten/argument-1-Engine/Graph/Optimiser/Operator/Symbol/index.html @@ -1,5 +1,5 @@ -Symbol (owl-base.Owl_computation_engine.Flatten.Engine.Graph.Optimiser.Operator.Symbol)

Module Operator.Symbol

Core functions
val op_to_str : Shape.Type.op -> string

TODO

val is_random_variable : Shape.Type.op -> bool

TODO

val refnum : 'a Owl_graph.node -> int

TODO

val node_shape : Shape.Type.attr Owl_graph.node -> int array

TODO

val node_numel : Shape.Type.attr Owl_graph.node -> int

TODO

val is_shape_unknown : Shape.Type.attr Owl_graph.node -> bool

TODO

val infer_shape_graph : Shape.Type.attr Owl_graph.node array -> unit

TODO

val shape_to_str : int array option array -> string

TODO

val node_to_str : Shape.Type.attr Owl_graph.node -> string

TODO

val node_to_arr : Shape.Type.t -> Shape.Type.arr

TODO

val arr_to_node : Shape.Type.arr -> Shape.Type.t

TODO

val node_to_elt : Shape.Type.t -> Shape.Type.elt

TODO

val elt_to_node : Shape.Type.elt -> Shape.Type.t

TODO

val make_node : +Symbol (owl-base.Owl_computation_engine.Flatten.Engine.Graph.Optimiser.Operator.Symbol)

Module Operator.Symbol

Core functions
val op_to_str : Shape.Type.op -> string

return the name of the operator as string

val is_random_variable : Shape.Type.op -> bool

check if operator is randon variable

val refnum : 'a Owl_graph.node -> int

return the reference number of the given node

val node_shape : Shape.Type.attr Owl_graph.node -> int array

return the shape of a node

val node_numel : Shape.Type.attr Owl_graph.node -> int

return the number of elements of a node

val is_shape_unknown : Shape.Type.attr Owl_graph.node -> bool

check if the shape of the input node is unknown

val infer_shape_graph : Shape.Type.attr Owl_graph.node array -> unit

automatically infer the shape of input node according to its descendents' shapes

val shape_to_str : int array option array -> string

helper function; return the input array in string format.

val node_to_str : Shape.Type.attr Owl_graph.node -> string

print node's information to string

val node_to_arr : Shape.Type.t -> Shape.Type.arr

Wrap computation graph node in an array type

val arr_to_node : Shape.Type.arr -> Shape.Type.t

Unwrap the array type to get the computation graph node within

val node_to_elt : Shape.Type.t -> Shape.Type.elt

Wrap computation graph node in an Elt type

val elt_to_node : Shape.Type.elt -> Shape.Type.t

Unwrap the Elt type to get the computation graph node within

val make_node : ?name:string -> ?value:Shape.Type.Device.value array -> ?shape:int array option array -> @@ -7,11 +7,11 @@ ?reuse:bool -> ?state:Shape.Type.state -> Shape.Type.op -> - Shape.Type.attr Owl_graph.node

TODO

val make_then_connect : + Shape.Type.attr Owl_graph.node

crate a computation graph node

val make_then_connect : ?shape:int array option array -> Shape.Type.op -> Shape.Type.attr Owl_graph.node array -> - Shape.Type.attr Owl_graph.node

TODO

val var_arr : ?shape:int array -> string -> Shape.Type.arr

TODO

val var_elt : string -> Shape.Type.elt

TODO

val const_arr : string -> Shape.Type.Device.A.arr -> Shape.Type.arr

TODO

val const_elt : string -> Shape.Type.Device.A.elt -> Shape.Type.elt

TODO

val new_block_id : unit -> int

new_block_id () returns an unused block id.

val make_empty_block : ?block_id:int -> int -> Shape.Type.block

make_empty_block s returns an empty block of memory of size s.

val make_value_block : + Shape.Type.attr Owl_graph.node

make nodes and then connect parents and children

val var_arr : ?shape:int array -> string -> Shape.Type.arr

creat a node and wrap in Arr type

val var_elt : string -> Shape.Type.elt

creat a node and wrap in Elt type

val const_arr : string -> Shape.Type.Device.A.arr -> Shape.Type.arr

get ndarray value from input and create an node and wrap in Arr type

val const_elt : string -> Shape.Type.Device.A.elt -> Shape.Type.elt

get value from input and create an node and wrap in Elt type

val new_block_id : unit -> int

new_block_id () returns an unused block id.

val make_empty_block : ?block_id:int -> int -> Shape.Type.block

make_empty_block s returns an empty block of memory of size s.

val make_value_block : Shape.Type.Device.value -> Shape.Type.attr Owl_graph.node -> unit

make_value_block value node creates a block of memory initialised with value and links the new block to node.

get_block node returns the memory block allocated to node. If no block is allocated, throws an exception.

val add_node_to_block : @@ -23,6 +23,6 @@ unit

Update the node that is currently using the block of memory.

val get_block_id : Shape.Type.attr Owl_graph.node -> int

get_block_id node returns the id of the block assigned to node. If node has not been assigned yet, returns -1.

val set_value : Shape.Type.attr Owl_graph.node -> Shape.Type.Device.value array -> - unit

TODO

val set_operator : Shape.Type.attr Owl_graph.node -> Shape.Type.op -> unit

TODO

TODO

val set_reuse : Shape.Type.attr Owl_graph.node -> bool -> unit

TODO

val get_reuse : Shape.Type.attr Owl_graph.node -> bool

TODO

val is_shared : Shape.Type.attr Owl_graph.node -> bool

TODO

val get_shared_nodes : + unit

set the arrays of value to cgraph node

get the arrays of value of cgraph node

val set_operator : Shape.Type.attr Owl_graph.node -> Shape.Type.op -> unit

set the operator of cgraph node

get the operator of cgraph node

val set_reuse : Shape.Type.attr Owl_graph.node -> bool -> unit

set reuse attribute in a node

val get_reuse : Shape.Type.attr Owl_graph.node -> bool

get reuse attribute in a node

val is_shared : Shape.Type.attr Owl_graph.node -> bool

check of the data block of memory is shared in a node

get_shared_nodes node returns the nodes sharing the same block of memory as node.

val is_var : Shape.Type.attr Owl_graph.node -> bool

TODO

val is_const : Shape.Type.attr Owl_graph.node -> bool

TODO

val is_node_arr : Shape.Type.attr Owl_graph.node -> bool

TODO

val is_node_elt : Shape.Type.attr Owl_graph.node -> bool

TODO

val is_assigned : Shape.Type.attr Owl_graph.node -> bool

is_assigned node checks if a block of memory has been assigned to node.

val check_assigned : Shape.Type.attr Owl_graph.node -> unit

check_assigned node throws an exception if node has not been assigned to a block.

val is_valid : Shape.Type.attr Owl_graph.node -> bool

TODO

val validate : Shape.Type.attr Owl_graph.node -> unit

TODO

val invalidate : Shape.Type.attr Owl_graph.node -> unit

TODO

val invalidate_graph : Shape.Type.attr Owl_graph.node -> unit

TODO

val is_freeze : Shape.Type.attr Owl_graph.node -> bool

TODO

val freeze : Shape.Type.attr Owl_graph.node -> unit

TODO

val freeze_descendants : Shape.Type.attr Owl_graph.node array -> unit

TODO

val freeze_ancestors : Shape.Type.attr Owl_graph.node array -> unit

TODO

TODO

TODO

val unsafe_assign_arr : Shape.Type.arr -> Shape.Type.Device.A.arr -> unit

TODO

val assign_arr : Shape.Type.arr -> Shape.Type.Device.A.arr -> unit

TODO

val assign_elt : Shape.Type.elt -> Shape.Type.Device.A.elt -> unit

TODO

val float_to_elt : float -> Shape.Type.elt

TODO

val elt_to_float : Shape.Type.elt -> float

TODO

+ Shape.Type.attr Owl_graph.node array

get_shared_nodes node returns the nodes sharing the same block of memory as node.

val is_var : Shape.Type.attr Owl_graph.node -> bool

check if the node's operator is Var type

val is_const : Shape.Type.attr Owl_graph.node -> bool

check if the node's operator is Const type

val is_node_arr : Shape.Type.attr Owl_graph.node -> bool

check the shape of a node's attr and return if it indicates an ndarray

val is_node_elt : Shape.Type.attr Owl_graph.node -> bool

check the shape of a node's attr and return if it indicates an elt

val is_assigned : Shape.Type.attr Owl_graph.node -> bool

is_assigned node checks if a block of memory has been assigned to node.

val check_assigned : Shape.Type.attr Owl_graph.node -> unit

check_assigned node throws an exception if node has not been assigned to a block.

val is_valid : Shape.Type.attr Owl_graph.node -> bool

check if the state attribute of a node is Valid

val validate : Shape.Type.attr Owl_graph.node -> unit

set Valid to the state attribute of a node

val invalidate : Shape.Type.attr Owl_graph.node -> unit

set Invalid to the state attribute of a node

val invalidate_graph : Shape.Type.attr Owl_graph.node -> unit

iteratively invalidate the nodes in a graph

val is_freeze : Shape.Type.attr Owl_graph.node -> bool

check the freeze attribute of a node

val freeze : Shape.Type.attr Owl_graph.node -> unit

return the freeze attribute of a node

val freeze_descendants : Shape.Type.attr Owl_graph.node array -> unit

iteratively freeze the descendants of a node

val freeze_ancestors : Shape.Type.attr Owl_graph.node array -> unit

iteratively freeze the ancestors of a node

pack an A.arr type input into Arr type

unpack input into A.arr type

pack an A.elt type input into Elt type

unpack input into A.elt type

val unsafe_assign_arr : Shape.Type.arr -> Shape.Type.Device.A.arr -> unit

assign Arr type value

val assign_arr : Shape.Type.arr -> Shape.Type.Device.A.arr -> unit

assign Arr type value

val assign_elt : Shape.Type.elt -> Shape.Type.Device.A.elt -> unit

assign Elt type value

val float_to_elt : float -> Shape.Type.elt

build an Elt type based on float value

val elt_to_float : Shape.Type.elt -> float

retrive a float value from an Elt type value

diff --git a/docs/owl-base/Owl_computation_engine/Flatten/argument-1-Engine/Graph/index.html b/docs/owl-base/Owl_computation_engine/Flatten/argument-1-Engine/Graph/index.html index 22380e708..eb03bf8ed 100644 --- a/docs/owl-base/Owl_computation_engine/Flatten/argument-1-Engine/Graph/index.html +++ b/docs/owl-base/Owl_computation_engine/Flatten/argument-1-Engine/Graph/index.html @@ -1,33 +1,33 @@ -Graph (owl-base.Owl_computation_engine.Flatten.Engine.Graph)

Module Engine.Graph

Type definition
type graph

TODO

Core functions
val shape_or_value : Optimiser.Operator.Symbol.Shape.Type.t -> string

TODO

val graph_to_dot : graph -> string

TODO

val graph_to_trace : graph -> string

TODO

val save_graph : 'a -> string -> unit

TODO

val load_graph : string -> 'a * 'b

TODO

val collect_rvs : +Graph (owl-base.Owl_computation_engine.Flatten.Engine.Graph)

Module Engine.Graph

Type definition
type graph
Core functions
val shape_or_value : Optimiser.Operator.Symbol.Shape.Type.t -> string

print shape for ndarrays, whilst value for scalars

val graph_to_dot : graph -> string

generate a string that can be written to a .dot file to draw the graph

val graph_to_trace : graph -> string

print the graph structure to a string

val save_graph : 'a -> string -> unit

save the graph object to a file with given name, using marshall format

val load_graph : string -> 'a * 'b

load the graph object from a file with given name

val invalidate_rvs : graph -> unit

TODO

traverse each node in the input array, and return the random variable type nodes.

val invalidate_rvs : graph -> unit

TODO

val get_inputs : + graph

Build a graph based on input nodes, output nodes, and graph name

get input nodes of a graph

get output nodes of a graph

val set_node_elt_val : + unit
val is_iopair_safe : 'a Owl_graph.node -> 'a Owl_graph.node -> bool

TODO

val make_iopair : + unit
val is_iopair_safe : 'a Owl_graph.node -> 'a Owl_graph.node -> bool
val update_iopair : graph -> unit

TODO

val remove_unused_iopair : + unit

create an iopair between the input nodes and output nodes in a graph

val update_iopair : graph -> unit
val remove_unused_iopair : 'a Owl_graph.node array -> 'b array -> - 'a Owl_graph.node array * 'b array

TODO

val init_inputs : + 'a Owl_graph.node array * 'b array

remove unuserd iopair from an array of nodes

val optimise : graph -> unit

TODO

+ unit

initialize inputs nodes of a graph with given function f

val optimise : graph -> unit

optimise the graph structure

diff --git a/docs/owl-base/Owl_computation_engine/Make_Graph/argument-1-Device/index.html b/docs/owl-base/Owl_computation_engine/Make_Graph/argument-1-Device/index.html index b97fb1fcd..f878eb075 100644 --- a/docs/owl-base/Owl_computation_engine/Make_Graph/argument-1-Device/index.html +++ b/docs/owl-base/Owl_computation_engine/Make_Graph/argument-1-Device/index.html @@ -1,2 +1,2 @@ -Device (owl-base.Owl_computation_engine.Make_Graph.Device)

Parameter Make_Graph.Device

Type definition
type device

TODO

type value

TODO

Core functions
val make_device : unit -> device

TODO

val arr_to_value : A.arr -> value

TODO

val value_to_arr : value -> A.arr

TODO

val elt_to_value : A.elt -> value

TODO

val value_to_elt : value -> A.elt

TODO

val value_to_float : value -> float

TODO

val is_arr : value -> bool

TODO

val is_elt : value -> bool

TODO

+Device (owl-base.Owl_computation_engine.Make_Graph.Device)

Parameter Make_Graph.Device

Type definition
type device
type value
Core functions
val make_device : unit -> device
val arr_to_value : A.arr -> value
val value_to_arr : value -> A.arr
val elt_to_value : A.elt -> value
val value_to_elt : value -> A.elt
val value_to_float : value -> float
val is_arr : value -> bool
val is_elt : value -> bool
diff --git a/docs/owl-base/Owl_computation_engine_sig/module-type-Flatten_Sig/Device/index.html b/docs/owl-base/Owl_computation_engine_sig/module-type-Flatten_Sig/Device/index.html index 5efb3e620..e2c71f230 100644 --- a/docs/owl-base/Owl_computation_engine_sig/module-type-Flatten_Sig/Device/index.html +++ b/docs/owl-base/Owl_computation_engine_sig/module-type-Flatten_Sig/Device/index.html @@ -1,2 +1,2 @@ -Device (owl-base.Owl_computation_engine_sig.Flatten_Sig.Device)

Module Flatten_Sig.Device

Type definition
type device

TODO

type value

TODO

Core functions
val make_device : unit -> device

TODO

val arr_to_value : A.arr -> value

TODO

val value_to_arr : value -> A.arr

TODO

val elt_to_value : A.elt -> value

TODO

val value_to_elt : value -> A.elt

TODO

val value_to_float : value -> float

TODO

val is_arr : value -> bool

TODO

val is_elt : value -> bool

TODO

+Device (owl-base.Owl_computation_engine_sig.Flatten_Sig.Device)

Module Flatten_Sig.Device

Type definition
type device
type value
Core functions
val make_device : unit -> device
val arr_to_value : A.arr -> value
val value_to_arr : value -> A.arr
val elt_to_value : A.elt -> value
val value_to_elt : value -> A.elt
val value_to_float : value -> float
val is_arr : value -> bool
val is_elt : value -> bool
diff --git a/docs/owl-base/Owl_computation_engine_sig/module-type-Flatten_Sig/Graph/Optimiser/Operator/Symbol/Shape/Type/Device/index.html b/docs/owl-base/Owl_computation_engine_sig/module-type-Flatten_Sig/Graph/Optimiser/Operator/Symbol/Shape/Type/Device/index.html index 2edbdf24f..526d24b6e 100644 --- a/docs/owl-base/Owl_computation_engine_sig/module-type-Flatten_Sig/Graph/Optimiser/Operator/Symbol/Shape/Type/Device/index.html +++ b/docs/owl-base/Owl_computation_engine_sig/module-type-Flatten_Sig/Graph/Optimiser/Operator/Symbol/Shape/Type/Device/index.html @@ -1,2 +1,2 @@ -Device (owl-base.Owl_computation_engine_sig.Flatten_Sig.Graph.Optimiser.Operator.Symbol.Shape.Type.Device)

Module Type.Device

Type definition
type device

TODO

type value

TODO

Core functions
val make_device : unit -> device

TODO

val arr_to_value : A.arr -> value

TODO

val value_to_arr : value -> A.arr

TODO

val elt_to_value : A.elt -> value

TODO

val value_to_elt : value -> A.elt

TODO

val value_to_float : value -> float

TODO

val is_arr : value -> bool

TODO

val is_elt : value -> bool

TODO

+Device (owl-base.Owl_computation_engine_sig.Flatten_Sig.Graph.Optimiser.Operator.Symbol.Shape.Type.Device)

Module Type.Device

Type definition
type device
type value
Core functions
val make_device : unit -> device
val arr_to_value : A.arr -> value
val value_to_arr : value -> A.arr
val elt_to_value : A.elt -> value
val value_to_elt : value -> A.elt
val value_to_float : value -> float
val is_arr : value -> bool
val is_elt : value -> bool
diff --git a/docs/owl-base/Owl_computation_engine_sig/module-type-Flatten_Sig/Graph/Optimiser/Operator/Symbol/index.html b/docs/owl-base/Owl_computation_engine_sig/module-type-Flatten_Sig/Graph/Optimiser/Operator/Symbol/index.html index 6b912ef63..5ddeda9db 100644 --- a/docs/owl-base/Owl_computation_engine_sig/module-type-Flatten_Sig/Graph/Optimiser/Operator/Symbol/index.html +++ b/docs/owl-base/Owl_computation_engine_sig/module-type-Flatten_Sig/Graph/Optimiser/Operator/Symbol/index.html @@ -1,5 +1,5 @@ -Symbol (owl-base.Owl_computation_engine_sig.Flatten_Sig.Graph.Optimiser.Operator.Symbol)

Module Operator.Symbol

Core functions
val op_to_str : Shape.Type.op -> string

TODO

val is_random_variable : Shape.Type.op -> bool

TODO

val refnum : 'a Owl_graph.node -> int

TODO

val node_shape : Shape.Type.attr Owl_graph.node -> int array

TODO

val node_numel : Shape.Type.attr Owl_graph.node -> int

TODO

val is_shape_unknown : Shape.Type.attr Owl_graph.node -> bool

TODO

val infer_shape_graph : Shape.Type.attr Owl_graph.node array -> unit

TODO

val shape_to_str : int array option array -> string

TODO

val node_to_str : Shape.Type.attr Owl_graph.node -> string

TODO

val node_to_arr : Shape.Type.t -> Shape.Type.arr

TODO

val arr_to_node : Shape.Type.arr -> Shape.Type.t

TODO

val node_to_elt : Shape.Type.t -> Shape.Type.elt

TODO

val elt_to_node : Shape.Type.elt -> Shape.Type.t

TODO

val make_node : +Symbol (owl-base.Owl_computation_engine_sig.Flatten_Sig.Graph.Optimiser.Operator.Symbol)

Module Operator.Symbol

Core functions
val op_to_str : Shape.Type.op -> string

return the name of the operator as string

val is_random_variable : Shape.Type.op -> bool

check if operator is randon variable

val refnum : 'a Owl_graph.node -> int

return the reference number of the given node

val node_shape : Shape.Type.attr Owl_graph.node -> int array

return the shape of a node

val node_numel : Shape.Type.attr Owl_graph.node -> int

return the number of elements of a node

val is_shape_unknown : Shape.Type.attr Owl_graph.node -> bool

check if the shape of the input node is unknown

val infer_shape_graph : Shape.Type.attr Owl_graph.node array -> unit

automatically infer the shape of input node according to its descendents' shapes

val shape_to_str : int array option array -> string

helper function; return the input array in string format.

val node_to_str : Shape.Type.attr Owl_graph.node -> string

print node's information to string

val node_to_arr : Shape.Type.t -> Shape.Type.arr

Wrap computation graph node in an array type

val arr_to_node : Shape.Type.arr -> Shape.Type.t

Unwrap the array type to get the computation graph node within

val node_to_elt : Shape.Type.t -> Shape.Type.elt

Wrap computation graph node in an Elt type

val elt_to_node : Shape.Type.elt -> Shape.Type.t

Unwrap the Elt type to get the computation graph node within

val make_node : ?name:string -> ?value:Shape.Type.Device.value array -> ?shape:int array option array -> @@ -7,11 +7,11 @@ ?reuse:bool -> ?state:Shape.Type.state -> Shape.Type.op -> - Shape.Type.attr Owl_graph.node

TODO

val make_then_connect : + Shape.Type.attr Owl_graph.node

crate a computation graph node

val make_then_connect : ?shape:int array option array -> Shape.Type.op -> Shape.Type.attr Owl_graph.node array -> - Shape.Type.attr Owl_graph.node

TODO

val var_arr : ?shape:int array -> string -> Shape.Type.arr

TODO

val var_elt : string -> Shape.Type.elt

TODO

val const_arr : string -> Shape.Type.Device.A.arr -> Shape.Type.arr

TODO

val const_elt : string -> Shape.Type.Device.A.elt -> Shape.Type.elt

TODO

val new_block_id : unit -> int

new_block_id () returns an unused block id.

val make_empty_block : ?block_id:int -> int -> Shape.Type.block

make_empty_block s returns an empty block of memory of size s.

val make_value_block : + Shape.Type.attr Owl_graph.node

make nodes and then connect parents and children

val var_arr : ?shape:int array -> string -> Shape.Type.arr

creat a node and wrap in Arr type

val var_elt : string -> Shape.Type.elt

creat a node and wrap in Elt type

val const_arr : string -> Shape.Type.Device.A.arr -> Shape.Type.arr

get ndarray value from input and create an node and wrap in Arr type

val const_elt : string -> Shape.Type.Device.A.elt -> Shape.Type.elt

get value from input and create an node and wrap in Elt type

val new_block_id : unit -> int

new_block_id () returns an unused block id.

val make_empty_block : ?block_id:int -> int -> Shape.Type.block

make_empty_block s returns an empty block of memory of size s.

val make_value_block : Shape.Type.Device.value -> Shape.Type.attr Owl_graph.node -> unit

make_value_block value node creates a block of memory initialised with value and links the new block to node.

get_block node returns the memory block allocated to node. If no block is allocated, throws an exception.

val add_node_to_block : @@ -23,6 +23,6 @@ unit

Update the node that is currently using the block of memory.

val get_block_id : Shape.Type.attr Owl_graph.node -> int

get_block_id node returns the id of the block assigned to node. If node has not been assigned yet, returns -1.

val set_value : Shape.Type.attr Owl_graph.node -> Shape.Type.Device.value array -> - unit

TODO

val set_operator : Shape.Type.attr Owl_graph.node -> Shape.Type.op -> unit

TODO

TODO

val set_reuse : Shape.Type.attr Owl_graph.node -> bool -> unit

TODO

val get_reuse : Shape.Type.attr Owl_graph.node -> bool

TODO

val is_shared : Shape.Type.attr Owl_graph.node -> bool

TODO

val get_shared_nodes : + unit

set the arrays of value to cgraph node

get the arrays of value of cgraph node

val set_operator : Shape.Type.attr Owl_graph.node -> Shape.Type.op -> unit

set the operator of cgraph node

get the operator of cgraph node

val set_reuse : Shape.Type.attr Owl_graph.node -> bool -> unit

set reuse attribute in a node

val get_reuse : Shape.Type.attr Owl_graph.node -> bool

get reuse attribute in a node

val is_shared : Shape.Type.attr Owl_graph.node -> bool

check of the data block of memory is shared in a node

get_shared_nodes node returns the nodes sharing the same block of memory as node.

val is_var : Shape.Type.attr Owl_graph.node -> bool

TODO

val is_const : Shape.Type.attr Owl_graph.node -> bool

TODO

val is_node_arr : Shape.Type.attr Owl_graph.node -> bool

TODO

val is_node_elt : Shape.Type.attr Owl_graph.node -> bool

TODO

val is_assigned : Shape.Type.attr Owl_graph.node -> bool

is_assigned node checks if a block of memory has been assigned to node.

val check_assigned : Shape.Type.attr Owl_graph.node -> unit

check_assigned node throws an exception if node has not been assigned to a block.

val is_valid : Shape.Type.attr Owl_graph.node -> bool

TODO

val validate : Shape.Type.attr Owl_graph.node -> unit

TODO

val invalidate : Shape.Type.attr Owl_graph.node -> unit

TODO

val invalidate_graph : Shape.Type.attr Owl_graph.node -> unit

TODO

val is_freeze : Shape.Type.attr Owl_graph.node -> bool

TODO

val freeze : Shape.Type.attr Owl_graph.node -> unit

TODO

val freeze_descendants : Shape.Type.attr Owl_graph.node array -> unit

TODO

val freeze_ancestors : Shape.Type.attr Owl_graph.node array -> unit

TODO

TODO

TODO

val unsafe_assign_arr : Shape.Type.arr -> Shape.Type.Device.A.arr -> unit

TODO

val assign_arr : Shape.Type.arr -> Shape.Type.Device.A.arr -> unit

TODO

val assign_elt : Shape.Type.elt -> Shape.Type.Device.A.elt -> unit

TODO

val float_to_elt : float -> Shape.Type.elt

TODO

val elt_to_float : Shape.Type.elt -> float

TODO

+ Shape.Type.attr Owl_graph.node array

get_shared_nodes node returns the nodes sharing the same block of memory as node.

val is_var : Shape.Type.attr Owl_graph.node -> bool

check if the node's operator is Var type

val is_const : Shape.Type.attr Owl_graph.node -> bool

check if the node's operator is Const type

val is_node_arr : Shape.Type.attr Owl_graph.node -> bool

check the shape of a node's attr and return if it indicates an ndarray

val is_node_elt : Shape.Type.attr Owl_graph.node -> bool

check the shape of a node's attr and return if it indicates an elt

val is_assigned : Shape.Type.attr Owl_graph.node -> bool

is_assigned node checks if a block of memory has been assigned to node.

val check_assigned : Shape.Type.attr Owl_graph.node -> unit

check_assigned node throws an exception if node has not been assigned to a block.

val is_valid : Shape.Type.attr Owl_graph.node -> bool

check if the state attribute of a node is Valid

val validate : Shape.Type.attr Owl_graph.node -> unit

set Valid to the state attribute of a node

val invalidate : Shape.Type.attr Owl_graph.node -> unit

set Invalid to the state attribute of a node

val invalidate_graph : Shape.Type.attr Owl_graph.node -> unit

iteratively invalidate the nodes in a graph

val is_freeze : Shape.Type.attr Owl_graph.node -> bool

check the freeze attribute of a node

val freeze : Shape.Type.attr Owl_graph.node -> unit

return the freeze attribute of a node

val freeze_descendants : Shape.Type.attr Owl_graph.node array -> unit

iteratively freeze the descendants of a node

val freeze_ancestors : Shape.Type.attr Owl_graph.node array -> unit

iteratively freeze the ancestors of a node

pack an A.arr type input into Arr type

unpack input into A.arr type

pack an A.elt type input into Elt type

unpack input into A.elt type

val unsafe_assign_arr : Shape.Type.arr -> Shape.Type.Device.A.arr -> unit

assign Arr type value

val assign_arr : Shape.Type.arr -> Shape.Type.Device.A.arr -> unit

assign Arr type value

val assign_elt : Shape.Type.elt -> Shape.Type.Device.A.elt -> unit

assign Elt type value

val float_to_elt : float -> Shape.Type.elt

build an Elt type based on float value

val elt_to_float : Shape.Type.elt -> float

retrive a float value from an Elt type value

diff --git a/docs/owl-base/Owl_computation_engine_sig/module-type-Flatten_Sig/Graph/index.html b/docs/owl-base/Owl_computation_engine_sig/module-type-Flatten_Sig/Graph/index.html index 821791cc0..b9b1ca54e 100644 --- a/docs/owl-base/Owl_computation_engine_sig/module-type-Flatten_Sig/Graph/index.html +++ b/docs/owl-base/Owl_computation_engine_sig/module-type-Flatten_Sig/Graph/index.html @@ -1,33 +1,33 @@ -Graph (owl-base.Owl_computation_engine_sig.Flatten_Sig.Graph)

Module Flatten_Sig.Graph

Type definition
type graph

TODO

Core functions
val shape_or_value : Optimiser.Operator.Symbol.Shape.Type.t -> string

TODO

val graph_to_dot : graph -> string

TODO

val graph_to_trace : graph -> string

TODO

val save_graph : 'a -> string -> unit

TODO

val load_graph : string -> 'a * 'b

TODO

val collect_rvs : +Graph (owl-base.Owl_computation_engine_sig.Flatten_Sig.Graph)

Module Flatten_Sig.Graph

Type definition
type graph
Core functions
val shape_or_value : Optimiser.Operator.Symbol.Shape.Type.t -> string

print shape for ndarrays, whilst value for scalars

val graph_to_dot : graph -> string

generate a string that can be written to a .dot file to draw the graph

val graph_to_trace : graph -> string

print the graph structure to a string

val save_graph : 'a -> string -> unit

save the graph object to a file with given name, using marshall format

val load_graph : string -> 'a * 'b

load the graph object from a file with given name

val invalidate_rvs : graph -> unit

TODO

traverse each node in the input array, and return the random variable type nodes.

val invalidate_rvs : graph -> unit

TODO

val get_inputs : + graph

Build a graph based on input nodes, output nodes, and graph name

get input nodes of a graph

get output nodes of a graph

val set_node_elt_val : + unit
val is_iopair_safe : 'a Owl_graph.node -> 'a Owl_graph.node -> bool

TODO

val make_iopair : + unit
val is_iopair_safe : 'a Owl_graph.node -> 'a Owl_graph.node -> bool
val update_iopair : graph -> unit

TODO

val remove_unused_iopair : + unit

create an iopair between the input nodes and output nodes in a graph

val update_iopair : graph -> unit
val remove_unused_iopair : 'a Owl_graph.node array -> 'b array -> - 'a Owl_graph.node array * 'b array

TODO

val init_inputs : + 'a Owl_graph.node array * 'b array

remove unuserd iopair from an array of nodes

val optimise : graph -> unit

TODO

+ unit

initialize inputs nodes of a graph with given function f

val optimise : graph -> unit

optimise the graph structure

diff --git a/docs/owl-base/Owl_computation_engine_sig/module-type-Flatten_Sig/Operator/Symbol/Shape/Type/Device/index.html b/docs/owl-base/Owl_computation_engine_sig/module-type-Flatten_Sig/Operator/Symbol/Shape/Type/Device/index.html index 68b478432..e11720af2 100644 --- a/docs/owl-base/Owl_computation_engine_sig/module-type-Flatten_Sig/Operator/Symbol/Shape/Type/Device/index.html +++ b/docs/owl-base/Owl_computation_engine_sig/module-type-Flatten_Sig/Operator/Symbol/Shape/Type/Device/index.html @@ -1,2 +1,2 @@ -Device (owl-base.Owl_computation_engine_sig.Flatten_Sig.Operator.Symbol.Shape.Type.Device)

Module Type.Device

Type definition
type device

TODO

type value

TODO

Core functions
val make_device : unit -> device

TODO

val arr_to_value : A.arr -> value

TODO

val value_to_arr : value -> A.arr

TODO

val elt_to_value : A.elt -> value

TODO

val value_to_elt : value -> A.elt

TODO

val value_to_float : value -> float

TODO

val is_arr : value -> bool

TODO

val is_elt : value -> bool

TODO

+Device (owl-base.Owl_computation_engine_sig.Flatten_Sig.Operator.Symbol.Shape.Type.Device)

Module Type.Device

Type definition
type device
type value
Core functions
val make_device : unit -> device
val arr_to_value : A.arr -> value
val value_to_arr : value -> A.arr
val elt_to_value : A.elt -> value
val value_to_elt : value -> A.elt
val value_to_float : value -> float
val is_arr : value -> bool
val is_elt : value -> bool
diff --git a/docs/owl-base/Owl_computation_engine_sig/module-type-Flatten_Sig/Operator/Symbol/index.html b/docs/owl-base/Owl_computation_engine_sig/module-type-Flatten_Sig/Operator/Symbol/index.html index c1aa76362..29415fd82 100644 --- a/docs/owl-base/Owl_computation_engine_sig/module-type-Flatten_Sig/Operator/Symbol/index.html +++ b/docs/owl-base/Owl_computation_engine_sig/module-type-Flatten_Sig/Operator/Symbol/index.html @@ -1,5 +1,5 @@ -Symbol (owl-base.Owl_computation_engine_sig.Flatten_Sig.Operator.Symbol)

Module Operator.Symbol

Core functions
val op_to_str : Shape.Type.op -> string

TODO

val is_random_variable : Shape.Type.op -> bool

TODO

val refnum : 'a Owl_graph.node -> int

TODO

val node_shape : Shape.Type.attr Owl_graph.node -> int array

TODO

val node_numel : Shape.Type.attr Owl_graph.node -> int

TODO

val is_shape_unknown : Shape.Type.attr Owl_graph.node -> bool

TODO

val infer_shape_graph : Shape.Type.attr Owl_graph.node array -> unit

TODO

val shape_to_str : int array option array -> string

TODO

val node_to_str : Shape.Type.attr Owl_graph.node -> string

TODO

val node_to_arr : Shape.Type.t -> Shape.Type.arr

TODO

val arr_to_node : Shape.Type.arr -> Shape.Type.t

TODO

val node_to_elt : Shape.Type.t -> Shape.Type.elt

TODO

val elt_to_node : Shape.Type.elt -> Shape.Type.t

TODO

val make_node : +Symbol (owl-base.Owl_computation_engine_sig.Flatten_Sig.Operator.Symbol)

Module Operator.Symbol

Core functions
val op_to_str : Shape.Type.op -> string

return the name of the operator as string

val is_random_variable : Shape.Type.op -> bool

check if operator is randon variable

val refnum : 'a Owl_graph.node -> int

return the reference number of the given node

val node_shape : Shape.Type.attr Owl_graph.node -> int array

return the shape of a node

val node_numel : Shape.Type.attr Owl_graph.node -> int

return the number of elements of a node

val is_shape_unknown : Shape.Type.attr Owl_graph.node -> bool

check if the shape of the input node is unknown

val infer_shape_graph : Shape.Type.attr Owl_graph.node array -> unit

automatically infer the shape of input node according to its descendents' shapes

val shape_to_str : int array option array -> string

helper function; return the input array in string format.

val node_to_str : Shape.Type.attr Owl_graph.node -> string

print node's information to string

val node_to_arr : Shape.Type.t -> Shape.Type.arr

Wrap computation graph node in an array type

val arr_to_node : Shape.Type.arr -> Shape.Type.t

Unwrap the array type to get the computation graph node within

val node_to_elt : Shape.Type.t -> Shape.Type.elt

Wrap computation graph node in an Elt type

val elt_to_node : Shape.Type.elt -> Shape.Type.t

Unwrap the Elt type to get the computation graph node within

val make_node : ?name:string -> ?value:Shape.Type.Device.value array -> ?shape:int array option array -> @@ -7,11 +7,11 @@ ?reuse:bool -> ?state:Shape.Type.state -> Shape.Type.op -> - Shape.Type.attr Owl_graph.node

TODO

val make_then_connect : + Shape.Type.attr Owl_graph.node

crate a computation graph node

val make_then_connect : ?shape:int array option array -> Shape.Type.op -> Shape.Type.attr Owl_graph.node array -> - Shape.Type.attr Owl_graph.node

TODO

val var_arr : ?shape:int array -> string -> Shape.Type.arr

TODO

val var_elt : string -> Shape.Type.elt

TODO

val const_arr : string -> Shape.Type.Device.A.arr -> Shape.Type.arr

TODO

val const_elt : string -> Shape.Type.Device.A.elt -> Shape.Type.elt

TODO

val new_block_id : unit -> int

new_block_id () returns an unused block id.

val make_empty_block : ?block_id:int -> int -> Shape.Type.block

make_empty_block s returns an empty block of memory of size s.

val make_value_block : + Shape.Type.attr Owl_graph.node

make nodes and then connect parents and children

val var_arr : ?shape:int array -> string -> Shape.Type.arr

creat a node and wrap in Arr type

val var_elt : string -> Shape.Type.elt

creat a node and wrap in Elt type

val const_arr : string -> Shape.Type.Device.A.arr -> Shape.Type.arr

get ndarray value from input and create an node and wrap in Arr type

val const_elt : string -> Shape.Type.Device.A.elt -> Shape.Type.elt

get value from input and create an node and wrap in Elt type

val new_block_id : unit -> int

new_block_id () returns an unused block id.

val make_empty_block : ?block_id:int -> int -> Shape.Type.block

make_empty_block s returns an empty block of memory of size s.

val make_value_block : Shape.Type.Device.value -> Shape.Type.attr Owl_graph.node -> unit

make_value_block value node creates a block of memory initialised with value and links the new block to node.

get_block node returns the memory block allocated to node. If no block is allocated, throws an exception.

val add_node_to_block : @@ -23,6 +23,6 @@ unit

Update the node that is currently using the block of memory.

val get_block_id : Shape.Type.attr Owl_graph.node -> int

get_block_id node returns the id of the block assigned to node. If node has not been assigned yet, returns -1.

val set_value : Shape.Type.attr Owl_graph.node -> Shape.Type.Device.value array -> - unit

TODO

val set_operator : Shape.Type.attr Owl_graph.node -> Shape.Type.op -> unit

TODO

TODO

val set_reuse : Shape.Type.attr Owl_graph.node -> bool -> unit

TODO

val get_reuse : Shape.Type.attr Owl_graph.node -> bool

TODO

val is_shared : Shape.Type.attr Owl_graph.node -> bool

TODO

val get_shared_nodes : + unit

set the arrays of value to cgraph node

get the arrays of value of cgraph node

val set_operator : Shape.Type.attr Owl_graph.node -> Shape.Type.op -> unit

set the operator of cgraph node

get the operator of cgraph node

val set_reuse : Shape.Type.attr Owl_graph.node -> bool -> unit

set reuse attribute in a node

val get_reuse : Shape.Type.attr Owl_graph.node -> bool

get reuse attribute in a node

val is_shared : Shape.Type.attr Owl_graph.node -> bool

check of the data block of memory is shared in a node

get_shared_nodes node returns the nodes sharing the same block of memory as node.

val is_var : Shape.Type.attr Owl_graph.node -> bool

TODO

val is_const : Shape.Type.attr Owl_graph.node -> bool

TODO

val is_node_arr : Shape.Type.attr Owl_graph.node -> bool

TODO

val is_node_elt : Shape.Type.attr Owl_graph.node -> bool

TODO

val is_assigned : Shape.Type.attr Owl_graph.node -> bool

is_assigned node checks if a block of memory has been assigned to node.

val check_assigned : Shape.Type.attr Owl_graph.node -> unit

check_assigned node throws an exception if node has not been assigned to a block.

val is_valid : Shape.Type.attr Owl_graph.node -> bool

TODO

val validate : Shape.Type.attr Owl_graph.node -> unit

TODO

val invalidate : Shape.Type.attr Owl_graph.node -> unit

TODO

val invalidate_graph : Shape.Type.attr Owl_graph.node -> unit

TODO

val is_freeze : Shape.Type.attr Owl_graph.node -> bool

TODO

val freeze : Shape.Type.attr Owl_graph.node -> unit

TODO

val freeze_descendants : Shape.Type.attr Owl_graph.node array -> unit

TODO

val freeze_ancestors : Shape.Type.attr Owl_graph.node array -> unit

TODO

TODO

TODO

val unsafe_assign_arr : Shape.Type.arr -> Shape.Type.Device.A.arr -> unit

TODO

val assign_arr : Shape.Type.arr -> Shape.Type.Device.A.arr -> unit

TODO

val assign_elt : Shape.Type.elt -> Shape.Type.Device.A.elt -> unit

TODO

val float_to_elt : float -> Shape.Type.elt

TODO

val elt_to_float : Shape.Type.elt -> float

TODO

+ Shape.Type.attr Owl_graph.node array

get_shared_nodes node returns the nodes sharing the same block of memory as node.

val is_var : Shape.Type.attr Owl_graph.node -> bool

check if the node's operator is Var type

val is_const : Shape.Type.attr Owl_graph.node -> bool

check if the node's operator is Const type

val is_node_arr : Shape.Type.attr Owl_graph.node -> bool

check the shape of a node's attr and return if it indicates an ndarray

val is_node_elt : Shape.Type.attr Owl_graph.node -> bool

check the shape of a node's attr and return if it indicates an elt

val is_assigned : Shape.Type.attr Owl_graph.node -> bool

is_assigned node checks if a block of memory has been assigned to node.

val check_assigned : Shape.Type.attr Owl_graph.node -> unit

check_assigned node throws an exception if node has not been assigned to a block.

val is_valid : Shape.Type.attr Owl_graph.node -> bool

check if the state attribute of a node is Valid

val validate : Shape.Type.attr Owl_graph.node -> unit

set Valid to the state attribute of a node

val invalidate : Shape.Type.attr Owl_graph.node -> unit

set Invalid to the state attribute of a node

val invalidate_graph : Shape.Type.attr Owl_graph.node -> unit

iteratively invalidate the nodes in a graph

val is_freeze : Shape.Type.attr Owl_graph.node -> bool

check the freeze attribute of a node

val freeze : Shape.Type.attr Owl_graph.node -> unit

return the freeze attribute of a node

val freeze_descendants : Shape.Type.attr Owl_graph.node array -> unit

iteratively freeze the descendants of a node

val freeze_ancestors : Shape.Type.attr Owl_graph.node array -> unit

iteratively freeze the ancestors of a node

pack an A.arr type input into Arr type

unpack input into A.arr type

pack an A.elt type input into Elt type

unpack input into A.elt type

val unsafe_assign_arr : Shape.Type.arr -> Shape.Type.Device.A.arr -> unit

assign Arr type value

val assign_arr : Shape.Type.arr -> Shape.Type.Device.A.arr -> unit

assign Arr type value

val assign_elt : Shape.Type.elt -> Shape.Type.Device.A.elt -> unit

assign Elt type value

val float_to_elt : float -> Shape.Type.elt

build an Elt type based on float value

val elt_to_float : Shape.Type.elt -> float

retrive a float value from an Elt type value

diff --git a/docs/owl-base/Owl_computation_engine_sig/module-type-Flatten_Sig/Optimiser/Operator/Symbol/Shape/Type/Device/index.html b/docs/owl-base/Owl_computation_engine_sig/module-type-Flatten_Sig/Optimiser/Operator/Symbol/Shape/Type/Device/index.html index fed50578a..80f9bcbdd 100644 --- a/docs/owl-base/Owl_computation_engine_sig/module-type-Flatten_Sig/Optimiser/Operator/Symbol/Shape/Type/Device/index.html +++ b/docs/owl-base/Owl_computation_engine_sig/module-type-Flatten_Sig/Optimiser/Operator/Symbol/Shape/Type/Device/index.html @@ -1,2 +1,2 @@ -Device (owl-base.Owl_computation_engine_sig.Flatten_Sig.Optimiser.Operator.Symbol.Shape.Type.Device)

Module Type.Device

Type definition
type device

TODO

type value

TODO

Core functions
val make_device : unit -> device

TODO

val arr_to_value : A.arr -> value

TODO

val value_to_arr : value -> A.arr

TODO

val elt_to_value : A.elt -> value

TODO

val value_to_elt : value -> A.elt

TODO

val value_to_float : value -> float

TODO

val is_arr : value -> bool

TODO

val is_elt : value -> bool

TODO

+Device (owl-base.Owl_computation_engine_sig.Flatten_Sig.Optimiser.Operator.Symbol.Shape.Type.Device)

Module Type.Device

Type definition
type device
type value
Core functions
val make_device : unit -> device
val arr_to_value : A.arr -> value
val value_to_arr : value -> A.arr
val elt_to_value : A.elt -> value
val value_to_elt : value -> A.elt
val value_to_float : value -> float
val is_arr : value -> bool
val is_elt : value -> bool
diff --git a/docs/owl-base/Owl_computation_engine_sig/module-type-Flatten_Sig/Optimiser/Operator/Symbol/index.html b/docs/owl-base/Owl_computation_engine_sig/module-type-Flatten_Sig/Optimiser/Operator/Symbol/index.html index e75127b8c..6c18e1092 100644 --- a/docs/owl-base/Owl_computation_engine_sig/module-type-Flatten_Sig/Optimiser/Operator/Symbol/index.html +++ b/docs/owl-base/Owl_computation_engine_sig/module-type-Flatten_Sig/Optimiser/Operator/Symbol/index.html @@ -1,5 +1,5 @@ -Symbol (owl-base.Owl_computation_engine_sig.Flatten_Sig.Optimiser.Operator.Symbol)

Module Operator.Symbol

Core functions
val op_to_str : Shape.Type.op -> string

TODO

val is_random_variable : Shape.Type.op -> bool

TODO

val refnum : 'a Owl_graph.node -> int

TODO

val node_shape : Shape.Type.attr Owl_graph.node -> int array

TODO

val node_numel : Shape.Type.attr Owl_graph.node -> int

TODO

val is_shape_unknown : Shape.Type.attr Owl_graph.node -> bool

TODO

val infer_shape_graph : Shape.Type.attr Owl_graph.node array -> unit

TODO

val shape_to_str : int array option array -> string

TODO

val node_to_str : Shape.Type.attr Owl_graph.node -> string

TODO

val node_to_arr : Shape.Type.t -> Shape.Type.arr

TODO

val arr_to_node : Shape.Type.arr -> Shape.Type.t

TODO

val node_to_elt : Shape.Type.t -> Shape.Type.elt

TODO

val elt_to_node : Shape.Type.elt -> Shape.Type.t

TODO

val make_node : +Symbol (owl-base.Owl_computation_engine_sig.Flatten_Sig.Optimiser.Operator.Symbol)

Module Operator.Symbol

Core functions
val op_to_str : Shape.Type.op -> string

return the name of the operator as string

val is_random_variable : Shape.Type.op -> bool

check if operator is randon variable

val refnum : 'a Owl_graph.node -> int

return the reference number of the given node

val node_shape : Shape.Type.attr Owl_graph.node -> int array

return the shape of a node

val node_numel : Shape.Type.attr Owl_graph.node -> int

return the number of elements of a node

val is_shape_unknown : Shape.Type.attr Owl_graph.node -> bool

check if the shape of the input node is unknown

val infer_shape_graph : Shape.Type.attr Owl_graph.node array -> unit

automatically infer the shape of input node according to its descendents' shapes

val shape_to_str : int array option array -> string

helper function; return the input array in string format.

val node_to_str : Shape.Type.attr Owl_graph.node -> string

print node's information to string

val node_to_arr : Shape.Type.t -> Shape.Type.arr

Wrap computation graph node in an array type

val arr_to_node : Shape.Type.arr -> Shape.Type.t

Unwrap the array type to get the computation graph node within

val node_to_elt : Shape.Type.t -> Shape.Type.elt

Wrap computation graph node in an Elt type

val elt_to_node : Shape.Type.elt -> Shape.Type.t

Unwrap the Elt type to get the computation graph node within

val make_node : ?name:string -> ?value:Shape.Type.Device.value array -> ?shape:int array option array -> @@ -7,11 +7,11 @@ ?reuse:bool -> ?state:Shape.Type.state -> Shape.Type.op -> - Shape.Type.attr Owl_graph.node

TODO

val make_then_connect : + Shape.Type.attr Owl_graph.node

crate a computation graph node

val make_then_connect : ?shape:int array option array -> Shape.Type.op -> Shape.Type.attr Owl_graph.node array -> - Shape.Type.attr Owl_graph.node

TODO

val var_arr : ?shape:int array -> string -> Shape.Type.arr

TODO

val var_elt : string -> Shape.Type.elt

TODO

val const_arr : string -> Shape.Type.Device.A.arr -> Shape.Type.arr

TODO

val const_elt : string -> Shape.Type.Device.A.elt -> Shape.Type.elt

TODO

val new_block_id : unit -> int

new_block_id () returns an unused block id.

val make_empty_block : ?block_id:int -> int -> Shape.Type.block

make_empty_block s returns an empty block of memory of size s.

val make_value_block : + Shape.Type.attr Owl_graph.node

make nodes and then connect parents and children

val var_arr : ?shape:int array -> string -> Shape.Type.arr

creat a node and wrap in Arr type

val var_elt : string -> Shape.Type.elt

creat a node and wrap in Elt type

val const_arr : string -> Shape.Type.Device.A.arr -> Shape.Type.arr

get ndarray value from input and create an node and wrap in Arr type

val const_elt : string -> Shape.Type.Device.A.elt -> Shape.Type.elt

get value from input and create an node and wrap in Elt type

val new_block_id : unit -> int

new_block_id () returns an unused block id.

val make_empty_block : ?block_id:int -> int -> Shape.Type.block

make_empty_block s returns an empty block of memory of size s.

val make_value_block : Shape.Type.Device.value -> Shape.Type.attr Owl_graph.node -> unit

make_value_block value node creates a block of memory initialised with value and links the new block to node.

get_block node returns the memory block allocated to node. If no block is allocated, throws an exception.

val add_node_to_block : @@ -23,6 +23,6 @@ unit

Update the node that is currently using the block of memory.

val get_block_id : Shape.Type.attr Owl_graph.node -> int

get_block_id node returns the id of the block assigned to node. If node has not been assigned yet, returns -1.

val set_value : Shape.Type.attr Owl_graph.node -> Shape.Type.Device.value array -> - unit

TODO

val set_operator : Shape.Type.attr Owl_graph.node -> Shape.Type.op -> unit

TODO

TODO

val set_reuse : Shape.Type.attr Owl_graph.node -> bool -> unit

TODO

val get_reuse : Shape.Type.attr Owl_graph.node -> bool

TODO

val is_shared : Shape.Type.attr Owl_graph.node -> bool

TODO

val get_shared_nodes : + unit

set the arrays of value to cgraph node

get the arrays of value of cgraph node

val set_operator : Shape.Type.attr Owl_graph.node -> Shape.Type.op -> unit

set the operator of cgraph node

get the operator of cgraph node

val set_reuse : Shape.Type.attr Owl_graph.node -> bool -> unit

set reuse attribute in a node

val get_reuse : Shape.Type.attr Owl_graph.node -> bool

get reuse attribute in a node

val is_shared : Shape.Type.attr Owl_graph.node -> bool

check of the data block of memory is shared in a node

get_shared_nodes node returns the nodes sharing the same block of memory as node.

val is_var : Shape.Type.attr Owl_graph.node -> bool

TODO

val is_const : Shape.Type.attr Owl_graph.node -> bool

TODO

val is_node_arr : Shape.Type.attr Owl_graph.node -> bool

TODO

val is_node_elt : Shape.Type.attr Owl_graph.node -> bool

TODO

val is_assigned : Shape.Type.attr Owl_graph.node -> bool

is_assigned node checks if a block of memory has been assigned to node.

val check_assigned : Shape.Type.attr Owl_graph.node -> unit

check_assigned node throws an exception if node has not been assigned to a block.

val is_valid : Shape.Type.attr Owl_graph.node -> bool

TODO

val validate : Shape.Type.attr Owl_graph.node -> unit

TODO

val invalidate : Shape.Type.attr Owl_graph.node -> unit

TODO

val invalidate_graph : Shape.Type.attr Owl_graph.node -> unit

TODO

val is_freeze : Shape.Type.attr Owl_graph.node -> bool

TODO

val freeze : Shape.Type.attr Owl_graph.node -> unit

TODO

val freeze_descendants : Shape.Type.attr Owl_graph.node array -> unit

TODO

val freeze_ancestors : Shape.Type.attr Owl_graph.node array -> unit

TODO

TODO

TODO

val unsafe_assign_arr : Shape.Type.arr -> Shape.Type.Device.A.arr -> unit

TODO

val assign_arr : Shape.Type.arr -> Shape.Type.Device.A.arr -> unit

TODO

val assign_elt : Shape.Type.elt -> Shape.Type.Device.A.elt -> unit

TODO

val float_to_elt : float -> Shape.Type.elt

TODO

val elt_to_float : Shape.Type.elt -> float

TODO

+ Shape.Type.attr Owl_graph.node array

get_shared_nodes node returns the nodes sharing the same block of memory as node.

val is_var : Shape.Type.attr Owl_graph.node -> bool

check if the node's operator is Var type

val is_const : Shape.Type.attr Owl_graph.node -> bool

check if the node's operator is Const type

val is_node_arr : Shape.Type.attr Owl_graph.node -> bool

check the shape of a node's attr and return if it indicates an ndarray

val is_node_elt : Shape.Type.attr Owl_graph.node -> bool

check the shape of a node's attr and return if it indicates an elt

val is_assigned : Shape.Type.attr Owl_graph.node -> bool

is_assigned node checks if a block of memory has been assigned to node.

val check_assigned : Shape.Type.attr Owl_graph.node -> unit

check_assigned node throws an exception if node has not been assigned to a block.

val is_valid : Shape.Type.attr Owl_graph.node -> bool

check if the state attribute of a node is Valid

val validate : Shape.Type.attr Owl_graph.node -> unit

set Valid to the state attribute of a node

val invalidate : Shape.Type.attr Owl_graph.node -> unit

set Invalid to the state attribute of a node

val invalidate_graph : Shape.Type.attr Owl_graph.node -> unit

iteratively invalidate the nodes in a graph

val is_freeze : Shape.Type.attr Owl_graph.node -> bool

check the freeze attribute of a node

val freeze : Shape.Type.attr Owl_graph.node -> unit

return the freeze attribute of a node

val freeze_descendants : Shape.Type.attr Owl_graph.node array -> unit

iteratively freeze the descendants of a node

val freeze_ancestors : Shape.Type.attr Owl_graph.node array -> unit

iteratively freeze the ancestors of a node

pack an A.arr type input into Arr type

unpack input into A.arr type

pack an A.elt type input into Elt type

unpack input into A.elt type

val unsafe_assign_arr : Shape.Type.arr -> Shape.Type.Device.A.arr -> unit

assign Arr type value

val assign_arr : Shape.Type.arr -> Shape.Type.Device.A.arr -> unit

assign Arr type value

val assign_elt : Shape.Type.elt -> Shape.Type.Device.A.elt -> unit

assign Elt type value

val float_to_elt : float -> Shape.Type.elt

build an Elt type based on float value

val elt_to_float : Shape.Type.elt -> float

retrive a float value from an Elt type value

diff --git a/docs/owl-base/Owl_computation_engine_sig/module-type-Flatten_Sig/Shape/Type/Device/index.html b/docs/owl-base/Owl_computation_engine_sig/module-type-Flatten_Sig/Shape/Type/Device/index.html index 27ca4d181..f3ebeeb18 100644 --- a/docs/owl-base/Owl_computation_engine_sig/module-type-Flatten_Sig/Shape/Type/Device/index.html +++ b/docs/owl-base/Owl_computation_engine_sig/module-type-Flatten_Sig/Shape/Type/Device/index.html @@ -1,2 +1,2 @@ -Device (owl-base.Owl_computation_engine_sig.Flatten_Sig.Shape.Type.Device)

Module Type.Device

Type definition
type device

TODO

type value

TODO

Core functions
val make_device : unit -> device

TODO

val arr_to_value : A.arr -> value

TODO

val value_to_arr : value -> A.arr

TODO

val elt_to_value : A.elt -> value

TODO

val value_to_elt : value -> A.elt

TODO

val value_to_float : value -> float

TODO

val is_arr : value -> bool

TODO

val is_elt : value -> bool

TODO

+Device (owl-base.Owl_computation_engine_sig.Flatten_Sig.Shape.Type.Device)

Module Type.Device

Type definition
type device
type value
Core functions
val make_device : unit -> device
val arr_to_value : A.arr -> value
val value_to_arr : value -> A.arr
val elt_to_value : A.elt -> value
val value_to_elt : value -> A.elt
val value_to_float : value -> float
val is_arr : value -> bool
val is_elt : value -> bool
diff --git a/docs/owl-base/Owl_computation_engine_sig/module-type-Flatten_Sig/Symbol/Shape/Type/Device/index.html b/docs/owl-base/Owl_computation_engine_sig/module-type-Flatten_Sig/Symbol/Shape/Type/Device/index.html index c1f674aa2..9e2670be6 100644 --- a/docs/owl-base/Owl_computation_engine_sig/module-type-Flatten_Sig/Symbol/Shape/Type/Device/index.html +++ b/docs/owl-base/Owl_computation_engine_sig/module-type-Flatten_Sig/Symbol/Shape/Type/Device/index.html @@ -1,2 +1,2 @@ -Device (owl-base.Owl_computation_engine_sig.Flatten_Sig.Symbol.Shape.Type.Device)

Module Type.Device

Type definition
type device

TODO

type value

TODO

Core functions
val make_device : unit -> device

TODO

val arr_to_value : A.arr -> value

TODO

val value_to_arr : value -> A.arr

TODO

val elt_to_value : A.elt -> value

TODO

val value_to_elt : value -> A.elt

TODO

val value_to_float : value -> float

TODO

val is_arr : value -> bool

TODO

val is_elt : value -> bool

TODO

+Device (owl-base.Owl_computation_engine_sig.Flatten_Sig.Symbol.Shape.Type.Device)

Module Type.Device

Type definition
type device
type value
Core functions
val make_device : unit -> device
val arr_to_value : A.arr -> value
val value_to_arr : value -> A.arr
val elt_to_value : A.elt -> value
val value_to_elt : value -> A.elt
val value_to_float : value -> float
val is_arr : value -> bool
val is_elt : value -> bool
diff --git a/docs/owl-base/Owl_computation_engine_sig/module-type-Flatten_Sig/Symbol/index.html b/docs/owl-base/Owl_computation_engine_sig/module-type-Flatten_Sig/Symbol/index.html index a1945f241..a951eac7c 100644 --- a/docs/owl-base/Owl_computation_engine_sig/module-type-Flatten_Sig/Symbol/index.html +++ b/docs/owl-base/Owl_computation_engine_sig/module-type-Flatten_Sig/Symbol/index.html @@ -1,5 +1,5 @@ -Symbol (owl-base.Owl_computation_engine_sig.Flatten_Sig.Symbol)

Module Flatten_Sig.Symbol

Core functions
val op_to_str : Shape.Type.op -> string

TODO

val is_random_variable : Shape.Type.op -> bool

TODO

val refnum : 'a Owl_graph.node -> int

TODO

val node_shape : Shape.Type.attr Owl_graph.node -> int array

TODO

val node_numel : Shape.Type.attr Owl_graph.node -> int

TODO

val is_shape_unknown : Shape.Type.attr Owl_graph.node -> bool

TODO

val infer_shape_graph : Shape.Type.attr Owl_graph.node array -> unit

TODO

val shape_to_str : int array option array -> string

TODO

val node_to_str : Shape.Type.attr Owl_graph.node -> string

TODO

val node_to_arr : Shape.Type.t -> Shape.Type.arr

TODO

val arr_to_node : Shape.Type.arr -> Shape.Type.t

TODO

val node_to_elt : Shape.Type.t -> Shape.Type.elt

TODO

val elt_to_node : Shape.Type.elt -> Shape.Type.t

TODO

val make_node : +Symbol (owl-base.Owl_computation_engine_sig.Flatten_Sig.Symbol)

Module Flatten_Sig.Symbol

Core functions
val op_to_str : Shape.Type.op -> string

return the name of the operator as string

val is_random_variable : Shape.Type.op -> bool

check if operator is randon variable

val refnum : 'a Owl_graph.node -> int

return the reference number of the given node

val node_shape : Shape.Type.attr Owl_graph.node -> int array

return the shape of a node

val node_numel : Shape.Type.attr Owl_graph.node -> int

return the number of elements of a node

val is_shape_unknown : Shape.Type.attr Owl_graph.node -> bool

check if the shape of the input node is unknown

val infer_shape_graph : Shape.Type.attr Owl_graph.node array -> unit

automatically infer the shape of input node according to its descendents' shapes

val shape_to_str : int array option array -> string

helper function; return the input array in string format.

val node_to_str : Shape.Type.attr Owl_graph.node -> string

print node's information to string

val node_to_arr : Shape.Type.t -> Shape.Type.arr

Wrap computation graph node in an array type

val arr_to_node : Shape.Type.arr -> Shape.Type.t

Unwrap the array type to get the computation graph node within

val node_to_elt : Shape.Type.t -> Shape.Type.elt

Wrap computation graph node in an Elt type

val elt_to_node : Shape.Type.elt -> Shape.Type.t

Unwrap the Elt type to get the computation graph node within

val make_node : ?name:string -> ?value:Shape.Type.Device.value array -> ?shape:int array option array -> @@ -7,11 +7,11 @@ ?reuse:bool -> ?state:Shape.Type.state -> Shape.Type.op -> - Shape.Type.attr Owl_graph.node

TODO

val make_then_connect : + Shape.Type.attr Owl_graph.node

crate a computation graph node

val make_then_connect : ?shape:int array option array -> Shape.Type.op -> Shape.Type.attr Owl_graph.node array -> - Shape.Type.attr Owl_graph.node

TODO

val var_arr : ?shape:int array -> string -> Shape.Type.arr

TODO

val var_elt : string -> Shape.Type.elt

TODO

val const_arr : string -> Shape.Type.Device.A.arr -> Shape.Type.arr

TODO

val const_elt : string -> Shape.Type.Device.A.elt -> Shape.Type.elt

TODO

val new_block_id : unit -> int

new_block_id () returns an unused block id.

val make_empty_block : ?block_id:int -> int -> Shape.Type.block

make_empty_block s returns an empty block of memory of size s.

val make_value_block : + Shape.Type.attr Owl_graph.node

make nodes and then connect parents and children

val var_arr : ?shape:int array -> string -> Shape.Type.arr

creat a node and wrap in Arr type

val var_elt : string -> Shape.Type.elt

creat a node and wrap in Elt type

val const_arr : string -> Shape.Type.Device.A.arr -> Shape.Type.arr

get ndarray value from input and create an node and wrap in Arr type

val const_elt : string -> Shape.Type.Device.A.elt -> Shape.Type.elt

get value from input and create an node and wrap in Elt type

val new_block_id : unit -> int

new_block_id () returns an unused block id.

val make_empty_block : ?block_id:int -> int -> Shape.Type.block

make_empty_block s returns an empty block of memory of size s.

val make_value_block : Shape.Type.Device.value -> Shape.Type.attr Owl_graph.node -> unit

make_value_block value node creates a block of memory initialised with value and links the new block to node.

get_block node returns the memory block allocated to node. If no block is allocated, throws an exception.

val add_node_to_block : @@ -23,6 +23,6 @@ unit

Update the node that is currently using the block of memory.

val get_block_id : Shape.Type.attr Owl_graph.node -> int

get_block_id node returns the id of the block assigned to node. If node has not been assigned yet, returns -1.

val set_value : Shape.Type.attr Owl_graph.node -> Shape.Type.Device.value array -> - unit

TODO

val set_operator : Shape.Type.attr Owl_graph.node -> Shape.Type.op -> unit

TODO

TODO

val set_reuse : Shape.Type.attr Owl_graph.node -> bool -> unit

TODO

val get_reuse : Shape.Type.attr Owl_graph.node -> bool

TODO

val is_shared : Shape.Type.attr Owl_graph.node -> bool

TODO

val get_shared_nodes : + unit

set the arrays of value to cgraph node

get the arrays of value of cgraph node

val set_operator : Shape.Type.attr Owl_graph.node -> Shape.Type.op -> unit

set the operator of cgraph node

get the operator of cgraph node

val set_reuse : Shape.Type.attr Owl_graph.node -> bool -> unit

set reuse attribute in a node

val get_reuse : Shape.Type.attr Owl_graph.node -> bool

get reuse attribute in a node

val is_shared : Shape.Type.attr Owl_graph.node -> bool

check of the data block of memory is shared in a node

get_shared_nodes node returns the nodes sharing the same block of memory as node.

val is_var : Shape.Type.attr Owl_graph.node -> bool

TODO

val is_const : Shape.Type.attr Owl_graph.node -> bool

TODO

val is_node_arr : Shape.Type.attr Owl_graph.node -> bool

TODO

val is_node_elt : Shape.Type.attr Owl_graph.node -> bool

TODO

val is_assigned : Shape.Type.attr Owl_graph.node -> bool

is_assigned node checks if a block of memory has been assigned to node.

val check_assigned : Shape.Type.attr Owl_graph.node -> unit

check_assigned node throws an exception if node has not been assigned to a block.

val is_valid : Shape.Type.attr Owl_graph.node -> bool

TODO

val validate : Shape.Type.attr Owl_graph.node -> unit

TODO

val invalidate : Shape.Type.attr Owl_graph.node -> unit

TODO

val invalidate_graph : Shape.Type.attr Owl_graph.node -> unit

TODO

val is_freeze : Shape.Type.attr Owl_graph.node -> bool

TODO

val freeze : Shape.Type.attr Owl_graph.node -> unit

TODO

val freeze_descendants : Shape.Type.attr Owl_graph.node array -> unit

TODO

val freeze_ancestors : Shape.Type.attr Owl_graph.node array -> unit

TODO

TODO

TODO

val unsafe_assign_arr : Shape.Type.arr -> Shape.Type.Device.A.arr -> unit

TODO

val assign_arr : Shape.Type.arr -> Shape.Type.Device.A.arr -> unit

TODO

val assign_elt : Shape.Type.elt -> Shape.Type.Device.A.elt -> unit

TODO

val float_to_elt : float -> Shape.Type.elt

TODO

val elt_to_float : Shape.Type.elt -> float

TODO

+ Shape.Type.attr Owl_graph.node array

get_shared_nodes node returns the nodes sharing the same block of memory as node.

val is_var : Shape.Type.attr Owl_graph.node -> bool

check if the node's operator is Var type

val is_const : Shape.Type.attr Owl_graph.node -> bool

check if the node's operator is Const type

val is_node_arr : Shape.Type.attr Owl_graph.node -> bool

check the shape of a node's attr and return if it indicates an ndarray

val is_node_elt : Shape.Type.attr Owl_graph.node -> bool

check the shape of a node's attr and return if it indicates an elt

val is_assigned : Shape.Type.attr Owl_graph.node -> bool

is_assigned node checks if a block of memory has been assigned to node.

val check_assigned : Shape.Type.attr Owl_graph.node -> unit

check_assigned node throws an exception if node has not been assigned to a block.

val is_valid : Shape.Type.attr Owl_graph.node -> bool

check if the state attribute of a node is Valid

val validate : Shape.Type.attr Owl_graph.node -> unit

set Valid to the state attribute of a node

val invalidate : Shape.Type.attr Owl_graph.node -> unit

set Invalid to the state attribute of a node

val invalidate_graph : Shape.Type.attr Owl_graph.node -> unit

iteratively invalidate the nodes in a graph

val is_freeze : Shape.Type.attr Owl_graph.node -> bool

check the freeze attribute of a node

val freeze : Shape.Type.attr Owl_graph.node -> unit

return the freeze attribute of a node

val freeze_descendants : Shape.Type.attr Owl_graph.node array -> unit

iteratively freeze the descendants of a node

val freeze_ancestors : Shape.Type.attr Owl_graph.node array -> unit

iteratively freeze the ancestors of a node

pack an A.arr type input into Arr type

unpack input into A.arr type

pack an A.elt type input into Elt type

unpack input into A.elt type

val unsafe_assign_arr : Shape.Type.arr -> Shape.Type.Device.A.arr -> unit

assign Arr type value

val assign_arr : Shape.Type.arr -> Shape.Type.Device.A.arr -> unit

assign Arr type value

val assign_elt : Shape.Type.elt -> Shape.Type.Device.A.elt -> unit

assign Elt type value

val float_to_elt : float -> Shape.Type.elt

build an Elt type based on float value

val elt_to_float : Shape.Type.elt -> float

retrive a float value from an Elt type value

diff --git a/docs/owl-base/Owl_computation_engine_sig/module-type-Flatten_Sig/Type/Device/index.html b/docs/owl-base/Owl_computation_engine_sig/module-type-Flatten_Sig/Type/Device/index.html index dc5681380..bd60973e1 100644 --- a/docs/owl-base/Owl_computation_engine_sig/module-type-Flatten_Sig/Type/Device/index.html +++ b/docs/owl-base/Owl_computation_engine_sig/module-type-Flatten_Sig/Type/Device/index.html @@ -1,2 +1,2 @@ -Device (owl-base.Owl_computation_engine_sig.Flatten_Sig.Type.Device)

Module Type.Device

Type definition
type device

TODO

type value

TODO

Core functions
val make_device : unit -> device

TODO

val arr_to_value : A.arr -> value

TODO

val value_to_arr : value -> A.arr

TODO

val elt_to_value : A.elt -> value

TODO

val value_to_elt : value -> A.elt

TODO

val value_to_float : value -> float

TODO

val is_arr : value -> bool

TODO

val is_elt : value -> bool

TODO

+Device (owl-base.Owl_computation_engine_sig.Flatten_Sig.Type.Device)

Module Type.Device

Type definition
type device
type value
Core functions
val make_device : unit -> device
val arr_to_value : A.arr -> value
val value_to_arr : value -> A.arr
val elt_to_value : A.elt -> value
val value_to_elt : value -> A.elt
val value_to_float : value -> float
val is_arr : value -> bool
val is_elt : value -> bool
diff --git a/docs/owl-base/Owl_computation_engine_sig/module-type-Flatten_Sig/index.html b/docs/owl-base/Owl_computation_engine_sig/module-type-Flatten_Sig/index.html index 9639ed70f..39b5ed32c 100644 --- a/docs/owl-base/Owl_computation_engine_sig/module-type-Flatten_Sig/index.html +++ b/docs/owl-base/Owl_computation_engine_sig/module-type-Flatten_Sig/index.html @@ -1,36 +1,36 @@ -Flatten_Sig (owl-base.Owl_computation_engine_sig.Flatten_Sig)

Module type Owl_computation_engine_sig.Flatten_Sig

include Owl_types_computation_engine.Sig
Core evaluation functions of the engine

Execute actual computation included in each CGraph element (of output type ndarray) in an array.

Execute actual computation included in each CGraph element (of output type float) in an array.

val eval_graph : Graph.graph -> unit

Execute actual computation of a computation graph.

include Owl_computation_graph_sig.Sig
Type definition
type graph

TODO

Core functions
val shape_or_value : Optimiser.Operator.Symbol.Shape.Type.t -> string

TODO

val graph_to_dot : graph -> string

TODO

val graph_to_trace : graph -> string

TODO

val save_graph : 'a -> string -> unit

TODO

val load_graph : string -> 'a * 'b

TODO

val collect_rvs : +Flatten_Sig (owl-base.Owl_computation_engine_sig.Flatten_Sig)

Module type Owl_computation_engine_sig.Flatten_Sig

include Owl_types_computation_engine.Sig
Core evaluation functions of the engine

Execute actual computation included in each CGraph element (of output type ndarray) in an array.

Execute actual computation included in each CGraph element (of output type float) in an array.

val eval_graph : Graph.graph -> unit

Execute actual computation of a computation graph.

include Owl_computation_graph_sig.Sig
Type definition
type graph
Core functions
val shape_or_value : Optimiser.Operator.Symbol.Shape.Type.t -> string

print shape for ndarrays, whilst value for scalars

val graph_to_dot : graph -> string

generate a string that can be written to a .dot file to draw the graph

val graph_to_trace : graph -> string

print the graph structure to a string

val save_graph : 'a -> string -> unit

save the graph object to a file with given name, using marshall format

val load_graph : string -> 'a * 'b

load the graph object from a file with given name

val invalidate_rvs : graph -> unit

TODO

traverse each node in the input array, and return the random variable type nodes.

val invalidate_rvs : graph -> unit

TODO

val get_inputs : + graph

Build a graph based on input nodes, output nodes, and graph name

get input nodes of a graph

get output nodes of a graph

val set_node_elt_val : + unit
val is_iopair_safe : 'a Owl_graph.node -> 'a Owl_graph.node -> bool

TODO

val make_iopair : + unit
val is_iopair_safe : 'a Owl_graph.node -> 'a Owl_graph.node -> bool
val update_iopair : graph -> unit

TODO

val remove_unused_iopair : + unit

create an iopair between the input nodes and output nodes in a graph

val update_iopair : graph -> unit
val remove_unused_iopair : 'a Owl_graph.node array -> 'b array -> - 'a Owl_graph.node array * 'b array

TODO

val init_inputs : + 'a Owl_graph.node array * 'b array

remove unuserd iopair from an array of nodes

val optimise : graph -> unit

TODO

include Owl_computation_optimiser_sig.Sig
Core functions
val estimate_complexity : 'a Owl_graph.node array -> int * int

TODO

val optimise_nodes : + unit

initialize inputs nodes of a graph with given function f

val optimise : graph -> unit

optimise the graph structure

include Owl_computation_optimiser_sig.Sig
Core functions
val estimate_complexity : 'a Owl_graph.node array -> int * int

TODO

val optimise_nodes : Operator.Symbol.Shape.Type.attr Owl_graph.node array -> unit

TODO

include Owl_computation_operator_sig.Sig
Vectorised functions

noop arr performs no operation on the array arr and returns it as is. This can be useful as a placeholder function. Returns the input array arr.

val empty : int array -> Symbol.Shape.Type.arr

empty shape creates an uninitialized array with the specified shape. The contents of the array are undefined. Returns a new array with the given shape.

val zeros : int array -> Symbol.Shape.Type.arr

zeros shape creates an array with the specified shape, filled with zeros. Returns a new array with all elements initialized to zero.

val ones : int array -> Symbol.Shape.Type.arr

ones shape creates an array with the specified shape, filled with ones. Returns a new array with all elements initialized to one.

val create : int array -> Symbol.Shape.Type.elt -> Symbol.Shape.Type.arr

create shape value creates an array with the specified shape, filled with the given value. Returns a new array with all elements initialized to value.

val sequential : ?a:Symbol.Shape.Type.elt -> @@ -450,7 +450,7 @@ Symbol.Shape.Type.arr

transpose ?axis arr transposes the array arr. If axis is provided, the transpose is performed according to the specified axes. Returns a new array with the transposed data.

val to_rows : Symbol.Shape.Type.arr -> 'a array

to_rows arr converts the array arr into an array of row vectors. Returns an array where each element is a row from the original array.

of_rows rows creates an array by stacking the row vectors in rows. Returns a new array constructed from the row vectors.

val to_cols : Symbol.Shape.Type.arr -> 'a array

to_cols arr converts the array arr into an array of column vectors. Returns an array where each element is a column from the original array.

of_cols cols creates an array by stacking the column vectors in cols. Returns a new array constructed from the column vectors.

val of_array : Symbol.Shape.Type.elt array -> int array -> - Symbol.Shape.Type.arr

of_array data shape creates an array from a flat array data with the specified shape. Returns a new array with the data arranged according to the shape.

val of_arrays : Symbol.Shape.Type.elt array array -> Symbol.Shape.Type.arr

of_arrays data creates an array from a 2D array data, where each sub-array represents a row. Returns a new array with the data from the 2D array.

val to_arrays : Symbol.Shape.Type.arr -> Symbol.Shape.Type.elt array array

to_arrays arr converts the array arr into a 2D array where each sub-array represents a row. Returns a 2D array with the data from the original array.

Scalar functions
module Scalar : sig ... end
module Mat : sig ... end
module Linalg : sig ... end
include Owl_computation_symbol_sig.Sig
Core functions
val op_to_str : Shape.Type.op -> string

TODO

val is_random_variable : Shape.Type.op -> bool

TODO

val refnum : 'a Owl_graph.node -> int

TODO

val node_shape : Shape.Type.attr Owl_graph.node -> int array

TODO

val node_numel : Shape.Type.attr Owl_graph.node -> int

TODO

val is_shape_unknown : Shape.Type.attr Owl_graph.node -> bool

TODO

val infer_shape_graph : Shape.Type.attr Owl_graph.node array -> unit

TODO

val shape_to_str : int array option array -> string

TODO

val node_to_str : Shape.Type.attr Owl_graph.node -> string

TODO

val node_to_arr : Shape.Type.t -> Shape.Type.arr

TODO

val arr_to_node : Shape.Type.arr -> Shape.Type.t

TODO

val node_to_elt : Shape.Type.t -> Shape.Type.elt

TODO

val elt_to_node : Shape.Type.elt -> Shape.Type.t

TODO

val make_node : + Symbol.Shape.Type.arr

of_array data shape creates an array from a flat array data with the specified shape. Returns a new array with the data arranged according to the shape.

val of_arrays : Symbol.Shape.Type.elt array array -> Symbol.Shape.Type.arr

of_arrays data creates an array from a 2D array data, where each sub-array represents a row. Returns a new array with the data from the 2D array.

val to_arrays : Symbol.Shape.Type.arr -> Symbol.Shape.Type.elt array array

to_arrays arr converts the array arr into a 2D array where each sub-array represents a row. Returns a 2D array with the data from the original array.

Scalar functions
module Scalar : sig ... end
module Mat : sig ... end
module Linalg : sig ... end
include Owl_computation_symbol_sig.Sig
Core functions
val op_to_str : Shape.Type.op -> string

return the name of the operator as string

val is_random_variable : Shape.Type.op -> bool

check if operator is randon variable

val refnum : 'a Owl_graph.node -> int

return the reference number of the given node

val node_shape : Shape.Type.attr Owl_graph.node -> int array

return the shape of a node

val node_numel : Shape.Type.attr Owl_graph.node -> int

return the number of elements of a node

val is_shape_unknown : Shape.Type.attr Owl_graph.node -> bool

check if the shape of the input node is unknown

val infer_shape_graph : Shape.Type.attr Owl_graph.node array -> unit

automatically infer the shape of input node according to its descendents' shapes

val shape_to_str : int array option array -> string

helper function; return the input array in string format.

val node_to_str : Shape.Type.attr Owl_graph.node -> string

print node's information to string

val node_to_arr : Shape.Type.t -> Shape.Type.arr

Wrap computation graph node in an array type

val arr_to_node : Shape.Type.arr -> Shape.Type.t

Unwrap the array type to get the computation graph node within

val node_to_elt : Shape.Type.t -> Shape.Type.elt

Wrap computation graph node in an Elt type

val elt_to_node : Shape.Type.elt -> Shape.Type.t

Unwrap the Elt type to get the computation graph node within

val make_node : ?name:string -> ?value:Shape.Type.Device.value array -> ?shape:int array option array -> @@ -458,11 +458,11 @@ ?reuse:bool -> ?state:Shape.Type.state -> Shape.Type.op -> - Shape.Type.attr Owl_graph.node

TODO

val make_then_connect : + Shape.Type.attr Owl_graph.node

crate a computation graph node

val make_then_connect : ?shape:int array option array -> Shape.Type.op -> Shape.Type.attr Owl_graph.node array -> - Shape.Type.attr Owl_graph.node

TODO

val var_arr : ?shape:int array -> string -> Shape.Type.arr

TODO

val var_elt : string -> Shape.Type.elt

TODO

val const_arr : string -> Shape.Type.Device.A.arr -> Shape.Type.arr

TODO

val const_elt : string -> Shape.Type.Device.A.elt -> Shape.Type.elt

TODO

val new_block_id : unit -> int

new_block_id () returns an unused block id.

val make_empty_block : ?block_id:int -> int -> Shape.Type.block

make_empty_block s returns an empty block of memory of size s.

val make_value_block : + Shape.Type.attr Owl_graph.node

make nodes and then connect parents and children

val var_arr : ?shape:int array -> string -> Shape.Type.arr

creat a node and wrap in Arr type

val var_elt : string -> Shape.Type.elt

creat a node and wrap in Elt type

val const_arr : string -> Shape.Type.Device.A.arr -> Shape.Type.arr

get ndarray value from input and create an node and wrap in Arr type

val const_elt : string -> Shape.Type.Device.A.elt -> Shape.Type.elt

get value from input and create an node and wrap in Elt type

val new_block_id : unit -> int

new_block_id () returns an unused block id.

val make_empty_block : ?block_id:int -> int -> Shape.Type.block

make_empty_block s returns an empty block of memory of size s.

val make_value_block : Shape.Type.Device.value -> Shape.Type.attr Owl_graph.node -> unit

make_value_block value node creates a block of memory initialised with value and links the new block to node.

get_block node returns the memory block allocated to node. If no block is allocated, throws an exception.

val add_node_to_block : @@ -474,12 +474,12 @@ unit

Update the node that is currently using the block of memory.

val get_block_id : Shape.Type.attr Owl_graph.node -> int

get_block_id node returns the id of the block assigned to node. If node has not been assigned yet, returns -1.

val set_value : Shape.Type.attr Owl_graph.node -> Shape.Type.Device.value array -> - unit

TODO

val set_operator : Shape.Type.attr Owl_graph.node -> Shape.Type.op -> unit

TODO

TODO

val set_reuse : Shape.Type.attr Owl_graph.node -> bool -> unit

TODO

val get_reuse : Shape.Type.attr Owl_graph.node -> bool

TODO

val is_shared : Shape.Type.attr Owl_graph.node -> bool

TODO

val get_shared_nodes : + unit

set the arrays of value to cgraph node

get the arrays of value of cgraph node

val set_operator : Shape.Type.attr Owl_graph.node -> Shape.Type.op -> unit

set the operator of cgraph node

get the operator of cgraph node

val set_reuse : Shape.Type.attr Owl_graph.node -> bool -> unit

set reuse attribute in a node

val get_reuse : Shape.Type.attr Owl_graph.node -> bool

get reuse attribute in a node

val is_shared : Shape.Type.attr Owl_graph.node -> bool

check of the data block of memory is shared in a node

get_shared_nodes node returns the nodes sharing the same block of memory as node.

val is_var : Shape.Type.attr Owl_graph.node -> bool

TODO

val is_const : Shape.Type.attr Owl_graph.node -> bool

TODO

val is_node_arr : Shape.Type.attr Owl_graph.node -> bool

TODO

val is_node_elt : Shape.Type.attr Owl_graph.node -> bool

TODO

val is_assigned : Shape.Type.attr Owl_graph.node -> bool

is_assigned node checks if a block of memory has been assigned to node.

val check_assigned : Shape.Type.attr Owl_graph.node -> unit

check_assigned node throws an exception if node has not been assigned to a block.

val is_valid : Shape.Type.attr Owl_graph.node -> bool

TODO

val validate : Shape.Type.attr Owl_graph.node -> unit

TODO

val invalidate : Shape.Type.attr Owl_graph.node -> unit

TODO

val invalidate_graph : Shape.Type.attr Owl_graph.node -> unit

TODO

val is_freeze : Shape.Type.attr Owl_graph.node -> bool

TODO

val freeze : Shape.Type.attr Owl_graph.node -> unit

TODO

val freeze_descendants : Shape.Type.attr Owl_graph.node array -> unit

TODO

val freeze_ancestors : Shape.Type.attr Owl_graph.node array -> unit

TODO

TODO

TODO

val unsafe_assign_arr : Shape.Type.arr -> Shape.Type.Device.A.arr -> unit

TODO

val assign_arr : Shape.Type.arr -> Shape.Type.Device.A.arr -> unit

TODO

val assign_elt : Shape.Type.elt -> Shape.Type.Device.A.elt -> unit

TODO

val float_to_elt : float -> Shape.Type.elt

TODO

val elt_to_float : Shape.Type.elt -> float

TODO

include Owl_computation_shape_sig.Sig
Core functions
val infer_shape : + Shape.Type.attr Owl_graph.node array

get_shared_nodes node returns the nodes sharing the same block of memory as node.

val is_var : Shape.Type.attr Owl_graph.node -> bool

check if the node's operator is Var type

val is_const : Shape.Type.attr Owl_graph.node -> bool

check if the node's operator is Const type

val is_node_arr : Shape.Type.attr Owl_graph.node -> bool

check the shape of a node's attr and return if it indicates an ndarray

val is_node_elt : Shape.Type.attr Owl_graph.node -> bool

check the shape of a node's attr and return if it indicates an elt

val is_assigned : Shape.Type.attr Owl_graph.node -> bool

is_assigned node checks if a block of memory has been assigned to node.

val check_assigned : Shape.Type.attr Owl_graph.node -> unit

check_assigned node throws an exception if node has not been assigned to a block.

val is_valid : Shape.Type.attr Owl_graph.node -> bool

check if the state attribute of a node is Valid

val validate : Shape.Type.attr Owl_graph.node -> unit

set Valid to the state attribute of a node

val invalidate : Shape.Type.attr Owl_graph.node -> unit

set Invalid to the state attribute of a node

val invalidate_graph : Shape.Type.attr Owl_graph.node -> unit

iteratively invalidate the nodes in a graph

val is_freeze : Shape.Type.attr Owl_graph.node -> bool

check the freeze attribute of a node

val freeze : Shape.Type.attr Owl_graph.node -> unit

return the freeze attribute of a node

val freeze_descendants : Shape.Type.attr Owl_graph.node array -> unit

iteratively freeze the descendants of a node

val freeze_ancestors : Shape.Type.attr Owl_graph.node array -> unit

iteratively freeze the ancestors of a node

pack an A.arr type input into Arr type

unpack input into A.arr type

pack an A.elt type input into Elt type

unpack input into A.elt type

val unsafe_assign_arr : Shape.Type.arr -> Shape.Type.Device.A.arr -> unit

assign Arr type value

val assign_arr : Shape.Type.arr -> Shape.Type.Device.A.arr -> unit

assign Arr type value

val assign_elt : Shape.Type.elt -> Shape.Type.Device.A.elt -> unit

assign Elt type value

val float_to_elt : float -> Shape.Type.elt

build an Elt type based on float value

val elt_to_float : Shape.Type.elt -> float

retrive a float value from an Elt type value

include Owl_computation_shape_sig.Sig
Core functions
val infer_shape : Type.op -> Type.attr Owl_graph.node array -> int array option array

TODO

include Owl_computation_type_sig.Sig
Type definition
type state =
  1. | Valid
  2. | Invalid
    (*

    TODO

    *)

TODO

and block = {
  1. size : int;
  2. block_id : int;
  3. mutable active : t option;
  4. mutable memory : Device.value;
  5. mutable nodes : t list;
}

block type keeps a reference to a block of memory and to the nodes sharing that block.

and attr = {
  1. mutable op : op;
  2. mutable freeze : bool;
  3. mutable reuse : bool;
  4. mutable state : state;
  5. mutable shape : int array option array;
  6. mutable value : Device.value array;
  7. mutable block : block array option;
}

TODO

and arr =
  1. | Arr of t
and elt =
  1. | Elt of t
and op =
  1. | Noop
  2. | Var
  3. | Const
  4. | Empty of int array
  5. | Zeros of int array
  6. | Ones of int array
  7. | Create of int array
  8. | Sequential of int array
  9. | Uniform of int array
  10. | Gaussian of int array
  11. | Bernoulli of int array
  12. | Init of int array * int -> elt
  13. | Get of int array
  14. | Set of int array
  15. | GetSlice of int list list
  16. | SetSlice of int list list
  17. | GetFancy of Owl_types_common.index list
  18. | SetFancy of Owl_types_common.index list
  19. | Copy
  20. | Reset
  21. | Reshape of int array
  22. | Reverse
  23. | Tile of int array
  24. | Repeat of int array
  25. | Pad of elt * int list list
  26. | Concatenate of int
  27. | Stack of int
  28. | Split of int * int array
  29. | Draw of int * int
  30. | Map of elt -> elt
  31. | Fold of int * elt -> elt -> elt
  32. | Scan of int * elt -> elt -> elt
  33. | OneHot of int
  34. | OfArray of int array
  35. | Delay of Device.A.arr -> Device.A.arr
  36. | DelayArray of int array * Device.A.arr array -> Device.A.arr
  37. | LazyPrint of int option * int option * bool option - * (Device.A.elt -> string) option
  38. | Abs
  39. | Neg
  40. | Floor
  41. | Ceil
  42. | Round
  43. | Sqr
  44. | Sqrt
  45. | Log
  46. | Log2
  47. | Log10
  48. | Exp
  49. | Sin
  50. | Cos
  51. | Tan
  52. | Sinh
  53. | Cosh
  54. | Tanh
  55. | Asin
  56. | Acos
  57. | Atan
  58. | Asinh
  59. | Acosh
  60. | Atanh
  61. | Min of bool * int
  62. | Max of bool * int
  63. | Sum of bool * int
  64. | SumReduce of int array
  65. | Signum
  66. | Sigmoid
  67. | Relu
  68. | Dawsn
  69. | Min'
  70. | Max'
  71. | Sum'
  72. | LogSumExp'
  73. | LogSumExp of bool * int
  74. | L1norm'
  75. | L2norm'
  76. | L2NormSqr'
  77. | ClipByValue
  78. | ClipByL2norm
  79. | Pow
  80. | ScalarPow
  81. | PowScalar
  82. | Atan2
  83. | ScalarAtan2
  84. | Atan2Scalar
  85. | Hypot
  86. | Min2
  87. | Max2
  88. | Add
  89. | Sub
  90. | Mul
  91. | Div
  92. | AddScalar
  93. | SubScalar
  94. | MulScalar
  95. | DivScalar
  96. | ScalarAdd
  97. | ScalarSub
  98. | ScalarMul
  99. | ScalarDiv
  100. | FMA
  101. | EltEqual
  102. | EltNotEqual
  103. | EltLess
  104. | EltGreater
  105. | EltLessEqual
  106. | EltGreaterEqual
  107. | EltEqualScalar
  108. | EltNotEqualScalar
  109. | EltLessScalar
  110. | EltGreaterScalar
  111. | EltLessEqualScalar
  112. | EltGreaterEqualScalar
  113. | Conv1d of Owl_types_common.padding * int array
  114. | Conv2d of Owl_types_common.padding * int array
  115. | Conv3d of Owl_types_common.padding * int array
  116. | TransposeConv1d of Owl_types_common.padding * int array
  117. | TransposeConv2d of Owl_types_common.padding * int array
  118. | TransposeConv3d of Owl_types_common.padding * int array
  119. | DilatedConv1d of Owl_types_common.padding * int array * int array
  120. | DilatedConv2d of Owl_types_common.padding * int array * int array
  121. | DilatedConv3d of Owl_types_common.padding * int array * int array
  122. | MaxPool1d of Owl_types_common.padding * int array * int array
  123. | MaxPool2d of Owl_types_common.padding * int array * int array
  124. | MaxPool3d of Owl_types_common.padding * int array * int array
  125. | AvgPool1d of Owl_types_common.padding * int array * int array
  126. | AvgPool2d of Owl_types_common.padding * int array * int array
  127. | AvgPool3d of Owl_types_common.padding * int array * int array
  128. | UpSampling2d of int array
  129. | Conv1dBackwardInput of int array
  130. | Conv1dBackwardKernel of int array
  131. | Conv2dBackwardInput of int array
  132. | Conv2dBackwardKernel of int array
  133. | Conv3dBackwardInput of int array
  134. | Conv3dBackwardKernel of int array
  135. | TransposeConv1dBackwardInput of int array
  136. | TransposeConv1dBackwardKernel of int array
  137. | TransposeConv2dBackwardInput of int array
  138. | TransposeConv2dBackwardKernel of int array
  139. | TransposeConv3dBackwardInput of int array
  140. | TransposeConv3dBackwardKernel of int array
  141. | DilatedConv1dBackwardInput of int array * int array
  142. | DilatedConv1dBackwardKernel of int array * int array
  143. | DilatedConv2dBackwardInput of int array * int array
  144. | DilatedConv2dBackwardKernel of int array * int array
  145. | DilatedConv3dBackwardInput of int array * int array
  146. | DilatedConv3dBackwardKernel of int array * int array
  147. | MaxPool1dBackward of Owl_types_common.padding * int array * int array
  148. | MaxPool2dBackward of Owl_types_common.padding * int array * int array
  149. | MaxPool3dBackward of Owl_types_common.padding * int array * int array
  150. | AvgPool1dBackward of Owl_types_common.padding * int array * int array
  151. | AvgPool2dBackward of Owl_types_common.padding * int array * int array
  152. | AvgPool3dBackward of Owl_types_common.padding * int array * int array
  153. | UpSampling2dBackward of int array
  154. | RowNum
  155. | ColNum
  156. | Row
  157. | Rows of int array
  158. | CopyRowTo
  159. | CopyColTo
  160. | Dot of bool * bool * elt * elt
  161. | Inv
  162. | Trace
  163. | Transpose of int array
  164. | ToRows
  165. | OfRows
  166. | Scalar_Add
  167. | Scalar_Sub
  168. | Scalar_Mul
  169. | Scalar_Div
  170. | Scalar_Pow
  171. | Scalar_Atan2
  172. | Scalar_Abs
  173. | Scalar_Neg
  174. | Scalar_Sqr
  175. | Scalar_Sqrt
  176. | Scalar_Exp
  177. | Scalar_Log
  178. | Scalar_Log2
  179. | Scalar_Log10
  180. | Scalar_Signum
  181. | Scalar_Floor
  182. | Scalar_Ceil
  183. | Scalar_Round
  184. | Scalar_Sin
  185. | Scalar_Cos
  186. | Scalar_Tan
  187. | Scalar_Sinh
  188. | Scalar_Cosh
  189. | Scalar_Tanh
  190. | Scalar_Asin
  191. | Scalar_Acos
  192. | Scalar_Atan
  193. | Scalar_Asinh
  194. | Scalar_Acosh
  195. | Scalar_Atanh
  196. | Scalar_Relu
  197. | Scalar_Dawsn
  198. | Scalar_Sigmoid
  199. | Fused_Adagrad of float * float
    (*

    TODO

    *)
include Owl_types_computation_device.Sig
Type definition
type device

TODO

type value

TODO

Core functions
val make_device : unit -> device

TODO

val arr_to_value : A.arr -> value

TODO

val value_to_arr : value -> A.arr

TODO

val elt_to_value : A.elt -> value

TODO

val value_to_elt : value -> A.elt

TODO

val value_to_float : value -> float

TODO

val is_arr : value -> bool

TODO

val is_elt : value -> bool

TODO

+ * (Device.A.elt -> string) option
  • | Abs
  • | Neg
  • | Floor
  • | Ceil
  • | Round
  • | Sqr
  • | Sqrt
  • | Log
  • | Log2
  • | Log10
  • | Exp
  • | Sin
  • | Cos
  • | Tan
  • | Sinh
  • | Cosh
  • | Tanh
  • | Asin
  • | Acos
  • | Atan
  • | Asinh
  • | Acosh
  • | Atanh
  • | Min of bool * int
  • | Max of bool * int
  • | Sum of bool * int
  • | SumReduce of int array
  • | Signum
  • | Sigmoid
  • | Relu
  • | Dawsn
  • | Min'
  • | Max'
  • | Sum'
  • | LogSumExp'
  • | LogSumExp of bool * int
  • | L1norm'
  • | L2norm'
  • | L2NormSqr'
  • | ClipByValue
  • | ClipByL2norm
  • | Pow
  • | ScalarPow
  • | PowScalar
  • | Atan2
  • | ScalarAtan2
  • | Atan2Scalar
  • | Hypot
  • | Min2
  • | Max2
  • | Add
  • | Sub
  • | Mul
  • | Div
  • | AddScalar
  • | SubScalar
  • | MulScalar
  • | DivScalar
  • | ScalarAdd
  • | ScalarSub
  • | ScalarMul
  • | ScalarDiv
  • | FMA
  • | EltEqual
  • | EltNotEqual
  • | EltLess
  • | EltGreater
  • | EltLessEqual
  • | EltGreaterEqual
  • | EltEqualScalar
  • | EltNotEqualScalar
  • | EltLessScalar
  • | EltGreaterScalar
  • | EltLessEqualScalar
  • | EltGreaterEqualScalar
  • | Conv1d of Owl_types_common.padding * int array
  • | Conv2d of Owl_types_common.padding * int array
  • | Conv3d of Owl_types_common.padding * int array
  • | TransposeConv1d of Owl_types_common.padding * int array
  • | TransposeConv2d of Owl_types_common.padding * int array
  • | TransposeConv3d of Owl_types_common.padding * int array
  • | DilatedConv1d of Owl_types_common.padding * int array * int array
  • | DilatedConv2d of Owl_types_common.padding * int array * int array
  • | DilatedConv3d of Owl_types_common.padding * int array * int array
  • | MaxPool1d of Owl_types_common.padding * int array * int array
  • | MaxPool2d of Owl_types_common.padding * int array * int array
  • | MaxPool3d of Owl_types_common.padding * int array * int array
  • | AvgPool1d of Owl_types_common.padding * int array * int array
  • | AvgPool2d of Owl_types_common.padding * int array * int array
  • | AvgPool3d of Owl_types_common.padding * int array * int array
  • | UpSampling2d of int array
  • | Conv1dBackwardInput of int array
  • | Conv1dBackwardKernel of int array
  • | Conv2dBackwardInput of int array
  • | Conv2dBackwardKernel of int array
  • | Conv3dBackwardInput of int array
  • | Conv3dBackwardKernel of int array
  • | TransposeConv1dBackwardInput of int array
  • | TransposeConv1dBackwardKernel of int array
  • | TransposeConv2dBackwardInput of int array
  • | TransposeConv2dBackwardKernel of int array
  • | TransposeConv3dBackwardInput of int array
  • | TransposeConv3dBackwardKernel of int array
  • | DilatedConv1dBackwardInput of int array * int array
  • | DilatedConv1dBackwardKernel of int array * int array
  • | DilatedConv2dBackwardInput of int array * int array
  • | DilatedConv2dBackwardKernel of int array * int array
  • | DilatedConv3dBackwardInput of int array * int array
  • | DilatedConv3dBackwardKernel of int array * int array
  • | MaxPool1dBackward of Owl_types_common.padding * int array * int array
  • | MaxPool2dBackward of Owl_types_common.padding * int array * int array
  • | MaxPool3dBackward of Owl_types_common.padding * int array * int array
  • | AvgPool1dBackward of Owl_types_common.padding * int array * int array
  • | AvgPool2dBackward of Owl_types_common.padding * int array * int array
  • | AvgPool3dBackward of Owl_types_common.padding * int array * int array
  • | UpSampling2dBackward of int array
  • | RowNum
  • | ColNum
  • | Row
  • | Rows of int array
  • | CopyRowTo
  • | CopyColTo
  • | Dot of bool * bool * elt * elt
  • | Inv
  • | Trace
  • | Transpose of int array
  • | ToRows
  • | OfRows
  • | Scalar_Add
  • | Scalar_Sub
  • | Scalar_Mul
  • | Scalar_Div
  • | Scalar_Pow
  • | Scalar_Atan2
  • | Scalar_Abs
  • | Scalar_Neg
  • | Scalar_Sqr
  • | Scalar_Sqrt
  • | Scalar_Exp
  • | Scalar_Log
  • | Scalar_Log2
  • | Scalar_Log10
  • | Scalar_Signum
  • | Scalar_Floor
  • | Scalar_Ceil
  • | Scalar_Round
  • | Scalar_Sin
  • | Scalar_Cos
  • | Scalar_Tan
  • | Scalar_Sinh
  • | Scalar_Cosh
  • | Scalar_Tanh
  • | Scalar_Asin
  • | Scalar_Acos
  • | Scalar_Atan
  • | Scalar_Asinh
  • | Scalar_Acosh
  • | Scalar_Atanh
  • | Scalar_Relu
  • | Scalar_Dawsn
  • | Scalar_Sigmoid
  • | Fused_Adagrad of float * float
    (*

    TODO

    *)
  • include Owl_types_computation_device.Sig
    Type definition
    type device
    type value
    Core functions
    val make_device : unit -> device
    val arr_to_value : A.arr -> value
    val value_to_arr : value -> A.arr
    val elt_to_value : A.elt -> value
    val value_to_elt : value -> A.elt
    val value_to_float : value -> float
    val is_arr : value -> bool
    val is_elt : value -> bool
    diff --git a/docs/owl-base/Owl_computation_engine_sig/module-type-Make_Graph_Sig/Optimiser/Operator/Symbol/Shape/Type/Device/index.html b/docs/owl-base/Owl_computation_engine_sig/module-type-Make_Graph_Sig/Optimiser/Operator/Symbol/Shape/Type/Device/index.html index dfb60dae5..01ea8c130 100644 --- a/docs/owl-base/Owl_computation_engine_sig/module-type-Make_Graph_Sig/Optimiser/Operator/Symbol/Shape/Type/Device/index.html +++ b/docs/owl-base/Owl_computation_engine_sig/module-type-Make_Graph_Sig/Optimiser/Operator/Symbol/Shape/Type/Device/index.html @@ -1,2 +1,2 @@ -Device (owl-base.Owl_computation_engine_sig.Make_Graph_Sig.Optimiser.Operator.Symbol.Shape.Type.Device)

    Module Type.Device

    Type definition
    type device

    TODO

    type value

    TODO

    Core functions
    val make_device : unit -> device

    TODO

    val arr_to_value : A.arr -> value

    TODO

    val value_to_arr : value -> A.arr

    TODO

    val elt_to_value : A.elt -> value

    TODO

    val value_to_elt : value -> A.elt

    TODO

    val value_to_float : value -> float

    TODO

    val is_arr : value -> bool

    TODO

    val is_elt : value -> bool

    TODO

    +Device (owl-base.Owl_computation_engine_sig.Make_Graph_Sig.Optimiser.Operator.Symbol.Shape.Type.Device)

    Module Type.Device

    Type definition
    type device
    type value
    Core functions
    val make_device : unit -> device
    val arr_to_value : A.arr -> value
    val value_to_arr : value -> A.arr
    val elt_to_value : A.elt -> value
    val value_to_elt : value -> A.elt
    val value_to_float : value -> float
    val is_arr : value -> bool
    val is_elt : value -> bool
    diff --git a/docs/owl-base/Owl_computation_engine_sig/module-type-Make_Graph_Sig/Optimiser/Operator/Symbol/index.html b/docs/owl-base/Owl_computation_engine_sig/module-type-Make_Graph_Sig/Optimiser/Operator/Symbol/index.html index 9ef99a2f9..d70746072 100644 --- a/docs/owl-base/Owl_computation_engine_sig/module-type-Make_Graph_Sig/Optimiser/Operator/Symbol/index.html +++ b/docs/owl-base/Owl_computation_engine_sig/module-type-Make_Graph_Sig/Optimiser/Operator/Symbol/index.html @@ -1,5 +1,5 @@ -Symbol (owl-base.Owl_computation_engine_sig.Make_Graph_Sig.Optimiser.Operator.Symbol)

    Module Operator.Symbol

    Core functions
    val op_to_str : Shape.Type.op -> string

    TODO

    val is_random_variable : Shape.Type.op -> bool

    TODO

    val refnum : 'a Owl_graph.node -> int

    TODO

    val node_shape : Shape.Type.attr Owl_graph.node -> int array

    TODO

    val node_numel : Shape.Type.attr Owl_graph.node -> int

    TODO

    val is_shape_unknown : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val infer_shape_graph : Shape.Type.attr Owl_graph.node array -> unit

    TODO

    val shape_to_str : int array option array -> string

    TODO

    val node_to_str : Shape.Type.attr Owl_graph.node -> string

    TODO

    val node_to_arr : Shape.Type.t -> Shape.Type.arr

    TODO

    val arr_to_node : Shape.Type.arr -> Shape.Type.t

    TODO

    val node_to_elt : Shape.Type.t -> Shape.Type.elt

    TODO

    val elt_to_node : Shape.Type.elt -> Shape.Type.t

    TODO

    val make_node : +Symbol (owl-base.Owl_computation_engine_sig.Make_Graph_Sig.Optimiser.Operator.Symbol)

    Module Operator.Symbol

    Core functions
    val op_to_str : Shape.Type.op -> string

    return the name of the operator as string

    val is_random_variable : Shape.Type.op -> bool

    check if operator is randon variable

    val refnum : 'a Owl_graph.node -> int

    return the reference number of the given node

    val node_shape : Shape.Type.attr Owl_graph.node -> int array

    return the shape of a node

    val node_numel : Shape.Type.attr Owl_graph.node -> int

    return the number of elements of a node

    val is_shape_unknown : Shape.Type.attr Owl_graph.node -> bool

    check if the shape of the input node is unknown

    val infer_shape_graph : Shape.Type.attr Owl_graph.node array -> unit

    automatically infer the shape of input node according to its descendents' shapes

    val shape_to_str : int array option array -> string

    helper function; return the input array in string format.

    val node_to_str : Shape.Type.attr Owl_graph.node -> string

    print node's information to string

    val node_to_arr : Shape.Type.t -> Shape.Type.arr

    Wrap computation graph node in an array type

    val arr_to_node : Shape.Type.arr -> Shape.Type.t

    Unwrap the array type to get the computation graph node within

    val node_to_elt : Shape.Type.t -> Shape.Type.elt

    Wrap computation graph node in an Elt type

    val elt_to_node : Shape.Type.elt -> Shape.Type.t

    Unwrap the Elt type to get the computation graph node within

    val make_node : ?name:string -> ?value:Shape.Type.Device.value array -> ?shape:int array option array -> @@ -7,11 +7,11 @@ ?reuse:bool -> ?state:Shape.Type.state -> Shape.Type.op -> - Shape.Type.attr Owl_graph.node

    TODO

    val make_then_connect : + Shape.Type.attr Owl_graph.node

    crate a computation graph node

    val make_then_connect : ?shape:int array option array -> Shape.Type.op -> Shape.Type.attr Owl_graph.node array -> - Shape.Type.attr Owl_graph.node

    TODO

    val var_arr : ?shape:int array -> string -> Shape.Type.arr

    TODO

    val var_elt : string -> Shape.Type.elt

    TODO

    val const_arr : string -> Shape.Type.Device.A.arr -> Shape.Type.arr

    TODO

    val const_elt : string -> Shape.Type.Device.A.elt -> Shape.Type.elt

    TODO

    val new_block_id : unit -> int

    new_block_id () returns an unused block id.

    val make_empty_block : ?block_id:int -> int -> Shape.Type.block

    make_empty_block s returns an empty block of memory of size s.

    val make_value_block : + Shape.Type.attr Owl_graph.node

    make nodes and then connect parents and children

    val var_arr : ?shape:int array -> string -> Shape.Type.arr

    creat a node and wrap in Arr type

    val var_elt : string -> Shape.Type.elt

    creat a node and wrap in Elt type

    val const_arr : string -> Shape.Type.Device.A.arr -> Shape.Type.arr

    get ndarray value from input and create an node and wrap in Arr type

    val const_elt : string -> Shape.Type.Device.A.elt -> Shape.Type.elt

    get value from input and create an node and wrap in Elt type

    val new_block_id : unit -> int

    new_block_id () returns an unused block id.

    val make_empty_block : ?block_id:int -> int -> Shape.Type.block

    make_empty_block s returns an empty block of memory of size s.

    val make_value_block : Shape.Type.Device.value -> Shape.Type.attr Owl_graph.node -> unit

    make_value_block value node creates a block of memory initialised with value and links the new block to node.

    get_block node returns the memory block allocated to node. If no block is allocated, throws an exception.

    val add_node_to_block : @@ -23,6 +23,6 @@ unit

    Update the node that is currently using the block of memory.

    val get_block_id : Shape.Type.attr Owl_graph.node -> int

    get_block_id node returns the id of the block assigned to node. If node has not been assigned yet, returns -1.

    val set_value : Shape.Type.attr Owl_graph.node -> Shape.Type.Device.value array -> - unit

    TODO

    val set_operator : Shape.Type.attr Owl_graph.node -> Shape.Type.op -> unit

    TODO

    TODO

    val set_reuse : Shape.Type.attr Owl_graph.node -> bool -> unit

    TODO

    val get_reuse : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val is_shared : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val get_shared_nodes : + unit

    set the arrays of value to cgraph node

    get the arrays of value of cgraph node

    val set_operator : Shape.Type.attr Owl_graph.node -> Shape.Type.op -> unit

    set the operator of cgraph node

    get the operator of cgraph node

    val set_reuse : Shape.Type.attr Owl_graph.node -> bool -> unit

    set reuse attribute in a node

    val get_reuse : Shape.Type.attr Owl_graph.node -> bool

    get reuse attribute in a node

    val is_shared : Shape.Type.attr Owl_graph.node -> bool

    check of the data block of memory is shared in a node

    get_shared_nodes node returns the nodes sharing the same block of memory as node.

    val is_var : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val is_const : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val is_node_arr : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val is_node_elt : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val is_assigned : Shape.Type.attr Owl_graph.node -> bool

    is_assigned node checks if a block of memory has been assigned to node.

    val check_assigned : Shape.Type.attr Owl_graph.node -> unit

    check_assigned node throws an exception if node has not been assigned to a block.

    val is_valid : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val validate : Shape.Type.attr Owl_graph.node -> unit

    TODO

    val invalidate : Shape.Type.attr Owl_graph.node -> unit

    TODO

    val invalidate_graph : Shape.Type.attr Owl_graph.node -> unit

    TODO

    val is_freeze : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val freeze : Shape.Type.attr Owl_graph.node -> unit

    TODO

    val freeze_descendants : Shape.Type.attr Owl_graph.node array -> unit

    TODO

    val freeze_ancestors : Shape.Type.attr Owl_graph.node array -> unit

    TODO

    TODO

    TODO

    val unsafe_assign_arr : Shape.Type.arr -> Shape.Type.Device.A.arr -> unit

    TODO

    val assign_arr : Shape.Type.arr -> Shape.Type.Device.A.arr -> unit

    TODO

    val assign_elt : Shape.Type.elt -> Shape.Type.Device.A.elt -> unit

    TODO

    val float_to_elt : float -> Shape.Type.elt

    TODO

    val elt_to_float : Shape.Type.elt -> float

    TODO

    + Shape.Type.attr Owl_graph.node array

    get_shared_nodes node returns the nodes sharing the same block of memory as node.

    val is_var : Shape.Type.attr Owl_graph.node -> bool

    check if the node's operator is Var type

    val is_const : Shape.Type.attr Owl_graph.node -> bool

    check if the node's operator is Const type

    val is_node_arr : Shape.Type.attr Owl_graph.node -> bool

    check the shape of a node's attr and return if it indicates an ndarray

    val is_node_elt : Shape.Type.attr Owl_graph.node -> bool

    check the shape of a node's attr and return if it indicates an elt

    val is_assigned : Shape.Type.attr Owl_graph.node -> bool

    is_assigned node checks if a block of memory has been assigned to node.

    val check_assigned : Shape.Type.attr Owl_graph.node -> unit

    check_assigned node throws an exception if node has not been assigned to a block.

    val is_valid : Shape.Type.attr Owl_graph.node -> bool

    check if the state attribute of a node is Valid

    val validate : Shape.Type.attr Owl_graph.node -> unit

    set Valid to the state attribute of a node

    val invalidate : Shape.Type.attr Owl_graph.node -> unit

    set Invalid to the state attribute of a node

    val invalidate_graph : Shape.Type.attr Owl_graph.node -> unit

    iteratively invalidate the nodes in a graph

    val is_freeze : Shape.Type.attr Owl_graph.node -> bool

    check the freeze attribute of a node

    val freeze : Shape.Type.attr Owl_graph.node -> unit

    return the freeze attribute of a node

    val freeze_descendants : Shape.Type.attr Owl_graph.node array -> unit

    iteratively freeze the descendants of a node

    val freeze_ancestors : Shape.Type.attr Owl_graph.node array -> unit

    iteratively freeze the ancestors of a node

    pack an A.arr type input into Arr type

    unpack input into A.arr type

    pack an A.elt type input into Elt type

    unpack input into A.elt type

    val unsafe_assign_arr : Shape.Type.arr -> Shape.Type.Device.A.arr -> unit

    assign Arr type value

    val assign_arr : Shape.Type.arr -> Shape.Type.Device.A.arr -> unit

    assign Arr type value

    val assign_elt : Shape.Type.elt -> Shape.Type.Device.A.elt -> unit

    assign Elt type value

    val float_to_elt : float -> Shape.Type.elt

    build an Elt type based on float value

    val elt_to_float : Shape.Type.elt -> float

    retrive a float value from an Elt type value

    diff --git a/docs/owl-base/Owl_computation_engine_sig/module-type-Make_Graph_Sig/index.html b/docs/owl-base/Owl_computation_engine_sig/module-type-Make_Graph_Sig/index.html index 15b81226e..c525514ab 100644 --- a/docs/owl-base/Owl_computation_engine_sig/module-type-Make_Graph_Sig/index.html +++ b/docs/owl-base/Owl_computation_engine_sig/module-type-Make_Graph_Sig/index.html @@ -1,33 +1,33 @@ -Make_Graph_Sig (owl-base.Owl_computation_engine_sig.Make_Graph_Sig)

    Module type Owl_computation_engine_sig.Make_Graph_Sig

    include Owl_computation_graph_sig.Sig
    Type definition
    type graph

    TODO

    Core functions
    val shape_or_value : Optimiser.Operator.Symbol.Shape.Type.t -> string

    TODO

    val graph_to_dot : graph -> string

    TODO

    val graph_to_trace : graph -> string

    TODO

    val save_graph : 'a -> string -> unit

    TODO

    val load_graph : string -> 'a * 'b

    TODO

    val collect_rvs : +Make_Graph_Sig (owl-base.Owl_computation_engine_sig.Make_Graph_Sig)

    Module type Owl_computation_engine_sig.Make_Graph_Sig

    include Owl_computation_graph_sig.Sig
    Type definition
    type graph
    Core functions
    val shape_or_value : Optimiser.Operator.Symbol.Shape.Type.t -> string

    print shape for ndarrays, whilst value for scalars

    val graph_to_dot : graph -> string

    generate a string that can be written to a .dot file to draw the graph

    val graph_to_trace : graph -> string

    print the graph structure to a string

    val save_graph : 'a -> string -> unit

    save the graph object to a file with given name, using marshall format

    val load_graph : string -> 'a * 'b

    load the graph object from a file with given name

    val invalidate_rvs : graph -> unit

    TODO

    traverse each node in the input array, and return the random variable type nodes.

    val invalidate_rvs : graph -> unit

    TODO

    val get_inputs : + graph

    Build a graph based on input nodes, output nodes, and graph name

    get input nodes of a graph

    get output nodes of a graph

    val set_node_elt_val : + unit
    val is_iopair_safe : 'a Owl_graph.node -> 'a Owl_graph.node -> bool

    TODO

    val make_iopair : + unit
    val is_iopair_safe : 'a Owl_graph.node -> 'a Owl_graph.node -> bool
    val update_iopair : graph -> unit

    TODO

    val remove_unused_iopair : + unit

    create an iopair between the input nodes and output nodes in a graph

    val update_iopair : graph -> unit
    val remove_unused_iopair : 'a Owl_graph.node array -> 'b array -> - 'a Owl_graph.node array * 'b array

    TODO

    val init_inputs : + 'a Owl_graph.node array * 'b array

    remove unuserd iopair from an array of nodes

    val optimise : graph -> unit

    TODO

    + unit

    initialize inputs nodes of a graph with given function f

    val optimise : graph -> unit

    optimise the graph structure

    diff --git a/docs/owl-base/Owl_computation_graph/Make/argument-1-Optimiser/Operator/Symbol/Shape/Type/Device/index.html b/docs/owl-base/Owl_computation_graph/Make/argument-1-Optimiser/Operator/Symbol/Shape/Type/Device/index.html index 5b0e9f747..0717c4518 100644 --- a/docs/owl-base/Owl_computation_graph/Make/argument-1-Optimiser/Operator/Symbol/Shape/Type/Device/index.html +++ b/docs/owl-base/Owl_computation_graph/Make/argument-1-Optimiser/Operator/Symbol/Shape/Type/Device/index.html @@ -1,2 +1,2 @@ -Device (owl-base.Owl_computation_graph.Make.Optimiser.Operator.Symbol.Shape.Type.Device)

    Module Type.Device

    Type definition
    type device

    TODO

    type value

    TODO

    Core functions
    val make_device : unit -> device

    TODO

    val arr_to_value : A.arr -> value

    TODO

    val value_to_arr : value -> A.arr

    TODO

    val elt_to_value : A.elt -> value

    TODO

    val value_to_elt : value -> A.elt

    TODO

    val value_to_float : value -> float

    TODO

    val is_arr : value -> bool

    TODO

    val is_elt : value -> bool

    TODO

    +Device (owl-base.Owl_computation_graph.Make.Optimiser.Operator.Symbol.Shape.Type.Device)

    Module Type.Device

    Type definition
    type device
    type value
    Core functions
    val make_device : unit -> device
    val arr_to_value : A.arr -> value
    val value_to_arr : value -> A.arr
    val elt_to_value : A.elt -> value
    val value_to_elt : value -> A.elt
    val value_to_float : value -> float
    val is_arr : value -> bool
    val is_elt : value -> bool
    diff --git a/docs/owl-base/Owl_computation_graph/Make/argument-1-Optimiser/Operator/Symbol/index.html b/docs/owl-base/Owl_computation_graph/Make/argument-1-Optimiser/Operator/Symbol/index.html index 2d0abcd38..1e68db6dc 100644 --- a/docs/owl-base/Owl_computation_graph/Make/argument-1-Optimiser/Operator/Symbol/index.html +++ b/docs/owl-base/Owl_computation_graph/Make/argument-1-Optimiser/Operator/Symbol/index.html @@ -1,5 +1,5 @@ -Symbol (owl-base.Owl_computation_graph.Make.Optimiser.Operator.Symbol)

    Module Operator.Symbol

    Core functions
    val op_to_str : Shape.Type.op -> string

    TODO

    val is_random_variable : Shape.Type.op -> bool

    TODO

    val refnum : 'a Owl_graph.node -> int

    TODO

    val node_shape : Shape.Type.attr Owl_graph.node -> int array

    TODO

    val node_numel : Shape.Type.attr Owl_graph.node -> int

    TODO

    val is_shape_unknown : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val infer_shape_graph : Shape.Type.attr Owl_graph.node array -> unit

    TODO

    val shape_to_str : int array option array -> string

    TODO

    val node_to_str : Shape.Type.attr Owl_graph.node -> string

    TODO

    val node_to_arr : Shape.Type.t -> Shape.Type.arr

    TODO

    val arr_to_node : Shape.Type.arr -> Shape.Type.t

    TODO

    val node_to_elt : Shape.Type.t -> Shape.Type.elt

    TODO

    val elt_to_node : Shape.Type.elt -> Shape.Type.t

    TODO

    val make_node : +Symbol (owl-base.Owl_computation_graph.Make.Optimiser.Operator.Symbol)

    Module Operator.Symbol

    Core functions
    val op_to_str : Shape.Type.op -> string

    return the name of the operator as string

    val is_random_variable : Shape.Type.op -> bool

    check if operator is randon variable

    val refnum : 'a Owl_graph.node -> int

    return the reference number of the given node

    val node_shape : Shape.Type.attr Owl_graph.node -> int array

    return the shape of a node

    val node_numel : Shape.Type.attr Owl_graph.node -> int

    return the number of elements of a node

    val is_shape_unknown : Shape.Type.attr Owl_graph.node -> bool

    check if the shape of the input node is unknown

    val infer_shape_graph : Shape.Type.attr Owl_graph.node array -> unit

    automatically infer the shape of input node according to its descendents' shapes

    val shape_to_str : int array option array -> string

    helper function; return the input array in string format.

    val node_to_str : Shape.Type.attr Owl_graph.node -> string

    print node's information to string

    val node_to_arr : Shape.Type.t -> Shape.Type.arr

    Wrap computation graph node in an array type

    val arr_to_node : Shape.Type.arr -> Shape.Type.t

    Unwrap the array type to get the computation graph node within

    val node_to_elt : Shape.Type.t -> Shape.Type.elt

    Wrap computation graph node in an Elt type

    val elt_to_node : Shape.Type.elt -> Shape.Type.t

    Unwrap the Elt type to get the computation graph node within

    val make_node : ?name:string -> ?value:Shape.Type.Device.value array -> ?shape:int array option array -> @@ -7,11 +7,11 @@ ?reuse:bool -> ?state:Shape.Type.state -> Shape.Type.op -> - Shape.Type.attr Owl_graph.node

    TODO

    val make_then_connect : + Shape.Type.attr Owl_graph.node

    crate a computation graph node

    val make_then_connect : ?shape:int array option array -> Shape.Type.op -> Shape.Type.attr Owl_graph.node array -> - Shape.Type.attr Owl_graph.node

    TODO

    val var_arr : ?shape:int array -> string -> Shape.Type.arr

    TODO

    val var_elt : string -> Shape.Type.elt

    TODO

    val const_arr : string -> Shape.Type.Device.A.arr -> Shape.Type.arr

    TODO

    val const_elt : string -> Shape.Type.Device.A.elt -> Shape.Type.elt

    TODO

    val new_block_id : unit -> int

    new_block_id () returns an unused block id.

    val make_empty_block : ?block_id:int -> int -> Shape.Type.block

    make_empty_block s returns an empty block of memory of size s.

    val make_value_block : + Shape.Type.attr Owl_graph.node

    make nodes and then connect parents and children

    val var_arr : ?shape:int array -> string -> Shape.Type.arr

    creat a node and wrap in Arr type

    val var_elt : string -> Shape.Type.elt

    creat a node and wrap in Elt type

    val const_arr : string -> Shape.Type.Device.A.arr -> Shape.Type.arr

    get ndarray value from input and create an node and wrap in Arr type

    val const_elt : string -> Shape.Type.Device.A.elt -> Shape.Type.elt

    get value from input and create an node and wrap in Elt type

    val new_block_id : unit -> int

    new_block_id () returns an unused block id.

    val make_empty_block : ?block_id:int -> int -> Shape.Type.block

    make_empty_block s returns an empty block of memory of size s.

    val make_value_block : Shape.Type.Device.value -> Shape.Type.attr Owl_graph.node -> unit

    make_value_block value node creates a block of memory initialised with value and links the new block to node.

    get_block node returns the memory block allocated to node. If no block is allocated, throws an exception.

    val add_node_to_block : @@ -23,6 +23,6 @@ unit

    Update the node that is currently using the block of memory.

    val get_block_id : Shape.Type.attr Owl_graph.node -> int

    get_block_id node returns the id of the block assigned to node. If node has not been assigned yet, returns -1.

    val set_value : Shape.Type.attr Owl_graph.node -> Shape.Type.Device.value array -> - unit

    TODO

    val set_operator : Shape.Type.attr Owl_graph.node -> Shape.Type.op -> unit

    TODO

    TODO

    val set_reuse : Shape.Type.attr Owl_graph.node -> bool -> unit

    TODO

    val get_reuse : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val is_shared : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val get_shared_nodes : + unit

    set the arrays of value to cgraph node

    get the arrays of value of cgraph node

    val set_operator : Shape.Type.attr Owl_graph.node -> Shape.Type.op -> unit

    set the operator of cgraph node

    get the operator of cgraph node

    val set_reuse : Shape.Type.attr Owl_graph.node -> bool -> unit

    set reuse attribute in a node

    val get_reuse : Shape.Type.attr Owl_graph.node -> bool

    get reuse attribute in a node

    val is_shared : Shape.Type.attr Owl_graph.node -> bool

    check of the data block of memory is shared in a node

    get_shared_nodes node returns the nodes sharing the same block of memory as node.

    val is_var : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val is_const : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val is_node_arr : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val is_node_elt : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val is_assigned : Shape.Type.attr Owl_graph.node -> bool

    is_assigned node checks if a block of memory has been assigned to node.

    val check_assigned : Shape.Type.attr Owl_graph.node -> unit

    check_assigned node throws an exception if node has not been assigned to a block.

    val is_valid : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val validate : Shape.Type.attr Owl_graph.node -> unit

    TODO

    val invalidate : Shape.Type.attr Owl_graph.node -> unit

    TODO

    val invalidate_graph : Shape.Type.attr Owl_graph.node -> unit

    TODO

    val is_freeze : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val freeze : Shape.Type.attr Owl_graph.node -> unit

    TODO

    val freeze_descendants : Shape.Type.attr Owl_graph.node array -> unit

    TODO

    val freeze_ancestors : Shape.Type.attr Owl_graph.node array -> unit

    TODO

    TODO

    TODO

    val unsafe_assign_arr : Shape.Type.arr -> Shape.Type.Device.A.arr -> unit

    TODO

    val assign_arr : Shape.Type.arr -> Shape.Type.Device.A.arr -> unit

    TODO

    val assign_elt : Shape.Type.elt -> Shape.Type.Device.A.elt -> unit

    TODO

    val float_to_elt : float -> Shape.Type.elt

    TODO

    val elt_to_float : Shape.Type.elt -> float

    TODO

    + Shape.Type.attr Owl_graph.node array

    get_shared_nodes node returns the nodes sharing the same block of memory as node.

    val is_var : Shape.Type.attr Owl_graph.node -> bool

    check if the node's operator is Var type

    val is_const : Shape.Type.attr Owl_graph.node -> bool

    check if the node's operator is Const type

    val is_node_arr : Shape.Type.attr Owl_graph.node -> bool

    check the shape of a node's attr and return if it indicates an ndarray

    val is_node_elt : Shape.Type.attr Owl_graph.node -> bool

    check the shape of a node's attr and return if it indicates an elt

    val is_assigned : Shape.Type.attr Owl_graph.node -> bool

    is_assigned node checks if a block of memory has been assigned to node.

    val check_assigned : Shape.Type.attr Owl_graph.node -> unit

    check_assigned node throws an exception if node has not been assigned to a block.

    val is_valid : Shape.Type.attr Owl_graph.node -> bool

    check if the state attribute of a node is Valid

    val validate : Shape.Type.attr Owl_graph.node -> unit

    set Valid to the state attribute of a node

    val invalidate : Shape.Type.attr Owl_graph.node -> unit

    set Invalid to the state attribute of a node

    val invalidate_graph : Shape.Type.attr Owl_graph.node -> unit

    iteratively invalidate the nodes in a graph

    val is_freeze : Shape.Type.attr Owl_graph.node -> bool

    check the freeze attribute of a node

    val freeze : Shape.Type.attr Owl_graph.node -> unit

    return the freeze attribute of a node

    val freeze_descendants : Shape.Type.attr Owl_graph.node array -> unit

    iteratively freeze the descendants of a node

    val freeze_ancestors : Shape.Type.attr Owl_graph.node array -> unit

    iteratively freeze the ancestors of a node

    pack an A.arr type input into Arr type

    unpack input into A.arr type

    pack an A.elt type input into Elt type

    unpack input into A.elt type

    val unsafe_assign_arr : Shape.Type.arr -> Shape.Type.Device.A.arr -> unit

    assign Arr type value

    val assign_arr : Shape.Type.arr -> Shape.Type.Device.A.arr -> unit

    assign Arr type value

    val assign_elt : Shape.Type.elt -> Shape.Type.Device.A.elt -> unit

    assign Elt type value

    val float_to_elt : float -> Shape.Type.elt

    build an Elt type based on float value

    val elt_to_float : Shape.Type.elt -> float

    retrive a float value from an Elt type value

    diff --git a/docs/owl-base/Owl_computation_graph_sig/module-type-Sig/Optimiser/Operator/Symbol/Shape/Type/Device/index.html b/docs/owl-base/Owl_computation_graph_sig/module-type-Sig/Optimiser/Operator/Symbol/Shape/Type/Device/index.html index 7cd32ae30..a80c6e846 100644 --- a/docs/owl-base/Owl_computation_graph_sig/module-type-Sig/Optimiser/Operator/Symbol/Shape/Type/Device/index.html +++ b/docs/owl-base/Owl_computation_graph_sig/module-type-Sig/Optimiser/Operator/Symbol/Shape/Type/Device/index.html @@ -1,2 +1,2 @@ -Device (owl-base.Owl_computation_graph_sig.Sig.Optimiser.Operator.Symbol.Shape.Type.Device)

    Module Type.Device

    Type definition
    type device

    TODO

    type value

    TODO

    Core functions
    val make_device : unit -> device

    TODO

    val arr_to_value : A.arr -> value

    TODO

    val value_to_arr : value -> A.arr

    TODO

    val elt_to_value : A.elt -> value

    TODO

    val value_to_elt : value -> A.elt

    TODO

    val value_to_float : value -> float

    TODO

    val is_arr : value -> bool

    TODO

    val is_elt : value -> bool

    TODO

    +Device (owl-base.Owl_computation_graph_sig.Sig.Optimiser.Operator.Symbol.Shape.Type.Device)

    Module Type.Device

    Type definition
    type device
    type value
    Core functions
    val make_device : unit -> device
    val arr_to_value : A.arr -> value
    val value_to_arr : value -> A.arr
    val elt_to_value : A.elt -> value
    val value_to_elt : value -> A.elt
    val value_to_float : value -> float
    val is_arr : value -> bool
    val is_elt : value -> bool
    diff --git a/docs/owl-base/Owl_computation_graph_sig/module-type-Sig/Optimiser/Operator/Symbol/index.html b/docs/owl-base/Owl_computation_graph_sig/module-type-Sig/Optimiser/Operator/Symbol/index.html index 9b5cf481f..208644ec7 100644 --- a/docs/owl-base/Owl_computation_graph_sig/module-type-Sig/Optimiser/Operator/Symbol/index.html +++ b/docs/owl-base/Owl_computation_graph_sig/module-type-Sig/Optimiser/Operator/Symbol/index.html @@ -1,5 +1,5 @@ -Symbol (owl-base.Owl_computation_graph_sig.Sig.Optimiser.Operator.Symbol)

    Module Operator.Symbol

    Core functions
    val op_to_str : Shape.Type.op -> string

    TODO

    val is_random_variable : Shape.Type.op -> bool

    TODO

    val refnum : 'a Owl_graph.node -> int

    TODO

    val node_shape : Shape.Type.attr Owl_graph.node -> int array

    TODO

    val node_numel : Shape.Type.attr Owl_graph.node -> int

    TODO

    val is_shape_unknown : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val infer_shape_graph : Shape.Type.attr Owl_graph.node array -> unit

    TODO

    val shape_to_str : int array option array -> string

    TODO

    val node_to_str : Shape.Type.attr Owl_graph.node -> string

    TODO

    val node_to_arr : Shape.Type.t -> Shape.Type.arr

    TODO

    val arr_to_node : Shape.Type.arr -> Shape.Type.t

    TODO

    val node_to_elt : Shape.Type.t -> Shape.Type.elt

    TODO

    val elt_to_node : Shape.Type.elt -> Shape.Type.t

    TODO

    val make_node : +Symbol (owl-base.Owl_computation_graph_sig.Sig.Optimiser.Operator.Symbol)

    Module Operator.Symbol

    Core functions
    val op_to_str : Shape.Type.op -> string

    return the name of the operator as string

    val is_random_variable : Shape.Type.op -> bool

    check if operator is randon variable

    val refnum : 'a Owl_graph.node -> int

    return the reference number of the given node

    val node_shape : Shape.Type.attr Owl_graph.node -> int array

    return the shape of a node

    val node_numel : Shape.Type.attr Owl_graph.node -> int

    return the number of elements of a node

    val is_shape_unknown : Shape.Type.attr Owl_graph.node -> bool

    check if the shape of the input node is unknown

    val infer_shape_graph : Shape.Type.attr Owl_graph.node array -> unit

    automatically infer the shape of input node according to its descendents' shapes

    val shape_to_str : int array option array -> string

    helper function; return the input array in string format.

    val node_to_str : Shape.Type.attr Owl_graph.node -> string

    print node's information to string

    val node_to_arr : Shape.Type.t -> Shape.Type.arr

    Wrap computation graph node in an array type

    val arr_to_node : Shape.Type.arr -> Shape.Type.t

    Unwrap the array type to get the computation graph node within

    val node_to_elt : Shape.Type.t -> Shape.Type.elt

    Wrap computation graph node in an Elt type

    val elt_to_node : Shape.Type.elt -> Shape.Type.t

    Unwrap the Elt type to get the computation graph node within

    val make_node : ?name:string -> ?value:Shape.Type.Device.value array -> ?shape:int array option array -> @@ -7,11 +7,11 @@ ?reuse:bool -> ?state:Shape.Type.state -> Shape.Type.op -> - Shape.Type.attr Owl_graph.node

    TODO

    val make_then_connect : + Shape.Type.attr Owl_graph.node

    crate a computation graph node

    val make_then_connect : ?shape:int array option array -> Shape.Type.op -> Shape.Type.attr Owl_graph.node array -> - Shape.Type.attr Owl_graph.node

    TODO

    val var_arr : ?shape:int array -> string -> Shape.Type.arr

    TODO

    val var_elt : string -> Shape.Type.elt

    TODO

    val const_arr : string -> Shape.Type.Device.A.arr -> Shape.Type.arr

    TODO

    val const_elt : string -> Shape.Type.Device.A.elt -> Shape.Type.elt

    TODO

    val new_block_id : unit -> int

    new_block_id () returns an unused block id.

    val make_empty_block : ?block_id:int -> int -> Shape.Type.block

    make_empty_block s returns an empty block of memory of size s.

    val make_value_block : + Shape.Type.attr Owl_graph.node

    make nodes and then connect parents and children

    val var_arr : ?shape:int array -> string -> Shape.Type.arr

    creat a node and wrap in Arr type

    val var_elt : string -> Shape.Type.elt

    creat a node and wrap in Elt type

    val const_arr : string -> Shape.Type.Device.A.arr -> Shape.Type.arr

    get ndarray value from input and create an node and wrap in Arr type

    val const_elt : string -> Shape.Type.Device.A.elt -> Shape.Type.elt

    get value from input and create an node and wrap in Elt type

    val new_block_id : unit -> int

    new_block_id () returns an unused block id.

    val make_empty_block : ?block_id:int -> int -> Shape.Type.block

    make_empty_block s returns an empty block of memory of size s.

    val make_value_block : Shape.Type.Device.value -> Shape.Type.attr Owl_graph.node -> unit

    make_value_block value node creates a block of memory initialised with value and links the new block to node.

    get_block node returns the memory block allocated to node. If no block is allocated, throws an exception.

    val add_node_to_block : @@ -23,6 +23,6 @@ unit

    Update the node that is currently using the block of memory.

    val get_block_id : Shape.Type.attr Owl_graph.node -> int

    get_block_id node returns the id of the block assigned to node. If node has not been assigned yet, returns -1.

    val set_value : Shape.Type.attr Owl_graph.node -> Shape.Type.Device.value array -> - unit

    TODO

    val set_operator : Shape.Type.attr Owl_graph.node -> Shape.Type.op -> unit

    TODO

    TODO

    val set_reuse : Shape.Type.attr Owl_graph.node -> bool -> unit

    TODO

    val get_reuse : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val is_shared : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val get_shared_nodes : + unit

    set the arrays of value to cgraph node

    get the arrays of value of cgraph node

    val set_operator : Shape.Type.attr Owl_graph.node -> Shape.Type.op -> unit

    set the operator of cgraph node

    get the operator of cgraph node

    val set_reuse : Shape.Type.attr Owl_graph.node -> bool -> unit

    set reuse attribute in a node

    val get_reuse : Shape.Type.attr Owl_graph.node -> bool

    get reuse attribute in a node

    val is_shared : Shape.Type.attr Owl_graph.node -> bool

    check of the data block of memory is shared in a node

    get_shared_nodes node returns the nodes sharing the same block of memory as node.

    val is_var : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val is_const : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val is_node_arr : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val is_node_elt : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val is_assigned : Shape.Type.attr Owl_graph.node -> bool

    is_assigned node checks if a block of memory has been assigned to node.

    val check_assigned : Shape.Type.attr Owl_graph.node -> unit

    check_assigned node throws an exception if node has not been assigned to a block.

    val is_valid : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val validate : Shape.Type.attr Owl_graph.node -> unit

    TODO

    val invalidate : Shape.Type.attr Owl_graph.node -> unit

    TODO

    val invalidate_graph : Shape.Type.attr Owl_graph.node -> unit

    TODO

    val is_freeze : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val freeze : Shape.Type.attr Owl_graph.node -> unit

    TODO

    val freeze_descendants : Shape.Type.attr Owl_graph.node array -> unit

    TODO

    val freeze_ancestors : Shape.Type.attr Owl_graph.node array -> unit

    TODO

    TODO

    TODO

    val unsafe_assign_arr : Shape.Type.arr -> Shape.Type.Device.A.arr -> unit

    TODO

    val assign_arr : Shape.Type.arr -> Shape.Type.Device.A.arr -> unit

    TODO

    val assign_elt : Shape.Type.elt -> Shape.Type.Device.A.elt -> unit

    TODO

    val float_to_elt : float -> Shape.Type.elt

    TODO

    val elt_to_float : Shape.Type.elt -> float

    TODO

    + Shape.Type.attr Owl_graph.node array

    get_shared_nodes node returns the nodes sharing the same block of memory as node.

    val is_var : Shape.Type.attr Owl_graph.node -> bool

    check if the node's operator is Var type

    val is_const : Shape.Type.attr Owl_graph.node -> bool

    check if the node's operator is Const type

    val is_node_arr : Shape.Type.attr Owl_graph.node -> bool

    check the shape of a node's attr and return if it indicates an ndarray

    val is_node_elt : Shape.Type.attr Owl_graph.node -> bool

    check the shape of a node's attr and return if it indicates an elt

    val is_assigned : Shape.Type.attr Owl_graph.node -> bool

    is_assigned node checks if a block of memory has been assigned to node.

    val check_assigned : Shape.Type.attr Owl_graph.node -> unit

    check_assigned node throws an exception if node has not been assigned to a block.

    val is_valid : Shape.Type.attr Owl_graph.node -> bool

    check if the state attribute of a node is Valid

    val validate : Shape.Type.attr Owl_graph.node -> unit

    set Valid to the state attribute of a node

    val invalidate : Shape.Type.attr Owl_graph.node -> unit

    set Invalid to the state attribute of a node

    val invalidate_graph : Shape.Type.attr Owl_graph.node -> unit

    iteratively invalidate the nodes in a graph

    val is_freeze : Shape.Type.attr Owl_graph.node -> bool

    check the freeze attribute of a node

    val freeze : Shape.Type.attr Owl_graph.node -> unit

    return the freeze attribute of a node

    val freeze_descendants : Shape.Type.attr Owl_graph.node array -> unit

    iteratively freeze the descendants of a node

    val freeze_ancestors : Shape.Type.attr Owl_graph.node array -> unit

    iteratively freeze the ancestors of a node

    pack an A.arr type input into Arr type

    unpack input into A.arr type

    pack an A.elt type input into Elt type

    unpack input into A.elt type

    val unsafe_assign_arr : Shape.Type.arr -> Shape.Type.Device.A.arr -> unit

    assign Arr type value

    val assign_arr : Shape.Type.arr -> Shape.Type.Device.A.arr -> unit

    assign Arr type value

    val assign_elt : Shape.Type.elt -> Shape.Type.Device.A.elt -> unit

    assign Elt type value

    val float_to_elt : float -> Shape.Type.elt

    build an Elt type based on float value

    val elt_to_float : Shape.Type.elt -> float

    retrive a float value from an Elt type value

    diff --git a/docs/owl-base/Owl_computation_graph_sig/module-type-Sig/index.html b/docs/owl-base/Owl_computation_graph_sig/module-type-Sig/index.html index 75728aaec..b4d7dcaaa 100644 --- a/docs/owl-base/Owl_computation_graph_sig/module-type-Sig/index.html +++ b/docs/owl-base/Owl_computation_graph_sig/module-type-Sig/index.html @@ -1,33 +1,33 @@ -Sig (owl-base.Owl_computation_graph_sig.Sig)

    Module type Owl_computation_graph_sig.Sig

    Type definition
    type graph

    TODO

    Core functions
    val shape_or_value : Optimiser.Operator.Symbol.Shape.Type.t -> string

    TODO

    val graph_to_dot : graph -> string

    TODO

    val graph_to_trace : graph -> string

    TODO

    val save_graph : 'a -> string -> unit

    TODO

    val load_graph : string -> 'a * 'b

    TODO

    val collect_rvs : +Sig (owl-base.Owl_computation_graph_sig.Sig)

    Module type Owl_computation_graph_sig.Sig

    Type definition
    type graph
    Core functions
    val shape_or_value : Optimiser.Operator.Symbol.Shape.Type.t -> string

    print shape for ndarrays, whilst value for scalars

    val graph_to_dot : graph -> string

    generate a string that can be written to a .dot file to draw the graph

    val graph_to_trace : graph -> string

    print the graph structure to a string

    val save_graph : 'a -> string -> unit

    save the graph object to a file with given name, using marshall format

    val load_graph : string -> 'a * 'b

    load the graph object from a file with given name

    val invalidate_rvs : graph -> unit

    TODO

    traverse each node in the input array, and return the random variable type nodes.

    val invalidate_rvs : graph -> unit

    TODO

    val get_inputs : + graph

    Build a graph based on input nodes, output nodes, and graph name

    get input nodes of a graph

    get output nodes of a graph

    val set_node_elt_val : + unit
    val is_iopair_safe : 'a Owl_graph.node -> 'a Owl_graph.node -> bool

    TODO

    val make_iopair : + unit
    val is_iopair_safe : 'a Owl_graph.node -> 'a Owl_graph.node -> bool
    val update_iopair : graph -> unit

    TODO

    val remove_unused_iopair : + unit

    create an iopair between the input nodes and output nodes in a graph

    val update_iopair : graph -> unit
    val remove_unused_iopair : 'a Owl_graph.node array -> 'b array -> - 'a Owl_graph.node array * 'b array

    TODO

    val init_inputs : + 'a Owl_graph.node array * 'b array

    remove unuserd iopair from an array of nodes

    val optimise : graph -> unit

    TODO

    + unit

    initialize inputs nodes of a graph with given function f

    val optimise : graph -> unit

    optimise the graph structure

    diff --git a/docs/owl-base/Owl_computation_operator/Make/argument-1-Symbol/Shape/Type/Device/index.html b/docs/owl-base/Owl_computation_operator/Make/argument-1-Symbol/Shape/Type/Device/index.html index 4e65b0fb5..6763786d5 100644 --- a/docs/owl-base/Owl_computation_operator/Make/argument-1-Symbol/Shape/Type/Device/index.html +++ b/docs/owl-base/Owl_computation_operator/Make/argument-1-Symbol/Shape/Type/Device/index.html @@ -1,2 +1,2 @@ -Device (owl-base.Owl_computation_operator.Make.Symbol.Shape.Type.Device)

    Module Type.Device

    Type definition
    type device

    TODO

    type value

    TODO

    Core functions
    val make_device : unit -> device

    TODO

    val arr_to_value : A.arr -> value

    TODO

    val value_to_arr : value -> A.arr

    TODO

    val elt_to_value : A.elt -> value

    TODO

    val value_to_elt : value -> A.elt

    TODO

    val value_to_float : value -> float

    TODO

    val is_arr : value -> bool

    TODO

    val is_elt : value -> bool

    TODO

    +Device (owl-base.Owl_computation_operator.Make.Symbol.Shape.Type.Device)

    Module Type.Device

    Type definition
    type device
    type value
    Core functions
    val make_device : unit -> device
    val arr_to_value : A.arr -> value
    val value_to_arr : value -> A.arr
    val elt_to_value : A.elt -> value
    val value_to_elt : value -> A.elt
    val value_to_float : value -> float
    val is_arr : value -> bool
    val is_elt : value -> bool
    diff --git a/docs/owl-base/Owl_computation_operator/Make/argument-1-Symbol/index.html b/docs/owl-base/Owl_computation_operator/Make/argument-1-Symbol/index.html index 5ba99e85a..42107b9e3 100644 --- a/docs/owl-base/Owl_computation_operator/Make/argument-1-Symbol/index.html +++ b/docs/owl-base/Owl_computation_operator/Make/argument-1-Symbol/index.html @@ -1,5 +1,5 @@ -Symbol (owl-base.Owl_computation_operator.Make.Symbol)

    Parameter Make.Symbol

    Core functions
    val op_to_str : Shape.Type.op -> string

    TODO

    val is_random_variable : Shape.Type.op -> bool

    TODO

    val refnum : 'a Owl_graph.node -> int

    TODO

    val node_shape : Shape.Type.attr Owl_graph.node -> int array

    TODO

    val node_numel : Shape.Type.attr Owl_graph.node -> int

    TODO

    val is_shape_unknown : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val infer_shape_graph : Shape.Type.attr Owl_graph.node array -> unit

    TODO

    val shape_to_str : int array option array -> string

    TODO

    val node_to_str : Shape.Type.attr Owl_graph.node -> string

    TODO

    val node_to_arr : Shape.Type.t -> Shape.Type.arr

    TODO

    val arr_to_node : Shape.Type.arr -> Shape.Type.t

    TODO

    val node_to_elt : Shape.Type.t -> Shape.Type.elt

    TODO

    val elt_to_node : Shape.Type.elt -> Shape.Type.t

    TODO

    val make_node : +Symbol (owl-base.Owl_computation_operator.Make.Symbol)

    Parameter Make.Symbol

    Core functions
    val op_to_str : Shape.Type.op -> string

    return the name of the operator as string

    val is_random_variable : Shape.Type.op -> bool

    check if operator is randon variable

    val refnum : 'a Owl_graph.node -> int

    return the reference number of the given node

    val node_shape : Shape.Type.attr Owl_graph.node -> int array

    return the shape of a node

    val node_numel : Shape.Type.attr Owl_graph.node -> int

    return the number of elements of a node

    val is_shape_unknown : Shape.Type.attr Owl_graph.node -> bool

    check if the shape of the input node is unknown

    val infer_shape_graph : Shape.Type.attr Owl_graph.node array -> unit

    automatically infer the shape of input node according to its descendents' shapes

    val shape_to_str : int array option array -> string

    helper function; return the input array in string format.

    val node_to_str : Shape.Type.attr Owl_graph.node -> string

    print node's information to string

    val node_to_arr : Shape.Type.t -> Shape.Type.arr

    Wrap computation graph node in an array type

    val arr_to_node : Shape.Type.arr -> Shape.Type.t

    Unwrap the array type to get the computation graph node within

    val node_to_elt : Shape.Type.t -> Shape.Type.elt

    Wrap computation graph node in an Elt type

    val elt_to_node : Shape.Type.elt -> Shape.Type.t

    Unwrap the Elt type to get the computation graph node within

    val make_node : ?name:string -> ?value:Shape.Type.Device.value array -> ?shape:int array option array -> @@ -7,11 +7,11 @@ ?reuse:bool -> ?state:Shape.Type.state -> Shape.Type.op -> - Shape.Type.attr Owl_graph.node

    TODO

    val make_then_connect : + Shape.Type.attr Owl_graph.node

    crate a computation graph node

    val make_then_connect : ?shape:int array option array -> Shape.Type.op -> Shape.Type.attr Owl_graph.node array -> - Shape.Type.attr Owl_graph.node

    TODO

    val var_arr : ?shape:int array -> string -> Shape.Type.arr

    TODO

    val var_elt : string -> Shape.Type.elt

    TODO

    val const_arr : string -> Shape.Type.Device.A.arr -> Shape.Type.arr

    TODO

    val const_elt : string -> Shape.Type.Device.A.elt -> Shape.Type.elt

    TODO

    val new_block_id : unit -> int

    new_block_id () returns an unused block id.

    val make_empty_block : ?block_id:int -> int -> Shape.Type.block

    make_empty_block s returns an empty block of memory of size s.

    val make_value_block : + Shape.Type.attr Owl_graph.node

    make nodes and then connect parents and children

    val var_arr : ?shape:int array -> string -> Shape.Type.arr

    creat a node and wrap in Arr type

    val var_elt : string -> Shape.Type.elt

    creat a node and wrap in Elt type

    val const_arr : string -> Shape.Type.Device.A.arr -> Shape.Type.arr

    get ndarray value from input and create an node and wrap in Arr type

    val const_elt : string -> Shape.Type.Device.A.elt -> Shape.Type.elt

    get value from input and create an node and wrap in Elt type

    val new_block_id : unit -> int

    new_block_id () returns an unused block id.

    val make_empty_block : ?block_id:int -> int -> Shape.Type.block

    make_empty_block s returns an empty block of memory of size s.

    val make_value_block : Shape.Type.Device.value -> Shape.Type.attr Owl_graph.node -> unit

    make_value_block value node creates a block of memory initialised with value and links the new block to node.

    get_block node returns the memory block allocated to node. If no block is allocated, throws an exception.

    val add_node_to_block : @@ -23,6 +23,6 @@ unit

    Update the node that is currently using the block of memory.

    val get_block_id : Shape.Type.attr Owl_graph.node -> int

    get_block_id node returns the id of the block assigned to node. If node has not been assigned yet, returns -1.

    val set_value : Shape.Type.attr Owl_graph.node -> Shape.Type.Device.value array -> - unit

    TODO

    val set_operator : Shape.Type.attr Owl_graph.node -> Shape.Type.op -> unit

    TODO

    TODO

    val set_reuse : Shape.Type.attr Owl_graph.node -> bool -> unit

    TODO

    val get_reuse : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val is_shared : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val get_shared_nodes : + unit

    set the arrays of value to cgraph node

    get the arrays of value of cgraph node

    val set_operator : Shape.Type.attr Owl_graph.node -> Shape.Type.op -> unit

    set the operator of cgraph node

    get the operator of cgraph node

    val set_reuse : Shape.Type.attr Owl_graph.node -> bool -> unit

    set reuse attribute in a node

    val get_reuse : Shape.Type.attr Owl_graph.node -> bool

    get reuse attribute in a node

    val is_shared : Shape.Type.attr Owl_graph.node -> bool

    check of the data block of memory is shared in a node

    get_shared_nodes node returns the nodes sharing the same block of memory as node.

    val is_var : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val is_const : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val is_node_arr : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val is_node_elt : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val is_assigned : Shape.Type.attr Owl_graph.node -> bool

    is_assigned node checks if a block of memory has been assigned to node.

    val check_assigned : Shape.Type.attr Owl_graph.node -> unit

    check_assigned node throws an exception if node has not been assigned to a block.

    val is_valid : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val validate : Shape.Type.attr Owl_graph.node -> unit

    TODO

    val invalidate : Shape.Type.attr Owl_graph.node -> unit

    TODO

    val invalidate_graph : Shape.Type.attr Owl_graph.node -> unit

    TODO

    val is_freeze : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val freeze : Shape.Type.attr Owl_graph.node -> unit

    TODO

    val freeze_descendants : Shape.Type.attr Owl_graph.node array -> unit

    TODO

    val freeze_ancestors : Shape.Type.attr Owl_graph.node array -> unit

    TODO

    TODO

    TODO

    val unsafe_assign_arr : Shape.Type.arr -> Shape.Type.Device.A.arr -> unit

    TODO

    val assign_arr : Shape.Type.arr -> Shape.Type.Device.A.arr -> unit

    TODO

    val assign_elt : Shape.Type.elt -> Shape.Type.Device.A.elt -> unit

    TODO

    val float_to_elt : float -> Shape.Type.elt

    TODO

    val elt_to_float : Shape.Type.elt -> float

    TODO

    + Shape.Type.attr Owl_graph.node array

    get_shared_nodes node returns the nodes sharing the same block of memory as node.

    val is_var : Shape.Type.attr Owl_graph.node -> bool

    check if the node's operator is Var type

    val is_const : Shape.Type.attr Owl_graph.node -> bool

    check if the node's operator is Const type

    val is_node_arr : Shape.Type.attr Owl_graph.node -> bool

    check the shape of a node's attr and return if it indicates an ndarray

    val is_node_elt : Shape.Type.attr Owl_graph.node -> bool

    check the shape of a node's attr and return if it indicates an elt

    val is_assigned : Shape.Type.attr Owl_graph.node -> bool

    is_assigned node checks if a block of memory has been assigned to node.

    val check_assigned : Shape.Type.attr Owl_graph.node -> unit

    check_assigned node throws an exception if node has not been assigned to a block.

    val is_valid : Shape.Type.attr Owl_graph.node -> bool

    check if the state attribute of a node is Valid

    val validate : Shape.Type.attr Owl_graph.node -> unit

    set Valid to the state attribute of a node

    val invalidate : Shape.Type.attr Owl_graph.node -> unit

    set Invalid to the state attribute of a node

    val invalidate_graph : Shape.Type.attr Owl_graph.node -> unit

    iteratively invalidate the nodes in a graph

    val is_freeze : Shape.Type.attr Owl_graph.node -> bool

    check the freeze attribute of a node

    val freeze : Shape.Type.attr Owl_graph.node -> unit

    return the freeze attribute of a node

    val freeze_descendants : Shape.Type.attr Owl_graph.node array -> unit

    iteratively freeze the descendants of a node

    val freeze_ancestors : Shape.Type.attr Owl_graph.node array -> unit

    iteratively freeze the ancestors of a node

    pack an A.arr type input into Arr type

    unpack input into A.arr type

    pack an A.elt type input into Elt type

    unpack input into A.elt type

    val unsafe_assign_arr : Shape.Type.arr -> Shape.Type.Device.A.arr -> unit

    assign Arr type value

    val assign_arr : Shape.Type.arr -> Shape.Type.Device.A.arr -> unit

    assign Arr type value

    val assign_elt : Shape.Type.elt -> Shape.Type.Device.A.elt -> unit

    assign Elt type value

    val float_to_elt : float -> Shape.Type.elt

    build an Elt type based on float value

    val elt_to_float : Shape.Type.elt -> float

    retrive a float value from an Elt type value

    diff --git a/docs/owl-base/Owl_computation_operator_sig/module-type-Sig/Symbol/Shape/Type/Device/index.html b/docs/owl-base/Owl_computation_operator_sig/module-type-Sig/Symbol/Shape/Type/Device/index.html index 1e80f1fa6..36da5756e 100644 --- a/docs/owl-base/Owl_computation_operator_sig/module-type-Sig/Symbol/Shape/Type/Device/index.html +++ b/docs/owl-base/Owl_computation_operator_sig/module-type-Sig/Symbol/Shape/Type/Device/index.html @@ -1,2 +1,2 @@ -Device (owl-base.Owl_computation_operator_sig.Sig.Symbol.Shape.Type.Device)

    Module Type.Device

    Type definition
    type device

    TODO

    type value

    TODO

    Core functions
    val make_device : unit -> device

    TODO

    val arr_to_value : A.arr -> value

    TODO

    val value_to_arr : value -> A.arr

    TODO

    val elt_to_value : A.elt -> value

    TODO

    val value_to_elt : value -> A.elt

    TODO

    val value_to_float : value -> float

    TODO

    val is_arr : value -> bool

    TODO

    val is_elt : value -> bool

    TODO

    +Device (owl-base.Owl_computation_operator_sig.Sig.Symbol.Shape.Type.Device)

    Module Type.Device

    Type definition
    type device
    type value
    Core functions
    val make_device : unit -> device
    val arr_to_value : A.arr -> value
    val value_to_arr : value -> A.arr
    val elt_to_value : A.elt -> value
    val value_to_elt : value -> A.elt
    val value_to_float : value -> float
    val is_arr : value -> bool
    val is_elt : value -> bool
    diff --git a/docs/owl-base/Owl_computation_operator_sig/module-type-Sig/Symbol/index.html b/docs/owl-base/Owl_computation_operator_sig/module-type-Sig/Symbol/index.html index e0e2d61b9..6011af62d 100644 --- a/docs/owl-base/Owl_computation_operator_sig/module-type-Sig/Symbol/index.html +++ b/docs/owl-base/Owl_computation_operator_sig/module-type-Sig/Symbol/index.html @@ -1,5 +1,5 @@ -Symbol (owl-base.Owl_computation_operator_sig.Sig.Symbol)

    Module Sig.Symbol

    Core functions
    val op_to_str : Shape.Type.op -> string

    TODO

    val is_random_variable : Shape.Type.op -> bool

    TODO

    val refnum : 'a Owl_graph.node -> int

    TODO

    val node_shape : Shape.Type.attr Owl_graph.node -> int array

    TODO

    val node_numel : Shape.Type.attr Owl_graph.node -> int

    TODO

    val is_shape_unknown : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val infer_shape_graph : Shape.Type.attr Owl_graph.node array -> unit

    TODO

    val shape_to_str : int array option array -> string

    TODO

    val node_to_str : Shape.Type.attr Owl_graph.node -> string

    TODO

    val node_to_arr : Shape.Type.t -> Shape.Type.arr

    TODO

    val arr_to_node : Shape.Type.arr -> Shape.Type.t

    TODO

    val node_to_elt : Shape.Type.t -> Shape.Type.elt

    TODO

    val elt_to_node : Shape.Type.elt -> Shape.Type.t

    TODO

    val make_node : +Symbol (owl-base.Owl_computation_operator_sig.Sig.Symbol)

    Module Sig.Symbol

    Core functions
    val op_to_str : Shape.Type.op -> string

    return the name of the operator as string

    val is_random_variable : Shape.Type.op -> bool

    check if operator is randon variable

    val refnum : 'a Owl_graph.node -> int

    return the reference number of the given node

    val node_shape : Shape.Type.attr Owl_graph.node -> int array

    return the shape of a node

    val node_numel : Shape.Type.attr Owl_graph.node -> int

    return the number of elements of a node

    val is_shape_unknown : Shape.Type.attr Owl_graph.node -> bool

    check if the shape of the input node is unknown

    val infer_shape_graph : Shape.Type.attr Owl_graph.node array -> unit

    automatically infer the shape of input node according to its descendents' shapes

    val shape_to_str : int array option array -> string

    helper function; return the input array in string format.

    val node_to_str : Shape.Type.attr Owl_graph.node -> string

    print node's information to string

    val node_to_arr : Shape.Type.t -> Shape.Type.arr

    Wrap computation graph node in an array type

    val arr_to_node : Shape.Type.arr -> Shape.Type.t

    Unwrap the array type to get the computation graph node within

    val node_to_elt : Shape.Type.t -> Shape.Type.elt

    Wrap computation graph node in an Elt type

    val elt_to_node : Shape.Type.elt -> Shape.Type.t

    Unwrap the Elt type to get the computation graph node within

    val make_node : ?name:string -> ?value:Shape.Type.Device.value array -> ?shape:int array option array -> @@ -7,11 +7,11 @@ ?reuse:bool -> ?state:Shape.Type.state -> Shape.Type.op -> - Shape.Type.attr Owl_graph.node

    TODO

    val make_then_connect : + Shape.Type.attr Owl_graph.node

    crate a computation graph node

    val make_then_connect : ?shape:int array option array -> Shape.Type.op -> Shape.Type.attr Owl_graph.node array -> - Shape.Type.attr Owl_graph.node

    TODO

    val var_arr : ?shape:int array -> string -> Shape.Type.arr

    TODO

    val var_elt : string -> Shape.Type.elt

    TODO

    val const_arr : string -> Shape.Type.Device.A.arr -> Shape.Type.arr

    TODO

    val const_elt : string -> Shape.Type.Device.A.elt -> Shape.Type.elt

    TODO

    val new_block_id : unit -> int

    new_block_id () returns an unused block id.

    val make_empty_block : ?block_id:int -> int -> Shape.Type.block

    make_empty_block s returns an empty block of memory of size s.

    val make_value_block : + Shape.Type.attr Owl_graph.node

    make nodes and then connect parents and children

    val var_arr : ?shape:int array -> string -> Shape.Type.arr

    creat a node and wrap in Arr type

    val var_elt : string -> Shape.Type.elt

    creat a node and wrap in Elt type

    val const_arr : string -> Shape.Type.Device.A.arr -> Shape.Type.arr

    get ndarray value from input and create an node and wrap in Arr type

    val const_elt : string -> Shape.Type.Device.A.elt -> Shape.Type.elt

    get value from input and create an node and wrap in Elt type

    val new_block_id : unit -> int

    new_block_id () returns an unused block id.

    val make_empty_block : ?block_id:int -> int -> Shape.Type.block

    make_empty_block s returns an empty block of memory of size s.

    val make_value_block : Shape.Type.Device.value -> Shape.Type.attr Owl_graph.node -> unit

    make_value_block value node creates a block of memory initialised with value and links the new block to node.

    get_block node returns the memory block allocated to node. If no block is allocated, throws an exception.

    val add_node_to_block : @@ -23,6 +23,6 @@ unit

    Update the node that is currently using the block of memory.

    val get_block_id : Shape.Type.attr Owl_graph.node -> int

    get_block_id node returns the id of the block assigned to node. If node has not been assigned yet, returns -1.

    val set_value : Shape.Type.attr Owl_graph.node -> Shape.Type.Device.value array -> - unit

    TODO

    val set_operator : Shape.Type.attr Owl_graph.node -> Shape.Type.op -> unit

    TODO

    TODO

    val set_reuse : Shape.Type.attr Owl_graph.node -> bool -> unit

    TODO

    val get_reuse : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val is_shared : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val get_shared_nodes : + unit

    set the arrays of value to cgraph node

    get the arrays of value of cgraph node

    val set_operator : Shape.Type.attr Owl_graph.node -> Shape.Type.op -> unit

    set the operator of cgraph node

    get the operator of cgraph node

    val set_reuse : Shape.Type.attr Owl_graph.node -> bool -> unit

    set reuse attribute in a node

    val get_reuse : Shape.Type.attr Owl_graph.node -> bool

    get reuse attribute in a node

    val is_shared : Shape.Type.attr Owl_graph.node -> bool

    check of the data block of memory is shared in a node

    get_shared_nodes node returns the nodes sharing the same block of memory as node.

    val is_var : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val is_const : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val is_node_arr : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val is_node_elt : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val is_assigned : Shape.Type.attr Owl_graph.node -> bool

    is_assigned node checks if a block of memory has been assigned to node.

    val check_assigned : Shape.Type.attr Owl_graph.node -> unit

    check_assigned node throws an exception if node has not been assigned to a block.

    val is_valid : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val validate : Shape.Type.attr Owl_graph.node -> unit

    TODO

    val invalidate : Shape.Type.attr Owl_graph.node -> unit

    TODO

    val invalidate_graph : Shape.Type.attr Owl_graph.node -> unit

    TODO

    val is_freeze : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val freeze : Shape.Type.attr Owl_graph.node -> unit

    TODO

    val freeze_descendants : Shape.Type.attr Owl_graph.node array -> unit

    TODO

    val freeze_ancestors : Shape.Type.attr Owl_graph.node array -> unit

    TODO

    TODO

    TODO

    val unsafe_assign_arr : Shape.Type.arr -> Shape.Type.Device.A.arr -> unit

    TODO

    val assign_arr : Shape.Type.arr -> Shape.Type.Device.A.arr -> unit

    TODO

    val assign_elt : Shape.Type.elt -> Shape.Type.Device.A.elt -> unit

    TODO

    val float_to_elt : float -> Shape.Type.elt

    TODO

    val elt_to_float : Shape.Type.elt -> float

    TODO

    + Shape.Type.attr Owl_graph.node array

    get_shared_nodes node returns the nodes sharing the same block of memory as node.

    val is_var : Shape.Type.attr Owl_graph.node -> bool

    check if the node's operator is Var type

    val is_const : Shape.Type.attr Owl_graph.node -> bool

    check if the node's operator is Const type

    val is_node_arr : Shape.Type.attr Owl_graph.node -> bool

    check the shape of a node's attr and return if it indicates an ndarray

    val is_node_elt : Shape.Type.attr Owl_graph.node -> bool

    check the shape of a node's attr and return if it indicates an elt

    val is_assigned : Shape.Type.attr Owl_graph.node -> bool

    is_assigned node checks if a block of memory has been assigned to node.

    val check_assigned : Shape.Type.attr Owl_graph.node -> unit

    check_assigned node throws an exception if node has not been assigned to a block.

    val is_valid : Shape.Type.attr Owl_graph.node -> bool

    check if the state attribute of a node is Valid

    val validate : Shape.Type.attr Owl_graph.node -> unit

    set Valid to the state attribute of a node

    val invalidate : Shape.Type.attr Owl_graph.node -> unit

    set Invalid to the state attribute of a node

    val invalidate_graph : Shape.Type.attr Owl_graph.node -> unit

    iteratively invalidate the nodes in a graph

    val is_freeze : Shape.Type.attr Owl_graph.node -> bool

    check the freeze attribute of a node

    val freeze : Shape.Type.attr Owl_graph.node -> unit

    return the freeze attribute of a node

    val freeze_descendants : Shape.Type.attr Owl_graph.node array -> unit

    iteratively freeze the descendants of a node

    val freeze_ancestors : Shape.Type.attr Owl_graph.node array -> unit

    iteratively freeze the ancestors of a node

    pack an A.arr type input into Arr type

    unpack input into A.arr type

    pack an A.elt type input into Elt type

    unpack input into A.elt type

    val unsafe_assign_arr : Shape.Type.arr -> Shape.Type.Device.A.arr -> unit

    assign Arr type value

    val assign_arr : Shape.Type.arr -> Shape.Type.Device.A.arr -> unit

    assign Arr type value

    val assign_elt : Shape.Type.elt -> Shape.Type.Device.A.elt -> unit

    assign Elt type value

    val float_to_elt : float -> Shape.Type.elt

    build an Elt type based on float value

    val elt_to_float : Shape.Type.elt -> float

    retrive a float value from an Elt type value

    diff --git a/docs/owl-base/Owl_computation_optimiser/Make/argument-1-Operator/Symbol/Shape/Type/Device/index.html b/docs/owl-base/Owl_computation_optimiser/Make/argument-1-Operator/Symbol/Shape/Type/Device/index.html index 8edff486c..7d9619d99 100644 --- a/docs/owl-base/Owl_computation_optimiser/Make/argument-1-Operator/Symbol/Shape/Type/Device/index.html +++ b/docs/owl-base/Owl_computation_optimiser/Make/argument-1-Operator/Symbol/Shape/Type/Device/index.html @@ -1,2 +1,2 @@ -Device (owl-base.Owl_computation_optimiser.Make.Operator.Symbol.Shape.Type.Device)

    Module Type.Device

    Type definition
    type device

    TODO

    type value

    TODO

    Core functions
    val make_device : unit -> device

    TODO

    val arr_to_value : A.arr -> value

    TODO

    val value_to_arr : value -> A.arr

    TODO

    val elt_to_value : A.elt -> value

    TODO

    val value_to_elt : value -> A.elt

    TODO

    val value_to_float : value -> float

    TODO

    val is_arr : value -> bool

    TODO

    val is_elt : value -> bool

    TODO

    +Device (owl-base.Owl_computation_optimiser.Make.Operator.Symbol.Shape.Type.Device)

    Module Type.Device

    Type definition
    type device
    type value
    Core functions
    val make_device : unit -> device
    val arr_to_value : A.arr -> value
    val value_to_arr : value -> A.arr
    val elt_to_value : A.elt -> value
    val value_to_elt : value -> A.elt
    val value_to_float : value -> float
    val is_arr : value -> bool
    val is_elt : value -> bool
    diff --git a/docs/owl-base/Owl_computation_optimiser/Make/argument-1-Operator/Symbol/index.html b/docs/owl-base/Owl_computation_optimiser/Make/argument-1-Operator/Symbol/index.html index 00ebdca45..01d4b860c 100644 --- a/docs/owl-base/Owl_computation_optimiser/Make/argument-1-Operator/Symbol/index.html +++ b/docs/owl-base/Owl_computation_optimiser/Make/argument-1-Operator/Symbol/index.html @@ -1,5 +1,5 @@ -Symbol (owl-base.Owl_computation_optimiser.Make.Operator.Symbol)

    Module Operator.Symbol

    Core functions
    val op_to_str : Shape.Type.op -> string

    TODO

    val is_random_variable : Shape.Type.op -> bool

    TODO

    val refnum : 'a Owl_graph.node -> int

    TODO

    val node_shape : Shape.Type.attr Owl_graph.node -> int array

    TODO

    val node_numel : Shape.Type.attr Owl_graph.node -> int

    TODO

    val is_shape_unknown : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val infer_shape_graph : Shape.Type.attr Owl_graph.node array -> unit

    TODO

    val shape_to_str : int array option array -> string

    TODO

    val node_to_str : Shape.Type.attr Owl_graph.node -> string

    TODO

    val node_to_arr : Shape.Type.t -> Shape.Type.arr

    TODO

    val arr_to_node : Shape.Type.arr -> Shape.Type.t

    TODO

    val node_to_elt : Shape.Type.t -> Shape.Type.elt

    TODO

    val elt_to_node : Shape.Type.elt -> Shape.Type.t

    TODO

    val make_node : +Symbol (owl-base.Owl_computation_optimiser.Make.Operator.Symbol)

    Module Operator.Symbol

    Core functions
    val op_to_str : Shape.Type.op -> string

    return the name of the operator as string

    val is_random_variable : Shape.Type.op -> bool

    check if operator is randon variable

    val refnum : 'a Owl_graph.node -> int

    return the reference number of the given node

    val node_shape : Shape.Type.attr Owl_graph.node -> int array

    return the shape of a node

    val node_numel : Shape.Type.attr Owl_graph.node -> int

    return the number of elements of a node

    val is_shape_unknown : Shape.Type.attr Owl_graph.node -> bool

    check if the shape of the input node is unknown

    val infer_shape_graph : Shape.Type.attr Owl_graph.node array -> unit

    automatically infer the shape of input node according to its descendents' shapes

    val shape_to_str : int array option array -> string

    helper function; return the input array in string format.

    val node_to_str : Shape.Type.attr Owl_graph.node -> string

    print node's information to string

    val node_to_arr : Shape.Type.t -> Shape.Type.arr

    Wrap computation graph node in an array type

    val arr_to_node : Shape.Type.arr -> Shape.Type.t

    Unwrap the array type to get the computation graph node within

    val node_to_elt : Shape.Type.t -> Shape.Type.elt

    Wrap computation graph node in an Elt type

    val elt_to_node : Shape.Type.elt -> Shape.Type.t

    Unwrap the Elt type to get the computation graph node within

    val make_node : ?name:string -> ?value:Shape.Type.Device.value array -> ?shape:int array option array -> @@ -7,11 +7,11 @@ ?reuse:bool -> ?state:Shape.Type.state -> Shape.Type.op -> - Shape.Type.attr Owl_graph.node

    TODO

    val make_then_connect : + Shape.Type.attr Owl_graph.node

    crate a computation graph node

    val make_then_connect : ?shape:int array option array -> Shape.Type.op -> Shape.Type.attr Owl_graph.node array -> - Shape.Type.attr Owl_graph.node

    TODO

    val var_arr : ?shape:int array -> string -> Shape.Type.arr

    TODO

    val var_elt : string -> Shape.Type.elt

    TODO

    val const_arr : string -> Shape.Type.Device.A.arr -> Shape.Type.arr

    TODO

    val const_elt : string -> Shape.Type.Device.A.elt -> Shape.Type.elt

    TODO

    val new_block_id : unit -> int

    new_block_id () returns an unused block id.

    val make_empty_block : ?block_id:int -> int -> Shape.Type.block

    make_empty_block s returns an empty block of memory of size s.

    val make_value_block : + Shape.Type.attr Owl_graph.node

    make nodes and then connect parents and children

    val var_arr : ?shape:int array -> string -> Shape.Type.arr

    creat a node and wrap in Arr type

    val var_elt : string -> Shape.Type.elt

    creat a node and wrap in Elt type

    val const_arr : string -> Shape.Type.Device.A.arr -> Shape.Type.arr

    get ndarray value from input and create an node and wrap in Arr type

    val const_elt : string -> Shape.Type.Device.A.elt -> Shape.Type.elt

    get value from input and create an node and wrap in Elt type

    val new_block_id : unit -> int

    new_block_id () returns an unused block id.

    val make_empty_block : ?block_id:int -> int -> Shape.Type.block

    make_empty_block s returns an empty block of memory of size s.

    val make_value_block : Shape.Type.Device.value -> Shape.Type.attr Owl_graph.node -> unit

    make_value_block value node creates a block of memory initialised with value and links the new block to node.

    get_block node returns the memory block allocated to node. If no block is allocated, throws an exception.

    val add_node_to_block : @@ -23,6 +23,6 @@ unit

    Update the node that is currently using the block of memory.

    val get_block_id : Shape.Type.attr Owl_graph.node -> int

    get_block_id node returns the id of the block assigned to node. If node has not been assigned yet, returns -1.

    val set_value : Shape.Type.attr Owl_graph.node -> Shape.Type.Device.value array -> - unit

    TODO

    val set_operator : Shape.Type.attr Owl_graph.node -> Shape.Type.op -> unit

    TODO

    TODO

    val set_reuse : Shape.Type.attr Owl_graph.node -> bool -> unit

    TODO

    val get_reuse : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val is_shared : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val get_shared_nodes : + unit

    set the arrays of value to cgraph node

    get the arrays of value of cgraph node

    val set_operator : Shape.Type.attr Owl_graph.node -> Shape.Type.op -> unit

    set the operator of cgraph node

    get the operator of cgraph node

    val set_reuse : Shape.Type.attr Owl_graph.node -> bool -> unit

    set reuse attribute in a node

    val get_reuse : Shape.Type.attr Owl_graph.node -> bool

    get reuse attribute in a node

    val is_shared : Shape.Type.attr Owl_graph.node -> bool

    check of the data block of memory is shared in a node

    get_shared_nodes node returns the nodes sharing the same block of memory as node.

    val is_var : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val is_const : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val is_node_arr : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val is_node_elt : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val is_assigned : Shape.Type.attr Owl_graph.node -> bool

    is_assigned node checks if a block of memory has been assigned to node.

    val check_assigned : Shape.Type.attr Owl_graph.node -> unit

    check_assigned node throws an exception if node has not been assigned to a block.

    val is_valid : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val validate : Shape.Type.attr Owl_graph.node -> unit

    TODO

    val invalidate : Shape.Type.attr Owl_graph.node -> unit

    TODO

    val invalidate_graph : Shape.Type.attr Owl_graph.node -> unit

    TODO

    val is_freeze : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val freeze : Shape.Type.attr Owl_graph.node -> unit

    TODO

    val freeze_descendants : Shape.Type.attr Owl_graph.node array -> unit

    TODO

    val freeze_ancestors : Shape.Type.attr Owl_graph.node array -> unit

    TODO

    TODO

    TODO

    val unsafe_assign_arr : Shape.Type.arr -> Shape.Type.Device.A.arr -> unit

    TODO

    val assign_arr : Shape.Type.arr -> Shape.Type.Device.A.arr -> unit

    TODO

    val assign_elt : Shape.Type.elt -> Shape.Type.Device.A.elt -> unit

    TODO

    val float_to_elt : float -> Shape.Type.elt

    TODO

    val elt_to_float : Shape.Type.elt -> float

    TODO

    + Shape.Type.attr Owl_graph.node array

    get_shared_nodes node returns the nodes sharing the same block of memory as node.

    val is_var : Shape.Type.attr Owl_graph.node -> bool

    check if the node's operator is Var type

    val is_const : Shape.Type.attr Owl_graph.node -> bool

    check if the node's operator is Const type

    val is_node_arr : Shape.Type.attr Owl_graph.node -> bool

    check the shape of a node's attr and return if it indicates an ndarray

    val is_node_elt : Shape.Type.attr Owl_graph.node -> bool

    check the shape of a node's attr and return if it indicates an elt

    val is_assigned : Shape.Type.attr Owl_graph.node -> bool

    is_assigned node checks if a block of memory has been assigned to node.

    val check_assigned : Shape.Type.attr Owl_graph.node -> unit

    check_assigned node throws an exception if node has not been assigned to a block.

    val is_valid : Shape.Type.attr Owl_graph.node -> bool

    check if the state attribute of a node is Valid

    val validate : Shape.Type.attr Owl_graph.node -> unit

    set Valid to the state attribute of a node

    val invalidate : Shape.Type.attr Owl_graph.node -> unit

    set Invalid to the state attribute of a node

    val invalidate_graph : Shape.Type.attr Owl_graph.node -> unit

    iteratively invalidate the nodes in a graph

    val is_freeze : Shape.Type.attr Owl_graph.node -> bool

    check the freeze attribute of a node

    val freeze : Shape.Type.attr Owl_graph.node -> unit

    return the freeze attribute of a node

    val freeze_descendants : Shape.Type.attr Owl_graph.node array -> unit

    iteratively freeze the descendants of a node

    val freeze_ancestors : Shape.Type.attr Owl_graph.node array -> unit

    iteratively freeze the ancestors of a node

    pack an A.arr type input into Arr type

    unpack input into A.arr type

    pack an A.elt type input into Elt type

    unpack input into A.elt type

    val unsafe_assign_arr : Shape.Type.arr -> Shape.Type.Device.A.arr -> unit

    assign Arr type value

    val assign_arr : Shape.Type.arr -> Shape.Type.Device.A.arr -> unit

    assign Arr type value

    val assign_elt : Shape.Type.elt -> Shape.Type.Device.A.elt -> unit

    assign Elt type value

    val float_to_elt : float -> Shape.Type.elt

    build an Elt type based on float value

    val elt_to_float : Shape.Type.elt -> float

    retrive a float value from an Elt type value

    diff --git a/docs/owl-base/Owl_computation_optimiser_sig/module-type-Sig/Operator/Symbol/Shape/Type/Device/index.html b/docs/owl-base/Owl_computation_optimiser_sig/module-type-Sig/Operator/Symbol/Shape/Type/Device/index.html index d8b6a5edd..baa4c46f9 100644 --- a/docs/owl-base/Owl_computation_optimiser_sig/module-type-Sig/Operator/Symbol/Shape/Type/Device/index.html +++ b/docs/owl-base/Owl_computation_optimiser_sig/module-type-Sig/Operator/Symbol/Shape/Type/Device/index.html @@ -1,2 +1,2 @@ -Device (owl-base.Owl_computation_optimiser_sig.Sig.Operator.Symbol.Shape.Type.Device)

    Module Type.Device

    Type definition
    type device

    TODO

    type value

    TODO

    Core functions
    val make_device : unit -> device

    TODO

    val arr_to_value : A.arr -> value

    TODO

    val value_to_arr : value -> A.arr

    TODO

    val elt_to_value : A.elt -> value

    TODO

    val value_to_elt : value -> A.elt

    TODO

    val value_to_float : value -> float

    TODO

    val is_arr : value -> bool

    TODO

    val is_elt : value -> bool

    TODO

    +Device (owl-base.Owl_computation_optimiser_sig.Sig.Operator.Symbol.Shape.Type.Device)

    Module Type.Device

    Type definition
    type device
    type value
    Core functions
    val make_device : unit -> device
    val arr_to_value : A.arr -> value
    val value_to_arr : value -> A.arr
    val elt_to_value : A.elt -> value
    val value_to_elt : value -> A.elt
    val value_to_float : value -> float
    val is_arr : value -> bool
    val is_elt : value -> bool
    diff --git a/docs/owl-base/Owl_computation_optimiser_sig/module-type-Sig/Operator/Symbol/index.html b/docs/owl-base/Owl_computation_optimiser_sig/module-type-Sig/Operator/Symbol/index.html index 17c4a6aa8..57857422b 100644 --- a/docs/owl-base/Owl_computation_optimiser_sig/module-type-Sig/Operator/Symbol/index.html +++ b/docs/owl-base/Owl_computation_optimiser_sig/module-type-Sig/Operator/Symbol/index.html @@ -1,5 +1,5 @@ -Symbol (owl-base.Owl_computation_optimiser_sig.Sig.Operator.Symbol)

    Module Operator.Symbol

    Core functions
    val op_to_str : Shape.Type.op -> string

    TODO

    val is_random_variable : Shape.Type.op -> bool

    TODO

    val refnum : 'a Owl_graph.node -> int

    TODO

    val node_shape : Shape.Type.attr Owl_graph.node -> int array

    TODO

    val node_numel : Shape.Type.attr Owl_graph.node -> int

    TODO

    val is_shape_unknown : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val infer_shape_graph : Shape.Type.attr Owl_graph.node array -> unit

    TODO

    val shape_to_str : int array option array -> string

    TODO

    val node_to_str : Shape.Type.attr Owl_graph.node -> string

    TODO

    val node_to_arr : Shape.Type.t -> Shape.Type.arr

    TODO

    val arr_to_node : Shape.Type.arr -> Shape.Type.t

    TODO

    val node_to_elt : Shape.Type.t -> Shape.Type.elt

    TODO

    val elt_to_node : Shape.Type.elt -> Shape.Type.t

    TODO

    val make_node : +Symbol (owl-base.Owl_computation_optimiser_sig.Sig.Operator.Symbol)

    Module Operator.Symbol

    Core functions
    val op_to_str : Shape.Type.op -> string

    return the name of the operator as string

    val is_random_variable : Shape.Type.op -> bool

    check if operator is randon variable

    val refnum : 'a Owl_graph.node -> int

    return the reference number of the given node

    val node_shape : Shape.Type.attr Owl_graph.node -> int array

    return the shape of a node

    val node_numel : Shape.Type.attr Owl_graph.node -> int

    return the number of elements of a node

    val is_shape_unknown : Shape.Type.attr Owl_graph.node -> bool

    check if the shape of the input node is unknown

    val infer_shape_graph : Shape.Type.attr Owl_graph.node array -> unit

    automatically infer the shape of input node according to its descendents' shapes

    val shape_to_str : int array option array -> string

    helper function; return the input array in string format.

    val node_to_str : Shape.Type.attr Owl_graph.node -> string

    print node's information to string

    val node_to_arr : Shape.Type.t -> Shape.Type.arr

    Wrap computation graph node in an array type

    val arr_to_node : Shape.Type.arr -> Shape.Type.t

    Unwrap the array type to get the computation graph node within

    val node_to_elt : Shape.Type.t -> Shape.Type.elt

    Wrap computation graph node in an Elt type

    val elt_to_node : Shape.Type.elt -> Shape.Type.t

    Unwrap the Elt type to get the computation graph node within

    val make_node : ?name:string -> ?value:Shape.Type.Device.value array -> ?shape:int array option array -> @@ -7,11 +7,11 @@ ?reuse:bool -> ?state:Shape.Type.state -> Shape.Type.op -> - Shape.Type.attr Owl_graph.node

    TODO

    val make_then_connect : + Shape.Type.attr Owl_graph.node

    crate a computation graph node

    val make_then_connect : ?shape:int array option array -> Shape.Type.op -> Shape.Type.attr Owl_graph.node array -> - Shape.Type.attr Owl_graph.node

    TODO

    val var_arr : ?shape:int array -> string -> Shape.Type.arr

    TODO

    val var_elt : string -> Shape.Type.elt

    TODO

    val const_arr : string -> Shape.Type.Device.A.arr -> Shape.Type.arr

    TODO

    val const_elt : string -> Shape.Type.Device.A.elt -> Shape.Type.elt

    TODO

    val new_block_id : unit -> int

    new_block_id () returns an unused block id.

    val make_empty_block : ?block_id:int -> int -> Shape.Type.block

    make_empty_block s returns an empty block of memory of size s.

    val make_value_block : + Shape.Type.attr Owl_graph.node

    make nodes and then connect parents and children

    val var_arr : ?shape:int array -> string -> Shape.Type.arr

    creat a node and wrap in Arr type

    val var_elt : string -> Shape.Type.elt

    creat a node and wrap in Elt type

    val const_arr : string -> Shape.Type.Device.A.arr -> Shape.Type.arr

    get ndarray value from input and create an node and wrap in Arr type

    val const_elt : string -> Shape.Type.Device.A.elt -> Shape.Type.elt

    get value from input and create an node and wrap in Elt type

    val new_block_id : unit -> int

    new_block_id () returns an unused block id.

    val make_empty_block : ?block_id:int -> int -> Shape.Type.block

    make_empty_block s returns an empty block of memory of size s.

    val make_value_block : Shape.Type.Device.value -> Shape.Type.attr Owl_graph.node -> unit

    make_value_block value node creates a block of memory initialised with value and links the new block to node.

    get_block node returns the memory block allocated to node. If no block is allocated, throws an exception.

    val add_node_to_block : @@ -23,6 +23,6 @@ unit

    Update the node that is currently using the block of memory.

    val get_block_id : Shape.Type.attr Owl_graph.node -> int

    get_block_id node returns the id of the block assigned to node. If node has not been assigned yet, returns -1.

    val set_value : Shape.Type.attr Owl_graph.node -> Shape.Type.Device.value array -> - unit

    TODO

    val set_operator : Shape.Type.attr Owl_graph.node -> Shape.Type.op -> unit

    TODO

    TODO

    val set_reuse : Shape.Type.attr Owl_graph.node -> bool -> unit

    TODO

    val get_reuse : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val is_shared : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val get_shared_nodes : + unit

    set the arrays of value to cgraph node

    get the arrays of value of cgraph node

    val set_operator : Shape.Type.attr Owl_graph.node -> Shape.Type.op -> unit

    set the operator of cgraph node

    get the operator of cgraph node

    val set_reuse : Shape.Type.attr Owl_graph.node -> bool -> unit

    set reuse attribute in a node

    val get_reuse : Shape.Type.attr Owl_graph.node -> bool

    get reuse attribute in a node

    val is_shared : Shape.Type.attr Owl_graph.node -> bool

    check of the data block of memory is shared in a node

    get_shared_nodes node returns the nodes sharing the same block of memory as node.

    val is_var : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val is_const : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val is_node_arr : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val is_node_elt : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val is_assigned : Shape.Type.attr Owl_graph.node -> bool

    is_assigned node checks if a block of memory has been assigned to node.

    val check_assigned : Shape.Type.attr Owl_graph.node -> unit

    check_assigned node throws an exception if node has not been assigned to a block.

    val is_valid : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val validate : Shape.Type.attr Owl_graph.node -> unit

    TODO

    val invalidate : Shape.Type.attr Owl_graph.node -> unit

    TODO

    val invalidate_graph : Shape.Type.attr Owl_graph.node -> unit

    TODO

    val is_freeze : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val freeze : Shape.Type.attr Owl_graph.node -> unit

    TODO

    val freeze_descendants : Shape.Type.attr Owl_graph.node array -> unit

    TODO

    val freeze_ancestors : Shape.Type.attr Owl_graph.node array -> unit

    TODO

    TODO

    TODO

    val unsafe_assign_arr : Shape.Type.arr -> Shape.Type.Device.A.arr -> unit

    TODO

    val assign_arr : Shape.Type.arr -> Shape.Type.Device.A.arr -> unit

    TODO

    val assign_elt : Shape.Type.elt -> Shape.Type.Device.A.elt -> unit

    TODO

    val float_to_elt : float -> Shape.Type.elt

    TODO

    val elt_to_float : Shape.Type.elt -> float

    TODO

    + Shape.Type.attr Owl_graph.node array

    get_shared_nodes node returns the nodes sharing the same block of memory as node.

    val is_var : Shape.Type.attr Owl_graph.node -> bool

    check if the node's operator is Var type

    val is_const : Shape.Type.attr Owl_graph.node -> bool

    check if the node's operator is Const type

    val is_node_arr : Shape.Type.attr Owl_graph.node -> bool

    check the shape of a node's attr and return if it indicates an ndarray

    val is_node_elt : Shape.Type.attr Owl_graph.node -> bool

    check the shape of a node's attr and return if it indicates an elt

    val is_assigned : Shape.Type.attr Owl_graph.node -> bool

    is_assigned node checks if a block of memory has been assigned to node.

    val check_assigned : Shape.Type.attr Owl_graph.node -> unit

    check_assigned node throws an exception if node has not been assigned to a block.

    val is_valid : Shape.Type.attr Owl_graph.node -> bool

    check if the state attribute of a node is Valid

    val validate : Shape.Type.attr Owl_graph.node -> unit

    set Valid to the state attribute of a node

    val invalidate : Shape.Type.attr Owl_graph.node -> unit

    set Invalid to the state attribute of a node

    val invalidate_graph : Shape.Type.attr Owl_graph.node -> unit

    iteratively invalidate the nodes in a graph

    val is_freeze : Shape.Type.attr Owl_graph.node -> bool

    check the freeze attribute of a node

    val freeze : Shape.Type.attr Owl_graph.node -> unit

    return the freeze attribute of a node

    val freeze_descendants : Shape.Type.attr Owl_graph.node array -> unit

    iteratively freeze the descendants of a node

    val freeze_ancestors : Shape.Type.attr Owl_graph.node array -> unit

    iteratively freeze the ancestors of a node

    pack an A.arr type input into Arr type

    unpack input into A.arr type

    pack an A.elt type input into Elt type

    unpack input into A.elt type

    val unsafe_assign_arr : Shape.Type.arr -> Shape.Type.Device.A.arr -> unit

    assign Arr type value

    val assign_arr : Shape.Type.arr -> Shape.Type.Device.A.arr -> unit

    assign Arr type value

    val assign_elt : Shape.Type.elt -> Shape.Type.Device.A.elt -> unit

    assign Elt type value

    val float_to_elt : float -> Shape.Type.elt

    build an Elt type based on float value

    val elt_to_float : Shape.Type.elt -> float

    retrive a float value from an Elt type value

    diff --git a/docs/owl-base/Owl_computation_shape/Make/argument-1-Type/Device/index.html b/docs/owl-base/Owl_computation_shape/Make/argument-1-Type/Device/index.html index 3ded8638b..194385ce2 100644 --- a/docs/owl-base/Owl_computation_shape/Make/argument-1-Type/Device/index.html +++ b/docs/owl-base/Owl_computation_shape/Make/argument-1-Type/Device/index.html @@ -1,2 +1,2 @@ -Device (owl-base.Owl_computation_shape.Make.Type.Device)

    Module Type.Device

    Type definition
    type device

    TODO

    type value

    TODO

    Core functions
    val make_device : unit -> device

    TODO

    val arr_to_value : A.arr -> value

    TODO

    val value_to_arr : value -> A.arr

    TODO

    val elt_to_value : A.elt -> value

    TODO

    val value_to_elt : value -> A.elt

    TODO

    val value_to_float : value -> float

    TODO

    val is_arr : value -> bool

    TODO

    val is_elt : value -> bool

    TODO

    +Device (owl-base.Owl_computation_shape.Make.Type.Device)

    Module Type.Device

    Type definition
    type device
    type value
    Core functions
    val make_device : unit -> device
    val arr_to_value : A.arr -> value
    val value_to_arr : value -> A.arr
    val elt_to_value : A.elt -> value
    val value_to_elt : value -> A.elt
    val value_to_float : value -> float
    val is_arr : value -> bool
    val is_elt : value -> bool
    diff --git a/docs/owl-base/Owl_computation_shape_sig/module-type-Sig/Type/Device/index.html b/docs/owl-base/Owl_computation_shape_sig/module-type-Sig/Type/Device/index.html index 3aa2e2b28..85c16e636 100644 --- a/docs/owl-base/Owl_computation_shape_sig/module-type-Sig/Type/Device/index.html +++ b/docs/owl-base/Owl_computation_shape_sig/module-type-Sig/Type/Device/index.html @@ -1,2 +1,2 @@ -Device (owl-base.Owl_computation_shape_sig.Sig.Type.Device)

    Module Type.Device

    Type definition
    type device

    TODO

    type value

    TODO

    Core functions
    val make_device : unit -> device

    TODO

    val arr_to_value : A.arr -> value

    TODO

    val value_to_arr : value -> A.arr

    TODO

    val elt_to_value : A.elt -> value

    TODO

    val value_to_elt : value -> A.elt

    TODO

    val value_to_float : value -> float

    TODO

    val is_arr : value -> bool

    TODO

    val is_elt : value -> bool

    TODO

    +Device (owl-base.Owl_computation_shape_sig.Sig.Type.Device)

    Module Type.Device

    Type definition
    type device
    type value
    Core functions
    val make_device : unit -> device
    val arr_to_value : A.arr -> value
    val value_to_arr : value -> A.arr
    val elt_to_value : A.elt -> value
    val value_to_elt : value -> A.elt
    val value_to_float : value -> float
    val is_arr : value -> bool
    val is_elt : value -> bool
    diff --git a/docs/owl-base/Owl_computation_symbol/Make/argument-1-Shape/Type/Device/index.html b/docs/owl-base/Owl_computation_symbol/Make/argument-1-Shape/Type/Device/index.html index 108fd94c7..4757e08c7 100644 --- a/docs/owl-base/Owl_computation_symbol/Make/argument-1-Shape/Type/Device/index.html +++ b/docs/owl-base/Owl_computation_symbol/Make/argument-1-Shape/Type/Device/index.html @@ -1,2 +1,2 @@ -Device (owl-base.Owl_computation_symbol.Make.Shape.Type.Device)

    Module Type.Device

    Type definition
    type device

    TODO

    type value

    TODO

    Core functions
    val make_device : unit -> device

    TODO

    val arr_to_value : A.arr -> value

    TODO

    val value_to_arr : value -> A.arr

    TODO

    val elt_to_value : A.elt -> value

    TODO

    val value_to_elt : value -> A.elt

    TODO

    val value_to_float : value -> float

    TODO

    val is_arr : value -> bool

    TODO

    val is_elt : value -> bool

    TODO

    +Device (owl-base.Owl_computation_symbol.Make.Shape.Type.Device)

    Module Type.Device

    Type definition
    type device
    type value
    Core functions
    val make_device : unit -> device
    val arr_to_value : A.arr -> value
    val value_to_arr : value -> A.arr
    val elt_to_value : A.elt -> value
    val value_to_elt : value -> A.elt
    val value_to_float : value -> float
    val is_arr : value -> bool
    val is_elt : value -> bool
    diff --git a/docs/owl-base/Owl_computation_symbol_sig/module-type-Sig/Shape/Type/Device/index.html b/docs/owl-base/Owl_computation_symbol_sig/module-type-Sig/Shape/Type/Device/index.html index cb081737f..a4fe1a081 100644 --- a/docs/owl-base/Owl_computation_symbol_sig/module-type-Sig/Shape/Type/Device/index.html +++ b/docs/owl-base/Owl_computation_symbol_sig/module-type-Sig/Shape/Type/Device/index.html @@ -1,2 +1,2 @@ -Device (owl-base.Owl_computation_symbol_sig.Sig.Shape.Type.Device)

    Module Type.Device

    Type definition
    type device

    TODO

    type value

    TODO

    Core functions
    val make_device : unit -> device

    TODO

    val arr_to_value : A.arr -> value

    TODO

    val value_to_arr : value -> A.arr

    TODO

    val elt_to_value : A.elt -> value

    TODO

    val value_to_elt : value -> A.elt

    TODO

    val value_to_float : value -> float

    TODO

    val is_arr : value -> bool

    TODO

    val is_elt : value -> bool

    TODO

    +Device (owl-base.Owl_computation_symbol_sig.Sig.Shape.Type.Device)

    Module Type.Device

    Type definition
    type device
    type value
    Core functions
    val make_device : unit -> device
    val arr_to_value : A.arr -> value
    val value_to_arr : value -> A.arr
    val elt_to_value : A.elt -> value
    val value_to_elt : value -> A.elt
    val value_to_float : value -> float
    val is_arr : value -> bool
    val is_elt : value -> bool
    diff --git a/docs/owl-base/Owl_computation_symbol_sig/module-type-Sig/index.html b/docs/owl-base/Owl_computation_symbol_sig/module-type-Sig/index.html index 80397f456..a0b90ac55 100644 --- a/docs/owl-base/Owl_computation_symbol_sig/module-type-Sig/index.html +++ b/docs/owl-base/Owl_computation_symbol_sig/module-type-Sig/index.html @@ -1,5 +1,5 @@ -Sig (owl-base.Owl_computation_symbol_sig.Sig)

    Module type Owl_computation_symbol_sig.Sig

    Core functions
    val op_to_str : Shape.Type.op -> string

    TODO

    val is_random_variable : Shape.Type.op -> bool

    TODO

    val refnum : 'a Owl_graph.node -> int

    TODO

    val node_shape : Shape.Type.attr Owl_graph.node -> int array

    TODO

    val node_numel : Shape.Type.attr Owl_graph.node -> int

    TODO

    val is_shape_unknown : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val infer_shape_graph : Shape.Type.attr Owl_graph.node array -> unit

    TODO

    val shape_to_str : int array option array -> string

    TODO

    val node_to_str : Shape.Type.attr Owl_graph.node -> string

    TODO

    val node_to_arr : Shape.Type.t -> Shape.Type.arr

    TODO

    val arr_to_node : Shape.Type.arr -> Shape.Type.t

    TODO

    val node_to_elt : Shape.Type.t -> Shape.Type.elt

    TODO

    val elt_to_node : Shape.Type.elt -> Shape.Type.t

    TODO

    val make_node : +Sig (owl-base.Owl_computation_symbol_sig.Sig)

    Module type Owl_computation_symbol_sig.Sig

    Core functions
    val op_to_str : Shape.Type.op -> string

    return the name of the operator as string

    val is_random_variable : Shape.Type.op -> bool

    check if operator is randon variable

    val refnum : 'a Owl_graph.node -> int

    return the reference number of the given node

    val node_shape : Shape.Type.attr Owl_graph.node -> int array

    return the shape of a node

    val node_numel : Shape.Type.attr Owl_graph.node -> int

    return the number of elements of a node

    val is_shape_unknown : Shape.Type.attr Owl_graph.node -> bool

    check if the shape of the input node is unknown

    val infer_shape_graph : Shape.Type.attr Owl_graph.node array -> unit

    automatically infer the shape of input node according to its descendents' shapes

    val shape_to_str : int array option array -> string

    helper function; return the input array in string format.

    val node_to_str : Shape.Type.attr Owl_graph.node -> string

    print node's information to string

    val node_to_arr : Shape.Type.t -> Shape.Type.arr

    Wrap computation graph node in an array type

    val arr_to_node : Shape.Type.arr -> Shape.Type.t

    Unwrap the array type to get the computation graph node within

    val node_to_elt : Shape.Type.t -> Shape.Type.elt

    Wrap computation graph node in an Elt type

    val elt_to_node : Shape.Type.elt -> Shape.Type.t

    Unwrap the Elt type to get the computation graph node within

    val make_node : ?name:string -> ?value:Shape.Type.Device.value array -> ?shape:int array option array -> @@ -7,11 +7,11 @@ ?reuse:bool -> ?state:Shape.Type.state -> Shape.Type.op -> - Shape.Type.attr Owl_graph.node

    TODO

    val make_then_connect : + Shape.Type.attr Owl_graph.node

    crate a computation graph node

    val make_then_connect : ?shape:int array option array -> Shape.Type.op -> Shape.Type.attr Owl_graph.node array -> - Shape.Type.attr Owl_graph.node

    TODO

    val var_arr : ?shape:int array -> string -> Shape.Type.arr

    TODO

    val var_elt : string -> Shape.Type.elt

    TODO

    val const_arr : string -> Shape.Type.Device.A.arr -> Shape.Type.arr

    TODO

    val const_elt : string -> Shape.Type.Device.A.elt -> Shape.Type.elt

    TODO

    val new_block_id : unit -> int

    new_block_id () returns an unused block id.

    val make_empty_block : ?block_id:int -> int -> Shape.Type.block

    make_empty_block s returns an empty block of memory of size s.

    val make_value_block : + Shape.Type.attr Owl_graph.node

    make nodes and then connect parents and children

    val var_arr : ?shape:int array -> string -> Shape.Type.arr

    creat a node and wrap in Arr type

    val var_elt : string -> Shape.Type.elt

    creat a node and wrap in Elt type

    val const_arr : string -> Shape.Type.Device.A.arr -> Shape.Type.arr

    get ndarray value from input and create an node and wrap in Arr type

    val const_elt : string -> Shape.Type.Device.A.elt -> Shape.Type.elt

    get value from input and create an node and wrap in Elt type

    val new_block_id : unit -> int

    new_block_id () returns an unused block id.

    val make_empty_block : ?block_id:int -> int -> Shape.Type.block

    make_empty_block s returns an empty block of memory of size s.

    val make_value_block : Shape.Type.Device.value -> Shape.Type.attr Owl_graph.node -> unit

    make_value_block value node creates a block of memory initialised with value and links the new block to node.

    get_block node returns the memory block allocated to node. If no block is allocated, throws an exception.

    val add_node_to_block : @@ -23,6 +23,6 @@ unit

    Update the node that is currently using the block of memory.

    val get_block_id : Shape.Type.attr Owl_graph.node -> int

    get_block_id node returns the id of the block assigned to node. If node has not been assigned yet, returns -1.

    val set_value : Shape.Type.attr Owl_graph.node -> Shape.Type.Device.value array -> - unit

    TODO

    val set_operator : Shape.Type.attr Owl_graph.node -> Shape.Type.op -> unit

    TODO

    TODO

    val set_reuse : Shape.Type.attr Owl_graph.node -> bool -> unit

    TODO

    val get_reuse : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val is_shared : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val get_shared_nodes : + unit

    set the arrays of value to cgraph node

    get the arrays of value of cgraph node

    val set_operator : Shape.Type.attr Owl_graph.node -> Shape.Type.op -> unit

    set the operator of cgraph node

    get the operator of cgraph node

    val set_reuse : Shape.Type.attr Owl_graph.node -> bool -> unit

    set reuse attribute in a node

    val get_reuse : Shape.Type.attr Owl_graph.node -> bool

    get reuse attribute in a node

    val is_shared : Shape.Type.attr Owl_graph.node -> bool

    check of the data block of memory is shared in a node

    get_shared_nodes node returns the nodes sharing the same block of memory as node.

    val is_var : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val is_const : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val is_node_arr : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val is_node_elt : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val is_assigned : Shape.Type.attr Owl_graph.node -> bool

    is_assigned node checks if a block of memory has been assigned to node.

    val check_assigned : Shape.Type.attr Owl_graph.node -> unit

    check_assigned node throws an exception if node has not been assigned to a block.

    val is_valid : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val validate : Shape.Type.attr Owl_graph.node -> unit

    TODO

    val invalidate : Shape.Type.attr Owl_graph.node -> unit

    TODO

    val invalidate_graph : Shape.Type.attr Owl_graph.node -> unit

    TODO

    val is_freeze : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val freeze : Shape.Type.attr Owl_graph.node -> unit

    TODO

    val freeze_descendants : Shape.Type.attr Owl_graph.node array -> unit

    TODO

    val freeze_ancestors : Shape.Type.attr Owl_graph.node array -> unit

    TODO

    TODO

    TODO

    val unsafe_assign_arr : Shape.Type.arr -> Shape.Type.Device.A.arr -> unit

    TODO

    val assign_arr : Shape.Type.arr -> Shape.Type.Device.A.arr -> unit

    TODO

    val assign_elt : Shape.Type.elt -> Shape.Type.Device.A.elt -> unit

    TODO

    val float_to_elt : float -> Shape.Type.elt

    TODO

    val elt_to_float : Shape.Type.elt -> float

    TODO

    + Shape.Type.attr Owl_graph.node array

    get_shared_nodes node returns the nodes sharing the same block of memory as node.

    val is_var : Shape.Type.attr Owl_graph.node -> bool

    check if the node's operator is Var type

    val is_const : Shape.Type.attr Owl_graph.node -> bool

    check if the node's operator is Const type

    val is_node_arr : Shape.Type.attr Owl_graph.node -> bool

    check the shape of a node's attr and return if it indicates an ndarray

    val is_node_elt : Shape.Type.attr Owl_graph.node -> bool

    check the shape of a node's attr and return if it indicates an elt

    val is_assigned : Shape.Type.attr Owl_graph.node -> bool

    is_assigned node checks if a block of memory has been assigned to node.

    val check_assigned : Shape.Type.attr Owl_graph.node -> unit

    check_assigned node throws an exception if node has not been assigned to a block.

    val is_valid : Shape.Type.attr Owl_graph.node -> bool

    check if the state attribute of a node is Valid

    val validate : Shape.Type.attr Owl_graph.node -> unit

    set Valid to the state attribute of a node

    val invalidate : Shape.Type.attr Owl_graph.node -> unit

    set Invalid to the state attribute of a node

    val invalidate_graph : Shape.Type.attr Owl_graph.node -> unit

    iteratively invalidate the nodes in a graph

    val is_freeze : Shape.Type.attr Owl_graph.node -> bool

    check the freeze attribute of a node

    val freeze : Shape.Type.attr Owl_graph.node -> unit

    return the freeze attribute of a node

    val freeze_descendants : Shape.Type.attr Owl_graph.node array -> unit

    iteratively freeze the descendants of a node

    val freeze_ancestors : Shape.Type.attr Owl_graph.node array -> unit

    iteratively freeze the ancestors of a node

    pack an A.arr type input into Arr type

    unpack input into A.arr type

    pack an A.elt type input into Elt type

    unpack input into A.elt type

    val unsafe_assign_arr : Shape.Type.arr -> Shape.Type.Device.A.arr -> unit

    assign Arr type value

    val assign_arr : Shape.Type.arr -> Shape.Type.Device.A.arr -> unit

    assign Arr type value

    val assign_elt : Shape.Type.elt -> Shape.Type.Device.A.elt -> unit

    assign Elt type value

    val float_to_elt : float -> Shape.Type.elt

    build an Elt type based on float value

    val elt_to_float : Shape.Type.elt -> float

    retrive a float value from an Elt type value

    diff --git a/docs/owl-base/Owl_computation_type/Make/argument-1-Device/index.html b/docs/owl-base/Owl_computation_type/Make/argument-1-Device/index.html index f434f2129..570bce172 100644 --- a/docs/owl-base/Owl_computation_type/Make/argument-1-Device/index.html +++ b/docs/owl-base/Owl_computation_type/Make/argument-1-Device/index.html @@ -1,2 +1,2 @@ -Device (owl-base.Owl_computation_type.Make.Device)

    Parameter Make.Device

    Type definition
    type device

    TODO

    type value

    TODO

    Core functions
    val make_device : unit -> device

    TODO

    val arr_to_value : A.arr -> value

    TODO

    val value_to_arr : value -> A.arr

    TODO

    val elt_to_value : A.elt -> value

    TODO

    val value_to_elt : value -> A.elt

    TODO

    val value_to_float : value -> float

    TODO

    val is_arr : value -> bool

    TODO

    val is_elt : value -> bool

    TODO

    +Device (owl-base.Owl_computation_type.Make.Device)

    Parameter Make.Device

    Type definition
    type device
    type value
    Core functions
    val make_device : unit -> device
    val arr_to_value : A.arr -> value
    val value_to_arr : value -> A.arr
    val elt_to_value : A.elt -> value
    val value_to_elt : value -> A.elt
    val value_to_float : value -> float
    val is_arr : value -> bool
    val is_elt : value -> bool
    diff --git a/docs/owl-base/Owl_computation_type_sig/module-type-Sig/Device/index.html b/docs/owl-base/Owl_computation_type_sig/module-type-Sig/Device/index.html index 4babd3c46..c13986636 100644 --- a/docs/owl-base/Owl_computation_type_sig/module-type-Sig/Device/index.html +++ b/docs/owl-base/Owl_computation_type_sig/module-type-Sig/Device/index.html @@ -1,2 +1,2 @@ -Device (owl-base.Owl_computation_type_sig.Sig.Device)

    Module Sig.Device

    Type definition
    type device

    TODO

    type value

    TODO

    Core functions
    val make_device : unit -> device

    TODO

    val arr_to_value : A.arr -> value

    TODO

    val value_to_arr : value -> A.arr

    TODO

    val elt_to_value : A.elt -> value

    TODO

    val value_to_elt : value -> A.elt

    TODO

    val value_to_float : value -> float

    TODO

    val is_arr : value -> bool

    TODO

    val is_elt : value -> bool

    TODO

    +Device (owl-base.Owl_computation_type_sig.Sig.Device)

    Module Sig.Device

    Type definition
    type device
    type value
    Core functions
    val make_device : unit -> device
    val arr_to_value : A.arr -> value
    val value_to_arr : value -> A.arr
    val elt_to_value : A.elt -> value
    val value_to_elt : value -> A.elt
    val value_to_float : value -> float
    val is_arr : value -> bool
    val is_elt : value -> bool
    diff --git a/docs/owl-base/Owl_lazy/Make/index.html b/docs/owl-base/Owl_lazy/Make/index.html index 21b44bff7..afa128f4a 100644 --- a/docs/owl-base/Owl_lazy/Make/index.html +++ b/docs/owl-base/Owl_lazy/Make/index.html @@ -1,5 +1,5 @@ -Make (owl-base.Owl_lazy.Make)

    Module Owl_lazy.Make

    Parameters

    Signature

    Type definition
    type arr

    TODO

    type elt

    TODO

    type value

    TODO

    type attr

    TODO

    type graph

    TODO

    Type conversion functions
    val arr_to_value : A.arr -> value

    TODO

    val value_to_arr : value -> A.arr

    TODO

    val elt_to_value : A.elt -> value

    TODO

    val value_to_elt : value -> A.elt

    TODO

    val value_to_float : value -> float

    TODO

    val node_to_arr : attr Owl_graph.node -> arr

    TODO

    val arr_to_node : arr -> attr Owl_graph.node

    TODO

    val node_to_elt : attr Owl_graph.node -> elt

    TODO

    val elt_to_node : elt -> attr Owl_graph.node

    TODO

    val pack_arr : A.arr -> arr

    TODO

    val unpack_arr : arr -> A.arr

    TODO

    val pack_elt : A.elt -> elt

    TODO

    val unpack_elt : elt -> A.elt

    TODO

    val float_to_elt : float -> elt

    TODO

    val elt_to_float : elt -> float

    TODO

    Utility functions
    val graph_to_dot : graph -> string

    TODO

    val graph_to_trace : graph -> string

    TODO

    Create variables
    val var_arr : ?shape:int array -> string -> arr

    TODO

    val var_elt : string -> elt

    TODO

    val const_arr : string -> A.arr -> arr

    TODO

    val const_elt : string -> A.elt -> elt

    TODO

    val assign_arr : arr -> A.arr -> unit

    TODO

    val assign_elt : elt -> A.elt -> unit

    TODO

    val unsafe_assign_arr : arr -> A.arr -> unit

    TODO

    Maths functions
    val noop : arr -> arr

    noop arr returns the array arr unchanged.

    val empty : int array -> arr

    empty shape creates an uninitialized array with the specified shape.

    val zeros : int array -> arr

    zeros shape creates an array of the specified shape filled with zeros.

    val ones : int array -> arr

    ones shape creates an array of the specified shape filled with ones.

    val create : int array -> elt -> arr

    create shape value creates an array of the specified shape filled with the given value.

    val sequential : ?a:elt -> ?step:elt -> int array -> arr

    sequential ?a ?step shape creates an array of the specified shape filled with sequential values starting from a and incremented by step.

    val uniform : ?a:elt -> ?b:elt -> int array -> arr

    uniform ?a ?b shape creates an array of the specified shape filled with values drawn from a uniform distribution between a and b.

    val gaussian : ?mu:elt -> ?sigma:elt -> int array -> arr

    gaussian ?mu ?sigma shape creates an array of the specified shape filled with values drawn from a Gaussian distribution with mean mu and standard deviation sigma.

    val bernoulli : ?p:elt -> int array -> arr

    bernoulli ?p shape creates an array of the specified shape filled with values drawn from a Bernoulli distribution with probability p.

    val init : int array -> (int -> elt) -> arr

    init shape f creates an array of the specified shape where each element is initialized by the function f, which takes the index of the element as input.

    val shape : arr -> int array

    shape arr returns the shape of the array arr.

    val numel : arr -> int

    numel arr returns the total number of elements in the array arr.

    val get : arr -> int array -> elt

    get arr indices retrieves the value at the specified indices from the array arr.

    val set : arr -> int array -> elt -> unit

    set arr indices value sets the value at the specified indices in the array arr to value.

    val get_slice : int list list -> arr -> arr

    get_slice slice_spec arr extracts a slice from the array arr according to the slice specification slice_spec.

    val set_slice : int list list -> arr -> arr -> unit

    set_slice slice_spec src dst sets the specified slice in the array dst to the values from src according to the slice specification slice_spec.

    val copy : arr -> arr

    copy arr creates a deep copy of the array arr.

    val reset : arr -> unit

    reset arr resets all elements in the array arr to zero.

    val reshape : arr -> int array -> arr

    reshape arr shape returns a new array with the elements of arr rearranged into the specified shape.

    val reverse : arr -> arr

    reverse arr returns a new array with the elements of arr reversed along all axes.

    val tile : arr -> int array -> arr

    tile arr reps creates a new array by repeating the array arr according to the repetition pattern reps.

    val repeat : arr -> int array -> arr

    repeat arr reps repeats the elements of arr along each axis according to the repetition pattern reps.

    val concatenate : ?axis:int -> arr array -> arr

    concatenate ?axis arrs concatenates the arrays in arrs along the specified axis.

    val split : ?axis:int -> int array -> arr -> arr array

    split ?axis indices arr splits the array arr into multiple sub-arrays along the specified axis at the given indices.

    val draw : ?axis:int -> arr -> int -> arr * 'a array

    draw ?axis arr n randomly selects n elements from the array arr along the specified axis, returning the selected elements and their corresponding indices.

    val map : (elt -> elt) -> arr -> arr

    map f arr applies the function f to each element of the array arr, returning a new array with the results.

    val fold : ?axis:int -> (elt -> elt -> elt) -> elt -> arr -> arr

    fold ?axis f init arr reduces the array arr along the specified axis using the function f, starting with the initial value init.

    val scan : ?axis:int -> (elt -> elt -> elt) -> arr -> arr

    scan ?axis f arr performs a cumulative reduction of the array arr along the specified axis using the function f.

    val one_hot : int -> arr -> arr

    one_hot depth arr converts the array arr into a one-hot encoded array with the specified depth.

    val lazy_print : +Make (owl-base.Owl_lazy.Make)

    Module Owl_lazy.Make

    Parameters

    Signature

    Type definition
    type arr
    type elt
    type value
    type attr
    type graph
    Type conversion functions
    val arr_to_value : A.arr -> value

    pack A.arr type to value type

    val value_to_arr : value -> A.arr

    retrieve A.arr type from value type input

    val elt_to_value : A.elt -> value

    pack A.elt type to value type

    val value_to_elt : value -> A.elt

    retrieve A.elt type from value type input

    val value_to_float : value -> float

    retrieve float type from value type input

    val node_to_arr : attr Owl_graph.node -> arr

    get Arr type from node

    val arr_to_node : arr -> attr Owl_graph.node

    pack Arr type into node

    val node_to_elt : attr Owl_graph.node -> elt

    get Elt type from node

    val elt_to_node : elt -> attr Owl_graph.node

    pack Elt type into node

    val pack_arr : A.arr -> arr

    pack A.arr type into Arr type

    val unpack_arr : arr -> A.arr

    unpack Arr type into A.arr

    val pack_elt : A.elt -> elt

    pack A.elt type into Elt type

    val unpack_elt : elt -> A.elt

    unpack Elt type into A.elt

    val float_to_elt : float -> elt

    build Elt type to float

    val elt_to_float : elt -> float

    get float value from Elt type

    Utility functions
    val graph_to_dot : graph -> string

    convert graph to dot string, which can be saved into file and later rendered into figures to show graph structure

    val graph_to_trace : graph -> string

    print graph structure

    Create variables
    val var_arr : ?shape:int array -> string -> arr

    create Arr

    val var_elt : string -> elt

    create Elt

    val const_arr : string -> A.arr -> arr

    create Arr with constant value

    val const_elt : string -> A.elt -> elt

    create Elt with constant value

    val assign_arr : arr -> A.arr -> unit

    assign A.arr value to Arr

    val assign_elt : elt -> A.elt -> unit

    assign A.elt value to Elt

    val unsafe_assign_arr : arr -> A.arr -> unit

    assign A.arr value to Arr

    Maths functions
    val noop : arr -> arr

    noop arr returns the array arr unchanged.

    val empty : int array -> arr

    empty shape creates an uninitialized array with the specified shape.

    val zeros : int array -> arr

    zeros shape creates an array of the specified shape filled with zeros.

    val ones : int array -> arr

    ones shape creates an array of the specified shape filled with ones.

    val create : int array -> elt -> arr

    create shape value creates an array of the specified shape filled with the given value.

    val sequential : ?a:elt -> ?step:elt -> int array -> arr

    sequential ?a ?step shape creates an array of the specified shape filled with sequential values starting from a and incremented by step.

    val uniform : ?a:elt -> ?b:elt -> int array -> arr

    uniform ?a ?b shape creates an array of the specified shape filled with values drawn from a uniform distribution between a and b.

    val gaussian : ?mu:elt -> ?sigma:elt -> int array -> arr

    gaussian ?mu ?sigma shape creates an array of the specified shape filled with values drawn from a Gaussian distribution with mean mu and standard deviation sigma.

    val bernoulli : ?p:elt -> int array -> arr

    bernoulli ?p shape creates an array of the specified shape filled with values drawn from a Bernoulli distribution with probability p.

    val init : int array -> (int -> elt) -> arr

    init shape f creates an array of the specified shape where each element is initialized by the function f, which takes the index of the element as input.

    val shape : arr -> int array

    shape arr returns the shape of the array arr.

    val numel : arr -> int

    numel arr returns the total number of elements in the array arr.

    val get : arr -> int array -> elt

    get arr indices retrieves the value at the specified indices from the array arr.

    val set : arr -> int array -> elt -> unit

    set arr indices value sets the value at the specified indices in the array arr to value.

    val get_slice : int list list -> arr -> arr

    get_slice slice_spec arr extracts a slice from the array arr according to the slice specification slice_spec.

    val set_slice : int list list -> arr -> arr -> unit

    set_slice slice_spec src dst sets the specified slice in the array dst to the values from src according to the slice specification slice_spec.

    val copy : arr -> arr

    copy arr creates a deep copy of the array arr.

    val reset : arr -> unit

    reset arr resets all elements in the array arr to zero.

    val reshape : arr -> int array -> arr

    reshape arr shape returns a new array with the elements of arr rearranged into the specified shape.

    val reverse : arr -> arr

    reverse arr returns a new array with the elements of arr reversed along all axes.

    val tile : arr -> int array -> arr

    tile arr reps creates a new array by repeating the array arr according to the repetition pattern reps.

    val repeat : arr -> int array -> arr

    repeat arr reps repeats the elements of arr along each axis according to the repetition pattern reps.

    val concatenate : ?axis:int -> arr array -> arr

    concatenate ?axis arrs concatenates the arrays in arrs along the specified axis.

    val split : ?axis:int -> int array -> arr -> arr array

    split ?axis indices arr splits the array arr into multiple sub-arrays along the specified axis at the given indices.

    val draw : ?axis:int -> arr -> int -> arr * 'a array

    draw ?axis arr n randomly selects n elements from the array arr along the specified axis, returning the selected elements and their corresponding indices.

    val map : (elt -> elt) -> arr -> arr

    map f arr applies the function f to each element of the array arr, returning a new array with the results.

    val fold : ?axis:int -> (elt -> elt -> elt) -> elt -> arr -> arr

    fold ?axis f init arr reduces the array arr along the specified axis using the function f, starting with the initial value init.

    val scan : ?axis:int -> (elt -> elt -> elt) -> arr -> arr

    scan ?axis f arr performs a cumulative reduction of the array arr along the specified axis using the function f.

    val one_hot : int -> arr -> arr

    one_hot depth arr converts the array arr into a one-hot encoded array with the specified depth.

    val lazy_print : ?max_row:int -> ?max_col:int -> ?header:bool -> @@ -80,8 +80,8 @@ input:attr Owl_graph.node array -> output:attr Owl_graph.node array -> string -> - graph

    TODO

    val get_inputs : graph -> attr Owl_graph.node array

    TODO

    val get_outputs : graph -> attr Owl_graph.node array

    TODO

    val make_iopair : + graph

    build a computation graph

    val get_inputs : graph -> attr Owl_graph.node array

    get input nodes of graph

    val get_outputs : graph -> attr Owl_graph.node array

    get output nodes of graph

    val make_iopair : graph -> attr Owl_graph.node array -> attr Owl_graph.node array -> - unit

    TODO

    val update_iopair : graph -> unit

    TODO

    val init_inputs : (attr Owl_graph.node -> value) -> graph -> unit

    TODO

    val optimise : graph -> unit

    TODO

    val eval_elt : elt array -> unit

    TODO

    val eval_arr : arr array -> unit

    TODO

    val eval_graph : graph -> unit

    TODO

    + unit

    connect iopairs in a graph

    val update_iopair : graph -> unit

    update iopairs in a graph

    val init_inputs : (attr Owl_graph.node -> value) -> graph -> unit

    initialize input nodes of a graph with given function f

    val optimise : graph -> unit

    optimise graph structures

    val eval_elt : elt array -> unit

    evaluate each Elt element in an array

    val eval_arr : arr array -> unit

    evaluate each Arr element in an array

    val eval_graph : graph -> unit

    evaluate all nodes in a computation graph

    diff --git a/docs/owl-base/Owl_neural_compiler/Make/argument-1-E/Graph/Optimiser/Operator/Symbol/Shape/Type/Device/index.html b/docs/owl-base/Owl_neural_compiler/Make/argument-1-E/Graph/Optimiser/Operator/Symbol/Shape/Type/Device/index.html index 411d00aad..bdc5d6a19 100644 --- a/docs/owl-base/Owl_neural_compiler/Make/argument-1-E/Graph/Optimiser/Operator/Symbol/Shape/Type/Device/index.html +++ b/docs/owl-base/Owl_neural_compiler/Make/argument-1-E/Graph/Optimiser/Operator/Symbol/Shape/Type/Device/index.html @@ -1,2 +1,2 @@ -Device (owl-base.Owl_neural_compiler.Make.E.Graph.Optimiser.Operator.Symbol.Shape.Type.Device)

    Module Type.Device

    Type definition
    type device

    TODO

    type value

    TODO

    Core functions
    val make_device : unit -> device

    TODO

    val arr_to_value : A.arr -> value

    TODO

    val value_to_arr : value -> A.arr

    TODO

    val elt_to_value : A.elt -> value

    TODO

    val value_to_elt : value -> A.elt

    TODO

    val value_to_float : value -> float

    TODO

    val is_arr : value -> bool

    TODO

    val is_elt : value -> bool

    TODO

    +Device (owl-base.Owl_neural_compiler.Make.E.Graph.Optimiser.Operator.Symbol.Shape.Type.Device)

    Module Type.Device

    Type definition
    type device
    type value
    Core functions
    val make_device : unit -> device
    val arr_to_value : A.arr -> value
    val value_to_arr : value -> A.arr
    val elt_to_value : A.elt -> value
    val value_to_elt : value -> A.elt
    val value_to_float : value -> float
    val is_arr : value -> bool
    val is_elt : value -> bool
    diff --git a/docs/owl-base/Owl_neural_compiler/Make/argument-1-E/Graph/Optimiser/Operator/Symbol/index.html b/docs/owl-base/Owl_neural_compiler/Make/argument-1-E/Graph/Optimiser/Operator/Symbol/index.html index 80338cd9b..b7a55df9f 100644 --- a/docs/owl-base/Owl_neural_compiler/Make/argument-1-E/Graph/Optimiser/Operator/Symbol/index.html +++ b/docs/owl-base/Owl_neural_compiler/Make/argument-1-E/Graph/Optimiser/Operator/Symbol/index.html @@ -1,5 +1,5 @@ -Symbol (owl-base.Owl_neural_compiler.Make.E.Graph.Optimiser.Operator.Symbol)

    Module Operator.Symbol

    Core functions
    val op_to_str : Shape.Type.op -> string

    TODO

    val is_random_variable : Shape.Type.op -> bool

    TODO

    val refnum : 'a Owl_graph.node -> int

    TODO

    val node_shape : Shape.Type.attr Owl_graph.node -> int array

    TODO

    val node_numel : Shape.Type.attr Owl_graph.node -> int

    TODO

    val is_shape_unknown : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val infer_shape_graph : Shape.Type.attr Owl_graph.node array -> unit

    TODO

    val shape_to_str : int array option array -> string

    TODO

    val node_to_str : Shape.Type.attr Owl_graph.node -> string

    TODO

    val node_to_arr : Shape.Type.t -> Shape.Type.arr

    TODO

    val arr_to_node : Shape.Type.arr -> Shape.Type.t

    TODO

    val node_to_elt : Shape.Type.t -> Shape.Type.elt

    TODO

    val elt_to_node : Shape.Type.elt -> Shape.Type.t

    TODO

    val make_node : +Symbol (owl-base.Owl_neural_compiler.Make.E.Graph.Optimiser.Operator.Symbol)

    Module Operator.Symbol

    Core functions
    val op_to_str : Shape.Type.op -> string

    return the name of the operator as string

    val is_random_variable : Shape.Type.op -> bool

    check if operator is randon variable

    val refnum : 'a Owl_graph.node -> int

    return the reference number of the given node

    val node_shape : Shape.Type.attr Owl_graph.node -> int array

    return the shape of a node

    val node_numel : Shape.Type.attr Owl_graph.node -> int

    return the number of elements of a node

    val is_shape_unknown : Shape.Type.attr Owl_graph.node -> bool

    check if the shape of the input node is unknown

    val infer_shape_graph : Shape.Type.attr Owl_graph.node array -> unit

    automatically infer the shape of input node according to its descendents' shapes

    val shape_to_str : int array option array -> string

    helper function; return the input array in string format.

    val node_to_str : Shape.Type.attr Owl_graph.node -> string

    print node's information to string

    val node_to_arr : Shape.Type.t -> Shape.Type.arr

    Wrap computation graph node in an array type

    val arr_to_node : Shape.Type.arr -> Shape.Type.t

    Unwrap the array type to get the computation graph node within

    val node_to_elt : Shape.Type.t -> Shape.Type.elt

    Wrap computation graph node in an Elt type

    val elt_to_node : Shape.Type.elt -> Shape.Type.t

    Unwrap the Elt type to get the computation graph node within

    val make_node : ?name:string -> ?value:Shape.Type.Device.value array -> ?shape:int array option array -> @@ -7,11 +7,11 @@ ?reuse:bool -> ?state:Shape.Type.state -> Shape.Type.op -> - Shape.Type.attr Owl_graph.node

    TODO

    val make_then_connect : + Shape.Type.attr Owl_graph.node

    crate a computation graph node

    val make_then_connect : ?shape:int array option array -> Shape.Type.op -> Shape.Type.attr Owl_graph.node array -> - Shape.Type.attr Owl_graph.node

    TODO

    val var_arr : ?shape:int array -> string -> Shape.Type.arr

    TODO

    val var_elt : string -> Shape.Type.elt

    TODO

    val const_arr : string -> Shape.Type.Device.A.arr -> Shape.Type.arr

    TODO

    val const_elt : string -> Shape.Type.Device.A.elt -> Shape.Type.elt

    TODO

    val new_block_id : unit -> int

    new_block_id () returns an unused block id.

    val make_empty_block : ?block_id:int -> int -> Shape.Type.block

    make_empty_block s returns an empty block of memory of size s.

    val make_value_block : + Shape.Type.attr Owl_graph.node

    make nodes and then connect parents and children

    val var_arr : ?shape:int array -> string -> Shape.Type.arr

    creat a node and wrap in Arr type

    val var_elt : string -> Shape.Type.elt

    creat a node and wrap in Elt type

    val const_arr : string -> Shape.Type.Device.A.arr -> Shape.Type.arr

    get ndarray value from input and create an node and wrap in Arr type

    val const_elt : string -> Shape.Type.Device.A.elt -> Shape.Type.elt

    get value from input and create an node and wrap in Elt type

    val new_block_id : unit -> int

    new_block_id () returns an unused block id.

    val make_empty_block : ?block_id:int -> int -> Shape.Type.block

    make_empty_block s returns an empty block of memory of size s.

    val make_value_block : Shape.Type.Device.value -> Shape.Type.attr Owl_graph.node -> unit

    make_value_block value node creates a block of memory initialised with value and links the new block to node.

    get_block node returns the memory block allocated to node. If no block is allocated, throws an exception.

    val add_node_to_block : @@ -23,6 +23,6 @@ unit

    Update the node that is currently using the block of memory.

    val get_block_id : Shape.Type.attr Owl_graph.node -> int

    get_block_id node returns the id of the block assigned to node. If node has not been assigned yet, returns -1.

    val set_value : Shape.Type.attr Owl_graph.node -> Shape.Type.Device.value array -> - unit

    TODO

    val set_operator : Shape.Type.attr Owl_graph.node -> Shape.Type.op -> unit

    TODO

    TODO

    val set_reuse : Shape.Type.attr Owl_graph.node -> bool -> unit

    TODO

    val get_reuse : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val is_shared : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val get_shared_nodes : + unit

    set the arrays of value to cgraph node

    get the arrays of value of cgraph node

    val set_operator : Shape.Type.attr Owl_graph.node -> Shape.Type.op -> unit

    set the operator of cgraph node

    get the operator of cgraph node

    val set_reuse : Shape.Type.attr Owl_graph.node -> bool -> unit

    set reuse attribute in a node

    val get_reuse : Shape.Type.attr Owl_graph.node -> bool

    get reuse attribute in a node

    val is_shared : Shape.Type.attr Owl_graph.node -> bool

    check of the data block of memory is shared in a node

    get_shared_nodes node returns the nodes sharing the same block of memory as node.

    val is_var : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val is_const : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val is_node_arr : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val is_node_elt : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val is_assigned : Shape.Type.attr Owl_graph.node -> bool

    is_assigned node checks if a block of memory has been assigned to node.

    val check_assigned : Shape.Type.attr Owl_graph.node -> unit

    check_assigned node throws an exception if node has not been assigned to a block.

    val is_valid : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val validate : Shape.Type.attr Owl_graph.node -> unit

    TODO

    val invalidate : Shape.Type.attr Owl_graph.node -> unit

    TODO

    val invalidate_graph : Shape.Type.attr Owl_graph.node -> unit

    TODO

    val is_freeze : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val freeze : Shape.Type.attr Owl_graph.node -> unit

    TODO

    val freeze_descendants : Shape.Type.attr Owl_graph.node array -> unit

    TODO

    val freeze_ancestors : Shape.Type.attr Owl_graph.node array -> unit

    TODO

    TODO

    TODO

    val unsafe_assign_arr : Shape.Type.arr -> Shape.Type.Device.A.arr -> unit

    TODO

    val assign_arr : Shape.Type.arr -> Shape.Type.Device.A.arr -> unit

    TODO

    val assign_elt : Shape.Type.elt -> Shape.Type.Device.A.elt -> unit

    TODO

    val float_to_elt : float -> Shape.Type.elt

    TODO

    val elt_to_float : Shape.Type.elt -> float

    TODO

    + Shape.Type.attr Owl_graph.node array

    get_shared_nodes node returns the nodes sharing the same block of memory as node.

    val is_var : Shape.Type.attr Owl_graph.node -> bool

    check if the node's operator is Var type

    val is_const : Shape.Type.attr Owl_graph.node -> bool

    check if the node's operator is Const type

    val is_node_arr : Shape.Type.attr Owl_graph.node -> bool

    check the shape of a node's attr and return if it indicates an ndarray

    val is_node_elt : Shape.Type.attr Owl_graph.node -> bool

    check the shape of a node's attr and return if it indicates an elt

    val is_assigned : Shape.Type.attr Owl_graph.node -> bool

    is_assigned node checks if a block of memory has been assigned to node.

    val check_assigned : Shape.Type.attr Owl_graph.node -> unit

    check_assigned node throws an exception if node has not been assigned to a block.

    val is_valid : Shape.Type.attr Owl_graph.node -> bool

    check if the state attribute of a node is Valid

    val validate : Shape.Type.attr Owl_graph.node -> unit

    set Valid to the state attribute of a node

    val invalidate : Shape.Type.attr Owl_graph.node -> unit

    set Invalid to the state attribute of a node

    val invalidate_graph : Shape.Type.attr Owl_graph.node -> unit

    iteratively invalidate the nodes in a graph

    val is_freeze : Shape.Type.attr Owl_graph.node -> bool

    check the freeze attribute of a node

    val freeze : Shape.Type.attr Owl_graph.node -> unit

    return the freeze attribute of a node

    val freeze_descendants : Shape.Type.attr Owl_graph.node array -> unit

    iteratively freeze the descendants of a node

    val freeze_ancestors : Shape.Type.attr Owl_graph.node array -> unit

    iteratively freeze the ancestors of a node

    pack an A.arr type input into Arr type

    unpack input into A.arr type

    pack an A.elt type input into Elt type

    unpack input into A.elt type

    val unsafe_assign_arr : Shape.Type.arr -> Shape.Type.Device.A.arr -> unit

    assign Arr type value

    val assign_arr : Shape.Type.arr -> Shape.Type.Device.A.arr -> unit

    assign Arr type value

    val assign_elt : Shape.Type.elt -> Shape.Type.Device.A.elt -> unit

    assign Elt type value

    val float_to_elt : float -> Shape.Type.elt

    build an Elt type based on float value

    val elt_to_float : Shape.Type.elt -> float

    retrive a float value from an Elt type value

    diff --git a/docs/owl-base/Owl_neural_compiler/Make/argument-1-E/Graph/index.html b/docs/owl-base/Owl_neural_compiler/Make/argument-1-E/Graph/index.html index babb9ad75..56af65a83 100644 --- a/docs/owl-base/Owl_neural_compiler/Make/argument-1-E/Graph/index.html +++ b/docs/owl-base/Owl_neural_compiler/Make/argument-1-E/Graph/index.html @@ -1,33 +1,33 @@ -Graph (owl-base.Owl_neural_compiler.Make.E.Graph)

    Module E.Graph

    Type definition
    type graph

    TODO

    Core functions
    val shape_or_value : Optimiser.Operator.Symbol.Shape.Type.t -> string

    TODO

    val graph_to_dot : graph -> string

    TODO

    val graph_to_trace : graph -> string

    TODO

    val save_graph : 'a -> string -> unit

    TODO

    val load_graph : string -> 'a * 'b

    TODO

    val collect_rvs : +Graph (owl-base.Owl_neural_compiler.Make.E.Graph)

    Module E.Graph

    Type definition
    type graph
    Core functions
    val shape_or_value : Optimiser.Operator.Symbol.Shape.Type.t -> string

    print shape for ndarrays, whilst value for scalars

    val graph_to_dot : graph -> string

    generate a string that can be written to a .dot file to draw the graph

    val graph_to_trace : graph -> string

    print the graph structure to a string

    val save_graph : 'a -> string -> unit

    save the graph object to a file with given name, using marshall format

    val load_graph : string -> 'a * 'b

    load the graph object from a file with given name

    val invalidate_rvs : graph -> unit

    TODO

    traverse each node in the input array, and return the random variable type nodes.

    val invalidate_rvs : graph -> unit

    TODO

    val get_inputs : + graph

    Build a graph based on input nodes, output nodes, and graph name

    get input nodes of a graph

    get output nodes of a graph

    val set_node_elt_val : + unit
    val is_iopair_safe : 'a Owl_graph.node -> 'a Owl_graph.node -> bool

    TODO

    val make_iopair : + unit
    val is_iopair_safe : 'a Owl_graph.node -> 'a Owl_graph.node -> bool
    val update_iopair : graph -> unit

    TODO

    val remove_unused_iopair : + unit

    create an iopair between the input nodes and output nodes in a graph

    val update_iopair : graph -> unit
    val remove_unused_iopair : 'a Owl_graph.node array -> 'b array -> - 'a Owl_graph.node array * 'b array

    TODO

    val init_inputs : + 'a Owl_graph.node array * 'b array

    remove unuserd iopair from an array of nodes

    val optimise : graph -> unit

    TODO

    + unit

    initialize inputs nodes of a graph with given function f

    val optimise : graph -> unit

    optimise the graph structure

    diff --git a/docs/owl-base/Owl_neural_generic/Flatten/argument-1-Graph/Neuron/Optimise/Algodiff/index.html b/docs/owl-base/Owl_neural_generic/Flatten/argument-1-Graph/Neuron/Optimise/Algodiff/index.html index 895b1edc4..a8e82f7b2 100644 --- a/docs/owl-base/Owl_neural_generic/Flatten/argument-1-Graph/Neuron/Optimise/Algodiff/index.html +++ b/docs/owl-base/Owl_neural_generic/Flatten/argument-1-Graph/Neuron/Optimise/Algodiff/index.html @@ -1,5 +1,5 @@ -Algodiff (owl-base.Owl_neural_generic.Flatten.Graph.Neuron.Optimise.Algodiff)

    Module Optimise.Algodiff

    include Owl_algodiff_core_sig.Sig
    Type definition
    include Owl_algodiff_types_sig.Sig with type elt := A.elt and type arr := A.arr
    type t =
    1. | F of A.elt
    2. | Arr of A.arr
    3. | DF of t * t * int
    4. | DR of t * t Stdlib.ref * op * int Stdlib.ref * int * int Stdlib.ref
    and adjoint = t -> t Stdlib.ref -> (t * t) list -> (t * t) list
    and register = t list -> t list
    and label = string * t list
    and op = adjoint * register * label
    Core functions
    val tag : unit -> int

    TODO

    val primal : t -> t

    TODO

    val primal' : t -> t

    TODO

    val zero : t -> t

    TODO

    val reset_zero : t -> t

    TODO

    val tangent : t -> t

    TODO

    val adjref : t -> t Stdlib.ref

    TODO

    val adjval : t -> t

    TODO

    val shape : t -> int array

    TODO

    val is_float : t -> bool

    TODO

    val is_arr : t -> bool

    TODO

    val row_num : t -> int

    number of rows

    val col_num : t -> int

    number of columns

    val numel : t -> int

    number of elements

    val clip_by_value : amin:A.elt -> amax:A.elt -> t -> t

    other functions, without tracking gradient

    val clip_by_l2norm : A.elt -> t -> t

    other functions, without tracking gradient

    val copy_primal' : t -> t

    TODO

    val tile : t -> int array -> t

    TODO

    val repeat : t -> int array -> t

    TODO

    val pack_elt : A.elt -> t

    convert from elt type to t type.

    val unpack_elt : t -> A.elt

    convert from t type to elt type.

    val pack_flt : float -> t

    convert from float type to t type.

    val _f : float -> t

    A shortcut function for F A.(float_to_elt x).

    val unpack_flt : t -> float

    convert from t type to float type.

    val pack_arr : A.arr -> t

    convert from arr type to t type.

    val unpack_arr : t -> A.arr

    convert from t type to arr type.

    val deep_info : t -> string

    TODO

    val type_info : t -> string

    TODO

    val error_binop : string -> t -> t -> 'a

    TODO

    val error_uniop : string -> t -> 'a

    TODO

    val make_forward : t -> t -> int -> t

    make_forward p t i construct a forward algodiff data type DF, consisting of primal p, tangent t, and tag i.

    val make_reverse : t -> int -> t

    make_reverse p i construct a reverse algodiff data type DR, consisting of primal, adjoint, op, fanout, tag, and tracker.

    val reverse_prop : t -> t -> unit

    reverse_prop f x performs reverse propagation for function f using the output value x.

    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

    similar 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)

    include Owl_algodiff_ops_sig.Sig +Algodiff (owl-base.Owl_neural_generic.Flatten.Graph.Neuron.Optimise.Algodiff)

    Module Optimise.Algodiff

    include Owl_algodiff_core_sig.Sig
    Type definition
    include Owl_algodiff_types_sig.Sig with type elt := A.elt and type arr := A.arr
    type t =
    1. | F of A.elt
    2. | Arr of A.arr
    3. | DF of t * t * int
    4. | DR of t * t Stdlib.ref * op * int Stdlib.ref * int * int Stdlib.ref
    and adjoint = t -> t Stdlib.ref -> (t * t) list -> (t * t) list
    and register = t list -> t list
    and label = string * t list
    and op = adjoint * register * label
    Core functions
    val tag : unit -> int

    start global tagging counter

    val primal : t -> t

    get primal component of DF or DR type

    val primal' : t -> t

    iteratively get primal component of DF or DR type until the component itself is not DF/DR

    val zero : t -> t

    return a zero value, which type decided by the input value

    val reset_zero : t -> t

    reset_zero x iteratively resets all elements included in x

    val tangent : t -> t

    get the tangent component of input, if the data type is suitable

    val adjref : t -> t Stdlib.ref

    get the adjref component of input, if the data type is suitable

    val adjval : t -> t

    get the adjval component of input, if the data type is suitableTODO

    val shape : t -> int array

    get the shape of primal' value of input

    val is_float : t -> bool

    check if input is of float value; if input is of type DF/DR, check its primal' value

    val is_arr : t -> bool

    check if input is of ndarray value; if input is of type DF/DR, check its primal' value

    val row_num : t -> int

    get the shape of primal' value of input; and then get the first dimension

    val col_num : t -> int

    get the shape of primal' value of input; and then get the second dimension

    val numel : t -> int

    for ndarray type input, return its total number of elements.

    val clip_by_value : amin:A.elt -> amax:A.elt -> t -> t

    other functions, without tracking gradient

    val clip_by_l2norm : A.elt -> t -> t

    other functions, without tracking gradient

    val copy_primal' : t -> t

    if primal' value of input is ndarray, copy its value in a new AD type ndarray

    val tile : t -> int array -> t

    if primal' value of input is ndarray, apply the tile function

    val repeat : t -> int array -> t

    if primal' value of input is ndarray, apply the repeat function

    val pack_elt : A.elt -> t

    convert from elt type to t type.

    val unpack_elt : t -> A.elt

    convert from t type to elt type.

    val pack_flt : float -> t

    convert from float type to t type.

    val _f : float -> t

    A shortcut function for F A.(float_to_elt x).

    val unpack_flt : t -> float

    convert from t type to float type.

    val pack_arr : A.arr -> t

    convert from arr type to t type.

    val unpack_arr : t -> A.arr

    convert from t type to arr type.

    val deep_info : t -> string
    val type_info : t -> string
    val error_binop : string -> t -> t -> 'a
    val error_uniop : string -> t -> 'a
    val make_forward : t -> t -> int -> t

    make_forward p t i construct a forward algodiff data type DF, consisting of primal p, tangent t, and tag i.

    val make_reverse : t -> int -> t

    make_reverse p i construct a reverse algodiff data type DR, consisting of primal, adjoint, op, fanout, tag, and tracker.

    val reverse_prop : t -> t -> unit

    reverse_prop f x performs reverse propagation for function f using the output value x.

    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

    similar 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)

    include Owl_algodiff_ops_sig.Sig with type t := t and type elt := A.elt and type arr := A.arr diff --git a/docs/owl-base/Owl_neural_graph/Make/argument-1-Neuron/Optimise/Algodiff/index.html b/docs/owl-base/Owl_neural_graph/Make/argument-1-Neuron/Optimise/Algodiff/index.html index 9f98a65ed..b50dbca34 100644 --- a/docs/owl-base/Owl_neural_graph/Make/argument-1-Neuron/Optimise/Algodiff/index.html +++ b/docs/owl-base/Owl_neural_graph/Make/argument-1-Neuron/Optimise/Algodiff/index.html @@ -1,5 +1,5 @@ -Algodiff (owl-base.Owl_neural_graph.Make.Neuron.Optimise.Algodiff)

    Module Optimise.Algodiff

    include Owl_algodiff_core_sig.Sig
    Type definition
    include Owl_algodiff_types_sig.Sig with type elt := A.elt and type arr := A.arr
    type t =
    1. | F of A.elt
    2. | Arr of A.arr
    3. | DF of t * t * int
    4. | DR of t * t Stdlib.ref * op * int Stdlib.ref * int * int Stdlib.ref
    and adjoint = t -> t Stdlib.ref -> (t * t) list -> (t * t) list
    and register = t list -> t list
    and label = string * t list
    and op = adjoint * register * label
    Core functions
    val tag : unit -> int

    TODO

    val primal : t -> t

    TODO

    val primal' : t -> t

    TODO

    val zero : t -> t

    TODO

    val reset_zero : t -> t

    TODO

    val tangent : t -> t

    TODO

    val adjref : t -> t Stdlib.ref

    TODO

    val adjval : t -> t

    TODO

    val shape : t -> int array

    TODO

    val is_float : t -> bool

    TODO

    val is_arr : t -> bool

    TODO

    val row_num : t -> int

    number of rows

    val col_num : t -> int

    number of columns

    val numel : t -> int

    number of elements

    val clip_by_value : amin:A.elt -> amax:A.elt -> t -> t

    other functions, without tracking gradient

    val clip_by_l2norm : A.elt -> t -> t

    other functions, without tracking gradient

    val copy_primal' : t -> t

    TODO

    val tile : t -> int array -> t

    TODO

    val repeat : t -> int array -> t

    TODO

    val pack_elt : A.elt -> t

    convert from elt type to t type.

    val unpack_elt : t -> A.elt

    convert from t type to elt type.

    val pack_flt : float -> t

    convert from float type to t type.

    val _f : float -> t

    A shortcut function for F A.(float_to_elt x).

    val unpack_flt : t -> float

    convert from t type to float type.

    val pack_arr : A.arr -> t

    convert from arr type to t type.

    val unpack_arr : t -> A.arr

    convert from t type to arr type.

    val deep_info : t -> string

    TODO

    val type_info : t -> string

    TODO

    val error_binop : string -> t -> t -> 'a

    TODO

    val error_uniop : string -> t -> 'a

    TODO

    val make_forward : t -> t -> int -> t

    make_forward p t i construct a forward algodiff data type DF, consisting of primal p, tangent t, and tag i.

    val make_reverse : t -> int -> t

    make_reverse p i construct a reverse algodiff data type DR, consisting of primal, adjoint, op, fanout, tag, and tracker.

    val reverse_prop : t -> t -> unit

    reverse_prop f x performs reverse propagation for function f using the output value x.

    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

    similar 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)

    include Owl_algodiff_ops_sig.Sig +Algodiff (owl-base.Owl_neural_graph.Make.Neuron.Optimise.Algodiff)

    Module Optimise.Algodiff

    include Owl_algodiff_core_sig.Sig
    Type definition
    include Owl_algodiff_types_sig.Sig with type elt := A.elt and type arr := A.arr
    type t =
    1. | F of A.elt
    2. | Arr of A.arr
    3. | DF of t * t * int
    4. | DR of t * t Stdlib.ref * op * int Stdlib.ref * int * int Stdlib.ref
    and adjoint = t -> t Stdlib.ref -> (t * t) list -> (t * t) list
    and register = t list -> t list
    and label = string * t list
    and op = adjoint * register * label
    Core functions
    val tag : unit -> int

    start global tagging counter

    val primal : t -> t

    get primal component of DF or DR type

    val primal' : t -> t

    iteratively get primal component of DF or DR type until the component itself is not DF/DR

    val zero : t -> t

    return a zero value, which type decided by the input value

    val reset_zero : t -> t

    reset_zero x iteratively resets all elements included in x

    val tangent : t -> t

    get the tangent component of input, if the data type is suitable

    val adjref : t -> t Stdlib.ref

    get the adjref component of input, if the data type is suitable

    val adjval : t -> t

    get the adjval component of input, if the data type is suitableTODO

    val shape : t -> int array

    get the shape of primal' value of input

    val is_float : t -> bool

    check if input is of float value; if input is of type DF/DR, check its primal' value

    val is_arr : t -> bool

    check if input is of ndarray value; if input is of type DF/DR, check its primal' value

    val row_num : t -> int

    get the shape of primal' value of input; and then get the first dimension

    val col_num : t -> int

    get the shape of primal' value of input; and then get the second dimension

    val numel : t -> int

    for ndarray type input, return its total number of elements.

    val clip_by_value : amin:A.elt -> amax:A.elt -> t -> t

    other functions, without tracking gradient

    val clip_by_l2norm : A.elt -> t -> t

    other functions, without tracking gradient

    val copy_primal' : t -> t

    if primal' value of input is ndarray, copy its value in a new AD type ndarray

    val tile : t -> int array -> t

    if primal' value of input is ndarray, apply the tile function

    val repeat : t -> int array -> t

    if primal' value of input is ndarray, apply the repeat function

    val pack_elt : A.elt -> t

    convert from elt type to t type.

    val unpack_elt : t -> A.elt

    convert from t type to elt type.

    val pack_flt : float -> t

    convert from float type to t type.

    val _f : float -> t

    A shortcut function for F A.(float_to_elt x).

    val unpack_flt : t -> float

    convert from t type to float type.

    val pack_arr : A.arr -> t

    convert from arr type to t type.

    val unpack_arr : t -> A.arr

    convert from t type to arr type.

    val deep_info : t -> string
    val type_info : t -> string
    val error_binop : string -> t -> t -> 'a
    val error_uniop : string -> t -> 'a
    val make_forward : t -> t -> int -> t

    make_forward p t i construct a forward algodiff data type DF, consisting of primal p, tangent t, and tag i.

    val make_reverse : t -> int -> t

    make_reverse p i construct a reverse algodiff data type DR, consisting of primal, adjoint, op, fanout, tag, and tracker.

    val reverse_prop : t -> t -> unit

    reverse_prop f x performs reverse propagation for function f using the output value x.

    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

    similar 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)

    include Owl_algodiff_ops_sig.Sig with type t := t and type elt := A.elt and type arr := A.arr diff --git a/docs/owl-base/Owl_neural_graph_sig/module-type-Sig/Neuron/Optimise/Algodiff/index.html b/docs/owl-base/Owl_neural_graph_sig/module-type-Sig/Neuron/Optimise/Algodiff/index.html index 056b2af84..7f81f0a5b 100644 --- a/docs/owl-base/Owl_neural_graph_sig/module-type-Sig/Neuron/Optimise/Algodiff/index.html +++ b/docs/owl-base/Owl_neural_graph_sig/module-type-Sig/Neuron/Optimise/Algodiff/index.html @@ -1,5 +1,5 @@ -Algodiff (owl-base.Owl_neural_graph_sig.Sig.Neuron.Optimise.Algodiff)

    Module Optimise.Algodiff

    include Owl_algodiff_core_sig.Sig
    Type definition
    include Owl_algodiff_types_sig.Sig with type elt := A.elt and type arr := A.arr
    type t =
    1. | F of A.elt
    2. | Arr of A.arr
    3. | DF of t * t * int
    4. | DR of t * t Stdlib.ref * op * int Stdlib.ref * int * int Stdlib.ref
    and adjoint = t -> t Stdlib.ref -> (t * t) list -> (t * t) list
    and register = t list -> t list
    and label = string * t list
    and op = adjoint * register * label
    Core functions
    val tag : unit -> int

    TODO

    val primal : t -> t

    TODO

    val primal' : t -> t

    TODO

    val zero : t -> t

    TODO

    val reset_zero : t -> t

    TODO

    val tangent : t -> t

    TODO

    val adjref : t -> t Stdlib.ref

    TODO

    val adjval : t -> t

    TODO

    val shape : t -> int array

    TODO

    val is_float : t -> bool

    TODO

    val is_arr : t -> bool

    TODO

    val row_num : t -> int

    number of rows

    val col_num : t -> int

    number of columns

    val numel : t -> int

    number of elements

    val clip_by_value : amin:A.elt -> amax:A.elt -> t -> t

    other functions, without tracking gradient

    val clip_by_l2norm : A.elt -> t -> t

    other functions, without tracking gradient

    val copy_primal' : t -> t

    TODO

    val tile : t -> int array -> t

    TODO

    val repeat : t -> int array -> t

    TODO

    val pack_elt : A.elt -> t

    convert from elt type to t type.

    val unpack_elt : t -> A.elt

    convert from t type to elt type.

    val pack_flt : float -> t

    convert from float type to t type.

    val _f : float -> t

    A shortcut function for F A.(float_to_elt x).

    val unpack_flt : t -> float

    convert from t type to float type.

    val pack_arr : A.arr -> t

    convert from arr type to t type.

    val unpack_arr : t -> A.arr

    convert from t type to arr type.

    val deep_info : t -> string

    TODO

    val type_info : t -> string

    TODO

    val error_binop : string -> t -> t -> 'a

    TODO

    val error_uniop : string -> t -> 'a

    TODO

    val make_forward : t -> t -> int -> t

    make_forward p t i construct a forward algodiff data type DF, consisting of primal p, tangent t, and tag i.

    val make_reverse : t -> int -> t

    make_reverse p i construct a reverse algodiff data type DR, consisting of primal, adjoint, op, fanout, tag, and tracker.

    val reverse_prop : t -> t -> unit

    reverse_prop f x performs reverse propagation for function f using the output value x.

    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

    similar 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)

    include Owl_algodiff_ops_sig.Sig +Algodiff (owl-base.Owl_neural_graph_sig.Sig.Neuron.Optimise.Algodiff)

    Module Optimise.Algodiff

    include Owl_algodiff_core_sig.Sig
    Type definition
    include Owl_algodiff_types_sig.Sig with type elt := A.elt and type arr := A.arr
    type t =
    1. | F of A.elt
    2. | Arr of A.arr
    3. | DF of t * t * int
    4. | DR of t * t Stdlib.ref * op * int Stdlib.ref * int * int Stdlib.ref
    and adjoint = t -> t Stdlib.ref -> (t * t) list -> (t * t) list
    and register = t list -> t list
    and label = string * t list
    and op = adjoint * register * label
    Core functions
    val tag : unit -> int

    start global tagging counter

    val primal : t -> t

    get primal component of DF or DR type

    val primal' : t -> t

    iteratively get primal component of DF or DR type until the component itself is not DF/DR

    val zero : t -> t

    return a zero value, which type decided by the input value

    val reset_zero : t -> t

    reset_zero x iteratively resets all elements included in x

    val tangent : t -> t

    get the tangent component of input, if the data type is suitable

    val adjref : t -> t Stdlib.ref

    get the adjref component of input, if the data type is suitable

    val adjval : t -> t

    get the adjval component of input, if the data type is suitableTODO

    val shape : t -> int array

    get the shape of primal' value of input

    val is_float : t -> bool

    check if input is of float value; if input is of type DF/DR, check its primal' value

    val is_arr : t -> bool

    check if input is of ndarray value; if input is of type DF/DR, check its primal' value

    val row_num : t -> int

    get the shape of primal' value of input; and then get the first dimension

    val col_num : t -> int

    get the shape of primal' value of input; and then get the second dimension

    val numel : t -> int

    for ndarray type input, return its total number of elements.

    val clip_by_value : amin:A.elt -> amax:A.elt -> t -> t

    other functions, without tracking gradient

    val clip_by_l2norm : A.elt -> t -> t

    other functions, without tracking gradient

    val copy_primal' : t -> t

    if primal' value of input is ndarray, copy its value in a new AD type ndarray

    val tile : t -> int array -> t

    if primal' value of input is ndarray, apply the tile function

    val repeat : t -> int array -> t

    if primal' value of input is ndarray, apply the repeat function

    val pack_elt : A.elt -> t

    convert from elt type to t type.

    val unpack_elt : t -> A.elt

    convert from t type to elt type.

    val pack_flt : float -> t

    convert from float type to t type.

    val _f : float -> t

    A shortcut function for F A.(float_to_elt x).

    val unpack_flt : t -> float

    convert from t type to float type.

    val pack_arr : A.arr -> t

    convert from arr type to t type.

    val unpack_arr : t -> A.arr

    convert from t type to arr type.

    val deep_info : t -> string
    val type_info : t -> string
    val error_binop : string -> t -> t -> 'a
    val error_uniop : string -> t -> 'a
    val make_forward : t -> t -> int -> t

    make_forward p t i construct a forward algodiff data type DF, consisting of primal p, tangent t, and tag i.

    val make_reverse : t -> int -> t

    make_reverse p i construct a reverse algodiff data type DR, consisting of primal, adjoint, op, fanout, tag, and tracker.

    val reverse_prop : t -> t -> unit

    reverse_prop f x performs reverse propagation for function f using the output value x.

    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

    similar 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)

    include Owl_algodiff_ops_sig.Sig with type t := t and type elt := A.elt and type arr := A.arr diff --git a/docs/owl-base/Owl_neural_neuron/Make/argument-1-Optimise/Algodiff/index.html b/docs/owl-base/Owl_neural_neuron/Make/argument-1-Optimise/Algodiff/index.html index b20fb4a98..10fb975a5 100644 --- a/docs/owl-base/Owl_neural_neuron/Make/argument-1-Optimise/Algodiff/index.html +++ b/docs/owl-base/Owl_neural_neuron/Make/argument-1-Optimise/Algodiff/index.html @@ -1,5 +1,5 @@ -Algodiff (owl-base.Owl_neural_neuron.Make.Optimise.Algodiff)

    Module Optimise.Algodiff

    include Owl_algodiff_core_sig.Sig
    Type definition
    include Owl_algodiff_types_sig.Sig with type elt := A.elt and type arr := A.arr
    type t =
    1. | F of A.elt
    2. | Arr of A.arr
    3. | DF of t * t * int
    4. | DR of t * t Stdlib.ref * op * int Stdlib.ref * int * int Stdlib.ref
    and adjoint = t -> t Stdlib.ref -> (t * t) list -> (t * t) list
    and register = t list -> t list
    and label = string * t list
    and op = adjoint * register * label
    Core functions
    val tag : unit -> int

    TODO

    val primal : t -> t

    TODO

    val primal' : t -> t

    TODO

    val zero : t -> t

    TODO

    val reset_zero : t -> t

    TODO

    val tangent : t -> t

    TODO

    val adjref : t -> t Stdlib.ref

    TODO

    val adjval : t -> t

    TODO

    val shape : t -> int array

    TODO

    val is_float : t -> bool

    TODO

    val is_arr : t -> bool

    TODO

    val row_num : t -> int

    number of rows

    val col_num : t -> int

    number of columns

    val numel : t -> int

    number of elements

    val clip_by_value : amin:A.elt -> amax:A.elt -> t -> t

    other functions, without tracking gradient

    val clip_by_l2norm : A.elt -> t -> t

    other functions, without tracking gradient

    val copy_primal' : t -> t

    TODO

    val tile : t -> int array -> t

    TODO

    val repeat : t -> int array -> t

    TODO

    val pack_elt : A.elt -> t

    convert from elt type to t type.

    val unpack_elt : t -> A.elt

    convert from t type to elt type.

    val pack_flt : float -> t

    convert from float type to t type.

    val _f : float -> t

    A shortcut function for F A.(float_to_elt x).

    val unpack_flt : t -> float

    convert from t type to float type.

    val pack_arr : A.arr -> t

    convert from arr type to t type.

    val unpack_arr : t -> A.arr

    convert from t type to arr type.

    val deep_info : t -> string

    TODO

    val type_info : t -> string

    TODO

    val error_binop : string -> t -> t -> 'a

    TODO

    val error_uniop : string -> t -> 'a

    TODO

    val make_forward : t -> t -> int -> t

    make_forward p t i construct a forward algodiff data type DF, consisting of primal p, tangent t, and tag i.

    val make_reverse : t -> int -> t

    make_reverse p i construct a reverse algodiff data type DR, consisting of primal, adjoint, op, fanout, tag, and tracker.

    val reverse_prop : t -> t -> unit

    reverse_prop f x performs reverse propagation for function f using the output value x.

    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

    similar 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)

    include Owl_algodiff_ops_sig.Sig +Algodiff (owl-base.Owl_neural_neuron.Make.Optimise.Algodiff)

    Module Optimise.Algodiff

    include Owl_algodiff_core_sig.Sig
    Type definition
    include Owl_algodiff_types_sig.Sig with type elt := A.elt and type arr := A.arr
    type t =
    1. | F of A.elt
    2. | Arr of A.arr
    3. | DF of t * t * int
    4. | DR of t * t Stdlib.ref * op * int Stdlib.ref * int * int Stdlib.ref
    and adjoint = t -> t Stdlib.ref -> (t * t) list -> (t * t) list
    and register = t list -> t list
    and label = string * t list
    and op = adjoint * register * label
    Core functions
    val tag : unit -> int

    start global tagging counter

    val primal : t -> t

    get primal component of DF or DR type

    val primal' : t -> t

    iteratively get primal component of DF or DR type until the component itself is not DF/DR

    val zero : t -> t

    return a zero value, which type decided by the input value

    val reset_zero : t -> t

    reset_zero x iteratively resets all elements included in x

    val tangent : t -> t

    get the tangent component of input, if the data type is suitable

    val adjref : t -> t Stdlib.ref

    get the adjref component of input, if the data type is suitable

    val adjval : t -> t

    get the adjval component of input, if the data type is suitableTODO

    val shape : t -> int array

    get the shape of primal' value of input

    val is_float : t -> bool

    check if input is of float value; if input is of type DF/DR, check its primal' value

    val is_arr : t -> bool

    check if input is of ndarray value; if input is of type DF/DR, check its primal' value

    val row_num : t -> int

    get the shape of primal' value of input; and then get the first dimension

    val col_num : t -> int

    get the shape of primal' value of input; and then get the second dimension

    val numel : t -> int

    for ndarray type input, return its total number of elements.

    val clip_by_value : amin:A.elt -> amax:A.elt -> t -> t

    other functions, without tracking gradient

    val clip_by_l2norm : A.elt -> t -> t

    other functions, without tracking gradient

    val copy_primal' : t -> t

    if primal' value of input is ndarray, copy its value in a new AD type ndarray

    val tile : t -> int array -> t

    if primal' value of input is ndarray, apply the tile function

    val repeat : t -> int array -> t

    if primal' value of input is ndarray, apply the repeat function

    val pack_elt : A.elt -> t

    convert from elt type to t type.

    val unpack_elt : t -> A.elt

    convert from t type to elt type.

    val pack_flt : float -> t

    convert from float type to t type.

    val _f : float -> t

    A shortcut function for F A.(float_to_elt x).

    val unpack_flt : t -> float

    convert from t type to float type.

    val pack_arr : A.arr -> t

    convert from arr type to t type.

    val unpack_arr : t -> A.arr

    convert from t type to arr type.

    val deep_info : t -> string
    val type_info : t -> string
    val error_binop : string -> t -> t -> 'a
    val error_uniop : string -> t -> 'a
    val make_forward : t -> t -> int -> t

    make_forward p t i construct a forward algodiff data type DF, consisting of primal p, tangent t, and tag i.

    val make_reverse : t -> int -> t

    make_reverse p i construct a reverse algodiff data type DR, consisting of primal, adjoint, op, fanout, tag, and tracker.

    val reverse_prop : t -> t -> unit

    reverse_prop f x performs reverse propagation for function f using the output value x.

    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

    similar 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)

    include Owl_algodiff_ops_sig.Sig with type t := t and type elt := A.elt and type arr := A.arr diff --git a/docs/owl-base/Owl_neural_neuron_sig/module-type-Sig/Optimise/Algodiff/index.html b/docs/owl-base/Owl_neural_neuron_sig/module-type-Sig/Optimise/Algodiff/index.html index 8ae5f5456..0258a060e 100644 --- a/docs/owl-base/Owl_neural_neuron_sig/module-type-Sig/Optimise/Algodiff/index.html +++ b/docs/owl-base/Owl_neural_neuron_sig/module-type-Sig/Optimise/Algodiff/index.html @@ -1,5 +1,5 @@ -Algodiff (owl-base.Owl_neural_neuron_sig.Sig.Optimise.Algodiff)

    Module Optimise.Algodiff

    include Owl_algodiff_core_sig.Sig
    Type definition
    include Owl_algodiff_types_sig.Sig with type elt := A.elt and type arr := A.arr
    type t =
    1. | F of A.elt
    2. | Arr of A.arr
    3. | DF of t * t * int
    4. | DR of t * t Stdlib.ref * op * int Stdlib.ref * int * int Stdlib.ref
    and adjoint = t -> t Stdlib.ref -> (t * t) list -> (t * t) list
    and register = t list -> t list
    and label = string * t list
    and op = adjoint * register * label
    Core functions
    val tag : unit -> int

    TODO

    val primal : t -> t

    TODO

    val primal' : t -> t

    TODO

    val zero : t -> t

    TODO

    val reset_zero : t -> t

    TODO

    val tangent : t -> t

    TODO

    val adjref : t -> t Stdlib.ref

    TODO

    val adjval : t -> t

    TODO

    val shape : t -> int array

    TODO

    val is_float : t -> bool

    TODO

    val is_arr : t -> bool

    TODO

    val row_num : t -> int

    number of rows

    val col_num : t -> int

    number of columns

    val numel : t -> int

    number of elements

    val clip_by_value : amin:A.elt -> amax:A.elt -> t -> t

    other functions, without tracking gradient

    val clip_by_l2norm : A.elt -> t -> t

    other functions, without tracking gradient

    val copy_primal' : t -> t

    TODO

    val tile : t -> int array -> t

    TODO

    val repeat : t -> int array -> t

    TODO

    val pack_elt : A.elt -> t

    convert from elt type to t type.

    val unpack_elt : t -> A.elt

    convert from t type to elt type.

    val pack_flt : float -> t

    convert from float type to t type.

    val _f : float -> t

    A shortcut function for F A.(float_to_elt x).

    val unpack_flt : t -> float

    convert from t type to float type.

    val pack_arr : A.arr -> t

    convert from arr type to t type.

    val unpack_arr : t -> A.arr

    convert from t type to arr type.

    val deep_info : t -> string

    TODO

    val type_info : t -> string

    TODO

    val error_binop : string -> t -> t -> 'a

    TODO

    val error_uniop : string -> t -> 'a

    TODO

    val make_forward : t -> t -> int -> t

    make_forward p t i construct a forward algodiff data type DF, consisting of primal p, tangent t, and tag i.

    val make_reverse : t -> int -> t

    make_reverse p i construct a reverse algodiff data type DR, consisting of primal, adjoint, op, fanout, tag, and tracker.

    val reverse_prop : t -> t -> unit

    reverse_prop f x performs reverse propagation for function f using the output value x.

    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

    similar 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)

    include Owl_algodiff_ops_sig.Sig +Algodiff (owl-base.Owl_neural_neuron_sig.Sig.Optimise.Algodiff)

    Module Optimise.Algodiff

    include Owl_algodiff_core_sig.Sig
    Type definition
    include Owl_algodiff_types_sig.Sig with type elt := A.elt and type arr := A.arr
    type t =
    1. | F of A.elt
    2. | Arr of A.arr
    3. | DF of t * t * int
    4. | DR of t * t Stdlib.ref * op * int Stdlib.ref * int * int Stdlib.ref
    and adjoint = t -> t Stdlib.ref -> (t * t) list -> (t * t) list
    and register = t list -> t list
    and label = string * t list
    and op = adjoint * register * label
    Core functions
    val tag : unit -> int

    start global tagging counter

    val primal : t -> t

    get primal component of DF or DR type

    val primal' : t -> t

    iteratively get primal component of DF or DR type until the component itself is not DF/DR

    val zero : t -> t

    return a zero value, which type decided by the input value

    val reset_zero : t -> t

    reset_zero x iteratively resets all elements included in x

    val tangent : t -> t

    get the tangent component of input, if the data type is suitable

    val adjref : t -> t Stdlib.ref

    get the adjref component of input, if the data type is suitable

    val adjval : t -> t

    get the adjval component of input, if the data type is suitableTODO

    val shape : t -> int array

    get the shape of primal' value of input

    val is_float : t -> bool

    check if input is of float value; if input is of type DF/DR, check its primal' value

    val is_arr : t -> bool

    check if input is of ndarray value; if input is of type DF/DR, check its primal' value

    val row_num : t -> int

    get the shape of primal' value of input; and then get the first dimension

    val col_num : t -> int

    get the shape of primal' value of input; and then get the second dimension

    val numel : t -> int

    for ndarray type input, return its total number of elements.

    val clip_by_value : amin:A.elt -> amax:A.elt -> t -> t

    other functions, without tracking gradient

    val clip_by_l2norm : A.elt -> t -> t

    other functions, without tracking gradient

    val copy_primal' : t -> t

    if primal' value of input is ndarray, copy its value in a new AD type ndarray

    val tile : t -> int array -> t

    if primal' value of input is ndarray, apply the tile function

    val repeat : t -> int array -> t

    if primal' value of input is ndarray, apply the repeat function

    val pack_elt : A.elt -> t

    convert from elt type to t type.

    val unpack_elt : t -> A.elt

    convert from t type to elt type.

    val pack_flt : float -> t

    convert from float type to t type.

    val _f : float -> t

    A shortcut function for F A.(float_to_elt x).

    val unpack_flt : t -> float

    convert from t type to float type.

    val pack_arr : A.arr -> t

    convert from arr type to t type.

    val unpack_arr : t -> A.arr

    convert from t type to arr type.

    val deep_info : t -> string
    val type_info : t -> string
    val error_binop : string -> t -> t -> 'a
    val error_uniop : string -> t -> 'a
    val make_forward : t -> t -> int -> t

    make_forward p t i construct a forward algodiff data type DF, consisting of primal p, tangent t, and tag i.

    val make_reverse : t -> int -> t

    make_reverse p i construct a reverse algodiff data type DR, consisting of primal, adjoint, op, fanout, tag, and tracker.

    val reverse_prop : t -> t -> unit

    reverse_prop f x performs reverse propagation for function f using the output value x.

    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

    similar 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)

    include Owl_algodiff_ops_sig.Sig with type t := t and type elt := A.elt and type arr := A.arr diff --git a/docs/owl-base/Owl_optimise_generic/Make/argument-1-Algodiff/index.html b/docs/owl-base/Owl_optimise_generic/Make/argument-1-Algodiff/index.html index b0e74ba49..95f12c7f2 100644 --- a/docs/owl-base/Owl_optimise_generic/Make/argument-1-Algodiff/index.html +++ b/docs/owl-base/Owl_optimise_generic/Make/argument-1-Algodiff/index.html @@ -1,5 +1,5 @@ -Algodiff (owl-base.Owl_optimise_generic.Make.Algodiff)

    Parameter Make.Algodiff

    include Owl_algodiff_core_sig.Sig
    Type definition
    include Owl_algodiff_types_sig.Sig with type elt := A.elt and type arr := A.arr
    type t =
    1. | F of A.elt
    2. | Arr of A.arr
    3. | DF of t * t * int
    4. | DR of t * t Stdlib.ref * op * int Stdlib.ref * int * int Stdlib.ref
    and adjoint = t -> t Stdlib.ref -> (t * t) list -> (t * t) list
    and register = t list -> t list
    and label = string * t list
    and op = adjoint * register * label
    Core functions
    val tag : unit -> int

    TODO

    val primal : t -> t

    TODO

    val primal' : t -> t

    TODO

    val zero : t -> t

    TODO

    val reset_zero : t -> t

    TODO

    val tangent : t -> t

    TODO

    val adjref : t -> t Stdlib.ref

    TODO

    val adjval : t -> t

    TODO

    val shape : t -> int array

    TODO

    val is_float : t -> bool

    TODO

    val is_arr : t -> bool

    TODO

    val row_num : t -> int

    number of rows

    val col_num : t -> int

    number of columns

    val numel : t -> int

    number of elements

    val clip_by_value : amin:A.elt -> amax:A.elt -> t -> t

    other functions, without tracking gradient

    val clip_by_l2norm : A.elt -> t -> t

    other functions, without tracking gradient

    val copy_primal' : t -> t

    TODO

    val tile : t -> int array -> t

    TODO

    val repeat : t -> int array -> t

    TODO

    val pack_elt : A.elt -> t

    convert from elt type to t type.

    val unpack_elt : t -> A.elt

    convert from t type to elt type.

    val pack_flt : float -> t

    convert from float type to t type.

    val _f : float -> t

    A shortcut function for F A.(float_to_elt x).

    val unpack_flt : t -> float

    convert from t type to float type.

    val pack_arr : A.arr -> t

    convert from arr type to t type.

    val unpack_arr : t -> A.arr

    convert from t type to arr type.

    val deep_info : t -> string

    TODO

    val type_info : t -> string

    TODO

    val error_binop : string -> t -> t -> 'a

    TODO

    val error_uniop : string -> t -> 'a

    TODO

    val make_forward : t -> t -> int -> t

    make_forward p t i construct a forward algodiff data type DF, consisting of primal p, tangent t, and tag i.

    val make_reverse : t -> int -> t

    make_reverse p i construct a reverse algodiff data type DR, consisting of primal, adjoint, op, fanout, tag, and tracker.

    val reverse_prop : t -> t -> unit

    reverse_prop f x performs reverse propagation for function f using the output value x.

    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

    similar 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)

    include Owl_algodiff_ops_sig.Sig +Algodiff (owl-base.Owl_optimise_generic.Make.Algodiff)

    Parameter Make.Algodiff

    include Owl_algodiff_core_sig.Sig
    Type definition
    include Owl_algodiff_types_sig.Sig with type elt := A.elt and type arr := A.arr
    type t =
    1. | F of A.elt
    2. | Arr of A.arr
    3. | DF of t * t * int
    4. | DR of t * t Stdlib.ref * op * int Stdlib.ref * int * int Stdlib.ref
    and adjoint = t -> t Stdlib.ref -> (t * t) list -> (t * t) list
    and register = t list -> t list
    and label = string * t list
    and op = adjoint * register * label
    Core functions
    val tag : unit -> int

    start global tagging counter

    val primal : t -> t

    get primal component of DF or DR type

    val primal' : t -> t

    iteratively get primal component of DF or DR type until the component itself is not DF/DR

    val zero : t -> t

    return a zero value, which type decided by the input value

    val reset_zero : t -> t

    reset_zero x iteratively resets all elements included in x

    val tangent : t -> t

    get the tangent component of input, if the data type is suitable

    val adjref : t -> t Stdlib.ref

    get the adjref component of input, if the data type is suitable

    val adjval : t -> t

    get the adjval component of input, if the data type is suitableTODO

    val shape : t -> int array

    get the shape of primal' value of input

    val is_float : t -> bool

    check if input is of float value; if input is of type DF/DR, check its primal' value

    val is_arr : t -> bool

    check if input is of ndarray value; if input is of type DF/DR, check its primal' value

    val row_num : t -> int

    get the shape of primal' value of input; and then get the first dimension

    val col_num : t -> int

    get the shape of primal' value of input; and then get the second dimension

    val numel : t -> int

    for ndarray type input, return its total number of elements.

    val clip_by_value : amin:A.elt -> amax:A.elt -> t -> t

    other functions, without tracking gradient

    val clip_by_l2norm : A.elt -> t -> t

    other functions, without tracking gradient

    val copy_primal' : t -> t

    if primal' value of input is ndarray, copy its value in a new AD type ndarray

    val tile : t -> int array -> t

    if primal' value of input is ndarray, apply the tile function

    val repeat : t -> int array -> t

    if primal' value of input is ndarray, apply the repeat function

    val pack_elt : A.elt -> t

    convert from elt type to t type.

    val unpack_elt : t -> A.elt

    convert from t type to elt type.

    val pack_flt : float -> t

    convert from float type to t type.

    val _f : float -> t

    A shortcut function for F A.(float_to_elt x).

    val unpack_flt : t -> float

    convert from t type to float type.

    val pack_arr : A.arr -> t

    convert from arr type to t type.

    val unpack_arr : t -> A.arr

    convert from t type to arr type.

    val deep_info : t -> string
    val type_info : t -> string
    val error_binop : string -> t -> t -> 'a
    val error_uniop : string -> t -> 'a
    val make_forward : t -> t -> int -> t

    make_forward p t i construct a forward algodiff data type DF, consisting of primal p, tangent t, and tag i.

    val make_reverse : t -> int -> t

    make_reverse p i construct a reverse algodiff data type DR, consisting of primal, adjoint, op, fanout, tag, and tracker.

    val reverse_prop : t -> t -> unit

    reverse_prop f x performs reverse propagation for function f using the output value x.

    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

    similar 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)

    include Owl_algodiff_ops_sig.Sig with type t := t and type elt := A.elt and type arr := A.arr diff --git a/docs/owl-base/Owl_optimise_generic_sig/module-type-Sig/Algodiff/index.html b/docs/owl-base/Owl_optimise_generic_sig/module-type-Sig/Algodiff/index.html index 3f0bd6ef8..c325f9956 100644 --- a/docs/owl-base/Owl_optimise_generic_sig/module-type-Sig/Algodiff/index.html +++ b/docs/owl-base/Owl_optimise_generic_sig/module-type-Sig/Algodiff/index.html @@ -1,5 +1,5 @@ -Algodiff (owl-base.Owl_optimise_generic_sig.Sig.Algodiff)

    Module Sig.Algodiff

    include Owl_algodiff_core_sig.Sig
    Type definition
    include Owl_algodiff_types_sig.Sig with type elt := A.elt and type arr := A.arr
    type t =
    1. | F of A.elt
    2. | Arr of A.arr
    3. | DF of t * t * int
    4. | DR of t * t Stdlib.ref * op * int Stdlib.ref * int * int Stdlib.ref
    and adjoint = t -> t Stdlib.ref -> (t * t) list -> (t * t) list
    and register = t list -> t list
    and label = string * t list
    and op = adjoint * register * label
    Core functions
    val tag : unit -> int

    TODO

    val primal : t -> t

    TODO

    val primal' : t -> t

    TODO

    val zero : t -> t

    TODO

    val reset_zero : t -> t

    TODO

    val tangent : t -> t

    TODO

    val adjref : t -> t Stdlib.ref

    TODO

    val adjval : t -> t

    TODO

    val shape : t -> int array

    TODO

    val is_float : t -> bool

    TODO

    val is_arr : t -> bool

    TODO

    val row_num : t -> int

    number of rows

    val col_num : t -> int

    number of columns

    val numel : t -> int

    number of elements

    val clip_by_value : amin:A.elt -> amax:A.elt -> t -> t

    other functions, without tracking gradient

    val clip_by_l2norm : A.elt -> t -> t

    other functions, without tracking gradient

    val copy_primal' : t -> t

    TODO

    val tile : t -> int array -> t

    TODO

    val repeat : t -> int array -> t

    TODO

    val pack_elt : A.elt -> t

    convert from elt type to t type.

    val unpack_elt : t -> A.elt

    convert from t type to elt type.

    val pack_flt : float -> t

    convert from float type to t type.

    val _f : float -> t

    A shortcut function for F A.(float_to_elt x).

    val unpack_flt : t -> float

    convert from t type to float type.

    val pack_arr : A.arr -> t

    convert from arr type to t type.

    val unpack_arr : t -> A.arr

    convert from t type to arr type.

    val deep_info : t -> string

    TODO

    val type_info : t -> string

    TODO

    val error_binop : string -> t -> t -> 'a

    TODO

    val error_uniop : string -> t -> 'a

    TODO

    val make_forward : t -> t -> int -> t

    make_forward p t i construct a forward algodiff data type DF, consisting of primal p, tangent t, and tag i.

    val make_reverse : t -> int -> t

    make_reverse p i construct a reverse algodiff data type DR, consisting of primal, adjoint, op, fanout, tag, and tracker.

    val reverse_prop : t -> t -> unit

    reverse_prop f x performs reverse propagation for function f using the output value x.

    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

    similar 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)

    include Owl_algodiff_ops_sig.Sig +Algodiff (owl-base.Owl_optimise_generic_sig.Sig.Algodiff)

    Module Sig.Algodiff

    include Owl_algodiff_core_sig.Sig
    Type definition
    include Owl_algodiff_types_sig.Sig with type elt := A.elt and type arr := A.arr
    type t =
    1. | F of A.elt
    2. | Arr of A.arr
    3. | DF of t * t * int
    4. | DR of t * t Stdlib.ref * op * int Stdlib.ref * int * int Stdlib.ref
    and adjoint = t -> t Stdlib.ref -> (t * t) list -> (t * t) list
    and register = t list -> t list
    and label = string * t list
    and op = adjoint * register * label
    Core functions
    val tag : unit -> int

    start global tagging counter

    val primal : t -> t

    get primal component of DF or DR type

    val primal' : t -> t

    iteratively get primal component of DF or DR type until the component itself is not DF/DR

    val zero : t -> t

    return a zero value, which type decided by the input value

    val reset_zero : t -> t

    reset_zero x iteratively resets all elements included in x

    val tangent : t -> t

    get the tangent component of input, if the data type is suitable

    val adjref : t -> t Stdlib.ref

    get the adjref component of input, if the data type is suitable

    val adjval : t -> t

    get the adjval component of input, if the data type is suitableTODO

    val shape : t -> int array

    get the shape of primal' value of input

    val is_float : t -> bool

    check if input is of float value; if input is of type DF/DR, check its primal' value

    val is_arr : t -> bool

    check if input is of ndarray value; if input is of type DF/DR, check its primal' value

    val row_num : t -> int

    get the shape of primal' value of input; and then get the first dimension

    val col_num : t -> int

    get the shape of primal' value of input; and then get the second dimension

    val numel : t -> int

    for ndarray type input, return its total number of elements.

    val clip_by_value : amin:A.elt -> amax:A.elt -> t -> t

    other functions, without tracking gradient

    val clip_by_l2norm : A.elt -> t -> t

    other functions, without tracking gradient

    val copy_primal' : t -> t

    if primal' value of input is ndarray, copy its value in a new AD type ndarray

    val tile : t -> int array -> t

    if primal' value of input is ndarray, apply the tile function

    val repeat : t -> int array -> t

    if primal' value of input is ndarray, apply the repeat function

    val pack_elt : A.elt -> t

    convert from elt type to t type.

    val unpack_elt : t -> A.elt

    convert from t type to elt type.

    val pack_flt : float -> t

    convert from float type to t type.

    val _f : float -> t

    A shortcut function for F A.(float_to_elt x).

    val unpack_flt : t -> float

    convert from t type to float type.

    val pack_arr : A.arr -> t

    convert from arr type to t type.

    val unpack_arr : t -> A.arr

    convert from t type to arr type.

    val deep_info : t -> string
    val type_info : t -> string
    val error_binop : string -> t -> t -> 'a
    val error_uniop : string -> t -> 'a
    val make_forward : t -> t -> int -> t

    make_forward p t i construct a forward algodiff data type DF, consisting of primal p, tangent t, and tag i.

    val make_reverse : t -> int -> t

    make_reverse p i construct a reverse algodiff data type DR, consisting of primal, adjoint, op, fanout, tag, and tracker.

    val reverse_prop : t -> t -> unit

    reverse_prop f x performs reverse propagation for function f using the output value x.

    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

    similar 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)

    include Owl_algodiff_ops_sig.Sig with type t := t and type elt := A.elt and type arr := A.arr diff --git a/docs/owl-base/Owl_types/module-type-Computation_Device/index.html b/docs/owl-base/Owl_types/module-type-Computation_Device/index.html index 810840a28..291b7da1f 100644 --- a/docs/owl-base/Owl_types/module-type-Computation_Device/index.html +++ b/docs/owl-base/Owl_types/module-type-Computation_Device/index.html @@ -1,2 +1,2 @@ -Computation_Device (owl-base.Owl_types.Computation_Device)

    Module type Owl_types.Computation_Device

    include Owl_types_computation_device.Sig
    Type definition
    type device

    TODO

    type value

    TODO

    Core functions
    val make_device : unit -> device

    TODO

    val arr_to_value : A.arr -> value

    TODO

    val value_to_arr : value -> A.arr

    TODO

    val elt_to_value : A.elt -> value

    TODO

    val value_to_elt : value -> A.elt

    TODO

    val value_to_float : value -> float

    TODO

    val is_arr : value -> bool

    TODO

    val is_elt : value -> bool

    TODO

    +Computation_Device (owl-base.Owl_types.Computation_Device)

    Module type Owl_types.Computation_Device

    include Owl_types_computation_device.Sig
    Type definition
    type device
    type value
    Core functions
    val make_device : unit -> device
    val arr_to_value : A.arr -> value
    val value_to_arr : value -> A.arr
    val elt_to_value : A.elt -> value
    val value_to_elt : value -> A.elt
    val value_to_float : value -> float
    val is_arr : value -> bool
    val is_elt : value -> bool
    diff --git a/docs/owl-base/Owl_types_computation_device/module-type-Sig/index.html b/docs/owl-base/Owl_types_computation_device/module-type-Sig/index.html index 40cf53df6..84d611720 100644 --- a/docs/owl-base/Owl_types_computation_device/module-type-Sig/index.html +++ b/docs/owl-base/Owl_types_computation_device/module-type-Sig/index.html @@ -1,2 +1,2 @@ -Sig (owl-base.Owl_types_computation_device.Sig)

    Module type Owl_types_computation_device.Sig

    Type definition
    type device

    TODO

    type value

    TODO

    Core functions
    val make_device : unit -> device

    TODO

    val arr_to_value : A.arr -> value

    TODO

    val value_to_arr : value -> A.arr

    TODO

    val elt_to_value : A.elt -> value

    TODO

    val value_to_elt : value -> A.elt

    TODO

    val value_to_float : value -> float

    TODO

    val is_arr : value -> bool

    TODO

    val is_elt : value -> bool

    TODO

    +Sig (owl-base.Owl_types_computation_device.Sig)

    Module type Owl_types_computation_device.Sig

    Type definition
    type device
    type value
    Core functions
    val make_device : unit -> device
    val arr_to_value : A.arr -> value
    val value_to_arr : value -> A.arr
    val elt_to_value : A.elt -> value
    val value_to_elt : value -> A.elt
    val value_to_float : value -> float
    val is_arr : value -> bool
    val is_elt : value -> bool
    diff --git a/docs/owl-base/Owl_types_computation_engine/module-type-Sig/Graph/Optimiser/Operator/Symbol/Shape/Type/Device/index.html b/docs/owl-base/Owl_types_computation_engine/module-type-Sig/Graph/Optimiser/Operator/Symbol/Shape/Type/Device/index.html index bbca23023..528435786 100644 --- a/docs/owl-base/Owl_types_computation_engine/module-type-Sig/Graph/Optimiser/Operator/Symbol/Shape/Type/Device/index.html +++ b/docs/owl-base/Owl_types_computation_engine/module-type-Sig/Graph/Optimiser/Operator/Symbol/Shape/Type/Device/index.html @@ -1,2 +1,2 @@ -Device (owl-base.Owl_types_computation_engine.Sig.Graph.Optimiser.Operator.Symbol.Shape.Type.Device)

    Module Type.Device

    Type definition
    type device

    TODO

    type value

    TODO

    Core functions
    val make_device : unit -> device

    TODO

    val arr_to_value : A.arr -> value

    TODO

    val value_to_arr : value -> A.arr

    TODO

    val elt_to_value : A.elt -> value

    TODO

    val value_to_elt : value -> A.elt

    TODO

    val value_to_float : value -> float

    TODO

    val is_arr : value -> bool

    TODO

    val is_elt : value -> bool

    TODO

    +Device (owl-base.Owl_types_computation_engine.Sig.Graph.Optimiser.Operator.Symbol.Shape.Type.Device)

    Module Type.Device

    Type definition
    type device
    type value
    Core functions
    val make_device : unit -> device
    val arr_to_value : A.arr -> value
    val value_to_arr : value -> A.arr
    val elt_to_value : A.elt -> value
    val value_to_elt : value -> A.elt
    val value_to_float : value -> float
    val is_arr : value -> bool
    val is_elt : value -> bool
    diff --git a/docs/owl-base/Owl_types_computation_engine/module-type-Sig/Graph/Optimiser/Operator/Symbol/index.html b/docs/owl-base/Owl_types_computation_engine/module-type-Sig/Graph/Optimiser/Operator/Symbol/index.html index 5980aea16..b6539ac39 100644 --- a/docs/owl-base/Owl_types_computation_engine/module-type-Sig/Graph/Optimiser/Operator/Symbol/index.html +++ b/docs/owl-base/Owl_types_computation_engine/module-type-Sig/Graph/Optimiser/Operator/Symbol/index.html @@ -1,5 +1,5 @@ -Symbol (owl-base.Owl_types_computation_engine.Sig.Graph.Optimiser.Operator.Symbol)

    Module Operator.Symbol

    Core functions
    val op_to_str : Shape.Type.op -> string

    TODO

    val is_random_variable : Shape.Type.op -> bool

    TODO

    val refnum : 'a Owl_graph.node -> int

    TODO

    val node_shape : Shape.Type.attr Owl_graph.node -> int array

    TODO

    val node_numel : Shape.Type.attr Owl_graph.node -> int

    TODO

    val is_shape_unknown : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val infer_shape_graph : Shape.Type.attr Owl_graph.node array -> unit

    TODO

    val shape_to_str : int array option array -> string

    TODO

    val node_to_str : Shape.Type.attr Owl_graph.node -> string

    TODO

    val node_to_arr : Shape.Type.t -> Shape.Type.arr

    TODO

    val arr_to_node : Shape.Type.arr -> Shape.Type.t

    TODO

    val node_to_elt : Shape.Type.t -> Shape.Type.elt

    TODO

    val elt_to_node : Shape.Type.elt -> Shape.Type.t

    TODO

    val make_node : +Symbol (owl-base.Owl_types_computation_engine.Sig.Graph.Optimiser.Operator.Symbol)

    Module Operator.Symbol

    Core functions
    val op_to_str : Shape.Type.op -> string

    return the name of the operator as string

    val is_random_variable : Shape.Type.op -> bool

    check if operator is randon variable

    val refnum : 'a Owl_graph.node -> int

    return the reference number of the given node

    val node_shape : Shape.Type.attr Owl_graph.node -> int array

    return the shape of a node

    val node_numel : Shape.Type.attr Owl_graph.node -> int

    return the number of elements of a node

    val is_shape_unknown : Shape.Type.attr Owl_graph.node -> bool

    check if the shape of the input node is unknown

    val infer_shape_graph : Shape.Type.attr Owl_graph.node array -> unit

    automatically infer the shape of input node according to its descendents' shapes

    val shape_to_str : int array option array -> string

    helper function; return the input array in string format.

    val node_to_str : Shape.Type.attr Owl_graph.node -> string

    print node's information to string

    val node_to_arr : Shape.Type.t -> Shape.Type.arr

    Wrap computation graph node in an array type

    val arr_to_node : Shape.Type.arr -> Shape.Type.t

    Unwrap the array type to get the computation graph node within

    val node_to_elt : Shape.Type.t -> Shape.Type.elt

    Wrap computation graph node in an Elt type

    val elt_to_node : Shape.Type.elt -> Shape.Type.t

    Unwrap the Elt type to get the computation graph node within

    val make_node : ?name:string -> ?value:Shape.Type.Device.value array -> ?shape:int array option array -> @@ -7,11 +7,11 @@ ?reuse:bool -> ?state:Shape.Type.state -> Shape.Type.op -> - Shape.Type.attr Owl_graph.node

    TODO

    val make_then_connect : + Shape.Type.attr Owl_graph.node

    crate a computation graph node

    val make_then_connect : ?shape:int array option array -> Shape.Type.op -> Shape.Type.attr Owl_graph.node array -> - Shape.Type.attr Owl_graph.node

    TODO

    val var_arr : ?shape:int array -> string -> Shape.Type.arr

    TODO

    val var_elt : string -> Shape.Type.elt

    TODO

    val const_arr : string -> Shape.Type.Device.A.arr -> Shape.Type.arr

    TODO

    val const_elt : string -> Shape.Type.Device.A.elt -> Shape.Type.elt

    TODO

    val new_block_id : unit -> int

    new_block_id () returns an unused block id.

    val make_empty_block : ?block_id:int -> int -> Shape.Type.block

    make_empty_block s returns an empty block of memory of size s.

    val make_value_block : + Shape.Type.attr Owl_graph.node

    make nodes and then connect parents and children

    val var_arr : ?shape:int array -> string -> Shape.Type.arr

    creat a node and wrap in Arr type

    val var_elt : string -> Shape.Type.elt

    creat a node and wrap in Elt type

    val const_arr : string -> Shape.Type.Device.A.arr -> Shape.Type.arr

    get ndarray value from input and create an node and wrap in Arr type

    val const_elt : string -> Shape.Type.Device.A.elt -> Shape.Type.elt

    get value from input and create an node and wrap in Elt type

    val new_block_id : unit -> int

    new_block_id () returns an unused block id.

    val make_empty_block : ?block_id:int -> int -> Shape.Type.block

    make_empty_block s returns an empty block of memory of size s.

    val make_value_block : Shape.Type.Device.value -> Shape.Type.attr Owl_graph.node -> unit

    make_value_block value node creates a block of memory initialised with value and links the new block to node.

    get_block node returns the memory block allocated to node. If no block is allocated, throws an exception.

    val add_node_to_block : @@ -23,6 +23,6 @@ unit

    Update the node that is currently using the block of memory.

    val get_block_id : Shape.Type.attr Owl_graph.node -> int

    get_block_id node returns the id of the block assigned to node. If node has not been assigned yet, returns -1.

    val set_value : Shape.Type.attr Owl_graph.node -> Shape.Type.Device.value array -> - unit

    TODO

    val set_operator : Shape.Type.attr Owl_graph.node -> Shape.Type.op -> unit

    TODO

    TODO

    val set_reuse : Shape.Type.attr Owl_graph.node -> bool -> unit

    TODO

    val get_reuse : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val is_shared : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val get_shared_nodes : + unit

    set the arrays of value to cgraph node

    get the arrays of value of cgraph node

    val set_operator : Shape.Type.attr Owl_graph.node -> Shape.Type.op -> unit

    set the operator of cgraph node

    get the operator of cgraph node

    val set_reuse : Shape.Type.attr Owl_graph.node -> bool -> unit

    set reuse attribute in a node

    val get_reuse : Shape.Type.attr Owl_graph.node -> bool

    get reuse attribute in a node

    val is_shared : Shape.Type.attr Owl_graph.node -> bool

    check of the data block of memory is shared in a node

    get_shared_nodes node returns the nodes sharing the same block of memory as node.

    val is_var : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val is_const : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val is_node_arr : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val is_node_elt : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val is_assigned : Shape.Type.attr Owl_graph.node -> bool

    is_assigned node checks if a block of memory has been assigned to node.

    val check_assigned : Shape.Type.attr Owl_graph.node -> unit

    check_assigned node throws an exception if node has not been assigned to a block.

    val is_valid : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val validate : Shape.Type.attr Owl_graph.node -> unit

    TODO

    val invalidate : Shape.Type.attr Owl_graph.node -> unit

    TODO

    val invalidate_graph : Shape.Type.attr Owl_graph.node -> unit

    TODO

    val is_freeze : Shape.Type.attr Owl_graph.node -> bool

    TODO

    val freeze : Shape.Type.attr Owl_graph.node -> unit

    TODO

    val freeze_descendants : Shape.Type.attr Owl_graph.node array -> unit

    TODO

    val freeze_ancestors : Shape.Type.attr Owl_graph.node array -> unit

    TODO

    TODO

    TODO

    val unsafe_assign_arr : Shape.Type.arr -> Shape.Type.Device.A.arr -> unit

    TODO

    val assign_arr : Shape.Type.arr -> Shape.Type.Device.A.arr -> unit

    TODO

    val assign_elt : Shape.Type.elt -> Shape.Type.Device.A.elt -> unit

    TODO

    val float_to_elt : float -> Shape.Type.elt

    TODO

    val elt_to_float : Shape.Type.elt -> float

    TODO

    + Shape.Type.attr Owl_graph.node array

    get_shared_nodes node returns the nodes sharing the same block of memory as node.

    val is_var : Shape.Type.attr Owl_graph.node -> bool

    check if the node's operator is Var type

    val is_const : Shape.Type.attr Owl_graph.node -> bool

    check if the node's operator is Const type

    val is_node_arr : Shape.Type.attr Owl_graph.node -> bool

    check the shape of a node's attr and return if it indicates an ndarray

    val is_node_elt : Shape.Type.attr Owl_graph.node -> bool

    check the shape of a node's attr and return if it indicates an elt

    val is_assigned : Shape.Type.attr Owl_graph.node -> bool

    is_assigned node checks if a block of memory has been assigned to node.

    val check_assigned : Shape.Type.attr Owl_graph.node -> unit

    check_assigned node throws an exception if node has not been assigned to a block.

    val is_valid : Shape.Type.attr Owl_graph.node -> bool

    check if the state attribute of a node is Valid

    val validate : Shape.Type.attr Owl_graph.node -> unit

    set Valid to the state attribute of a node

    val invalidate : Shape.Type.attr Owl_graph.node -> unit

    set Invalid to the state attribute of a node

    val invalidate_graph : Shape.Type.attr Owl_graph.node -> unit

    iteratively invalidate the nodes in a graph

    val is_freeze : Shape.Type.attr Owl_graph.node -> bool

    check the freeze attribute of a node

    val freeze : Shape.Type.attr Owl_graph.node -> unit

    return the freeze attribute of a node

    val freeze_descendants : Shape.Type.attr Owl_graph.node array -> unit

    iteratively freeze the descendants of a node

    val freeze_ancestors : Shape.Type.attr Owl_graph.node array -> unit

    iteratively freeze the ancestors of a node

    pack an A.arr type input into Arr type

    unpack input into A.arr type

    pack an A.elt type input into Elt type

    unpack input into A.elt type

    val unsafe_assign_arr : Shape.Type.arr -> Shape.Type.Device.A.arr -> unit

    assign Arr type value

    val assign_arr : Shape.Type.arr -> Shape.Type.Device.A.arr -> unit

    assign Arr type value

    val assign_elt : Shape.Type.elt -> Shape.Type.Device.A.elt -> unit

    assign Elt type value

    val float_to_elt : float -> Shape.Type.elt

    build an Elt type based on float value

    val elt_to_float : Shape.Type.elt -> float

    retrive a float value from an Elt type value

    diff --git a/docs/owl-base/Owl_types_computation_engine/module-type-Sig/Graph/index.html b/docs/owl-base/Owl_types_computation_engine/module-type-Sig/Graph/index.html index cca269e39..a30479ed0 100644 --- a/docs/owl-base/Owl_types_computation_engine/module-type-Sig/Graph/index.html +++ b/docs/owl-base/Owl_types_computation_engine/module-type-Sig/Graph/index.html @@ -1,33 +1,33 @@ -Graph (owl-base.Owl_types_computation_engine.Sig.Graph)

    Module Sig.Graph

    Type definition
    type graph

    TODO

    Core functions
    val shape_or_value : Optimiser.Operator.Symbol.Shape.Type.t -> string

    TODO

    val graph_to_dot : graph -> string

    TODO

    val graph_to_trace : graph -> string

    TODO

    val save_graph : 'a -> string -> unit

    TODO

    val load_graph : string -> 'a * 'b

    TODO

    val collect_rvs : +Graph (owl-base.Owl_types_computation_engine.Sig.Graph)

    Module Sig.Graph

    Type definition
    type graph
    Core functions
    val shape_or_value : Optimiser.Operator.Symbol.Shape.Type.t -> string

    print shape for ndarrays, whilst value for scalars

    val graph_to_dot : graph -> string

    generate a string that can be written to a .dot file to draw the graph

    val graph_to_trace : graph -> string

    print the graph structure to a string

    val save_graph : 'a -> string -> unit

    save the graph object to a file with given name, using marshall format

    val load_graph : string -> 'a * 'b

    load the graph object from a file with given name

    val invalidate_rvs : graph -> unit

    TODO

    traverse each node in the input array, and return the random variable type nodes.

    val invalidate_rvs : graph -> unit

    TODO

    val get_inputs : + graph

    Build a graph based on input nodes, output nodes, and graph name

    get input nodes of a graph

    get output nodes of a graph

    val set_node_elt_val : + unit
    val is_iopair_safe : 'a Owl_graph.node -> 'a Owl_graph.node -> bool

    TODO

    val make_iopair : + unit
    val is_iopair_safe : 'a Owl_graph.node -> 'a Owl_graph.node -> bool
    val update_iopair : graph -> unit

    TODO

    val remove_unused_iopair : + unit

    create an iopair between the input nodes and output nodes in a graph

    val update_iopair : graph -> unit
    val remove_unused_iopair : 'a Owl_graph.node array -> 'b array -> - 'a Owl_graph.node array * 'b array

    TODO

    val init_inputs : + 'a Owl_graph.node array * 'b array

    remove unuserd iopair from an array of nodes

    val optimise : graph -> unit

    TODO

    + unit

    initialize inputs nodes of a graph with given function f

    val optimise : graph -> unit

    optimise the graph structure

    diff --git a/docs/owl/Owl_regression_generic/Make/argument-1-Optimise/Algodiff/index.html b/docs/owl/Owl_regression_generic/Make/argument-1-Optimise/Algodiff/index.html index ed2700a91..fcd8395cb 100644 --- a/docs/owl/Owl_regression_generic/Make/argument-1-Optimise/Algodiff/index.html +++ b/docs/owl/Owl_regression_generic/Make/argument-1-Optimise/Algodiff/index.html @@ -1,5 +1,5 @@ -Algodiff (owl.Owl_regression_generic.Make.Optimise.Algodiff)

    Module Optimise.Algodiff

    include Owl_algodiff_core_sig.Sig
    Type definition
    include Owl_algodiff_types_sig.Sig with type elt := A.elt and type arr := A.arr
    type t =
    1. | F of A.elt
    2. | Arr of A.arr
    3. | DF of t * t * int
    4. | DR of t * t Stdlib.ref * op * int Stdlib.ref * int * int Stdlib.ref
    and adjoint = t -> t Stdlib.ref -> (t * t) list -> (t * t) list
    and register = t list -> t list
    and label = string * t list
    and op = adjoint * register * label
    Core functions
    val tag : unit -> int

    TODO

    val primal : t -> t

    TODO

    val primal' : t -> t

    TODO

    val zero : t -> t

    TODO

    val reset_zero : t -> t

    TODO

    val tangent : t -> t

    TODO

    val adjref : t -> t Stdlib.ref

    TODO

    val adjval : t -> t

    TODO

    val shape : t -> int array

    TODO

    val is_float : t -> bool

    TODO

    val is_arr : t -> bool

    TODO

    val row_num : t -> int

    number of rows

    val col_num : t -> int

    number of columns

    val numel : t -> int

    number of elements

    val clip_by_value : amin:A.elt -> amax:A.elt -> t -> t

    other functions, without tracking gradient

    val clip_by_l2norm : A.elt -> t -> t

    other functions, without tracking gradient

    val copy_primal' : t -> t

    TODO

    val tile : t -> int array -> t

    TODO

    val repeat : t -> int array -> t

    TODO

    val pack_elt : A.elt -> t

    convert from elt type to t type.

    val unpack_elt : t -> A.elt

    convert from t type to elt type.

    val pack_flt : float -> t

    convert from float type to t type.

    val _f : float -> t

    A shortcut function for F A.(float_to_elt x).

    val unpack_flt : t -> float

    convert from t type to float type.

    val pack_arr : A.arr -> t

    convert from arr type to t type.

    val unpack_arr : t -> A.arr

    convert from t type to arr type.

    val deep_info : t -> string

    TODO

    val type_info : t -> string

    TODO

    val error_binop : string -> t -> t -> 'a

    TODO

    val error_uniop : string -> t -> 'a

    TODO

    val make_forward : t -> t -> int -> t

    make_forward p t i construct a forward algodiff data type DF, consisting of primal p, tangent t, and tag i.

    val make_reverse : t -> int -> t

    make_reverse p i construct a reverse algodiff data type DR, consisting of primal, adjoint, op, fanout, tag, and tracker.

    val reverse_prop : t -> t -> unit

    reverse_prop f x performs reverse propagation for function f using the output value x.

    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

    similar 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)

    include Owl_algodiff_ops_sig.Sig +Algodiff (owl.Owl_regression_generic.Make.Optimise.Algodiff)

    Module Optimise.Algodiff

    include Owl_algodiff_core_sig.Sig
    Type definition
    include Owl_algodiff_types_sig.Sig with type elt := A.elt and type arr := A.arr
    type t =
    1. | F of A.elt
    2. | Arr of A.arr
    3. | DF of t * t * int
    4. | DR of t * t Stdlib.ref * op * int Stdlib.ref * int * int Stdlib.ref
    and adjoint = t -> t Stdlib.ref -> (t * t) list -> (t * t) list
    and register = t list -> t list
    and label = string * t list
    and op = adjoint * register * label
    Core functions
    val tag : unit -> int

    start global tagging counter

    val primal : t -> t

    get primal component of DF or DR type

    val primal' : t -> t

    iteratively get primal component of DF or DR type until the component itself is not DF/DR

    val zero : t -> t

    return a zero value, which type decided by the input value

    val reset_zero : t -> t

    reset_zero x iteratively resets all elements included in x

    val tangent : t -> t

    get the tangent component of input, if the data type is suitable

    val adjref : t -> t Stdlib.ref

    get the adjref component of input, if the data type is suitable

    val adjval : t -> t

    get the adjval component of input, if the data type is suitableTODO

    val shape : t -> int array

    get the shape of primal' value of input

    val is_float : t -> bool

    check if input is of float value; if input is of type DF/DR, check its primal' value

    val is_arr : t -> bool

    check if input is of ndarray value; if input is of type DF/DR, check its primal' value

    val row_num : t -> int

    get the shape of primal' value of input; and then get the first dimension

    val col_num : t -> int

    get the shape of primal' value of input; and then get the second dimension

    val numel : t -> int

    for ndarray type input, return its total number of elements.

    val clip_by_value : amin:A.elt -> amax:A.elt -> t -> t

    other functions, without tracking gradient

    val clip_by_l2norm : A.elt -> t -> t

    other functions, without tracking gradient

    val copy_primal' : t -> t

    if primal' value of input is ndarray, copy its value in a new AD type ndarray

    val tile : t -> int array -> t

    if primal' value of input is ndarray, apply the tile function

    val repeat : t -> int array -> t

    if primal' value of input is ndarray, apply the repeat function

    val pack_elt : A.elt -> t

    convert from elt type to t type.

    val unpack_elt : t -> A.elt

    convert from t type to elt type.

    val pack_flt : float -> t

    convert from float type to t type.

    val _f : float -> t

    A shortcut function for F A.(float_to_elt x).

    val unpack_flt : t -> float

    convert from t type to float type.

    val pack_arr : A.arr -> t

    convert from arr type to t type.

    val unpack_arr : t -> A.arr

    convert from t type to arr type.

    val deep_info : t -> string
    val type_info : t -> string
    val error_binop : string -> t -> t -> 'a
    val error_uniop : string -> t -> 'a
    val make_forward : t -> t -> int -> t

    make_forward p t i construct a forward algodiff data type DF, consisting of primal p, tangent t, and tag i.

    val make_reverse : t -> int -> t

    make_reverse p i construct a reverse algodiff data type DR, consisting of primal, adjoint, op, fanout, tag, and tracker.

    val reverse_prop : t -> t -> unit

    reverse_prop f x performs reverse propagation for function f using the output value x.

    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

    similar 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)

    include Owl_algodiff_ops_sig.Sig with type t := t and type elt := A.elt and type arr := A.arr diff --git a/docs/owl/Owl_regression_generic_sig/module-type-Sig/Optimise/Algodiff/index.html b/docs/owl/Owl_regression_generic_sig/module-type-Sig/Optimise/Algodiff/index.html index 63de134ab..354375ecb 100644 --- a/docs/owl/Owl_regression_generic_sig/module-type-Sig/Optimise/Algodiff/index.html +++ b/docs/owl/Owl_regression_generic_sig/module-type-Sig/Optimise/Algodiff/index.html @@ -1,5 +1,5 @@ -Algodiff (owl.Owl_regression_generic_sig.Sig.Optimise.Algodiff)

    Module Optimise.Algodiff

    include Owl_algodiff_core_sig.Sig
    Type definition
    include Owl_algodiff_types_sig.Sig with type elt := A.elt and type arr := A.arr
    type t =
    1. | F of A.elt
    2. | Arr of A.arr
    3. | DF of t * t * int
    4. | DR of t * t Stdlib.ref * op * int Stdlib.ref * int * int Stdlib.ref
    and adjoint = t -> t Stdlib.ref -> (t * t) list -> (t * t) list
    and register = t list -> t list
    and label = string * t list
    and op = adjoint * register * label
    Core functions
    val tag : unit -> int

    TODO

    val primal : t -> t

    TODO

    val primal' : t -> t

    TODO

    val zero : t -> t

    TODO

    val reset_zero : t -> t

    TODO

    val tangent : t -> t

    TODO

    val adjref : t -> t Stdlib.ref

    TODO

    val adjval : t -> t

    TODO

    val shape : t -> int array

    TODO

    val is_float : t -> bool

    TODO

    val is_arr : t -> bool

    TODO

    val row_num : t -> int

    number of rows

    val col_num : t -> int

    number of columns

    val numel : t -> int

    number of elements

    val clip_by_value : amin:A.elt -> amax:A.elt -> t -> t

    other functions, without tracking gradient

    val clip_by_l2norm : A.elt -> t -> t

    other functions, without tracking gradient

    val copy_primal' : t -> t

    TODO

    val tile : t -> int array -> t

    TODO

    val repeat : t -> int array -> t

    TODO

    val pack_elt : A.elt -> t

    convert from elt type to t type.

    val unpack_elt : t -> A.elt

    convert from t type to elt type.

    val pack_flt : float -> t

    convert from float type to t type.

    val _f : float -> t

    A shortcut function for F A.(float_to_elt x).

    val unpack_flt : t -> float

    convert from t type to float type.

    val pack_arr : A.arr -> t

    convert from arr type to t type.

    val unpack_arr : t -> A.arr

    convert from t type to arr type.

    val deep_info : t -> string

    TODO

    val type_info : t -> string

    TODO

    val error_binop : string -> t -> t -> 'a

    TODO

    val error_uniop : string -> t -> 'a

    TODO

    val make_forward : t -> t -> int -> t

    make_forward p t i construct a forward algodiff data type DF, consisting of primal p, tangent t, and tag i.

    val make_reverse : t -> int -> t

    make_reverse p i construct a reverse algodiff data type DR, consisting of primal, adjoint, op, fanout, tag, and tracker.

    val reverse_prop : t -> t -> unit

    reverse_prop f x performs reverse propagation for function f using the output value x.

    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

    similar 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)

    include Owl_algodiff_ops_sig.Sig +Algodiff (owl.Owl_regression_generic_sig.Sig.Optimise.Algodiff)

    Module Optimise.Algodiff

    include Owl_algodiff_core_sig.Sig
    Type definition
    include Owl_algodiff_types_sig.Sig with type elt := A.elt and type arr := A.arr
    type t =
    1. | F of A.elt
    2. | Arr of A.arr
    3. | DF of t * t * int
    4. | DR of t * t Stdlib.ref * op * int Stdlib.ref * int * int Stdlib.ref
    and adjoint = t -> t Stdlib.ref -> (t * t) list -> (t * t) list
    and register = t list -> t list
    and label = string * t list
    and op = adjoint * register * label
    Core functions
    val tag : unit -> int

    start global tagging counter

    val primal : t -> t

    get primal component of DF or DR type

    val primal' : t -> t

    iteratively get primal component of DF or DR type until the component itself is not DF/DR

    val zero : t -> t

    return a zero value, which type decided by the input value

    val reset_zero : t -> t

    reset_zero x iteratively resets all elements included in x

    val tangent : t -> t

    get the tangent component of input, if the data type is suitable

    val adjref : t -> t Stdlib.ref

    get the adjref component of input, if the data type is suitable

    val adjval : t -> t

    get the adjval component of input, if the data type is suitableTODO

    val shape : t -> int array

    get the shape of primal' value of input

    val is_float : t -> bool

    check if input is of float value; if input is of type DF/DR, check its primal' value

    val is_arr : t -> bool

    check if input is of ndarray value; if input is of type DF/DR, check its primal' value

    val row_num : t -> int

    get the shape of primal' value of input; and then get the first dimension

    val col_num : t -> int

    get the shape of primal' value of input; and then get the second dimension

    val numel : t -> int

    for ndarray type input, return its total number of elements.

    val clip_by_value : amin:A.elt -> amax:A.elt -> t -> t

    other functions, without tracking gradient

    val clip_by_l2norm : A.elt -> t -> t

    other functions, without tracking gradient

    val copy_primal' : t -> t

    if primal' value of input is ndarray, copy its value in a new AD type ndarray

    val tile : t -> int array -> t

    if primal' value of input is ndarray, apply the tile function

    val repeat : t -> int array -> t

    if primal' value of input is ndarray, apply the repeat function

    val pack_elt : A.elt -> t

    convert from elt type to t type.

    val unpack_elt : t -> A.elt

    convert from t type to elt type.

    val pack_flt : float -> t

    convert from float type to t type.

    val _f : float -> t

    A shortcut function for F A.(float_to_elt x).

    val unpack_flt : t -> float

    convert from t type to float type.

    val pack_arr : A.arr -> t

    convert from arr type to t type.

    val unpack_arr : t -> A.arr

    convert from t type to arr type.

    val deep_info : t -> string
    val type_info : t -> string
    val error_binop : string -> t -> t -> 'a
    val error_uniop : string -> t -> 'a
    val make_forward : t -> t -> int -> t

    make_forward p t i construct a forward algodiff data type DF, consisting of primal p, tangent t, and tag i.

    val make_reverse : t -> int -> t

    make_reverse p i construct a reverse algodiff data type DR, consisting of primal, adjoint, op, fanout, tag, and tracker.

    val reverse_prop : t -> t -> unit

    reverse_prop f x performs reverse propagation for function f using the output value x.

    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

    similar 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)

    include Owl_algodiff_ops_sig.Sig with type t := t and type elt := A.elt and type arr := A.arr