mxnet
Public Member Functions | Public Attributes | Friends | List of all members
mxnet::cpp::Executor Class Reference

Executor interface. More...

#include <executor.h>

Collaboration diagram for mxnet::cpp::Executor:
Collaboration graph

Public Member Functions

 Executor (const Symbol &symbol, Context context, const std::vector< NDArray > &arg_arrays, const std::vector< NDArray > &grad_arrays, const std::vector< OpReqType > &grad_reqs, const std::vector< NDArray > &aux_arrays, const std::map< std::string, Context > &group_to_ctx=std::map< std::string, Context >(), Executor *shared_exec=nullptr)
 
 Executor (const ExecutorHandle &h)
 
void Forward (bool is_train)
 Perform a Forward operation of Operator After this operation, user can get the result by using function head. More...
 
void Backward (const std::vector< NDArray > &head_grads=std::vector< NDArray >())
 Perform a Backward operation of the Operator. This must be called after Forward. After this operation, NDArrays specified by grad_in_args_store will be updated accordingly. User is allowed to pass in an empty Array if the head node is loss function and head gradeitn is not needed. More...
 
void Reshape ()
 
std::string DebugStr ()
 update the arguments with given learning rate and optimizer More...
 
 ~Executor ()
 destructor, free the handle More...
 
std::map< std::string, NDArrayarg_dict ()
 
std::map< std::string, NDArraygrad_dict ()
 
std::map< std::string, NDArrayaux_dict ()
 

Public Attributes

std::vector< NDArrayarg_arrays
 
std::vector< NDArraygrad_arrays
 
std::vector< NDArrayaux_arrays
 
std::vector< NDArrayoutputs
 arrays store the outputs of forward More...
 

Friends

class Monitor
 

Detailed Description

Executor interface.

Constructor & Destructor Documentation

mxnet::cpp::Executor::Executor ( const Symbol symbol,
Context  context,
const std::vector< NDArray > &  arg_arrays,
const std::vector< NDArray > &  grad_arrays,
const std::vector< OpReqType > &  grad_reqs,
const std::vector< NDArray > &  aux_arrays,
const std::map< std::string, Context > &  group_to_ctx = std::map< std::string, Context >(),
Executor shared_exec = nullptr 
)
mxnet::cpp::Executor::Executor ( const ExecutorHandle h)
inlineexplicit
mxnet::cpp::Executor::~Executor ( )
inline

destructor, free the handle

Member Function Documentation

std::map<std::string, NDArray> mxnet::cpp::Executor::arg_dict ( )
inline
std::map<std::string, NDArray> mxnet::cpp::Executor::aux_dict ( )
inline
void mxnet::cpp::Executor::Backward ( const std::vector< NDArray > &  head_grads = std::vector<NDArray>())
inline

Perform a Backward operation of the Operator. This must be called after Forward. After this operation, NDArrays specified by grad_in_args_store will be updated accordingly. User is allowed to pass in an empty Array if the head node is loss function and head gradeitn is not needed.

Parameters
head_gradsthe gradient of head nodes to be backproped.
std::string mxnet::cpp::Executor::DebugStr ( )

update the arguments with given learning rate and optimizer

Returns
the SymbolHandle
void mxnet::cpp::Executor::Forward ( bool  is_train)
inline

Perform a Forward operation of Operator After this operation, user can get the result by using function head.

std::map<std::string, NDArray> mxnet::cpp::Executor::grad_dict ( )
inline
void mxnet::cpp::Executor::Reshape ( )

Friends And Related Function Documentation

friend class Monitor
friend

Member Data Documentation

std::vector<NDArray> mxnet::cpp::Executor::arg_arrays
std::vector<NDArray> mxnet::cpp::Executor::aux_arrays
std::vector<NDArray> mxnet::cpp::Executor::grad_arrays
std::vector<NDArray> mxnet::cpp::Executor::outputs

arrays store the outputs of forward


The documentation for this class was generated from the following file: