mxnet
|
namespace of mxnet More...
Namespaces | |
common | |
cpp | |
csr | |
engine | |
namespace of engine internal types. | |
op | |
namespace of arguments | |
rowsparse | |
rtc | |
Classes | |
struct | Context |
Context information about the execution environment. More... | |
struct | DataBatch |
DataBatch of NDArray, returned by Iterator. More... | |
struct | DataInst |
a single data instance More... | |
struct | DataIteratorReg |
Registry entry for DataIterator factory functions. More... | |
class | Engine |
Dependency engine that schedules operations. More... | |
class | Executor |
Executor of a computation graph. Executor can be created by Binding a symbol. More... | |
class | IIterator |
iterator type More... | |
class | Imperative |
runtime functions for NDArray More... | |
class | KVStore |
distributed key-value store More... | |
class | NDArray |
ndarray interface More... | |
struct | NDArrayFunctionReg |
Registry entry for NDArrayFunction. More... | |
struct | OpContext |
All the possible information needed by Operator.Forward and Backward This is the superset of RunContext. We use this data structure to bookkeep everything needed by Forward and Backward. More... | |
class | Operator |
Operator interface. Operator defines basic operation unit of optimized computation graph in mxnet. This interface relies on pre-allocated memory in TBlob, the caller need to set the memory region in TBlob correctly before calling Forward and Backward. More... | |
class | OperatorProperty |
OperatorProperty is a object that stores all information about Operator. It also contains method to generate context(device) specific operators. More... | |
struct | OperatorPropertyReg |
Registry entry for OperatorProperty factory functions. More... | |
class | OpStatePtr |
Operator state. This is a pointer type, its content is mutable even if OpStatePtr is const. More... | |
struct | Resource |
Resources used by mxnet operations. A resource is something special other than NDArray, but will still participate. More... | |
class | ResourceManager |
Global resource manager. More... | |
struct | ResourceRequest |
The resources that can be requested by Operator. More... | |
struct | RunContext |
execution time context. The information needed in runtime for actual execution. More... | |
class | Storage |
Storage manager across multiple devices. More... | |
class | TBlob |
tensor blob class that can be used to hold tensor of any dimension, any device and any data type, This is a weak type that can be used to transfer data through interface TBlob itself do not involve any arithmentic operations, but it can be converted to tensor of fixed dimension for further operations More... | |
Typedefs | |
typedef mshadow::cpu | cpu |
mxnet cpu More... | |
typedef mshadow::gpu | gpu |
mxnet gpu More... | |
typedef mshadow::index_t | index_t |
index type usually use unsigned More... | |
typedef mshadow::default_real_t | real_t |
data type that will be used to store ndarray More... | |
using | TShape = nnvm::TShape |
Shape data structure used to record shape information. More... | |
using | Op = nnvm::Op |
operator structure from NNVM More... | |
using | StorageTypeVector = std::vector< int > |
The result holder of storage type of each NodeEntry in the graph. More... | |
using | DispatchModeVector = std::vector< DispatchMode > |
The result holder of dispatch mode of each Node in the graph. More... | |
using | CachedOpPtr = std::shared_ptr< Imperative::CachedOp > |
typedef std::function< IIterator< DataBatch > *()> | DataIteratorFactory |
typedef the factory function of data iterator More... | |
typedef std::function< void(NDArray **used_vars, real_t *scalars, NDArray **mutate_vars, int num_params, char **param_keys, char **param_vals)> | NDArrayAPIFunction |
definition of NDArray function More... | |
using | FCreateOpState = std::function< OpStatePtr(const NodeAttrs &attrs, Context ctx, const std::vector< TShape > &in_shape, const std::vector< int > &in_type)> |
Create a Layer style, forward/backward operator. This is easy to write code that contains state. OpStatePtr is a pointer type, it's content is mutable even if OpStatePtr is constant. More... | |
using | FExecType = std::function< ExecType(const NodeAttrs &attrs)> |
Execution mode of this operator. More... | |
using | FStatefulCompute = std::function< void(const OpStatePtr &state, const OpContext &ctx, const std::vector< TBlob > &inputs, const std::vector< OpReqType > &req, const std::vector< TBlob > &outputs)> |
Resiger a compute function for stateful operator. OpStatePtr is a pointer type, it's content is mutable even if OpStatePtr is constant. More... | |
using | FStatefulComputeEx = std::function< void(const OpStatePtr &state, const OpContext &ctx, const std::vector< NDArray > &inputs, const std::vector< OpReqType > &req, const std::vector< NDArray > &outputs)> |
Resiger a compute function for stateful operator using NDArray interface. OpStatePtr is a pointer type, it's content is mutable even if OpStatePtr is constant. More... | |
using | FResourceRequest = std::function< std::vector< ResourceRequest >(const NodeAttrs &n)> |
The resource request from the operator. More... | |
using | FNDArrayFunction = std::function< void(const nnvm::NodeAttrs &attrs, const std::vector< NDArray > &inputs, std::vector< NDArray > *outputs)> |
Register an operator called as a NDArray function. More... | |
using | FCompute = std::function< void(const nnvm::NodeAttrs &attrs, const OpContext &ctx, const std::vector< TBlob > &inputs, const std::vector< OpReqType > &req, const std::vector< TBlob > &outputs)> |
Resiger a compute function for simple stateless forward only operator. More... | |
using | FComputeEx = std::function< void(const nnvm::NodeAttrs &attrs, const OpContext &ctx, const std::vector< NDArray > &inputs, const std::vector< OpReqType > &req, const std::vector< NDArray > &outputs)> |
Resiger an NDArray compute function for simple stateless forward only operator. More... | |
using | FInferStorageType = std::function< bool(const NodeAttrs &attrs, const int dev_mask, DispatchMode *dispatch_mode, std::vector< int > *in_attrs, std::vector< int > *out_attrs)> |
Resiger a storage and dispatch mode inference function based on storage types of the inputs and outputs, and the dev_mask for the operator. More... | |
typedef std::function< OperatorProperty *()> | OperatorPropertyFactory |
typedef the factory function of operator property More... | |
Functions | |
size_t | num_aux_data (NDArrayStorageType stype) |
void | CopyFromTo (const NDArray &from, const NDArray *to, int priority=0) |
issue an copy operation from one NDArray to another the two ndarray can sit on different devices this operation will be scheduled by the engine More... | |
void | CopyFromTo (const NDArray &from, const NDArray &to, int priority=0) |
issue an copy operation from one NDArray to another the two ndarray can sit on different devices this operation will be scheduled by the engine More... | |
void | ElementwiseSum (const std::vector< NDArray > &source, NDArray *out, int priority=0) |
Perform elementwise sum over each data from source, store result into out. More... | |
NDArray | operator+ (const NDArray &lhs, const NDArray &rhs) |
elementwise add More... | |
NDArray | operator+ (const NDArray &lhs, const real_t &rhs) |
elementwise add More... | |
NDArray | operator- (const NDArray &lhs, const NDArray &rhs) |
elementwise subtraction More... | |
NDArray | operator- (const NDArray &lhs, const real_t &rhs) |
elementwise subtraction More... | |
NDArray | operator* (const NDArray &lhs, const NDArray &rhs) |
elementwise multiplication More... | |
NDArray | operator* (const NDArray &lhs, const real_t &rhs) |
elementwise multiplication More... | |
NDArray | operator/ (const NDArray &lhs, const NDArray &rhs) |
elementwise division More... | |
NDArray | operator/ (const NDArray &lhs, const real_t &rhs) |
elementwise division More... | |
void | RandomSeed (uint32_t seed) |
Seed the random number generator. More... | |
void | SampleUniform (real_t begin, real_t end, NDArray *out) |
Sample uniform distribution for each elements of out. More... | |
void | SampleGaussian (real_t mu, real_t sigma, NDArray *out) |
Sample gaussian distribution for each elements of out. More... | |
void | SampleGamma (real_t alpha, real_t beta, NDArray *out) |
Sample gamma distribution for each elements of out. More... | |
void | SampleExponential (real_t lambda, NDArray *out) |
Sample exponential distribution for each elements of out. More... | |
void | SamplePoisson (real_t lambda, NDArray *out) |
Sample Poisson distribution for each elements of out. More... | |
void | SampleNegBinomial (int32_t k, real_t p, NDArray *out) |
Sample negative binomial distribution for each elements of out. More... | |
void | SampleGenNegBinomial (real_t mu, real_t alpha, NDArray *out) |
Sample generalized negative binomial distribution for each elements of out. More... | |
namespace of mxnet
Macros/inlines to assist CLion to parse Cuda files (*.cu, *.cuh)
Copyright (c) 2015 by Contributors
using mxnet::CachedOpPtr = typedef std::shared_ptr<Imperative::CachedOp> |
typedef mshadow::cpu mxnet::cpu |
mxnet cpu
typedef std::function<IIterator<DataBatch> *()> mxnet::DataIteratorFactory |
typedef the factory function of data iterator
using mxnet::DispatchModeVector = typedef std::vector<DispatchMode> |
The result holder of dispatch mode of each Node in the graph.
using mxnet::FCompute = typedef std::function<void (const nnvm::NodeAttrs& attrs, const OpContext& ctx, const std::vector<TBlob>& inputs, const std::vector<OpReqType>& req, const std::vector<TBlob>& outputs)> |
Resiger a compute function for simple stateless forward only operator.
using mxnet::FComputeEx = typedef std::function<void (const nnvm::NodeAttrs& attrs, const OpContext& ctx, const std::vector<NDArray>& inputs, const std::vector<OpReqType>& req, const std::vector<NDArray>& outputs)> |
Resiger an NDArray compute function for simple stateless forward only operator.
using mxnet::FCreateOpState = typedef std::function<OpStatePtr (const NodeAttrs& attrs, Context ctx, const std::vector<TShape>& in_shape, const std::vector<int>& in_type)> |
Create a Layer style, forward/backward operator. This is easy to write code that contains state. OpStatePtr is a pointer type, it's content is mutable even if OpStatePtr is constant.
This is not the only way to register an op execution function. More simpler or specialized operator form can be registered
using mxnet::FExecType = typedef std::function<ExecType (const NodeAttrs& attrs)> |
Execution mode of this operator.
using mxnet::FInferStorageType = typedef std::function<bool (const NodeAttrs& attrs, const int dev_mask, DispatchMode* dispatch_mode, std::vector<int>* in_attrs, std::vector<int>* out_attrs)> |
Resiger a storage and dispatch mode inference function based on storage types of the inputs and outputs, and the dev_mask for the operator.
using mxnet::FNDArrayFunction = typedef std::function<void (const nnvm::NodeAttrs& attrs, const std::vector<NDArray>& inputs, std::vector<NDArray>* outputs)> |
Register an operator called as a NDArray function.
using mxnet::FResourceRequest = typedef std::function< std::vector<ResourceRequest> (const NodeAttrs& n)> |
The resource request from the operator.
using mxnet::FStatefulCompute = typedef std::function<void (const OpStatePtr& state, const OpContext& ctx, const std::vector<TBlob>& inputs, const std::vector<OpReqType>& req, const std::vector<TBlob>& outputs)> |
Resiger a compute function for stateful operator. OpStatePtr is a pointer type, it's content is mutable even if OpStatePtr is constant.
using mxnet::FStatefulComputeEx = typedef std::function<void (const OpStatePtr& state, const OpContext& ctx, const std::vector<NDArray>& inputs, const std::vector<OpReqType>& req, const std::vector<NDArray>& outputs)> |
Resiger a compute function for stateful operator using NDArray interface. OpStatePtr is a pointer type, it's content is mutable even if OpStatePtr is constant.
typedef mshadow::gpu mxnet::gpu |
mxnet gpu
typedef mshadow::index_t mxnet::index_t |
index type usually use unsigned
typedef std::function<void (NDArray **used_vars, real_t *scalars, NDArray **mutate_vars, int num_params, char **param_keys, char **param_vals)> mxnet::NDArrayAPIFunction |
definition of NDArray function
using mxnet::Op = typedef nnvm::Op |
operator structure from NNVM
typedef std::function<OperatorProperty *()> mxnet::OperatorPropertyFactory |
typedef the factory function of operator property
typedef mshadow::default_real_t mxnet::real_t |
data type that will be used to store ndarray
using mxnet::StorageTypeVector = typedef std::vector<int> |
The result holder of storage type of each NodeEntry in the graph.
using mxnet::TShape = typedef nnvm::TShape |
Shape data structure used to record shape information.
|
strong |
|
strong |
the execution type of the operator
Enumerator | |
---|---|
kSync |
Forward/Backward are synchronize calls. |
kAsync |
Forward/Backward are asynchronize, will call OpContext.async_on_complete when operation finishes. |
kCrossDeviceCopy |
Cross device copy operation, this is a special operator That indicates copy across devices, the input and output can sit on different device. In current implementation, copy operator is specially handled by executor. This flag is used for special case treatment and future extension of different copy ops. |
|
strong |
Function property, used to hint what action is pushed to engine.
mask information on how functions can be exposed
Enumerator | |
---|---|
kNDArrayArgBeforeScalar |
all the use_vars should go before scalar |
kScalarArgBeforeNDArray |
all the scalar should go before use_vars |
kAcceptEmptyMutateTarget |
whether this function allows the handles in the target to be empty NDArray that are not yet initialized, and will initialize them when the function is invoked. most function should support this, except copy between different devices, which requires the NDArray to be pre-initialized with context |
enum mxnet::OpReqType |
issue an copy operation from one NDArray to another the two ndarray can sit on different devices this operation will be scheduled by the engine
from | the ndarray we want to copy data from |
to | the target ndarray |
priority | Priority of the action. |
issue an copy operation from one NDArray to another the two ndarray can sit on different devices this operation will be scheduled by the engine
from | the ndarray we want to copy data from |
to | the target ndarray |
priority | Priority of the action. |
void mxnet::ElementwiseSum | ( | const std::vector< NDArray > & | source, |
NDArray * | out, | ||
int | priority = 0 |
||
) |
Perform elementwise sum over each data from source, store result into out.
source | the ndarray we want to sum |
out | the target ndarray |
priority | Priority of the action. |
size_t mxnet::num_aux_data | ( | NDArrayStorageType | stype | ) |
elementwise multiplication
lhs | left operand |
rhs | right operand |
elementwise multiplication
lhs | left operand |
rhs | right operand |
elementwise add
lhs | left operand |
rhs | right operand |
elementwise add
lhs | left operand |
rhs | right operand |
elementwise subtraction
lhs | left operand |
rhs | right operand |
elementwise subtraction
lhs | left operand |
rhs | right operand |
elementwise division
lhs | left operand |
rhs | right operand |
elementwise division
lhs | left operand |
rhs | right operand |
void mxnet::RandomSeed | ( | uint32_t | seed | ) |
Seed the random number generator.
seed | the seed to set to global random number generators. |
Sample exponential distribution for each elements of out.
lambda | parameter (rate) of the exponential distribution |
out | output NDArray. |
Sample gamma distribution for each elements of out.
alpha | parameter (shape) of the gamma distribution |
beta | parameter (scale) of the gamma distribution |
out | output NDArray. |
Sample gaussian distribution for each elements of out.
mu | mean of gaussian distribution. |
sigma | standard deviation of gaussian distribution. |
out | output NDArray. |
Sample generalized negative binomial distribution for each elements of out.
mu | parameter (mean) of the distribution |
alpha | parameter (over dispersion) of the distribution |
out | output NDArray. |
Sample negative binomial distribution for each elements of out.
k | failure limit |
p | success probability |
out | output NDArray. |
Sample Poisson distribution for each elements of out.
lambda | parameter (rate) of the Poisson distribution |
out | output NDArray. |