Owl_computation_engine.Flattenmodule Engine : Owl_types_computation_engine.Siginclude module type of struct include Engine endmodule Graph = Engine.Graphval eval_arr : Graph.Optimiser.Operator.Symbol.Shape.Type.arr array -> unitExecute actual computation included in each CGraph element (of output type ndarray) in an array.
val eval_elt : Graph.Optimiser.Operator.Symbol.Shape.Type.elt array -> unitExecute actual computation included in each CGraph element (of output type float) in an array.
val eval_graph : Graph.graph -> unitExecute actual computation of a computation graph.
include module type of struct include Graph endmodule Optimiser = Graph.Optimisertype graph = Engine.Graph.graphval shape_or_value : Optimiser.Operator.Symbol.Shape.Type.t -> stringprint shape for ndarrays, whilst value for scalars
val graph_to_dot : graph -> stringgenerate a string that can be written to a .dot file to draw the graph
val graph_to_trace : graph -> stringprint the graph structure to a string
save the graph object to a file with given name, using marshall format
val collect_rvs :
Optimiser.Operator.Symbol.Shape.Type.attr Owl_graph.node array ->
Optimiser.Operator.Symbol.Shape.Type.attr Owl_graph.node arraytraverse each node in the input array, and return the random variable type nodes.
val invalidate_rvs : graph -> unitTODO
val make_graph :
input:Optimiser.Operator.Symbol.Shape.Type.attr Owl_graph.node array ->
output:Optimiser.Operator.Symbol.Shape.Type.attr Owl_graph.node array ->
string ->
graphBuild a graph based on input nodes, output nodes, and graph name
val get_inputs :
graph ->
Optimiser.Operator.Symbol.Shape.Type.attr Owl_graph.node arrayget input nodes of a graph
val get_outputs :
graph ->
Optimiser.Operator.Symbol.Shape.Type.attr Owl_graph.node arrayget output nodes of a graph
val get_node_arr_val :
Optimiser.Operator.Symbol.Shape.Type.attr Owl_graph.node ->
Optimiser.Operator.Symbol.Shape.Type.Device.A.arrval get_node_elt_val :
Optimiser.Operator.Symbol.Shape.Type.attr Owl_graph.node ->
Optimiser.Operator.Symbol.Shape.Type.Device.A.eltval set_node_arr_val :
Optimiser.Operator.Symbol.Shape.Type.attr Owl_graph.node ->
Optimiser.Operator.Symbol.Shape.Type.Device.value ->
unitval set_node_elt_val :
Optimiser.Operator.Symbol.Shape.Type.attr Owl_graph.node ->
Optimiser.Operator.Symbol.Shape.Type.Device.value ->
unitval is_iopair_safe : 'a Owl_graph.node -> 'a Owl_graph.node -> boolval make_iopair :
graph ->
Optimiser.Operator.Symbol.Shape.Type.attr Owl_graph.node array ->
Optimiser.Operator.Symbol.Shape.Type.attr Owl_graph.node array ->
unitcreate an iopair between the input nodes and output nodes in a graph
val update_iopair : graph -> unitval remove_unused_iopair :
'a Owl_graph.node array ->
'b array ->
'a Owl_graph.node array * 'b arrayremove unuserd iopair from an array of nodes
val init_inputs :
(Optimiser.Operator.Symbol.Shape.Type.attr Owl_graph.node ->
Optimiser.Operator.Symbol.Shape.Type.Device.value) ->
graph ->
unitinitialize inputs nodes of a graph with given function f
val optimise : graph -> unitoptimise the graph structure
include module type of struct include Optimiser endmodule Operator = Optimiser.Operatorval estimate_complexity : 'a Owl_graph.node array -> int * intTODO
val optimise_nodes :
Operator.Symbol.Shape.Type.attr Owl_graph.node array ->
unitTODO
include module type of struct include Operator endmodule Symbol = Operator.Symbolval noop : Symbol.Shape.Type.arr -> Symbol.Shape.Type.arrnoop 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.arrempty 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.arrzeros 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.arrones 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.arrcreate 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 ->
?step:Symbol.Shape.Type.elt ->
int array ->
Symbol.Shape.Type.arrsequential ?a ?step shape creates an array with the specified shape, filled with a sequence of values starting from a with a step of step. If a is not provided, the sequence starts from 0. If step is not provided, the step size is 1. Returns a new array with sequential values.
val uniform :
?a:Symbol.Shape.Type.elt ->
?b:Symbol.Shape.Type.elt ->
int array ->
Symbol.Shape.Type.arruniform ?a ?b shape creates an array with the specified shape, filled with random values drawn from a uniform distribution over [a, b\). If a and b are not provided, the default range is [0, 1\) . Returns a new array with uniform random values.
val gaussian :
?mu:Symbol.Shape.Type.elt ->
?sigma:Symbol.Shape.Type.elt ->
int array ->
Symbol.Shape.Type.arrgaussian ?mu ?sigma shape creates an array with the specified shape, filled with random values drawn from a Gaussian distribution with mean mu and standard deviation sigma. If mu is not provided, the default mean is 0. If sigma is not provided, the default standard deviation is 1. Returns a new array with Gaussian random values.
val bernoulli : ?p:Symbol.Shape.Type.elt -> int array -> Symbol.Shape.Type.arrbernoulli ?p shape creates an array with the specified shape, filled with random values drawn from a Bernoulli distribution with probability p of being 1. If p is not provided, the default probability is 0.5. Returns a new array with Bernoulli random values.
val init : int array -> (int -> Symbol.Shape.Type.elt) -> Symbol.Shape.Type.arrinit shape f creates an array with the specified shape, where each element is initialized using the function f. The function f takes the linear index of the element as input. Returns a new array with elements initialized by the function f.
val init_nd :
int array ->
(int array -> Symbol.Shape.Type.elt) ->
Symbol.Shape.Type.arrinit_nd shape f creates an array with the specified shape, where each element is initialized using the function f. The function f takes the multidimensional index of the element as input. Returns a new array with elements initialized by the function f.
val shape : Symbol.Shape.Type.arr -> int arrayshape arr returns the shape of the array arr as an array of integers, each representing the size of the corresponding dimension.
val numel : Symbol.Shape.Type.arr -> intnumel arr returns the total number of elements in the array arr.
val get : Symbol.Shape.Type.arr -> int array -> Symbol.Shape.Type.eltget arr index retrieves the element at the specified multidimensional index in the array arr. Returns the value of the element at the given index.
val set : Symbol.Shape.Type.arr -> int array -> Symbol.Shape.Type.elt -> unitset arr index value sets the element at the specified multidimensional index in the array arr to the given value.
val get_slice : int list list -> Symbol.Shape.Type.arr -> Symbol.Shape.Type.arrget_slice slices arr extracts a slice from the array arr according to the list of slices. Each element in slices specifies the range for the corresponding dimension. Returns a new array with the extracted slice.
val set_slice :
int list list ->
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arr ->
unitset_slice slices src dest sets the slice in dest defined by slices with the values from the source array src.
val get_fancy :
Owl_types.index list ->
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arrget_fancy indices arr extracts elements from the array arr according to the list of indices. Each element in indices specifies an advanced indexing method. Returns a new array with the extracted elements.
val set_fancy :
Owl_types.index list ->
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arr ->
unitset_fancy indices src dest sets the elements in dest defined by indices with the values from the source array src.
val copy : Symbol.Shape.Type.arr -> Symbol.Shape.Type.arrcopy arr creates a deep copy of the array arr. Returns a new array that is a copy of arr.
copy_ ~out src copies the contents of the array src into the pre-allocated array out.
val reset : Symbol.Shape.Type.arr -> unitreset arr sets all elements of the array arr to zero.
val reshape : Symbol.Shape.Type.arr -> int array -> Symbol.Shape.Type.arrreshape arr shape reshapes the array arr into the new shape. The total number of elements must remain the same. Returns a new array with the specified shape.
val reverse : Symbol.Shape.Type.arr -> Symbol.Shape.Type.arrreverse arr reverses the elements of the array arr along each dimension. Returns a new array with the elements reversed.
val tile : Symbol.Shape.Type.arr -> int array -> Symbol.Shape.Type.arrtile arr reps replicates the array arr according to the number of repetitions specified in reps for each dimension. Returns a new array with the tiled data.
val repeat : Symbol.Shape.Type.arr -> int array -> Symbol.Shape.Type.arrrepeat arr reps repeats the elements of the array arr according to the number of repetitions specified in reps for each dimension. Returns a new array with the repeated data.
val pad :
?v:Symbol.Shape.Type.elt ->
int list list ->
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arrpad ?v padding arr pads the array arr with the value v according to the padding specification for each dimension. If v is not provided, the default padding value is zero. Returns a new array with the padded data.
val expand : ?hi:bool -> Symbol.Shape.Type.arr -> int -> Symbol.Shape.Type.arrexpand ?hi arr n expands the dimensions of the array arr by inserting a new dimension of size n. If hi is true, the new dimension is added at the beginning; otherwise, it is added at the end. Returns a new array with the expanded dimensions.
val squeeze : ?axis:int array -> Symbol.Shape.Type.arr -> Symbol.Shape.Type.arrsqueeze ?axis arr removes single-dimensional entries from the shape of the array arr. If axis is provided, only the specified dimensions are removed. Returns a new array with the squeezed shape.
val concatenate :
?axis:int ->
Symbol.Shape.Type.arr array ->
Symbol.Shape.Type.arrconcatenate ?axis arrays concatenates a sequence of arrays along the specified axis. If axis is not provided, the arrays are concatenated along the first axis. Returns a new array with the concatenated data.
val stack : ?axis:int -> Symbol.Shape.Type.arr array -> Symbol.Shape.Type.arrstack ?axis arrays stacks a sequence of arrays along a new dimension at the specified axis. If axis is not provided, the arrays are stacked along the first axis. Returns a new array with the stacked data.
val concat :
axis:int ->
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arrconcat ~axis a b concatenates the arrays a and b along the specified axis. Returns a new array with the concatenated data.
split ?axis src num_or_sections splits the array src into multiple sub-arrays along the specified axis.
num_or_sections specifies the number of equal-sized sub-arrays or the indices where to split. Returns an array of sub-arrays.val draw :
?axis:int ->
Symbol.Shape.Type.arr ->
int ->
Symbol.Shape.Type.arr * 'a arraydraw ?axis arr n randomly draws n samples from the array arr along the specified axis. Returns a tuple containing the sampled array and an array of indices from which the samples were drawn.
val map :
(Symbol.Shape.Type.elt -> Symbol.Shape.Type.elt) ->
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arrmap f arr applies the function f to each element of the array arr. Returns a new array with the results of applying f.
val fold :
?axis:int ->
(Symbol.Shape.Type.elt -> Symbol.Shape.Type.elt -> Symbol.Shape.Type.elt) ->
Symbol.Shape.Type.elt ->
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arrfold ?axis f init arr reduces the array arr along the specified axis using the function f and an initial value init. If axis is not provided, the reduction is performed on all elements. Returns a new array with the reduced values.
val scan :
?axis:int ->
(Symbol.Shape.Type.elt -> Symbol.Shape.Type.elt -> Symbol.Shape.Type.elt) ->
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arrscan ?axis f arr performs a cumulative reduction of the array arr along the specified axis using the function f. Returns a new array with the cumulative results.
val one_hot : int -> Symbol.Shape.Type.arr -> Symbol.Shape.Type.arrone_hot depth arr converts the array arr into a one-hot encoded array with a specified depth. Returns a new array with one-hot encoding.
val delay :
(Symbol.Shape.Type.Device.A.arr -> Symbol.Shape.Type.Device.A.arr) ->
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arrdelay f x returns f x. It allows to use a function that is not tracked by the computation graph and delay its evaluation. The output must have the same shape as the input.
val delay_array :
int array ->
(Symbol.Shape.Type.Device.A.arr array -> Symbol.Shape.Type.Device.A.arr) ->
Symbol.Shape.Type.arr array ->
Symbol.Shape.Type.arrdelay_array out_shape f x works in the same way as delay but is applied on an array of ndarrays. Needs the shape of the output as an argument.
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.arrlazy_print x prints the output of x when it is evaluated. Is implemented as an identity node. For information about the optional parameters, refer to the print function of the Ndarray module.
print ?max_row ?max_col ?header ?fmt data prints a representation of the given data.
max_row is an optional parameter specifying the maximum number of rows to print.max_col is an optional parameter specifying the maximum number of columns to print.header is an optional parameter to include a header in the output.fmt is an optional parameter to specify the format of the output.val abs : Symbol.Shape.Type.arr -> Symbol.Shape.Type.arrabs arr computes the absolute value of each element in the array arr. Returns a new array with the absolute values.
val neg : Symbol.Shape.Type.arr -> Symbol.Shape.Type.arrneg arr negates each element in the array arr. Returns a new array with each element negated.
val floor : Symbol.Shape.Type.arr -> Symbol.Shape.Type.arrfloor arr applies the floor function to each element in the array arr. Returns a new array with the floor of each element.
val ceil : Symbol.Shape.Type.arr -> Symbol.Shape.Type.arrceil arr applies the ceiling function to each element in the array arr. Returns a new array with the ceiling of each element.
val round : Symbol.Shape.Type.arr -> Symbol.Shape.Type.arrround arr rounds each element in the array arr to the nearest integer. Returns a new array with each element rounded to the nearest integer.
val sqr : Symbol.Shape.Type.arr -> Symbol.Shape.Type.arrsqr arr computes the square of each element in the array arr. Returns a new array with the square of each element.
val sqrt : Symbol.Shape.Type.arr -> Symbol.Shape.Type.arrsqrt arr computes the square root of each element in the array arr. Returns a new array with the square roots of the elements.
val log : Symbol.Shape.Type.arr -> Symbol.Shape.Type.arrlog arr computes the natural logarithm of each element in the array arr. Returns a new array with the natural logarithms of the elements.
val log2 : Symbol.Shape.Type.arr -> Symbol.Shape.Type.arrlog2 arr computes the base-2 logarithm of each element in the array arr. Returns a new array with the base-2 logarithms of the elements.
val log10 : Symbol.Shape.Type.arr -> Symbol.Shape.Type.arrlog10 arr computes the base-10 logarithm of each element in the array arr. Returns a new array with the base-10 logarithms of the elements.
val exp : Symbol.Shape.Type.arr -> Symbol.Shape.Type.arrexp arr computes the exponential function of each element in the array arr. Returns a new array with the exponentials of the elements.
val sin : Symbol.Shape.Type.arr -> Symbol.Shape.Type.arrsin arr computes the sine of each element in the array arr. Returns a new array with the sines of the elements.
val cos : Symbol.Shape.Type.arr -> Symbol.Shape.Type.arrcos arr computes the cosine of each element in the array arr. Returns a new array with the cosines of the elements.
val tan : Symbol.Shape.Type.arr -> Symbol.Shape.Type.arrtan arr computes the tangent of each element in the array arr. Returns a new array with the tangents of the elements.
val sinh : Symbol.Shape.Type.arr -> Symbol.Shape.Type.arrsinh arr computes the hyperbolic sine of each element in the array arr. Returns a new array with the hyperbolic sines of the elements.
val cosh : Symbol.Shape.Type.arr -> Symbol.Shape.Type.arrcosh arr computes the hyperbolic cosine of each element in the array arr. Returns a new array with the hyperbolic cosines of the elements.
val tanh : Symbol.Shape.Type.arr -> Symbol.Shape.Type.arrtanh arr computes the hyperbolic tangent of each element in the array arr. Returns a new array with the hyperbolic tangents of the elements.
val asin : Symbol.Shape.Type.arr -> Symbol.Shape.Type.arrasin arr computes the arcsine of each element in the array arr. Returns a new array with the arcsines of the elements.
val acos : Symbol.Shape.Type.arr -> Symbol.Shape.Type.arracos arr computes the arccosine of each element in the array arr. Returns a new array with the arccosines of the elements.
val atan : Symbol.Shape.Type.arr -> Symbol.Shape.Type.arratan arr computes the arctangent of each element in the array arr. Returns a new array with the arctangents of the elements.
val asinh : Symbol.Shape.Type.arr -> Symbol.Shape.Type.arrasinh arr computes the inverse hyperbolic sine of each element in the array arr. Returns a new array with the inverse hyperbolic sines of the elements.
val acosh : Symbol.Shape.Type.arr -> Symbol.Shape.Type.arracosh arr computes the inverse hyperbolic cosine of each element in the array arr. Returns a new array with the inverse hyperbolic cosines of the elements.
val atanh : Symbol.Shape.Type.arr -> Symbol.Shape.Type.arratanh arr computes the inverse hyperbolic tangent of each element in the array arr. Returns a new array with the inverse hyperbolic tangents of the elements.
val min :
?axis:int ->
?keep_dims:bool ->
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arrmin ?axis ?keep_dims arr computes the minimum value along the specified axis of the array arr.
axis specifies the axis along which to compute the minimum.keep_dims specifies whether to keep the reduced dimensions. Returns a new array with the minimum values.val max :
?axis:int ->
?keep_dims:bool ->
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arrmax ?axis ?keep_dims arr computes the maximum value along the specified axis of the array arr.
axis specifies the axis along which to compute the maximum.keep_dims specifies whether to keep the reduced dimensions. Returns a new array with the maximum values.val sum :
?axis:int ->
?keep_dims:bool ->
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arrsum ?axis ?keep_dims arr computes the sum of elements along the specified axis of the array arr.
axis specifies the axis along which to compute the sum.keep_dims specifies whether to keep the reduced dimensions. Returns a new array with the sum of elements.val sum_reduce :
?axis:int array ->
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arrsum_reduce ?axis arr computes the sum of elements along the specified axes of the array arr.
axis specifies the axes along which to compute the sum. Returns a new array with the sum of elements.val signum : Symbol.Shape.Type.arr -> Symbol.Shape.Type.arrsignum arr computes the signum function of each element in the array arr. Returns a new array where each element is -1, 0, or 1, depending on the sign of the corresponding element in arr.
val sigmoid : Symbol.Shape.Type.arr -> Symbol.Shape.Type.arrsigmoid arr computes the sigmoid function of each element in the array arr. Returns a new array with the sigmoid values.
val relu : Symbol.Shape.Type.arr -> Symbol.Shape.Type.arrrelu arr applies the Rectified Linear Unit (ReLU) function to each element in the array arr. Returns a new array where each element is the maximum of 0 and the corresponding element in arr.
val dawsn : Symbol.Shape.Type.arr -> Symbol.Shape.Type.arrdawsn arr computes Dawson's function of each element in the array arr. Returns a new array with Dawson's function values.
val min' : Symbol.Shape.Type.arr -> Symbol.Shape.Type.eltmin' arr computes the minimum value in the array arr. Returns the minimum value as an element.
val max' : Symbol.Shape.Type.arr -> Symbol.Shape.Type.eltmax' arr computes the maximum value in the array arr. Returns the maximum value as an element.
val sum' : Symbol.Shape.Type.arr -> Symbol.Shape.Type.eltsum' arr computes the sum of all elements in the array arr. Returns the sum as an element.
val log_sum_exp' : Symbol.Shape.Type.arr -> Symbol.Shape.Type.eltlog_sum_exp' arr computes the log-sum-exp of all elements in the array arr. Returns the log-sum-exp as an element.
val log_sum_exp :
?axis:int ->
?keep_dims:bool ->
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arrlog_sum_exp ?axis ?keep_dims arr computes the log of the sum of exponentials of elements along the specified axis of the array arr.
axis specifies the axis along which to compute the log-sum-exp. If not specified, computes over all elements.keep_dims if true, retains reduced dimensions with size 1. Returns a new array with the log-sum-exp values.val l1norm' : Symbol.Shape.Type.arr -> Symbol.Shape.Type.eltl1norm' arr computes the L1 norm (sum of absolute values) of all elements in the array arr. Returns the L1 norm as an element.
val l2norm' : Symbol.Shape.Type.arr -> Symbol.Shape.Type.eltl2norm' arr computes the L2 norm (Euclidean norm) of all elements in the array arr. Returns the L2 norm as an element.
val l2norm_sqr' : Symbol.Shape.Type.arr -> Symbol.Shape.Type.eltl2norm_sqr' arr computes the squared L2 norm (sum of squared values) of all elements in the array arr. Returns the squared L2 norm as an element.
val clip_by_value :
?amin:Symbol.Shape.Type.elt ->
?amax:Symbol.Shape.Type.elt ->
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arrclip_by_value ?amin ?amax arr clips the values in the array arr to the range amin, amax.
amin specifies the minimum value to clip to.amax specifies the maximum value to clip to. Returns a new array with the values clipped to the specified range.val clip_by_l2norm :
Symbol.Shape.Type.elt ->
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arrclip_by_l2norm max_norm arr clips the values in the array arr so that the L2 norm does not exceed max_norm. Returns a new array with the values clipped by the specified L2 norm.
val pow :
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arrpow base exp computes each element of the array base raised to the power of the corresponding element in exp. Returns a new array with the power values.
val scalar_pow :
Symbol.Shape.Type.elt ->
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arrscalar_pow scalar arr raises the scalar value scalar to the power of each element in the array arr. Returns a new array with the power values.
val pow_scalar :
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.elt ->
Symbol.Shape.Type.arrpow_scalar arr scalar raises each element in the array arr to the power of the scalar value scalar. Returns a new array with the power values.
val atan2 :
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arratan2 y x computes the element-wise arctangent of y / x, using the signs of the elements to determine the correct quadrant. Returns a new array with the arctangent values.
val scalar_atan2 :
Symbol.Shape.Type.elt ->
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arrscalar_atan2 scalar arr computes the element-wise arctangent of scalar / each element in the array arr. Returns a new array with the arctangent values.
val atan2_scalar :
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.elt ->
Symbol.Shape.Type.arratan2_scalar arr scalar computes the element-wise arctangent of each element in the array arr / scalar. Returns a new array with the arctangent values.
val hypot :
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arrhypot x y computes the hypotenuse (sqrt(x^2 + y^2)) for each element in the arrays x and y. Returns a new array with the hypotenuse values.
val min2 :
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arrmin2 a b computes the element-wise minimum of arrays a and b. Returns a new array with the minimum values.
val max2 :
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arrmax2 a b computes the element-wise maximum of arrays a and b. Returns a new array with the maximum values.
val add :
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arradd a b computes the element-wise addition of arrays a and b. Returns a new array with the sum of elements.
val sub :
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arrsub a b computes the element-wise subtraction of arrays a and b. Returns a new array with the difference of elements.
val mul :
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arrmul a b computes the element-wise multiplication of arrays a and b. Returns a new array with the product of elements.
val div :
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arrdiv a b computes the element-wise division of arrays a and b. Returns a new array with the quotient of elements.
val add_scalar :
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.elt ->
Symbol.Shape.Type.arradd_scalar arr scalar adds the scalar value scalar to each element in the array arr. Returns a new array with the resulting values.
val sub_scalar :
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.elt ->
Symbol.Shape.Type.arrsub_scalar arr scalar subtracts the scalar value scalar from each element in the array arr. Returns a new array with the resulting values.
val mul_scalar :
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.elt ->
Symbol.Shape.Type.arrmul_scalar arr scalar multiplies each element in the array arr by the scalar value scalar. Returns a new array with the resulting values.
val div_scalar :
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.elt ->
Symbol.Shape.Type.arrdiv_scalar arr scalar divides each element in the array arr by the scalar value scalar. Returns a new array with the resulting values.
val scalar_add :
Symbol.Shape.Type.elt ->
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arrscalar_add scalar arr adds the scalar value scalar to each element in the array arr. Returns a new array with the resulting values.
val scalar_sub :
Symbol.Shape.Type.elt ->
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arrscalar_sub scalar arr subtracts each element in the array arr from the scalar value scalar. Returns a new array with the resulting values.
val scalar_mul :
Symbol.Shape.Type.elt ->
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arrscalar_mul scalar arr multiplies each element in the array arr by the scalar value scalar. Returns a new array with the resulting values.
val scalar_div :
Symbol.Shape.Type.elt ->
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arrscalar_div scalar arr divides the scalar value scalar by each element in the array arr. Returns a new array with the resulting values.
val fma :
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arrfma a b c computes the fused multiply-add operation, multiplying arrays a and b, then adding array c. Returns a new array with the resulting values.
val elt_equal :
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arrelt_equal a b performs element-wise equality comparison between arrays a and b. Returns a new array where each element is true if the corresponding elements in a and b are equal, and false otherwise.
val elt_not_equal :
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arrelt_not_equal a b performs element-wise inequality comparison between arrays a and b. Returns a new array where each element is true if the corresponding elements in a and b are not equal, and false otherwise.
val elt_less :
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arrelt_less a b performs element-wise less-than comparison between arrays a and b. Returns a new array where each element is true if the corresponding element in a is less than that in b, and false otherwise.
val elt_greater :
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arrelt_greater a b performs element-wise greater-than comparison between arrays a and b. Returns a new array where each element is true if the corresponding element in a is greater than that in b, and false otherwise.
val elt_less_equal :
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arrelt_less_equal a b performs element-wise less-than-or-equal-to comparison between arrays a and b. Returns a new array where each element is true if the corresponding element in a is less than or equal to that in b, and false otherwise.
val elt_greater_equal :
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arrelt_greater_equal a b performs element-wise greater-than-or-equal-to comparison between arrays a and b. Returns a new array where each element is true if the corresponding element in a is greater than or equal to that in b, and false otherwise.
val elt_equal_scalar :
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.elt ->
Symbol.Shape.Type.arrelt_equal_scalar arr scalar performs element-wise equality comparison between each element in the array arr and the scalar value scalar. Returns a new array where each element is true if it equals scalar, and false otherwise.
val elt_not_equal_scalar :
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.elt ->
Symbol.Shape.Type.arrelt_not_equal_scalar arr scalar performs element-wise inequality comparison between each element in the array arr and the scalar value scalar. Returns a new array where each element is true if it does not equal scalar, and false otherwise.
val elt_less_scalar :
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.elt ->
Symbol.Shape.Type.arrelt_less_scalar arr scalar performs element-wise less-than comparison between each element in the array arr and the scalar value scalar. Returns a new array where each element is true if it is less than scalar, and false otherwise.
val elt_greater_scalar :
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.elt ->
Symbol.Shape.Type.arrelt_greater_scalar arr scalar performs element-wise greater-than comparison between each element in the array arr and the scalar value scalar. Returns a new array where each element is true if it is greater than scalar, and false otherwise.
val elt_less_equal_scalar :
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.elt ->
Symbol.Shape.Type.arrelt_less_equal_scalar arr scalar performs element-wise less-than-or-equal-to comparison between each element in the array arr and the scalar value scalar. Returns a new array where each element is true if it is less than or equal to scalar, and false otherwise.
val elt_greater_equal_scalar :
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.elt ->
Symbol.Shape.Type.arrelt_greater_equal_scalar arr scalar performs element-wise greater-than-or-equal-to comparison between each element in the array arr and the scalar value scalar. Returns a new array where each element is true if it is greater than or equal to scalar, and false otherwise.
val conv1d :
?padding:Owl_types.padding ->
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arr ->
int array ->
Symbol.Shape.Type.arrconv1d ?padding input kernel strides performs a 1-dimensional convolution on the input array using the specified kernel.
padding specifies the padding strategy (default is "valid").strides specifies the stride length. Returns a new array with the result of the convolution.val conv2d :
?padding:Owl_types.padding ->
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arr ->
int array ->
Symbol.Shape.Type.arrconv2d ?padding input kernel strides performs a 2-dimensional convolution on the input array using the specified kernel.
padding specifies the padding strategy (default is "valid").strides specifies the stride length. Returns a new array with the result of the convolution.val conv3d :
?padding:Owl_types.padding ->
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arr ->
int array ->
Symbol.Shape.Type.arrconv3d ?padding input kernel strides performs a 3-dimensional convolution on the input array using the specified kernel.
padding specifies the padding strategy (default is "valid").strides specifies the stride length. Returns a new array with the result of the convolution.val transpose_conv1d :
?padding:Owl_types.padding ->
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arr ->
int array ->
Symbol.Shape.Type.arrtranspose_conv1d ?padding input kernel strides performs a 1-dimensional transposed convolution (also known as deconvolution) on the input array using the specified kernel.
padding specifies the padding strategy (default is "valid").strides specifies the stride length. Returns a new array with the result of the transposed convolution.val transpose_conv2d :
?padding:Owl_types.padding ->
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arr ->
int array ->
Symbol.Shape.Type.arrtranspose_conv2d ?padding input kernel strides performs a 2-dimensional transposed convolution (also known as deconvolution) on the input array using the specified kernel.
padding specifies the padding strategy (default is "valid").strides specifies the stride length. Returns a new array with the result of the transposed convolution.val transpose_conv3d :
?padding:Owl_types.padding ->
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arr ->
int array ->
Symbol.Shape.Type.arrtranspose_conv3d ?padding input kernel strides performs a 3-dimensional transposed convolution (also known as deconvolution) on the input array using the specified kernel.
padding specifies the padding strategy (default is "valid").strides specifies the stride length. Returns a new array with the result of the transposed convolution.val dilated_conv1d :
?padding:Owl_types.padding ->
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arr ->
int array ->
int array ->
Symbol.Shape.Type.arrdilated_conv1d ?padding input kernel strides dilations performs a 1-dimensional dilated convolution on the input array using the specified kernel.
padding specifies the padding strategy (default is "valid").strides specifies the stride length.dilations specifies the dilation rate. Returns a new array with the result of the dilated convolution.val dilated_conv2d :
?padding:Owl_types.padding ->
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arr ->
int array ->
int array ->
Symbol.Shape.Type.arrdilated_conv2d ?padding input kernel strides dilations performs a 2-dimensional dilated convolution on the input array using the specified kernel.
padding specifies the padding strategy (default is "valid").strides specifies the stride length.dilations specifies the dilation rate. Returns a new array with the result of the dilated convolution.val dilated_conv3d :
?padding:Owl_types.padding ->
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arr ->
int array ->
int array ->
Symbol.Shape.Type.arrdilated_conv3d ?padding input kernel strides dilations performs a 3-dimensional dilated convolution on the input array using the specified kernel.
padding specifies the padding strategy (default is "valid").strides specifies the stride length.dilations specifies the dilation rate. Returns a new array with the result of the dilated convolution.val max_pool1d :
?padding:Owl_types.padding ->
Symbol.Shape.Type.arr ->
int array ->
int array ->
Symbol.Shape.Type.arrmax_pool1d ?padding input pool_size strides applies a 1-dimensional max pooling operation on the input array.
padding specifies the padding strategy (default is "valid").pool_size specifies the size of the pooling window.strides specifies the stride length. Returns a new array with the result of the max pooling.val max_pool2d :
?padding:Owl_types.padding ->
Symbol.Shape.Type.arr ->
int array ->
int array ->
Symbol.Shape.Type.arrmax_pool2d ?padding input pool_size strides applies a 2-dimensional max pooling operation on the input array.
padding specifies the padding strategy (default is "valid").pool_size specifies the size of the pooling window.strides specifies the stride length. Returns a new array with the result of the max pooling.val max_pool3d :
?padding:Owl_types.padding ->
Symbol.Shape.Type.arr ->
int array ->
int array ->
Symbol.Shape.Type.arrmax_pool3d ?padding input pool_size strides applies a 3-dimensional max pooling operation on the input array.
padding specifies the padding strategy (default is "valid").pool_size specifies the size of the pooling window.strides specifies the stride length. Returns a new array with the result of the max pooling.val avg_pool1d :
?padding:Owl_types.padding ->
Symbol.Shape.Type.arr ->
int array ->
int array ->
Symbol.Shape.Type.arravg_pool1d ?padding input pool_size strides applies a 1-dimensional average pooling operation on the input array.
padding specifies the padding strategy (default is "valid").pool_size specifies the size of the pooling window.strides specifies the stride length. Returns a new array with the result of the average pooling.val avg_pool2d :
?padding:Owl_types.padding ->
Symbol.Shape.Type.arr ->
int array ->
int array ->
Symbol.Shape.Type.arravg_pool2d ?padding input pool_size strides applies a 2-dimensional average pooling operation on the input array.
padding specifies the padding strategy (default is "valid").pool_size specifies the size of the pooling window.strides specifies the stride length. Returns a new array with the result of the average pooling.val avg_pool3d :
?padding:Owl_types.padding ->
Symbol.Shape.Type.arr ->
int array ->
int array ->
Symbol.Shape.Type.arravg_pool3d ?padding input pool_size strides applies a 3-dimensional average pooling operation on the input array.
padding specifies the padding strategy (default is "valid").pool_size specifies the size of the pooling window.strides specifies the stride length. Returns a new array with the result of the average pooling.val upsampling2d : Symbol.Shape.Type.arr -> int array -> Symbol.Shape.Type.arrupsampling2d input size performs a 2-dimensional upsampling on the input array.
size specifies the upsampling factors for each dimension. Returns a new array with the upsampled data.val conv1d_backward_input :
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arr ->
int array ->
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arrconv1d_backward_input input kernel strides grad_output computes the gradient of the loss with respect to the 1-dimensional input array.
input is the original input array.kernel is the convolutional kernel used during the forward pass.strides specifies the stride length.grad_output is the gradient of the loss with respect to the output of the convolutional layer. Returns a new array with the gradients of the input.val conv1d_backward_kernel :
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arr ->
int array ->
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arrconv1d_backward_kernel input kernel strides grad_output computes the gradient of the loss with respect to the 1-dimensional convolutional kernel.
input is the original input array.kernel is the convolutional kernel used during the forward pass.strides specifies the stride length.grad_output is the gradient of the loss with respect to the output of the convolutional layer. Returns a new array with the gradients of the kernel.val conv2d_backward_input :
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arr ->
int array ->
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arrconv2d_backward_input input kernel strides grad_output computes the gradient of the loss with respect to the 2-dimensional input array.
input is the original input array.kernel is the convolutional kernel used during the forward pass.strides specifies the stride length.grad_output is the gradient of the loss with respect to the output of the convolutional layer. Returns a new array with the gradients of the input.val conv2d_backward_kernel :
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arr ->
int array ->
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arrconv2d_backward_kernel input kernel strides grad_output computes the gradient of the loss with respect to the 2-dimensional convolutional kernel.
input is the original input array.kernel is the convolutional kernel used during the forward pass.strides specifies the stride length.grad_output is the gradient of the loss with respect to the output of the convolutional layer. Returns a new array with the gradients of the kernel.val conv3d_backward_input :
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arr ->
int array ->
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arrconv3d_backward_input input kernel strides grad_output computes the gradient of the loss with respect to the 3-dimensional input array.
input is the original input array.kernel is the convolutional kernel used during the forward pass.strides specifies the stride length.grad_output is the gradient of the loss with respect to the output of the convolutional layer. Returns a new array with the gradients of the input.val conv3d_backward_kernel :
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arr ->
int array ->
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arrconv3d_backward_kernel input kernel strides grad_output computes the gradient of the loss with respect to the 3-dimensional convolutional kernel.
input is the original input array.kernel is the convolutional kernel used during the forward pass.strides specifies the stride length.grad_output is the gradient of the loss with respect to the output of the convolutional layer. Returns a new array with the gradients of the kernel.val transpose_conv1d_backward_input :
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arr ->
int array ->
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arrtranspose_conv1d_backward_input input kernel strides grad_output computes the gradient of the loss with respect to the 1-dimensional input array for the transposed convolution operation.
input is the original input array.kernel is the transposed convolutional kernel used during the forward pass.strides specifies the stride length.grad_output is the gradient of the loss with respect to the output of the transposed convolutional layer. Returns a new array with the gradients of the input.val transpose_conv1d_backward_kernel :
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arr ->
int array ->
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arrtranspose_conv1d_backward_kernel input kernel strides grad_output computes the gradient of the loss with respect to the 1-dimensional transposed convolutional kernel.
input is the original input array.kernel is the transposed convolutional kernel used during the forward pass.strides specifies the stride length.grad_output is the gradient of the loss with respect to the output of the transposed convolutional layer. Returns a new array with the gradients of the kernel.val transpose_conv2d_backward_input :
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arr ->
int array ->
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arrtranspose_conv2d_backward_input input kernel strides grad_output computes the gradient of the loss with respect to the 2-dimensional input array for the transposed convolution operation.
input is the original input array.kernel is the transposed convolutional kernel used during the forward pass.strides specifies the stride length.grad_output is the gradient of the loss with respect to the output of the transposed convolutional layer. Returns a new array with the gradients of the input.val transpose_conv2d_backward_kernel :
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arr ->
int array ->
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arrtranspose_conv2d_backward_kernel input kernel strides grad_output computes the gradient of the loss with respect to the 2-dimensional transposed convolutional kernel.
input is the original input array.kernel is the transposed convolutional kernel used during the forward pass.strides specifies the stride length.grad_output is the gradient of the loss with respect to the output of the transposed convolutional layer. Returns a new array with the gradients of the kernel.val transpose_conv3d_backward_input :
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arr ->
int array ->
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arrtranspose_conv3d_backward_input input kernel strides grad_output computes the gradient of the loss with respect to the 3-dimensional input array for the transposed convolution operation.
input is the original input array.kernel is the transposed convolutional kernel used during the forward pass.strides specifies the stride length.grad_output is the gradient of the loss with respect to the output of the transposed convolutional layer. Returns a new array with the gradients of the input.val transpose_conv3d_backward_kernel :
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arr ->
int array ->
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arrtranspose_conv3d_backward_kernel input kernel strides grad_output computes the gradient of the loss with respect to the 3-dimensional transposed convolutional kernel.
input is the original input array.kernel is the transposed convolutional kernel used during the forward pass.strides specifies the stride length.grad_output is the gradient of the loss with respect to the output of the transposed convolutional layer. Returns a new array with the gradients of the kernel.val dilated_conv1d_backward_input :
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arr ->
int array ->
int array ->
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arrdilated_conv1d_backward_input input kernel strides dilations grad_output computes the gradient of the loss with respect to the 1-dimensional input array for the dilated convolution operation.
input is the original input array.kernel is the dilated convolutional kernel used during the forward pass.strides specifies the stride length.dilations specifies the dilation rate.grad_output is the gradient of the loss with respect to the output of the dilated convolutional layer. Returns a new array with the gradients of the input.val dilated_conv1d_backward_kernel :
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arr ->
int array ->
int array ->
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arrdilated_conv1d_backward_kernel input kernel strides dilations grad_output computes the gradient of the loss with respect to the 1-dimensional dilated convolutional kernel.
input is the original input array.kernel is the dilated convolutional kernel used during the forward pass.strides specifies the stride length.dilations specifies the dilation rate.grad_output is the gradient of the loss with respect to the output of the dilated convolutional layer. Returns a new array with the gradients of the kernel.val dilated_conv2d_backward_input :
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arr ->
int array ->
int array ->
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arrdilated_conv2d_backward_input input kernel strides dilations grad_output computes the gradient of the loss with respect to the 2-dimensional input array for the dilated convolution operation.
input is the original input array.kernel is the dilated convolutional kernel used during the forward pass.strides specifies the stride length.dilations specifies the dilation rate.grad_output is the gradient of the loss with respect to the output of the dilated convolutional layer. Returns a new array with the gradients of the input.val dilated_conv2d_backward_kernel :
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arr ->
int array ->
int array ->
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arrdilated_conv2d_backward_kernel input kernel strides dilations grad_output computes the gradient of the loss with respect to the 2-dimensional dilated convolutional kernel.
input is the original input array.kernel is the dilated convolutional kernel used during the forward pass.strides specifies the stride length.dilations specifies the dilation rate.grad_output is the gradient of the loss with respect to the output of the dilated convolutional layer. Returns a new array with the gradients of the kernel.val dilated_conv3d_backward_input :
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arr ->
int array ->
int array ->
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arrdilated_conv3d_backward_input input kernel strides dilations grad_output computes the gradient of the loss with respect to the 3-dimensional input array for the dilated convolution operation.
input is the original input array.kernel is the dilated convolutional kernel used during the forward pass.strides specifies the stride length.dilations specifies the dilation rate.grad_output is the gradient of the loss with respect to the output of the dilated convolutional layer. Returns a new array with the gradients of the input.val dilated_conv3d_backward_kernel :
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arr ->
int array ->
int array ->
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arrdilated_conv3d_backward_kernel input kernel strides dilations grad_output computes the gradient of the loss with respect to the 3-dimensional dilated convolutional kernel.
input is the original input array.kernel is the dilated convolutional kernel used during the forward pass.strides specifies the stride length.dilations specifies the dilation rate.grad_output is the gradient of the loss with respect to the output of the dilated convolutional layer. Returns a new array with the gradients of the kernel.val max_pool1d_backward :
Owl_types.padding ->
Symbol.Shape.Type.arr ->
int array ->
int array ->
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arrmax_pool1d_backward padding input pool_size strides grad_output computes the gradient of the loss with respect to the 1-dimensional input array after max pooling.
padding specifies the padding strategy used during the forward pass.input is the original input array.pool_size specifies the size of the pooling window.strides specifies the stride length.grad_output is the gradient of the loss with respect to the output of the max pooling layer. Returns a new array with the gradients of the input.val max_pool2d_backward :
Owl_types.padding ->
Symbol.Shape.Type.arr ->
int array ->
int array ->
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arrmax_pool2d_backward padding input pool_size strides grad_output computes the gradient of the loss with respect to the 2-dimensional input array after max pooling.
padding specifies the padding strategy used during the forward pass.input is the original input array.pool_size specifies the size of the pooling window.strides specifies the stride length.grad_output is the gradient of the loss with respect to the output of the max pooling layer. Returns a new array with the gradients of the input.val max_pool3d_backward :
Owl_types.padding ->
Symbol.Shape.Type.arr ->
int array ->
int array ->
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arrmax_pool3d_backward padding input pool_size strides grad_output computes the gradient of the loss with respect to the 3-dimensional input array after max pooling.
padding specifies the padding strategy used during the forward pass.input is the original input array.pool_size specifies the size of the pooling window.strides specifies the stride length.grad_output is the gradient of the loss with respect to the output of the max pooling layer. Returns a new array with the gradients of the input.val avg_pool1d_backward :
Owl_types.padding ->
Symbol.Shape.Type.arr ->
int array ->
int array ->
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arravg_pool1d_backward padding input pool_size strides grad_output computes the gradient of the loss with respect to the 1-dimensional input array after average pooling.
padding specifies the padding strategy used during the forward pass.input is the original input array.pool_size specifies the size of the pooling window.strides specifies the stride length.grad_output is the gradient of the loss with respect to the output of the average pooling layer. Returns a new array with the gradients of the input.val avg_pool2d_backward :
Owl_types.padding ->
Symbol.Shape.Type.arr ->
int array ->
int array ->
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arravg_pool2d_backward padding input pool_size strides grad_output computes the gradient of the loss with respect to the 2-dimensional input array after average pooling.
padding specifies the padding strategy used during the forward pass.input is the original input array.pool_size specifies the size of the pooling window.strides specifies the stride length.grad_output is the gradient of the loss with respect to the output of the average pooling layer. Returns a new array with the gradients of the input.val avg_pool3d_backward :
Owl_types.padding ->
Symbol.Shape.Type.arr ->
int array ->
int array ->
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arravg_pool3d_backward padding input pool_size strides grad_output computes the gradient of the loss with respect to the 3-dimensional input array after average pooling.
padding specifies the padding strategy used during the forward pass.input is the original input array.pool_size specifies the size of the pooling window.strides specifies the stride length.grad_output is the gradient of the loss with respect to the output of the average pooling layer. Returns a new array with the gradients of the input.val upsampling2d_backward :
Symbol.Shape.Type.arr ->
int array ->
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arrupsampling2d_backward input size grad_output computes the gradient of the loss with respect to the input array after 2-dimensional upsampling.
input is the original input array.size specifies the upsampling factors for each dimension.grad_output is the gradient of the loss with respect to the output of the upsampling layer. Returns a new array with the gradients of the input.val row_num : Symbol.Shape.Type.arr -> introw_num arr returns the number of rows in the array arr.
val col_num : Symbol.Shape.Type.arr -> intcol_num arr returns the number of columns in the array arr.
val row : Symbol.Shape.Type.arr -> 'a -> Symbol.Shape.Type.arrrow arr idx extracts the row at index idx from the array arr. Returns a new array containing the specified row.
val rows : Symbol.Shape.Type.arr -> int array -> Symbol.Shape.Type.arrrows arr indices extracts multiple rows specified by indices from the array arr. Returns a new array containing the selected rows.
val copy_row_to : Symbol.Shape.Type.arr -> 'a -> 'b -> unitcopy_row_to src src_idx dest_idx copies the row at index src_idx in the array src to the row at index dest_idx.
val copy_col_to : Symbol.Shape.Type.arr -> 'a -> 'b -> unitcopy_col_to src src_idx dest_idx copies the column at index src_idx in the array src to the column at index dest_idx.
val diag : ?k:int -> Symbol.Shape.Type.arr -> Symbol.Shape.Type.arrdiag ?k arr extracts the k-th diagonal from the array arr. If k is not provided, the main diagonal is extracted. Returns a new array containing the diagonal elements.
val trace : Symbol.Shape.Type.arr -> Symbol.Shape.Type.elttrace arr computes the sum of the elements on the main diagonal of the array arr. Returns the trace as an element.
val dot :
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arrdot a b computes the dot product of the arrays a and b. Returns a new array with the result of the dot product.
val transpose :
?axis:int array ->
Symbol.Shape.Type.arr ->
Symbol.Shape.Type.arrtranspose ?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 arrayto_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.
val of_rows : Symbol.Shape.Type.arr array -> Symbol.Shape.Type.arrof_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 arrayto_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.
val of_cols : Symbol.Shape.Type.arr array -> Symbol.Shape.Type.arrof_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.arrof_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.arrof_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 arrayto_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.
module Scalar = Operator.Scalarmodule Mat = Operator.Matmodule Linalg = Operator.Linalginclude module type of struct include Symbol endmodule Shape = Symbol.Shapeval op_to_str : Shape.Type.op -> stringreturn the name of the operator as string
val is_random_variable : Shape.Type.op -> boolcheck if operator is randon variable
val refnum : 'a Owl_graph.node -> intreturn the reference number of the given node
val node_shape : Shape.Type.attr Owl_graph.node -> int arrayreturn the shape of a node
val node_numel : Shape.Type.attr Owl_graph.node -> intreturn the number of elements of a node
val is_shape_unknown : Shape.Type.attr Owl_graph.node -> boolcheck if the shape of the input node is unknown
val infer_shape_graph : Shape.Type.attr Owl_graph.node array -> unitautomatically infer the shape of input node according to its descendents' shapes
helper function; return the input array in string format.
val node_to_str : Shape.Type.attr Owl_graph.node -> stringprint node's information to string
val node_to_arr : Shape.Type.t -> Shape.Type.arrWrap computation graph node in an array type
val arr_to_node : Shape.Type.arr -> Shape.Type.tUnwrap the array type to get the computation graph node within
val node_to_elt : Shape.Type.t -> Shape.Type.eltWrap computation graph node in an Elt type
val elt_to_node : Shape.Type.elt -> Shape.Type.tUnwrap 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 ->
?freeze:bool ->
?reuse:bool ->
?state:Shape.Type.state ->
Shape.Type.op ->
Shape.Type.attr Owl_graph.nodecrate 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.nodemake nodes and then connect parents and children
val var_arr : ?shape:int array -> string -> Shape.Type.arrcreat a node and wrap in Arr type
val var_elt : string -> Shape.Type.eltcreat a node and wrap in Elt type
val const_arr : string -> Shape.Type.Device.A.arr -> Shape.Type.arrget ndarray value from input and create an node and wrap in Arr type
val const_elt : string -> Shape.Type.Device.A.elt -> Shape.Type.eltget value from input and create an node and wrap in Elt type
val make_empty_block : ?block_id:int -> int -> Shape.Type.blockmake_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 ->
unitmake_value_block value node creates a block of memory initialised with value and links the new block to node.
val get_block : Shape.Type.attr Owl_graph.node -> Shape.Type.block arrayget_block node returns the memory block allocated to node. If no block is allocated, throws an exception.
val add_node_to_block :
Shape.Type.attr Owl_graph.node ->
Shape.Type.block ->
unitLink a node to a reusable block and initialises its memory on the memory of the block.
val get_active_node : Shape.Type.block -> Shape.Type.attr Owl_graph.node optionReturn the node that is currently using the memory of the block.
val set_active_node :
Shape.Type.block ->
Shape.Type.attr Owl_graph.node ->
unitUpdate the node that is currently using the block of memory.
val get_block_id : Shape.Type.attr Owl_graph.node -> intget_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 ->
unitset the arrays of value to cgraph node
val get_value : Shape.Type.attr Owl_graph.node -> Shape.Type.Device.value arrayget the arrays of value of cgraph node
val set_operator : Shape.Type.attr Owl_graph.node -> Shape.Type.op -> unitset the operator of cgraph node
val get_operator : Shape.Type.attr Owl_graph.node -> Shape.Type.opget the operator of cgraph node
val set_reuse : Shape.Type.attr Owl_graph.node -> bool -> unitset reuse attribute in a node
val get_reuse : Shape.Type.attr Owl_graph.node -> boolget reuse attribute in a node
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 -> boolcheck if the node's operator is Var type
val is_const : Shape.Type.attr Owl_graph.node -> boolcheck if the node's operator is Const type
val is_node_arr : Shape.Type.attr Owl_graph.node -> boolcheck the shape of a node's attr and return if it indicates an ndarray
val is_node_elt : Shape.Type.attr Owl_graph.node -> boolcheck the shape of a node's attr and return if it indicates an elt
val is_assigned : Shape.Type.attr Owl_graph.node -> boolis_assigned node checks if a block of memory has been assigned to node.
val check_assigned : Shape.Type.attr Owl_graph.node -> unitcheck_assigned node throws an exception if node has not been assigned to a block.
val is_valid : Shape.Type.attr Owl_graph.node -> boolcheck if the state attribute of a node is Valid
val validate : Shape.Type.attr Owl_graph.node -> unitset Valid to the state attribute of a node
val invalidate : Shape.Type.attr Owl_graph.node -> unitset Invalid to the state attribute of a node
val invalidate_graph : Shape.Type.attr Owl_graph.node -> unititeratively invalidate the nodes in a graph
val is_freeze : Shape.Type.attr Owl_graph.node -> boolcheck the freeze attribute of a node
val freeze : Shape.Type.attr Owl_graph.node -> unitreturn the freeze attribute of a node
val freeze_descendants : Shape.Type.attr Owl_graph.node array -> unititeratively freeze the descendants of a node
val freeze_ancestors : Shape.Type.attr Owl_graph.node array -> unititeratively freeze the ancestors of a node
val pack_arr : Shape.Type.Device.A.arr -> Shape.Type.arrpack an A.arr type input into Arr type
val unpack_arr : Shape.Type.arr -> Shape.Type.Device.A.arrunpack input into A.arr type
val pack_elt : Shape.Type.Device.A.elt -> Shape.Type.eltpack an A.elt type input into Elt type
val unpack_elt : Shape.Type.elt -> Shape.Type.Device.A.eltunpack input into A.elt type
val unsafe_assign_arr : Shape.Type.arr -> Shape.Type.Device.A.arr -> unitassign Arr type value
val assign_arr : Shape.Type.arr -> Shape.Type.Device.A.arr -> unitassign Arr type value
val assign_elt : Shape.Type.elt -> Shape.Type.Device.A.elt -> unitassign Elt type value
val float_to_elt : float -> Shape.Type.eltbuild an Elt type based on float value
val elt_to_float : Shape.Type.elt -> floatretrive a float value from an Elt type value
include module type of struct include Shape endmodule Type = Shape.Typeval infer_shape :
Type.op ->
Type.attr Owl_graph.node array ->
int array option arrayTODO
include module type of struct include Type endmodule Device = Type.Devicetype t = attr Owl_graph.nodeTODO
and block = Engine.Graph.Optimiser.Operator.Symbol.Shape.Type.block = {size : int;block_id : int;mutable active : t option;mutable memory : Device.value;mutable nodes : t list;}block type keeps a reference to a block of memory and to the nodes sharing that block.
and attr = Engine.Graph.Optimiser.Operator.Symbol.Shape.Type.attr = {mutable op : op;mutable freeze : bool;mutable reuse : bool;mutable state : state;mutable shape : int array option array;mutable value : Device.value array;mutable block : block array option;}TODO
and op = Engine.Graph.Optimiser.Operator.Symbol.Shape.Type.op = | Noop| Var| Const| Empty of int array| Zeros of int array| Ones of int array| Create of int array| Sequential of int array| Uniform of int array| Gaussian of int array| Bernoulli of int array| Init of int array * int -> elt| Get of int array| Set of int array| GetSlice of int list list| SetSlice of int list list| GetFancy of Owl_types_common.index list| SetFancy of Owl_types_common.index list| Copy| Reset| Reshape of int array| Reverse| Tile of int array| Repeat of int array| Pad of elt * int list list| Concatenate of int| Stack of int| Split of int * int array| Draw of int * int| Map of elt -> elt| Fold of int * elt -> elt -> elt| Scan of int * elt -> elt -> elt| OneHot of int| OfArray of int array| Delay of Device.A.arr -> Device.A.arr| DelayArray of int array * Device.A.arr array -> Device.A.arr| LazyPrint of int option
* int option
* bool option
* (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 * floatTODO
*)val number : Owl_types_common.number