package owl-base

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Parameters

Signature

include module type of struct include Engine end
module Graph = Engine.Graph
Core evaluation functions of the engine

TODO

TODO

val eval_graph : Graph.graph -> unit

TODO

include module type of struct include Graph end
module Optimiser = Graph.Optimiser
type graph = Engine.Graph.graph
val shape_or_value : Optimiser.Operator.Symbol.Shape.Type.t -> string
val graph_to_dot : graph -> string
val graph_to_trace : graph -> string
val save_graph : 'a -> string -> unit
val load_graph : string -> 'a * 'b
val invalidate_rvs : graph -> unit
val is_iopair_safe : 'a Owl_graph.node -> 'a Owl_graph.node -> bool
val update_iopair : graph -> unit
val remove_unused_iopair : 'a Owl_graph.node array -> 'b array -> 'a Owl_graph.node array * 'b array
val optimise : graph -> unit
include module type of struct include Optimiser end
module Operator = Optimiser.Operator
val estimate_complexity : 'a Owl_graph.node array -> int * int
val optimise_nodes : Operator.Symbol.Shape.Type.attr Owl_graph.node array -> unit
include module type of struct include Operator end
module Symbol = Operator.Symbol
val empty : int array -> Symbol.Shape.Type.arr
val zeros : int array -> Symbol.Shape.Type.arr
val ones : int array -> Symbol.Shape.Type.arr
val eye : int -> Symbol.Shape.Type.arr
val create : int array -> Symbol.Shape.Type.elt -> Symbol.Shape.Type.arr
val sequential : ?a:Symbol.Shape.Type.elt -> ?step:Symbol.Shape.Type.elt -> int array -> Symbol.Shape.Type.arr
val gaussian : ?mu:Symbol.Shape.Type.elt -> ?sigma:Symbol.Shape.Type.elt -> int array -> Symbol.Shape.Type.arr
val bernoulli : ?p:Symbol.Shape.Type.elt -> int array -> Symbol.Shape.Type.arr
val init : int array -> (int -> Symbol.Shape.Type.elt) -> Symbol.Shape.Type.arr
val init_nd : int array -> (int array -> Symbol.Shape.Type.elt) -> Symbol.Shape.Type.arr
val shape : Symbol.Shape.Type.arr -> int array
val numel : Symbol.Shape.Type.arr -> int
val set : Symbol.Shape.Type.arr -> int array -> Symbol.Shape.Type.elt -> unit
val get_slice : int list list -> Symbol.Shape.Type.arr -> Symbol.Shape.Type.arr
val set_slice : int list list -> Symbol.Shape.Type.arr -> Symbol.Shape.Type.arr -> unit
val copy_ : out:'a -> 'b -> 'c
val reset : Symbol.Shape.Type.arr -> unit
val reshape : Symbol.Shape.Type.arr -> int array -> Symbol.Shape.Type.arr
val tile : Symbol.Shape.Type.arr -> int array -> Symbol.Shape.Type.arr
val repeat : Symbol.Shape.Type.arr -> int array -> Symbol.Shape.Type.arr
val expand : ?hi:bool -> Symbol.Shape.Type.arr -> int -> Symbol.Shape.Type.arr
val squeeze : ?axis:int array -> Symbol.Shape.Type.arr -> Symbol.Shape.Type.arr
val concatenate : ?axis:int -> Symbol.Shape.Type.arr array -> Symbol.Shape.Type.arr
val split : ?axis:int -> 'a -> 'b -> 'c
val draw : ?axis:int -> Symbol.Shape.Type.arr -> int -> Symbol.Shape.Type.arr * 'a array
val lazy_print : ?max_row:int -> ?max_col:int -> ?header:bool -> ?fmt:(Symbol.Shape.Type.Device.A.elt -> string) -> Symbol.Shape.Type.arr -> Symbol.Shape.Type.arr
val print : ?max_row:'a -> ?max_col:'b -> ?header:'c -> ?fmt:'d -> 'e -> unit
val sum_reduce : ?axis:int array -> Symbol.Shape.Type.arr -> Symbol.Shape.Type.arr
val transpose_conv1d : ?padding:Owl_types.padding -> Symbol.Shape.Type.arr -> Symbol.Shape.Type.arr -> int array -> Symbol.Shape.Type.arr
val transpose_conv2d : ?padding:Owl_types.padding -> Symbol.Shape.Type.arr -> Symbol.Shape.Type.arr -> int array -> Symbol.Shape.Type.arr
val transpose_conv3d : ?padding:Owl_types.padding -> Symbol.Shape.Type.arr -> Symbol.Shape.Type.arr -> int array -> Symbol.Shape.Type.arr
val dilated_conv1d : ?padding:Owl_types.padding -> Symbol.Shape.Type.arr -> Symbol.Shape.Type.arr -> int array -> int array -> Symbol.Shape.Type.arr
val dilated_conv2d : ?padding:Owl_types.padding -> Symbol.Shape.Type.arr -> Symbol.Shape.Type.arr -> int array -> int array -> Symbol.Shape.Type.arr
val dilated_conv3d : ?padding:Owl_types.padding -> Symbol.Shape.Type.arr -> Symbol.Shape.Type.arr -> int array -> int array -> Symbol.Shape.Type.arr
val max_pool1d : ?padding:Owl_types.padding -> Symbol.Shape.Type.arr -> int array -> int array -> Symbol.Shape.Type.arr
val max_pool2d : ?padding:Owl_types.padding -> Symbol.Shape.Type.arr -> int array -> int array -> Symbol.Shape.Type.arr
val max_pool3d : ?padding:Owl_types.padding -> Symbol.Shape.Type.arr -> int array -> int array -> Symbol.Shape.Type.arr
val avg_pool1d : ?padding:Owl_types.padding -> Symbol.Shape.Type.arr -> int array -> int array -> Symbol.Shape.Type.arr
val avg_pool2d : ?padding:Owl_types.padding -> Symbol.Shape.Type.arr -> int array -> int array -> Symbol.Shape.Type.arr
val avg_pool3d : ?padding:Owl_types.padding -> Symbol.Shape.Type.arr -> int array -> int array -> Symbol.Shape.Type.arr
val upsampling2d : Symbol.Shape.Type.arr -> int array -> Symbol.Shape.Type.arr
val transpose_conv1d_backward_input : Symbol.Shape.Type.arr -> Symbol.Shape.Type.arr -> int array -> Symbol.Shape.Type.arr -> Symbol.Shape.Type.arr
val transpose_conv1d_backward_kernel : Symbol.Shape.Type.arr -> Symbol.Shape.Type.arr -> int array -> Symbol.Shape.Type.arr -> Symbol.Shape.Type.arr
val transpose_conv2d_backward_input : Symbol.Shape.Type.arr -> Symbol.Shape.Type.arr -> int array -> Symbol.Shape.Type.arr -> Symbol.Shape.Type.arr
val transpose_conv2d_backward_kernel : Symbol.Shape.Type.arr -> Symbol.Shape.Type.arr -> int array -> Symbol.Shape.Type.arr -> Symbol.Shape.Type.arr
val transpose_conv3d_backward_input : Symbol.Shape.Type.arr -> Symbol.Shape.Type.arr -> int array -> Symbol.Shape.Type.arr -> Symbol.Shape.Type.arr
val transpose_conv3d_backward_kernel : Symbol.Shape.Type.arr -> Symbol.Shape.Type.arr -> int array -> Symbol.Shape.Type.arr -> Symbol.Shape.Type.arr
val dilated_conv1d_backward_input : Symbol.Shape.Type.arr -> Symbol.Shape.Type.arr -> int array -> int array -> Symbol.Shape.Type.arr -> Symbol.Shape.Type.arr
val dilated_conv1d_backward_kernel : Symbol.Shape.Type.arr -> Symbol.Shape.Type.arr -> int array -> int array -> Symbol.Shape.Type.arr -> Symbol.Shape.Type.arr
val dilated_conv2d_backward_input : Symbol.Shape.Type.arr -> Symbol.Shape.Type.arr -> int array -> int array -> Symbol.Shape.Type.arr -> Symbol.Shape.Type.arr
val dilated_conv2d_backward_kernel : Symbol.Shape.Type.arr -> Symbol.Shape.Type.arr -> int array -> int array -> Symbol.Shape.Type.arr -> Symbol.Shape.Type.arr
val dilated_conv3d_backward_input : Symbol.Shape.Type.arr -> Symbol.Shape.Type.arr -> int array -> int array -> Symbol.Shape.Type.arr -> Symbol.Shape.Type.arr
val dilated_conv3d_backward_kernel : Symbol.Shape.Type.arr -> Symbol.Shape.Type.arr -> int array -> int array -> Symbol.Shape.Type.arr -> Symbol.Shape.Type.arr
val max_pool1d_backward : Owl_types.padding -> Symbol.Shape.Type.arr -> int array -> int array -> Symbol.Shape.Type.arr -> Symbol.Shape.Type.arr
val max_pool2d_backward : Owl_types.padding -> Symbol.Shape.Type.arr -> int array -> int array -> Symbol.Shape.Type.arr -> Symbol.Shape.Type.arr
val max_pool3d_backward : Owl_types.padding -> Symbol.Shape.Type.arr -> int array -> int array -> Symbol.Shape.Type.arr -> Symbol.Shape.Type.arr
val avg_pool1d_backward : Owl_types.padding -> Symbol.Shape.Type.arr -> int array -> int array -> Symbol.Shape.Type.arr -> Symbol.Shape.Type.arr
val avg_pool2d_backward : Owl_types.padding -> Symbol.Shape.Type.arr -> int array -> int array -> Symbol.Shape.Type.arr -> Symbol.Shape.Type.arr
val avg_pool3d_backward : Owl_types.padding -> Symbol.Shape.Type.arr -> int array -> int array -> Symbol.Shape.Type.arr -> Symbol.Shape.Type.arr
val upsampling2d_backward : Symbol.Shape.Type.arr -> int array -> Symbol.Shape.Type.arr -> Symbol.Shape.Type.arr
val row_num : Symbol.Shape.Type.arr -> int
val col_num : Symbol.Shape.Type.arr -> int
val rows : Symbol.Shape.Type.arr -> int array -> Symbol.Shape.Type.arr
val copy_row_to : Symbol.Shape.Type.arr -> 'a -> 'b -> unit
val copy_col_to : Symbol.Shape.Type.arr -> 'a -> 'b -> unit
val chol : ?upper:bool -> Symbol.Shape.Type.arr -> Symbol.Shape.Type.arr
val discrete_lyapunov : ?solver:[ `bilinear | `default | `direct ] -> Symbol.Shape.Type.arr -> Symbol.Shape.Type.arr -> Symbol.Shape.Type.arr
val linsolve : ?trans:bool -> ?typ:[ `l | `n | `u ] -> Symbol.Shape.Type.arr -> Symbol.Shape.Type.arr -> Symbol.Shape.Type.arr
val transpose : ?axis:int array -> Symbol.Shape.Type.arr -> Symbol.Shape.Type.arr
val to_rows : Symbol.Shape.Type.arr -> 'a array
val to_cols : Symbol.Shape.Type.arr -> 'a array
val of_array : Symbol.Shape.Type.elt array -> int array -> Symbol.Shape.Type.arr
val of_arrays : Symbol.Shape.Type.elt array array -> Symbol.Shape.Type.arr
val to_arrays : Symbol.Shape.Type.arr -> Symbol.Shape.Type.elt array array
module Scalar = Operator.Scalar
include module type of struct include Symbol end
module Shape = Symbol.Shape
val op_to_str : Shape.Type.op -> string
val is_random_variable : Shape.Type.op -> bool
val refnum : 'a Owl_graph.node -> int
val node_shape : Shape.Type.attr Owl_graph.node -> int array
val node_numel : Shape.Type.attr Owl_graph.node -> int
val is_shape_unknown : Shape.Type.attr Owl_graph.node -> bool
val infer_shape_graph : Shape.Type.attr Owl_graph.node array -> unit
val shape_to_str : int array option array -> string
val node_to_str : Shape.Type.attr Owl_graph.node -> string
val node_to_arr : Shape.Type.t -> Shape.Type.arr
val arr_to_node : Shape.Type.arr -> Shape.Type.t
val node_to_elt : Shape.Type.t -> Shape.Type.elt
val elt_to_node : Shape.Type.elt -> Shape.Type.t
val make_node : ?name:string -> ?value:Shape.Type.Device.value array -> ?shape:int array option array -> ?freeze:bool -> ?reuse:bool -> ?state:Shape.Type.state -> Shape.Type.op -> Shape.Type.attr Owl_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
val var_arr : ?shape:int array -> string -> Shape.Type.arr
val var_elt : string -> Shape.Type.elt
val const_arr : string -> Shape.Type.Device.A.arr -> Shape.Type.arr
val const_elt : string -> Shape.Type.Device.A.elt -> Shape.Type.elt
val new_block_id : unit -> int
val make_empty_block : ?block_id:int -> int -> Shape.Type.block
val make_value_block : Shape.Type.Device.value -> Shape.Type.attr Owl_graph.node -> unit
val add_node_to_block : Shape.Type.attr Owl_graph.node -> Shape.Type.block -> unit
val get_active_node : Shape.Type.block -> Shape.Type.attr Owl_graph.node option
val set_active_node : Shape.Type.block -> Shape.Type.attr Owl_graph.node -> unit
val get_block_id : Shape.Type.attr Owl_graph.node -> int
val set_value : Shape.Type.attr Owl_graph.node -> Shape.Type.Device.value array -> unit
val set_operator : Shape.Type.attr Owl_graph.node -> Shape.Type.op -> unit
val set_reuse : Shape.Type.attr Owl_graph.node -> bool -> unit
val get_reuse : Shape.Type.attr Owl_graph.node -> bool
val is_shared : Shape.Type.attr Owl_graph.node -> bool
val is_var : Shape.Type.attr Owl_graph.node -> bool
val is_const : Shape.Type.attr Owl_graph.node -> bool
val is_node_arr : Shape.Type.attr Owl_graph.node -> bool
val is_node_elt : Shape.Type.attr Owl_graph.node -> bool
val is_assigned : Shape.Type.attr Owl_graph.node -> bool
val check_assigned : Shape.Type.attr Owl_graph.node -> unit
val is_valid : Shape.Type.attr Owl_graph.node -> bool
val validate : Shape.Type.attr Owl_graph.node -> unit
val invalidate : Shape.Type.attr Owl_graph.node -> unit
val invalidate_graph : Shape.Type.attr Owl_graph.node -> unit
val is_freeze : Shape.Type.attr Owl_graph.node -> bool
val freeze : Shape.Type.attr Owl_graph.node -> unit
val freeze_descendants : Shape.Type.attr Owl_graph.node array -> unit
val freeze_ancestors : Shape.Type.attr Owl_graph.node array -> unit
val unsafe_assign_arr : Shape.Type.arr -> Shape.Type.Device.A.arr -> unit
val assign_arr : Shape.Type.arr -> Shape.Type.Device.A.arr -> unit
val assign_elt : Shape.Type.elt -> Shape.Type.Device.A.elt -> unit
val float_to_elt : float -> Shape.Type.elt
val elt_to_float : Shape.Type.elt -> float
include module type of struct include Shape end
module Type = Shape.Type
val infer_shape : Type.op -> Type.attr Owl_graph.node array -> int array option array
include module type of struct include Type end
module Device = Type.Device
and block = Engine.Graph.Optimiser.Operator.Symbol.Shape.Type.block = {
  1. size : int;
  2. block_id : int;
  3. mutable active : t option;
  4. mutable memory : Device.value;
  5. mutable nodes : t list;
}
and attr = Engine.Graph.Optimiser.Operator.Symbol.Shape.Type.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;
}
and op = Engine.Graph.Optimiser.Operator.Symbol.Shape.Type.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. | Copy
  18. | Reset
  19. | Reshape of int array
  20. | Reverse
  21. | Tile of int array
  22. | Repeat of int array
  23. | Pad of elt * int list list
  24. | Concatenate of int
  25. | Split of int * int array
  26. | Draw of int * int
  27. | Map of elt -> elt
  28. | Fold of int * elt -> elt -> elt
  29. | Scan of int * elt -> elt -> elt
  30. | OneHot of int
  31. | OfArray of int array
  32. | Delay of Device.A.arr -> Device.A.arr
  33. | DelayArray of int array * Device.A.arr array -> Device.A.arr
  34. | LazyPrint of int option * int option * bool option * (Device.A.elt -> string) option
  35. | Abs
  36. | Neg
  37. | Floor
  38. | Ceil
  39. | Round
  40. | Sqr
  41. | Sqrt
  42. | Log
  43. | Log2
  44. | Log10
  45. | Exp
  46. | Sin
  47. | Cos
  48. | Tan
  49. | Sinh
  50. | Cosh
  51. | Tanh
  52. | Asin
  53. | Acos
  54. | Atan
  55. | Asinh
  56. | Acosh
  57. | Atanh
  58. | Min of int
  59. | Max of int
  60. | Sum of int
  61. | SumReduce of int array
  62. | Signum
  63. | Sigmoid
  64. | Relu
  65. | Min'
  66. | Max'
  67. | Sum'
  68. | L1norm'
  69. | L2norm'
  70. | L2NormSqr'
  71. | ClipByValue
  72. | ClipByL2norm
  73. | Pow
  74. | ScalarPow
  75. | PowScalar
  76. | Atan2
  77. | ScalarAtan2
  78. | Atan2Scalar
  79. | Hypot
  80. | Min2
  81. | Max2
  82. | Add
  83. | Sub
  84. | Mul
  85. | Div
  86. | AddScalar
  87. | SubScalar
  88. | MulScalar
  89. | DivScalar
  90. | ScalarAdd
  91. | ScalarSub
  92. | ScalarMul
  93. | ScalarDiv
  94. | FMA
  95. | EltEqual
  96. | EltNotEqual
  97. | EltLess
  98. | EltGreater
  99. | EltLessEqual
  100. | EltGreaterEqual
  101. | EltEqualScalar
  102. | EltNotEqualScalar
  103. | EltLessScalar
  104. | EltGreaterScalar
  105. | EltLessEqualScalar
  106. | EltGreaterEqualScalar
  107. | Conv1d of Owl_types.padding * int array
  108. | Conv2d of Owl_types.padding * int array
  109. | Conv3d of Owl_types.padding * int array
  110. | TransposeConv1d of Owl_types.padding * int array
  111. | TransposeConv2d of Owl_types.padding * int array
  112. | TransposeConv3d of Owl_types.padding * int array
  113. | DilatedConv1d of Owl_types.padding * int array * int array
  114. | DilatedConv2d of Owl_types.padding * int array * int array
  115. | DilatedConv3d of Owl_types.padding * int array * int array
  116. | MaxPool1d of Owl_types.padding * int array * int array
  117. | MaxPool2d of Owl_types.padding * int array * int array
  118. | MaxPool3d of Owl_types.padding * int array * int array
  119. | AvgPool1d of Owl_types.padding * int array * int array
  120. | AvgPool2d of Owl_types.padding * int array * int array
  121. | AvgPool3d of Owl_types.padding * int array * int array
  122. | UpSampling2d of int array
  123. | Conv1dBackwardInput of int array
  124. | Conv1dBackwardKernel of int array
  125. | Conv2dBackwardInput of int array
  126. | Conv2dBackwardKernel of int array
  127. | Conv3dBackwardInput of int array
  128. | Conv3dBackwardKernel of int array
  129. | TransposeConv1dBackwardInput of int array
  130. | TransposeConv1dBackwardKernel of int array
  131. | TransposeConv2dBackwardInput of int array
  132. | TransposeConv2dBackwardKernel of int array
  133. | TransposeConv3dBackwardInput of int array
  134. | TransposeConv3dBackwardKernel of int array
  135. | DilatedConv1dBackwardInput of int array * int array
  136. | DilatedConv1dBackwardKernel of int array * int array
  137. | DilatedConv2dBackwardInput of int array * int array
  138. | DilatedConv2dBackwardKernel of int array * int array
  139. | DilatedConv3dBackwardInput of int array * int array
  140. | DilatedConv3dBackwardKernel of int array * int array
  141. | MaxPool1dBackward of Owl_types.padding * int array * int array
  142. | MaxPool2dBackward of Owl_types.padding * int array * int array
  143. | MaxPool3dBackward of Owl_types.padding * int array * int array
  144. | AvgPool1dBackward of Owl_types.padding * int array * int array
  145. | AvgPool2dBackward of Owl_types.padding * int array * int array
  146. | AvgPool3dBackward of Owl_types.padding * int array * int array
  147. | UpSampling2dBackward of int array
  148. | RowNum
  149. | ColNum
  150. | Row
  151. | Rows of int array
  152. | CopyRowTo
  153. | CopyColTo
  154. | Dot of bool * bool * elt * elt
  155. | Inv
  156. | Trace
  157. | Transpose of int array
  158. | ToRows
  159. | OfRows
  160. | Scalar_Add
  161. | Scalar_Sub
  162. | Scalar_Mul
  163. | Scalar_Div
  164. | Scalar_Pow
  165. | Scalar_Atan2
  166. | Scalar_Abs
  167. | Scalar_Neg
  168. | Scalar_Sqr
  169. | Scalar_Sqrt
  170. | Scalar_Exp
  171. | Scalar_Log
  172. | Scalar_Log2
  173. | Scalar_Log10
  174. | Scalar_Signum
  175. | Scalar_Floor
  176. | Scalar_Ceil
  177. | Scalar_Round
  178. | Scalar_Sin
  179. | Scalar_Cos
  180. | Scalar_Tan
  181. | Scalar_Sinh
  182. | Scalar_Cosh
  183. | Scalar_Tanh
  184. | Scalar_Asin
  185. | Scalar_Acos
  186. | Scalar_Atan
  187. | Scalar_Asinh
  188. | Scalar_Acosh
  189. | Scalar_Atanh
  190. | Scalar_Relu
  191. | Scalar_Sigmoid
  192. | Fused_Adagrad of float * float
include module type of struct include Device end
module A = Device.A
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
OCaml

Innovation. Community. Security.