Executor is the actual executing object of MXNet. def __init__(self, handle, symbol, ctx, grad_req, group2ctx): """Constructor, used Symbol.bind and Symbol.simple_bind instead. Parameters ---------- handle: ExecutorHandle ExecutorHandle generated by calling Bind See Also -------- Symbol.bind : to create executor
list all the output ndarray Returns ------- A list of ndarray bound to the heads of executor.
Parameters ---------- is_train: bool, optional whether this forward is for evaluation purpose. **kwargs Additional specification of input arguments. Examples -------- >>> # doing forward by specifying data >>> $texec->forward(1, data => $mydata); >>> # doing forward by not specifying things, but copy to the executor before hand >>> $mydata->copyto($texec->arg_dict->{'data'}); >>> $texec->forward(1); >>> # doing forward by specifying data and get outputs >>> my $outputs = $texec->forward(1, data => $mydata); >>> print $outputs->[0]->aspdl;
Do backward pass to get the gradient of arguments. Parameters ---------- out_grads : NDArray or list of NDArray or dict of str to NDArray, optional Gradient on the outputs to be propagated back. This parameter is only needed when bind is called on outputs that are not a loss function.
Install callback. Parameters ---------- callback : subref Takes a string and an NDArrayHandle.
Get dictionary representation of argument arrrays. Returns ------- arg_dict : dict of str to NDArray The dictionary that maps name of arguments to NDArrays. Raises ------ ValueError : if there are duplicated names in the arguments.
Get dictionary representation of gradient arrays. Returns ------- grad_dict : dict of str to NDArray The dictionary that maps name of arguments to gradient arrays.
Get dictionary representation of auxiliary states arrrays. Returns ------- aux_dict : dict of str to NDArray The dictionary that maps name of auxiliary states to NDArrays. Raises ------ ValueError : if there are duplicated names in the arguments.
Get dictionary representation of argument arrrays. Returns ------- output_dict : dict of str to NDArray The dictionary that maps name of arguments to NDArrays. Raises ------ ValueError : if there are duplicated names in the arguments.
Copy parameters from arg_params, aux_params into executor's internal array. Parameters ---------- arg_params : dict of str to NDArray Parameters, dict of name to NDArray of arguments aux_params : dict of str to NDArray, optional Parameters, dict of name to NDArray of auxiliary states. allow_extra_params : boolean, optional Whether allow extra parameters that are not needed by symbol If this is True, no error will be thrown when arg_params or aux_params contain extra parameters that is not needed by the executor. Raises ------ ValueError If there is additional parameters in the dict but allow_extra_params=False
Return a new executor with the same symbol and shared memory, but different input/output shapes. For runtime reshaping, variable length sequences, etc. The returned executor shares state with the current one, and cannot be used in parallel with it. Parameters ---------- partial_shaping : bool Whether to allow changing the shape of unspecified arguments. allow_up_sizing : bool Whether to allow allocating new ndarrays that's larger than the original. kwargs : dict of string to tuple of int new shape for arguments. Returns ------- exec : Executor A new executor that shares memory with self.
Get a debug string about internal execution plan. Returns ------- debug_str : string Debug string of the executor.
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.