Symbol¶
Symbolic programming with computation graphs¶
Get symbol attributes¶
Get the arguments of symbol |
|
Gets a new grouped symbol whose output contains inputs to output nodes of the original symbol |
|
Convert symbol to Graphviz or visNetwork visualisation |
|
Get a symbol that contains all the internals |
|
Judge if an object is mx.symbol |
|
Inference the shape of arguments, outputs, and auxiliary states |
|
Returns a 1D int64 array containing the shape of data |
|
Returns a 1D int64 array containing the size of data |
|
Get the outputs of a symbol |
Create symbols¶
Create a symbol that groups symbols together |
|
Group normalization |
|
Create a symbolic variable with specified name |
|
Returns a one-hot array |
|
Return an array of ones with the same shape and type as the input array |
|
Return an array of zeros with the same shape, type and storage type as the input array |
Manipulation of symbols¶
Conversion¶
Apply symbol to the inputs |
|
Casts all elements of the input to a new type |
|
Casts tensor storage type to the new type |
|
Load an mx.symbol object |
|
Load an mx.symbol object from a json string |
|
Save an mx.symbol object |
Reshaping¶
Perform an feature concat on channel dim (dim 1) over all the inputs |
|
Reshapes the input array |
|
Flattens the input array into a 2-D array by collapsing the higher dimensions |
|
Reshape some or all dimensions of lhs to have the same shape as some or all dimensions of rhs |
|
Scatters data into a new tensor according to indices |
|
Splits an array along a particular axis into multiple sub-arrays |
|
Remove single-dimensional entries from the shape of an array |
|
Join a sequence of arrays along a new axis |
Expanding elements¶
Generates 2D sampling grid for bilinear sampling |
|
Pads an input array with a constant or edge values of the array |
|
Upsamples the given input data |
|
Returns element-wise sum of the input arrays with broadcasting |
|
Broadcasts the input array over particular axes |
|
Broadcasts the input array over particular axes |
|
Returns element-wise division of the input arrays with broadcasting |
|
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 hypotenuse of a right angled triangle, given its “legs” 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 |
|
Broadcasts lhs to have the same shape as rhs |
|
Returns the result of element-wise logical and with broadcasting |
|
Returns the result of element-wise logical or with broadcasting |
|
Returns the result of element-wise logical xor with broadcasting |
|
Returns element-wise maximum of the input arrays with broadcasting |
|
Returns element-wise minimum of the input arrays with broadcasting |
|
Returns element-wise difference of the input arrays with broadcasting |
|
Returns element-wise modulo of the input arrays with broadcasting |
|
Returns element-wise product of the input arrays with broadcasting |
|
Returns the result of element-wise not equal to (!=) comparison operation with broadcasting |
|
Returns element-wise sum of the input arrays with broadcasting |
|
Returns result of first array elements raised to powers from second array, element-wise with broadcasting |
|
Returns element-wise difference of the input arrays with broadcasting |
|
Broadcasts the input array to a new shape |
|
Inserts a new axis of size 1 into the array shape For example, given |
|
Repeats elements of an array |
|
Repeats the whole array multiple times |
Rearranging elements¶
Reverses the elements of each sequence |
|
Interchanges two axes of an array |
|
Rearranges(permutes) data from depth into blocks of spatial data |
|
Reverses the order of elements along given axis while preserving array shape |
|
Reverses the order of elements along given axis while preserving array shape |
|
Randomly shuffle the elements |
|
Rearranges(permutes) blocks of spatial data into depth |
|
Interchanges two axes of an array |
|
Permutes the dimensions of an array |
Sorting and searching¶
Returns indices of the maximum values along an axis |
|
Returns argmax indices of each channel from the input array |
|
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 indices of the top k elements in an input array along the given axis (by default) |
|
Return the elements, either from x or y, depending on the condition |
Indexing¶
Takes the last element of a sequence |
|
Sets all elements outside the sequence to a constant value |
|
Splits an array along a particular axis into multiple sub-arrays |
|
Takes elements from a data batch |
|
Picks elements from an input array according to the input indices along the given axis |
|
Extracts a diagonal or constructs a diagonal array |
|
Fill one element of each line(row for python, column for R/Julia) in lhs according to index indicated by rhs and values indicated by mhs |
|
Gather elements or slices from data and store to a tensor whose shape is defined by indices |
|
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 |
Mathematical operations on symbols¶
Arithmetic¶
Adds all input arguments element-wise |
|
Returns element-wise absolute value of the input |
|
Adds all input arguments element-wise |
|
Check if all the float numbers in the array are finite (used for AMP) |
|
Returns element-wise cube-root value of the input |
|
Return the cumulative sum of the elements along a given axis |
|
Adds arguments element-wise |
|
Divides arguments element-wise |
|
Multiplies arguments element-wise |
|
Subtracts arguments element-wise |
|
Returns element-wise gauss error function of the input |
|
Returns element-wise inverse gauss error function of the input |
|
Returns element-wise exponential value of the input |
|
Returns |
|
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 a copy of the input |
|
Returns element-wise Natural logarithmic value of the input |
|
Returns element-wise Base-10 logarithmic value of the input |
|
Returns element-wise |
|
Returns element-wise Base-2 logarithmic value of the input |
|
Returns the result of logical NOT (!) function |
|
Calculate the mean and variance of data |
|
Check if all the float numbers in all the arrays are finite (used for AMP) |
|
Compute the LARS coefficients of multiple weights and grads from their sums of square” |
|
Compute the sums of squares of multiple arrays |
|
Numerical negative of the argument, element-wise |
|
Returns element-wise inverse cube-root value of the input |
|
Returns the reciprocal of the argument, element-wise |
|
Set to zero multiple arrays |
|
Returns element-wise inverse square-root value of the input |
|
Returns element-wise sign of the input |
|
Returns element-wise square-root value of the input |
|
Returns element-wise squared value of the input |
Reduce¶
Computes the max of array elements over given axes |
|
Computes the max 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 product of array elements over given axes |
|
Computes the sum of array elements over given axes |
|
Computes the sum of array elements over given axes |
Round¶
Returns element-wise ceiling of the input |
|
Clips (limits) the values in an array |
|
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 |
Linear algebra¶
Normalize the input array using the L2 norm |
|
Batchwise dot product |
|
Dot product of two arrays |
|
Computes the Khatri-Rao product of the input matrices |
|
Compute the determinant of a matrix |
|
Extracts the diagonal entries of a square matrix |
|
Extracts a triangular sub-matrix from a square matrix |
|
LQ factorization for general matrix |
|
Performs general matrix multiplication and accumulation |
|
Performs general matrix multiplication |
|
Compute the inverse of a matrix |
|
Constructs a square matrix with the input as diagonal |
|
Constructs a square matrix with the input representing a specific triangular sub-matrix |
|
Performs Cholesky factorization of a symmetric positive-definite matrix |
|
Performs matrix inversion from a Cholesky factorization |
|
Compute the sign and log of the determinant of a matrix |
|
Computes the sum of the logarithms of the diagonal elements of a square matrix |
|
Multiplication of matrix with its transpose |
|
Performs multiplication with a lower triangular matrix |
|
Solves matrix equation involving a lower triangular matrix |
|
Computes the norm on an NDArray |
|
Calculate Smooth L1 Loss(lhs, scalar) by summing |
Trigonometric functions¶
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 |
|
Computes the element-wise cosine of the input array |
|
Converts each element of the input array from radians to degrees |
|
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 functions¶
Returns the element-wise inverse hyperbolic cosine of the input array, computed element-wise |
|
Returns the element-wise inverse hyperbolic sine 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 |
Neural network symbol operations¶
Applies an activation function element-wise to the input |
|
Batch normalization |
|
Batch normalization |
|
Stops gradient computation |
|
Connectionist Temporal Classification Loss |
|
Compute N-D convolution on (N+2)-D input |
|
This operator is DEPRECATED |
|
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\) |
|
Apply a sparse regularization to the output a sigmoid activation function |
|
Applies instance normalization to the n-dimensional input array |
|
Applies local response normalization to the input |
|
Layer normalization |
|
Applies Leaky rectified linear unit activation element-wise to the input |
|
Computes and optimizes for squared loss during backward propagation |
|
Applies a logistic function to the input |
|
Computes mean absolute error of the input |
|
Make your own loss function in network construction |
|
Performs pooling on the input |
|
This operator is DEPRECATED |
|
Applies recurrent layers to input data |
|
Performs region of interest(ROI) pooling on the input array |
|
Computes support vector machine based transformation of the input |
|
Applies softmax activation to input |
|
Computes the gradient of cross entropy loss with respect to softmax output |
|
Applies a spatial transformer to input feature map |
|
Connectionist Temporal Classification Loss |
|
Computes hard sigmoid of x element-wise |
|
Computes the log softmax of the input |
|
Make your own loss function in network construction |
|
Computes rectified linear activation |
|
Computes sigmoid of x element-wise |
|
Applies the softmax function |
|
Calculate cross entropy of softmax output and one-hot label |
|
Applies the softmin function |
|
Computes softsign of x element-wise |
|
Stops gradient computation |