Routines¶
Create Arrays¶
Returns evenly spaced values within a given interval. |
|
Creates an array from any object exposing the array interface. |
|
Extracts a diagonal or constructs a diagonal array. |
|
Returns a new array of given shape and type, without initializing entries. |
|
Returns a new array of given shape and type, filled with the given value val. |
|
Loads an array from file. |
|
Returns a new array filled with all ones, with the given shape and type. |
|
Return an array of ones with the same shape and type as the input array. |
|
Saves a list of arrays or a dict of str->array to file. |
|
Return a new array of given shape and type, filled with zeros. |
|
Return an array of zeros with the same shape, type and storage type as the input array. |
Manipulate¶
Change shape and type¶
Casts all elements of the input to a new type. |
|
Flattens the input array into a 2-D array by collapsing the higher dimensions. |
|
Inserts a new axis of size 1 into the array shape |
|
Reshapes the input array. |
|
Reshape some or all dimensions of lhs to have the same shape as some or all dimensions of rhs. |
|
Returns a 1D int64 array containing the shape of data. |
|
Returns a 1D int64 array containing the size of data. |
Expand elements¶
Broadcasts the input array over particular axes. |
|
Broadcasts lhs to have the same shape as rhs. |
|
Broadcasts the input array to a new shape. |
|
Pads an input array with a constant or edge values of the array. |
|
Repeats elements of an array. |
|
Repeats the whole array multiple times. |
Rearrange elements¶
Rearranges(permutes) data from depth into blocks of spatial data. |
|
Reverses the order of elements along given axis while preserving array shape. |
|
Rearranges(permutes) blocks of spatial data into depth. |
|
Interchanges two axes of an array. |
|
Permutes the dimensions of an array. |
Join and split¶
Joins input arrays along a given axis. |
|
Splits an array along a particular axis into multiple sub-arrays. |
|
Join a sequence of arrays along a new axis. |
Index¶
Takes elements from a data batch. |
|
Returns a one-hot array. |
|
Picks elements from an input array according to the input indices along the given axis. |
|
Converts a batch of index arrays into an array of flat indices. |
|
Slices a region of the array. |
|
Slices along a given axis. |
|
Slices a region of the array like the shape of another array. |
|
Takes elements from an input array along the given axis. |
|
Converts an array of flat indices into a batch of index arrays. |
|
Return the elements, either from x or y, depending on the condition. |
Sequence¶
|
Takes the last element of a sequence. |
|
Sets all elements outside the sequence to a constant value. |
|
Reverses the elements of each sequence. |
Math¶
Arithmetic¶
Returns element-wise sum of the input arrays with broadcasting. |
|
Adds all input arguments element-wise. |
|
Batchwise dot product. |
|
Returns element-wise division of the input arrays with broadcasting. |
|
Dot product of two arrays. |
|
Returns element-wise modulo of the input arrays with broadcasting. |
|
Returns element-wise product of the input arrays with broadcasting. |
|
Numerical negative of the argument, element-wise. |
|
Returns element-wise difference of the input arrays with broadcasting. |
Trigonometric¶
Returns element-wise inverse cosine of the input array. |
|
Returns element-wise inverse sine of the input array. |
|
Returns element-wise inverse tangent of the input array. |
|
Returns the hypotenuse of a right angled triangle, given its “legs” with broadcasting. |
|
Converts each element of the input array from radians to degrees. |
|
Computes the element-wise cosine of the input array. |
|
Converts each element of the input array from degrees to radians. |
|
Computes the element-wise sine of the input array. |
|
Computes the element-wise tangent of the input array. |
Hyperbolic¶
Returns the element-wise inverse hyperbolic sine of the input array, computed element-wise. |
|
Returns the element-wise inverse hyperbolic cosine of the input array, computed element-wise. |
|
Returns the element-wise inverse hyperbolic tangent of the input array, computed element-wise. |
|
Returns the hyperbolic cosine of the input array, computed element-wise. |
|
Returns the hyperbolic sine of the input array, computed element-wise. |
|
Returns the hyperbolic tangent of the input array, computed element-wise. |
Reduce¶
Computes the max of array elements over given axes. |
|
Computes the min of array elements over given axes. |
|
Computes the mean of array elements over given axes. |
|
Computes the product of array elements over given axes treating Not a Numbers ( |
|
Computes the sum of array elements over given axes treating Not a Numbers ( |
|
Computes the norm on an NDArray. |
|
Computes the product of array elements over given axes. |
|
Computes the sum of array elements over given axes. |
Round¶
Returns element-wise ceiling of the input. |
|
Returns element-wise rounded value to the nearest integer towards zero of the input. |
|
Returns element-wise floor of the input. |
|
Returns element-wise rounded value to the nearest integer of the input. |
|
Returns element-wise rounded value to the nearest integer of the input. |
|
Return the element-wise truncated value of the input. |
Exponents and logarithms¶
Returns element-wise exponential value of the input. |
|
Returns |
|
Returns element-wise Natural logarithmic value of the input. |
|
Returns element-wise |
|
Returns element-wise Base-10 logarithmic value of the input. |
|
Returns element-wise Base-2 logarithmic value of the input. |
Powers¶
Returns element-wise cube-root value of the input. |
|
Returns result of first array elements raised to powers from second array, element-wise with broadcasting. |
|
Returns element-wise inverse cube-root value of the input. |
|
Returns the reciprocal of the argument, element-wise. |
|
Returns element-wise inverse square-root value of the input. |
|
Returns element-wise squared value of the input. |
|
Returns element-wise square-root value of the input. |
Compare¶
Returns the result of element-wise equal to (==) comparison operation with broadcasting. |
|
Returns the result of element-wise greater than (>) comparison operation with broadcasting. |
|
Returns the result of element-wise greater than or equal to (>=) comparison operation with broadcasting. |
|
Returns the result of element-wise lesser than (<) comparison operation with broadcasting. |
|
Returns the result of element-wise lesser than or equal to (<=) comparison operation with broadcasting. |
|
Returns the result of element-wise not equal to (!=) comparison operation with broadcasting. |
Logical¶
Returns the result of element-wise logical and comparison operation with broadcasting. |
|
Returns the result of logical NOT (!) function |
|
Returns the result of element-wise logical or comparison operation with broadcasting. |
|
Returns the result of element-wise logical xor comparison operation with broadcasting. |
Sort and Search¶
|
Returns indices of the maximum values along an axis. |
|
Returns indices of the minimum values along an axis. |
|
Returns the indices that would sort an input array along the given axis. |
|
Returns a sorted copy of an input array along the given axis. |
|
Returns the top k elements in an input array along the given axis. |
Random Distribution¶
Draw samples from an exponential distribution. |
|
Draw random samples from a gamma distribution. |
|
Draw random samples from a generalized negative binomial distribution. |
|
Concurrent sampling from multiple multinomial distributions. |
|
Draw random samples from a negative binomial distribution. |
|
Draw random samples from a normal (Gaussian) distribution. |
|
Draw random samples from a Poisson distribution. |
|
Draw random samples from a discrete uniform distribution. |
|
Draw random samples from a normal (Gaussian) distribution. |
|
Shuffle the elements randomly. |
|
Draw random samples from a uniform distribution. |
Linear Algebra¶
LQ factorization for general matrix. |
|
Performs general matrix multiplication and accumulation. |
|
Performs general matrix multiplication. |
|
Performs Cholesky factorization of a symmetric positive-definite matrix. |
|
Performs matrix inversion from a Cholesky factorization. |
|
Computes the sum of the logarithms of the diagonal elements of a square matrix. |
|
Eigendecomposition for symmetric matrix. |
|
Multiplication of matrix with its transpose. |
|
Performs multiplication with a lower triangular matrix. |
|
Solves matrix equation involving a lower triangular matrix. |
Miscellaneous¶
|
Returns element-wise absolute value of the input. |
|
Clips (limits) the values in an array. |
|
Returns the gamma function (extension of the factorial function to the reals), computed element-wise on the input array. |
|
Returns element-wise log of the absolute value of the gamma function of the input. |
|
Returns element-wise maximum of the input arrays with broadcasting. |
|
Returns element-wise minimum of the input arrays with broadcasting. |
|
Returns element-wise sign of the input. |
Neural Network¶
|
Applies an activation function element-wise to the input. |
|
Batch normalization. |
|
Applies bilinear sampling to input feature map. |
|
Stops gradient computation. |
|
Compute N-D convolution on (N+2)-D input. |
|
Applies correlation to inputs. |
|
Apply a custom operator implemented in a frontend language (like Python). |
|
Computes 1D or 2D transposed convolution (aka fractionally strided convolution) of the input tensor. |
|
Applies dropout operation to input array. |
|
Maps integer indices to vector representations (embeddings). |
|
Applies a linear transformation: \(Y = XW^T + b\). |
|
Generates 2D sampling grid for bilinear sampling. |
|
Apply a sparse regularization to the output a sigmoid activation function. |
|
Applies instance normalization to the n-dimensional input array. |
|
Normalize the input array using the L2 norm. |
|
Layer normalization. |
|
Applies Leaky rectified linear unit activation element-wise to the input. |
|
Computes and optimizes for squared loss during backward propagation. |
|
Computes the log softmax of the input. |
|
Applies a logistic function to the input. |
|
Applies local response normalization to the input. |
|
Computes mean absolute error of the input. |
|
Make your own loss function in network construction. |
|
Performs pooling on the input. |
|
Computes rectified linear. |
|
Performs region of interest(ROI) pooling on the input array. |
|
Applies recurrent layers to input data. |
|
Computes sigmoid of x element-wise. |
|
Calculate Smooth L1 Loss(lhs, scalar) by summing |
|
Applies the softmax function. |
|
Calculate cross entropy of softmax output and one-hot label. |
|
Computes the gradient of cross entropy loss with respect to softmax output. |
|
Applies softmax activation to input. |
|
Applies a spatial transformer to input feature map. |
|
Computes support vector machine based transformation of the input. |
|
Performs nearest neighbor/bilinear up sampling to inputs. |
Contributed routines¶
Contrib NDArray API of MXNet.
Note
This package contains experimental APIs and may change in the near future.
Manipulate¶
Apply CountSketch to input: map a d-dimension data to k-dimension data” |
|
Number of stored values for a sparse tensor, including explicit zeros. |
|
Copies the elements of a new_tensor into the old_tensor. |
Quantization¶
Dequantize the input tensor into a float tensor. |
|
Quantize a input tensor from float to out_type, with user-specified min_range and max_range. |
Neural network¶
Applies a 2D adaptive average pooling over a 4D input with the shape of (NCHW). |
|
Perform 2D resizing (upsampling or downsampling) for 4D input using bilinear interpolation. |
|
Connectionist Temporal Classification Loss. |
|
Compute 2-D deformable convolution on 4-D input. |
|
Performs deformable position-sensitive region-of-interest pooling on inputs. |
|
Convert multibox detection predictions. |
|
Generate prior(anchor) boxes from data, sizes and ratios. |
|
Compute Multibox training targets |
|
Generate region proposals via RPN |
|
Generate region proposals via RPN |
|
Performs region-of-interest pooling on inputs. |
|
This operator takes a 4D feature map as an input array and region proposals as rois, then align the feature map over sub-regions of input and produces a fixed-sized output array. |
Control flow¶
Run an if-then-else using user-defined condition and computation |
|
Run a for loop with user-defined computation over NDArrays on dimension 0. |
|
Run a while loop with user-defined computation and loop condition. |