Peform an synchronize copy from the array. Parameters ---------- source_array : array_like The data source we should like to copy from. Can be array ref in PDL::pdl init format or PDL object
Return a copied PDL array of current array. Returns ------- array : PDL A copy of array content.
Return a copied PDL::Matrix array of current array. Requires caller to "use PDL::Matrix" in user space. Returns ------- array : PDL::Matrix A copy of array content.
Return a sliced NDArray that shares memory with current one. Parameters ---------- start : int Starting index of slice. stop : int Finishing index of slice.
Return a sub NDArray that shares memory with current one. Parameters ---------- idx : int index of sub array.
Return a reshaped NDArray that shares memory with current one. Parameters ---------- new_shape : iterable of int new shape of NDArray
Broadcasting the current NDArray into the given shape. The semantics is the same with `numpy`'s broadcasting Parameters --------- shape : the shape to broadcast the broadcast shape
Block until all pending writes operations on current NDArray are finished. This function will return when all the pending writes to the current NDArray finishes. There can still be pending read going on when the function returns.
Get shape of current NDArray. Returns ------- a tuple representing shape of current ndarray
Get size of current NDArray. Returns ------- an int representing size of current ndarray
Get context of current NDArray. Returns ------- context : mxnet.Context The context of current NDArray.
Get data type of current NDArray. Returns ------- an dtype string ('float32', 'float64', 'float16', 'uint8', 'int32') representing type of current ndarray. 'float32' is a default dtype for ndarray class.
When other is NDArray, the content is copied over. When other is a Context, a new NDArray in the context will be created as target Parameters ---------- other : NDArray or Context Target NDArray or context we want to copy data to. Returns ------- dst : NDArray The copy target NDArray
Make a copy of the current ndarray on the same context Return ------ cpy : NDArray The copy
Get transpose of current NDArray
Parameters ---------- dtype : numpy.dtype or string Desired type of result array. Returns ------- array : ndarray A copy of array content.
Return an `NDArray` that lives in the target context. If the array is already in that context, `self` is returned. Otherwise, a copy is made. Parameters ---------- context : Context The target context we want the return value to live in. Returns ------- A copy or `self` as an `NDArray` that lives in the target context.
One hot encoding indices into matrix out. Parameters ---------- indices: NDArray An NDArray containing indices of the categorical features. out: NDArray The result holder of the encoding. Returns ------- out: Array Same as out.
Helper function for element-wise operation The function will perform numpy-like broadcasting if needed and call different functions Parameters ---------- lhs : NDArray or numeric value left hande side operand rhs : NDArray or numeric value right hand side operand fn_array : function function to be called if both lhs and rhs are of NDArray type lfn_scalar : function function to be called if lhs is NDArray while rhs is numeric value rfn_scalar : function function to be called if lhs is numeric value while rhs is NDArray; if none is provided, then the function is commutative, so rfn_scalar is equal to lfn_scalar Returns ------- out: NDArray result array
Perform element-wise addition Parameters ---------- $other : Array of float value right hand side operand $reverse : Boolean, if true, reverses $self and $other Returns ------- out: Array result array
Perform element-wise subtract Parameters ---------- $other : Array of float value right hand side operand $reverse : Boolean, if true, reverses $self and $other Returns ------- out: Array result array
Perform element-wise multiplication Parameters ---------- $other : Array of float value right hand side operand $reverse : Boolean, if true, reverses $self and $other Returns ------- out: Array result array
Perform element-wise divide Parameters ---------- $other : Array of float value right hand side operand $reverse : Boolean, if true, reverses $self and $other Returns ------- out: Array result array
Perform element-wise power operator Parameters ---------- $other : Array of float value right hand side operand $reverse : Boolean, if true, reverses $self and $other Returns ------- out: Array result array
Perform maximum operator Parameters ---------- $other : Array of float value right hand side operand Returns ------- out: Array result array
Perform minimum operator Parameters ---------- $other : Array of float value right hand side operand Returns ------- out: Array result array
Return ($self == $other) element-wise Parameters ---------- $other : Array of float value right hand side operand $reverse : Boolean, if true, reverses $self and $other Returns ------- out: Array result array
Return ($self != $other) element-wise Parameters ---------- $other : Array of float value right hand side operand $reverse : Boolean, if true, reverses $self and $other Returns ------- out: Array result array
Return ($self > $other) element-wise Parameters ---------- $other : Array of float value right hand side operand $reverse : Boolean, if true, reverses $self and $other Returns ------- out: Array result array
Return ($self >= $other) element-wise Parameters ---------- $other : Array of float value right hand side operand $reverse : Boolean, if true, reverses $self and $other Returns ------- out: Array result array
Return ($self < $other) element-wise Parameters ---------- $other : Array of float value right hand side operand $reverse : Boolean, if true, reverses $self and $other Returns ------- out: Array result array
Return ($self <= $other) element-wise Parameters ---------- $other : Array of float value right hand side operand $reverse : Boolean, if true, reverses $self and $other Returns ------- out: Array result array
The same as divide
Create an empty uninitialized new NDArray, with specified shape. Parameters ---------- shape : ArrayRef shape of the NDArray. ctx : Context, optional The context of the NDArray, default to current default context. Returns ------- out: Array The created NDArray.
Create a new NDArray filled with 0, with specified shape. Parameters ---------- shape : ArrayRef shape of the NDArray. ctx : Context, optional. The context of the NDArray, default to current default context. Returns ------- out: Array The created NDArray.
Create a new NDArray filled with 1, with specified shape. Parameters ---------- shape : ArrayRef shape of the NDArray. ctx : Context, optional. The context of the NDArray, default to current default context. Returns ------- out: Array The created NDArray.
Create a new NDArray filled with given value, with specified shape. Parameters ---------- shape : ArrayRef shape of the NDArray. val : float or int value to be filled with. ctx : Context, optional. The context of the NDArray, default to current default context. Returns ------- out: Array The created NDArray.
Create a new NDArray that copies content from source_array. Parameters ---------- source_array : array_like Source data to create NDArray from. ctx : Context, optional The context of the NDArray, default to current default context. Returns ------- out: Array The created NDArray.
Concatenate a list of NDArrays along the first dimension. Parameters ---------- arrays : list of NDArray Arrays to be concatenate. They must have identical shape except the first dimension. They also must have the same data type. axis : int The axis along which to concatenate. always_copy : bool Default `True`. When not `True`, if the arrays only contain one `NDArray`, that element will be returned directly, avoid copying. Returns ------- An `NDArray` that lives on the same context as `arrays[0].context`.
Simlar function in the MXNet ndarray as numpy.arange See Also https://docs.scipy.org/doc/numpy/reference/generated/numpy.arange.html. Parameters ---------- start : number, optional Start of interval. The interval includes this value. The default start value is 0. stop : number, optional End of interval. The interval does not include this value. step : number, optional Spacing between values repeat : number, optional "The repeating time of all elements. E.g repeat=3, the element a will be repeated three times --> a, a, a. ctx : Context, optional The context of the NDArray, default to current default context. dtype : type, optional The value type of the NDArray, default to np.float32 Returns ------- out : NDArray The created NDArray
Load ndarray from binary file. You can also use Storable to do the job if you only work on perl. The advantage of load/save is the file is language agnostic. This means the file saved using save can be loaded by other language binding of mxnet. You also get the benefit being able to directly load/save from cloud storage(S3, HDFS) Parameters ---------- fname : str The name of the file.Can be S3 or HDFS address (remember built with S3 support). Example of fname: - `s3://my-bucket/path/my-s3-ndarray` - `hdfs://my-bucket/path/my-hdfs-ndarray` - `/path-to/my-local-ndarray` Returns ------- out : list of NDArray or dict of str to NDArray List of NDArray or dict of str->NDArray, depending on what was saved.
Save array of NDArray or hash of str->NDArray to binary file. You can also use Storable to do the job if you only work on perl. The advantage of load/save is the file is language agnostic. This means the file saved using save can be loaded by other language binding of mxnet. You also get the benefit being able to directly load/save from cloud storage(S3, HDFS) Parameters ---------- fname : str The name of the file.Can be S3 or HDFS address (remember built with S3 support). Example of fname: - `s3://my-bucket/path/my-s3-ndarray` - `hdfs://my-bucket/path/my-hdfs-ndarray` - `/path-to/my-local-ndarray` data : list of NDArray or dict of str to NDArray The data to be saved.
Decode an image from string. Requires OpenCV to work. Parameters ---------- str_img : str binary image data clip_rect : iterable of 4 int clip decoded image to rectangle (x0, y0, x1, y1) out : NDArray output buffer. can be 3 dimensional (c, h, w) or 4 dimensional (n, c, h, w) index : int output decoded image to i-th slice of 4 dimensional buffer channels : int number of channels to output. Decode to grey scale when channels = 1. mean : NDArray subtract mean from decode image before outputing.
"""Return a new empty handle. Empty handle can be used to hold result Returns ------- a new empty ndarray handle """
Return a new handle with specified shape and context. Empty handle is only used to hold results Returns ------- a new empty ndarray handle
This function is used for benchmark only """
2 POD Errors
The following errors were encountered while parsing the POD:
Unknown directive: =head
To install AI::MXNet, copy and paste the appropriate command in to your terminal.
cpanm
cpanm AI::MXNet
CPAN shell
perl -MCPAN -e shell install AI::MXNet
For more information on module installation, please visit the detailed CPAN module installation guide.