package owl-base

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
module Graph : sig ... end
val eval_graph : Graph.graph -> unit
module Optimiser = Graph.Optimiser
type graph = E.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
module Operator = Graph.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
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 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 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
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
val infer_shape : Type.op -> Type.attr Owl_graph.node array -> int array option array
and block = E.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 = E.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 = E.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. | Dawsn
  66. | Min'
  67. | Max'
  68. | Sum'
  69. | L1norm'
  70. | L2norm'
  71. | L2NormSqr'
  72. | ClipByValue
  73. | ClipByL2norm
  74. | Pow
  75. | ScalarPow
  76. | PowScalar
  77. | Atan2
  78. | ScalarAtan2
  79. | Atan2Scalar
  80. | Hypot
  81. | Min2
  82. | Max2
  83. | Add
  84. | Sub
  85. | Mul
  86. | Div
  87. | AddScalar
  88. | SubScalar
  89. | MulScalar
  90. | DivScalar
  91. | ScalarAdd
  92. | ScalarSub
  93. | ScalarMul
  94. | ScalarDiv
  95. | FMA
  96. | EltEqual
  97. | EltNotEqual
  98. | EltLess
  99. | EltGreater
  100. | EltLessEqual
  101. | EltGreaterEqual
  102. | EltEqualScalar
  103. | EltNotEqualScalar
  104. | EltLessScalar
  105. | EltGreaterScalar
  106. | EltLessEqualScalar
  107. | EltGreaterEqualScalar
  108. | Conv1d of Owl_types.padding * int array
  109. | Conv2d of Owl_types.padding * int array
  110. | Conv3d of Owl_types.padding * int array
  111. | TransposeConv1d of Owl_types.padding * int array
  112. | TransposeConv2d of Owl_types.padding * int array
  113. | TransposeConv3d of Owl_types.padding * int array
  114. | DilatedConv1d of Owl_types.padding * int array * int array
  115. | DilatedConv2d of Owl_types.padding * int array * int array
  116. | DilatedConv3d of Owl_types.padding * int array * int array
  117. | MaxPool1d of Owl_types.padding * int array * int array
  118. | MaxPool2d of Owl_types.padding * int array * int array
  119. | MaxPool3d of Owl_types.padding * int array * int array
  120. | AvgPool1d of Owl_types.padding * int array * int array
  121. | AvgPool2d of Owl_types.padding * int array * int array
  122. | AvgPool3d of Owl_types.padding * int array * int array
  123. | UpSampling2d of int array
  124. | Conv1dBackwardInput of int array
  125. | Conv1dBackwardKernel of int array
  126. | Conv2dBackwardInput of int array
  127. | Conv2dBackwardKernel of int array
  128. | Conv3dBackwardInput of int array
  129. | Conv3dBackwardKernel of int array
  130. | TransposeConv1dBackwardInput of int array
  131. | TransposeConv1dBackwardKernel of int array
  132. | TransposeConv2dBackwardInput of int array
  133. | TransposeConv2dBackwardKernel of int array
  134. | TransposeConv3dBackwardInput of int array
  135. | TransposeConv3dBackwardKernel of int array
  136. | DilatedConv1dBackwardInput of int array * int array
  137. | DilatedConv1dBackwardKernel of int array * int array
  138. | DilatedConv2dBackwardInput of int array * int array
  139. | DilatedConv2dBackwardKernel of int array * int array
  140. | DilatedConv3dBackwardInput of int array * int array
  141. | DilatedConv3dBackwardKernel of int array * int array
  142. | MaxPool1dBackward of Owl_types.padding * int array * int array
  143. | MaxPool2dBackward of Owl_types.padding * int array * int array
  144. | MaxPool3dBackward of Owl_types.padding * int array * int array
  145. | AvgPool1dBackward of Owl_types.padding * int array * int array
  146. | AvgPool2dBackward of Owl_types.padding * int array * int array
  147. | AvgPool3dBackward of Owl_types.padding * int array * int array
  148. | UpSampling2dBackward of int array
  149. | RowNum
  150. | ColNum
  151. | Row
  152. | Rows of int array
  153. | CopyRowTo
  154. | CopyColTo
  155. | Dot of bool * bool * elt * elt
  156. | Inv
  157. | Trace
  158. | Transpose of int array
  159. | ToRows
  160. | OfRows
  161. | Scalar_Add
  162. | Scalar_Sub
  163. | Scalar_Mul
  164. | Scalar_Div
  165. | Scalar_Pow
  166. | Scalar_Atan2
  167. | Scalar_Abs
  168. | Scalar_Neg
  169. | Scalar_Sqr
  170. | Scalar_Sqrt
  171. | Scalar_Exp
  172. | Scalar_Log
  173. | Scalar_Log2
  174. | Scalar_Log10
  175. | Scalar_Signum
  176. | Scalar_Floor
  177. | Scalar_Ceil
  178. | Scalar_Round
  179. | Scalar_Sin
  180. | Scalar_Cos
  181. | Scalar_Tan
  182. | Scalar_Sinh
  183. | Scalar_Cosh
  184. | Scalar_Tanh
  185. | Scalar_Asin
  186. | Scalar_Acos
  187. | Scalar_Atan
  188. | Scalar_Asinh
  189. | Scalar_Acosh
  190. | Scalar_Atanh
  191. | Scalar_Relu
  192. | Scalar_Dawsn
  193. | Scalar_Sigmoid
  194. | Fused_Adagrad of float * float
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.