Tenncor
|
Namespaces | |
internal | |
Classes | |
struct | AnyConvr |
Implementation of optimization converter that represents any node. More... | |
struct | BuilderArg |
FuncArg equivalent for optimizer's IR of functor. More... | |
struct | Constant |
Constant implementation of Eigen leaf tensor. More... | |
struct | ConstantNode |
Constant's node wrapper. More... | |
struct | ConverterBuilder |
Optimization builder's implementation for building ETEQ nodes. More... | |
struct | CoordMap |
Eigen transformation wrapper implementation of iCoordMap. More... | |
struct | EADLoader |
PBM Unmarshaller implementation for loading ETEQ Nodes. More... | |
struct | EADSaver |
PBM Marshaller implementation for saving ETEQ Nodes. More... | |
struct | EigenMatOp |
Implementation of iEigen that assigns Matrix operator to Matrix object. More... | |
struct | EigenTensOp |
Implementation of iEigen that assigns Tensor operator to Tensor object. More... | |
struct | FuncArg |
Eigen node version of teq::FuncArg. More... | |
struct | FuncConvr |
Implementation of optimization converter that represents and builds functors. More... | |
struct | Functor |
Functor implementation of operable functor of Eigen operators. More... | |
struct | FunctorNode |
Functor's node wrapper. More... | |
struct | GradientBuilder |
ETEQ implementation of TEQ's Backward Propagation Builder. More... | |
struct | GroupConvr |
Implementation of optimization converter that represents and builds subgraphs of specific types. More... | |
struct | iEigen |
Interface of generic Eigen data wrapper. More... | |
struct | iLeaf |
iLeaf extension of TEQ iLeaf containing Eigen data objects More... | |
struct | iNode |
Interface node for wrapping typed tensor. More... | |
struct | iSession |
Session interface that tracks and rapidly updates subgraphs. More... | |
struct | NodeConverters |
Node registry of tensor types and tensor to node function. More... | |
struct | OpArg |
Raw data, shape, and transformation argument struct. More... | |
struct | ScalarConvr |
Implementation of optimization converter that represents and builds scalar constants. More... | |
struct | Session |
struct | ShapedArr |
Shaped array wraps around a vector and shape. More... | |
struct | Variable |
Leaf node implementation containing mutable Eigen data. More... | |
struct | VariableNode |
Variable's node wrapper. More... | |
Typedefs | |
using | CoordptrT = std::shared_ptr< CoordMap > |
Type of iCoordMap smartpointer. More... | |
using | DimensionsT = std::array< Eigen::Index, 8 > |
Eigen shape. More... | |
template<typename T > | |
using | MatrixT = Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > |
Eigen Matrix. More... | |
template<typename T > | |
using | MatMapT = Eigen::Map< MatrixT< T > > |
Eigen Matrix Map (reference) More... | |
template<typename T > | |
using | TensorT = Eigen::Tensor< T, 8 > |
Eigen Tensor. More... | |
template<typename T > | |
using | TensMapT = Eigen::TensorMap< TensorT< T > > |
Eigen Tensor Map (reference) More... | |
template<typename T > | |
using | EigenptrT = std::shared_ptr< iEigen< T > > |
Smart point of generic Eigen data object. More... | |
template<typename T > | |
using | ArgsT = std::vector< FuncArg< T > > |
Type of typed functor arguments. More... | |
template<typename T > | |
using | NodeptrT = std::shared_ptr< iNode< T > > |
Smart pointer of node. More... | |
template<typename T > | |
using | NodesT = std::vector< NodeptrT< T > > |
Vector of nodes. More... | |
template<typename T > | |
using | NodeBuilderF = std::function< NodeptrT< T >(teq::TensptrT)> |
Function for building a node from tensor. More... | |
template<typename OP , size_t N, typename T > | |
using | ReduceOutT = Eigen::TensorReductionOp< OP, const std::array< teq::RankT, N >, const TensMapT< T > > |
Generic Eigen reduction operator. More... | |
using | BuilderArgsT = std::vector< BuilderArg > |
Vector of FuncArg. More... | |
using | EngineT = std::default_random_engine |
RNG engine used. More... | |
template<typename T > | |
using | GenF = std::function< T()> |
Function that returns a generated number. More... | |
template<typename T > | |
using | VarptrT = std::shared_ptr< VariableNode< T > > |
Smart pointer of variable nodes to preserve assign functions. More... | |
Functions | |
template<typename T > | |
NodeptrT< T > | make_constant_scalar (T scalar, teq::Shape shape) |
Return constant node given scalar and shape. More... | |
template<typename T > | |
NodeptrT< T > | make_constant (T *data, teq::Shape shape) |
Return constant node given raw array and shape. More... | |
CoordptrT | reduce (std::vector< teq::RankT > red_dims) |
Return CoordMap wrapper of reduction dimensions. More... | |
CoordptrT | extend (teq::RankT rank, std::vector< teq::DimT > ext) |
Return CoordMap wrapper of extension parameters. More... | |
CoordptrT | permute (std::vector< teq::RankT > dims) |
Return CoordMap wrapper of permute indices. More... | |
template<typename T > | |
MatMapT< T > | tens_to_matmap (TensorT< T > &tens) |
Return Matrix Map given Tensor. More... | |
template<typename T > | |
MatMapT< T > | mat_to_matmap (MatrixT< T > &mat) |
Return Map of Matrix. More... | |
template<typename T > | |
MatMapT< T > | tensmap_to_matmap (TensMapT< T > &tens) |
Return Matrix Map of Tensor Map. More... | |
template<typename T > | |
TensMapT< T > | mat_to_tensmap (MatrixT< T > &mat) |
Return Tensor Map of Matrix. More... | |
template<typename T > | |
TensMapT< T > | tens_to_tensmap (TensorT< T > &tens) |
Return Tensor Map of Tensor. More... | |
template<typename T , typename EigenSource , typename EigenArgs > | |
EigenptrT< T > | make_eigentensor (DimensionsT dims, std::function< EigenSource(EigenArgs &)> make_base, EigenArgs args) |
template<typename T , typename EigenSource , typename EigenArgs > | |
EigenptrT< T > | make_eigenmatrix (DimensionsT dims, std::function< EigenSource(EigenArgs &)> make_base, EigenArgs args) |
template<typename T > | |
TensorT< T > | make_tensor (const teq::Shape &shape) |
Return Eigen Tensor filled with 0s given teq Shape. More... | |
template<typename T > | |
MatMapT< T > | make_matmap (T *data, const teq::Shape &shape) |
Return Eigen Matrix given raw data and teq Shape. More... | |
template<typename T > | |
TensMapT< T > | make_tensmap (T *data, const teq::Shape &shape) |
Return Eigen Tensor given raw data and teq Shape. More... | |
template<typename T > | |
teq::Shape | get_shape (const TensorT< T > &tens) |
Return the teq Shape representation of Eigen Tensor. More... | |
template<typename T > | |
teq::Shape | get_shape (const TensMapT< T > &tens) |
Return the teq Shape representation of Eigen Tensor Map. More... | |
DimensionsT | shape_convert (teq::Shape shape) |
Return Eigen shape of teq Shape. More... | |
template<typename T > | |
FuncArg< T > | identity_map (NodeptrT< T > node) |
Return FuncArg<T> that identity maps input tensor. More... | |
template<typename T > | |
FuncArg< T > | reduce_map (NodeptrT< T > node, teq::RankT offset, teq::RankT ndims) |
template<typename T > | |
FuncArg< T > | extend_map (NodeptrT< T > node, teq::RankT rank, std::vector< teq::DimT > ext) |
template<typename T > | |
FuncArg< T > | permute_map (NodeptrT< T > node, std::vector< teq::RankT > order) |
template<typename T > | |
FuncArg< T > | slice_map (NodeptrT< T > node, teq::RankT offset, teq::RankT extent, teq::RankT dimension) |
template<typename T > | |
FuncArg< T > | pad_map (NodeptrT< T > node, const std::pair< teq::DimT, teq::DimT > &padding, teq::RankT dimension) |
template<typename T > | |
FuncArg< T > | stride_map (NodeptrT< T > node, const std::vector< teq::DimT > &incrs) |
template<typename T > | |
NodeptrT< T > | make_functor (teq::Opcode opcode, ArgsT< T > args) |
Return functor node given opcode and node arguments. More... | |
template<typename T > | |
NodeptrT< T > | reduce_grad (const teq::FuncArg &child, NodeptrT< T > bwd, size_t idx) |
Return reduction operator gradient of reduced functor node (bwd) More... | |
template<typename T > | |
NodeptrT< T > | permute_grad (teq::iFunctor *fwd, NodeptrT< T > bwd, size_t idx) |
Return permutation gradient of permuted functor node (bwd) More... | |
template<typename T > | |
NodeptrT< T > | extend_grad (teq::iFunctor *fwd, NodeptrT< T > bwd, size_t idx) |
Return extension gradient of extended functor node (bwd) More... | |
template<typename T > | |
NodeptrT< T > | derive (NodeptrT< T > root, NodeptrT< T > target) |
Derive root with respect to target and optimized. More... | |
template<typename TensType , typename T > | |
bool | register_builder (NodeBuilderF< T > builder) |
static bool | is_2d (teq::Shape shape) |
template<typename T > | |
EigenptrT< T > | reduce_sum (teq::Shape &outshape, const OpArg< T > &in) template< typename T > EigenptrT< T > reduce_prod(teq |
Return Eigen data object representing reduction where aggregation is sum. More... | |
template<typename T > | |
EigenptrT< T > | permute (teq::Shape &outshape, const OpArg< T > &in) |
Return Eigen data object representing transpose and permutation. More... | |
template<typename T > | |
EigenptrT< T > | slice (teq::Shape &outshape, const OpArg< T > &in) |
Return Eigen data object representing data slicing of dimensions. More... | |
template<typename T > | |
EigenptrT< T > | pad (teq::Shape &outshape, const OpArg< T > &in) |
Return Eigen data object representing data zero padding. More... | |
template<typename T > | |
EigenptrT< T > | stride (teq::Shape &outshape, const OpArg< T > &in) |
Return Eigen data object representing strided view of in. More... | |
template<typename T > | |
EigenptrT< T > | abs (teq::Shape &outshape, const OpArg< T > &in) |
template<typename T > | |
EigenptrT< T > | neg (teq::Shape &outshape, const OpArg< T > &in) |
template<typename T > | |
EigenptrT< T > | sin (teq::Shape &outshape, const OpArg< T > &in) |
template<typename T > | |
EigenptrT< T > | cos (teq::Shape &outshape, const OpArg< T > &in) |
template<typename T > | |
EigenptrT< T > | tan (teq::Shape &outshape, const OpArg< T > &in) |
template<typename T > | |
EigenptrT< T > | exp (teq::Shape &outshape, const OpArg< T > &in) |
template<typename T > | |
EigenptrT< T > | log (teq::Shape &outshape, const OpArg< T > &in) |
template<typename T > | |
EigenptrT< T > | sqrt (teq::Shape &outshape, const OpArg< T > &in) |
template<typename T > | |
EigenptrT< T > | round (teq::Shape &outshape, const OpArg< T > &in) |
template<typename T > | |
EigenptrT< T > | sigmoid (teq::Shape &outshape, const OpArg< T > &in) |
template<typename T > | |
EigenptrT< T > | sigmoid_grad (teq::Shape &outshape, const OpArg< T > &in) |
template<typename T > | |
EigenptrT< T > | tanh (teq::Shape &outshape, const OpArg< T > &in) |
template<typename T > | |
EigenptrT< T > | square (teq::Shape &outshape, const OpArg< T > &in) |
template<typename T > | |
EigenptrT< T > | cube (teq::Shape &outshape, const OpArg< T > &in) |
template<typename T > | |
EigenptrT< T > | pow (teq::Shape &outshape, const OpArg< T > &a, const OpArg< T > &b) |
template<typename T > | |
EigenptrT< T > | add (teq::Shape &outshape, const OpArg< T > &a, const OpArg< T > &b) |
template<typename T > | |
EigenptrT< T > | sub (teq::Shape &outshape, const OpArg< T > &a, const OpArg< T > &b) |
template<typename T > | |
EigenptrT< T > | mul (teq::Shape &outshape, const OpArg< T > &a, const OpArg< T > &b) |
template<typename T > | |
EigenptrT< T > | div (teq::Shape &outshape, const OpArg< T > &a, const OpArg< T > &b) |
template<typename T > | |
EigenptrT< T > | eq (teq::Shape &outshape, const OpArg< T > &a, const OpArg< T > &b) |
template<typename T > | |
EigenptrT< T > | neq (teq::Shape &outshape, const OpArg< T > &a, const OpArg< T > &b) |
template<typename T > | |
EigenptrT< T > | lt (teq::Shape &outshape, const OpArg< T > &a, const OpArg< T > &b) |
template<typename T > | |
EigenptrT< T > | gt (teq::Shape &outshape, const OpArg< T > &a, const OpArg< T > &b) |
template<typename T > | |
EigenptrT< T > | min (teq::Shape &outshape, const OpArg< T > &a, const OpArg< T > &b) |
template<typename T > | |
EigenptrT< T > | max (teq::Shape &outshape, const OpArg< T > &a, const OpArg< T > &b) |
template<typename T > | |
EigenptrT< T > | rand_uniform (teq::Shape &outshape, const OpArg< T > &a, const OpArg< T > &b) |
template<typename T > | |
EigenptrT< T > | select (teq::Shape &outshape, const OpArg< T > &condition, const OpArg< T > &then, const OpArg< T > &otherwise) |
template<typename T > | |
EigenptrT< T > | matmul (teq::Shape &outshape, const OpArg< T > &a, const OpArg< T > &b) |
template<typename T > | |
EigenptrT< T > | convolution (teq::Shape &outshape, const OpArg< T > &input, const OpArg< T > &kernel) |
Apply convolution of kernel across input. More... | |
template<typename T > | |
EigenptrT< T > | convolution_image_grad (teq::Shape &imageshape, const OpArg< T > &kernel, const OpArg< T > &super_composite) |
Applies the gradient of convolution with respect to image. More... | |
template<typename T > | |
EigenptrT< T > | convolution_kernel_grad (teq::Shape &kernelshape, const OpArg< T > &image, const OpArg< T > &super_composite) |
Applies the gradient of convolution with respect to kernel. More... | |
static std::vector< double > | vectorize (::NumList *list) |
static CoordptrT | coorderize (::NumList *list) |
template<typename T > | |
opt::OptCtx | parse (std::string content) |
Return optimization rules tied to ETEQ Builder specified in content. More... | |
template<typename T > | |
opt::OptCtx | parse_file (std::string filename) |
Return optimization rules tied to ETEQ Builder specified in file. More... | |
EngineT & | get_engine (void) |
Return global random generator. More... | |
template<typename T , typename std::enable_if< std::is_integral< T >::value >::type * = nullptr> | |
T | unif (const T &a, const T &b) |
Return uniformly generated number between a and b (integers only) More... | |
template<typename T , typename std::enable_if< std::is_integral< T >::value >::type * = nullptr> | |
GenF< T > | unif_gen (const T &a, const T &b) |
Return uniformly generator function that produces numbers between a and b (integers only) More... | |
template<typename T , typename std::enable_if<!std::is_integral< T >::value >::type * = nullptr> | |
GenF< T > | unif_gen (T a, T b) |
Return uniformly generator function that produces numbers between a and b (decimals only) More... | |
template<typename T , typename std::enable_if<!std::is_integral< T >::value >::type * = nullptr> | |
GenF< T > | norm_gen (T mean, T stdev) |
Return normally generator function that produces numbers with mean and stdev (decimals only) More... | |
static bool | is_big_endian (void) |
template<typename T > | |
NodeptrT< T > | convert_to_node (VarptrT< T > var) |
Return Node smart pointer of Variable smart pointer. More... | |
template<typename T > | |
VarptrT< T > | make_variable_scalar (T scalar, teq::Shape shape, std::string label="") |
Return variable node given scalar and shape. More... | |
template<typename T > | |
VarptrT< T > | make_variable (teq::Shape shape, std::string label="") |
Return zero-initialized variable node of specified shape. More... | |
template<typename T > | |
VarptrT< T > | make_variable (T *data, teq::Shape shape, std::string label="") |
Return variable node given raw array and shape. More... | |
Variables | |
static const size_t | label_limit = 5 |
static std::unordered_set< size_t > | non_bijectives |
constant.hpp eteq
Purpose: Implement constant leaf tensor
coord.hpp eteq
Purpose: Define Eigen transformation argument wrapper
eigen.hpp eteq
Purpose: Define Eigen tensor and matrix transformation functions
funcarg.hpp eteq
Purpose: Typed Eigen node version of teq::FuncArg
functor.hpp eteq
Purpose: Eigen functor implementation of operable func
grader.hpp eteq
Purpose: Implement eteq gradient definition for supported operations
ileaf.hpp eteq
Purpose: Define interfaces and building blocks for an equation graph
inode.hpp eteq
Purpose: Define node interface and registration and conversion objects
operator.hpp eteq
Purpose: Define functions manipulating tensor data values No function in this file makes any attempt to check for nullptrs
parse.hpp eteq
Purpose: Extend optimization module by defining ETEQ node parsing
random.hpp eteq
Purpose: Define randomization functions used in Eigen operators
serialize.hpp eteq
Purpose: Define functions for marshal and unmarshal data sources
session.hpp eteq
Purpose: Define and implement session that tracks subgraphs and rapidly updates the tracked graph or a portion of tracked graph
shaped_arr.hpp eteq
Purpose: Define a data-shape representation to feed in to the variable
variable.hpp eteq
Purpose: Define data structures for owning, and passing generalized and type-specific data
using eteq::ArgsT = typedef std::vector<FuncArg<T> > |
Type of typed functor arguments.
using eteq::BuilderArgsT = typedef std::vector<BuilderArg> |
Vector of FuncArg.
using eteq::CoordptrT = typedef std::shared_ptr<CoordMap> |
Type of iCoordMap smartpointer.
using eteq::DimensionsT = typedef std::array<Eigen::Index,8> |
Eigen shape.
using eteq::EigenptrT = typedef std::shared_ptr<iEigen<T> > |
Smart point of generic Eigen data object.
using eteq::EngineT = typedef std::default_random_engine |
RNG engine used.
using eteq::GenF = typedef std::function<T()> |
Function that returns a generated number.
using eteq::MatMapT = typedef Eigen::Map<MatrixT<T> > |
Eigen Matrix Map (reference)
using eteq::MatrixT = typedef Eigen::Matrix<T,Eigen::Dynamic,Eigen::Dynamic,Eigen::RowMajor> |
Eigen Matrix.
using eteq::NodeBuilderF = typedef std::function<NodeptrT<T>(teq::TensptrT)> |
Function for building a node from tensor.
using eteq::NodeptrT = typedef std::shared_ptr<iNode<T> > |
Smart pointer of node.
using eteq::NodesT = typedef std::vector<NodeptrT<T> > |
Vector of nodes.
using eteq::ReduceOutT = typedef Eigen::TensorReductionOp<OP, const std::array<teq::RankT,N>,const TensMapT<T> > |
Generic Eigen reduction operator.
using eteq::TensMapT = typedef Eigen::TensorMap<TensorT<T> > |
Eigen Tensor Map (reference)
using eteq::TensorT = typedef Eigen::Tensor<T,8> |
Eigen Tensor.
using eteq::VarptrT = typedef std::shared_ptr<VariableNode<T> > |
Smart pointer of variable nodes to preserve assign functions.
EigenptrT<T> eteq::abs | ( | teq::Shape & | outshape, |
const OpArg< T > & | in | ||
) |
Given reference to output array, and input vector ref, make output elements take absolute value of inputs
EigenptrT<T> eteq::add | ( | teq::Shape & | outshape, |
const OpArg< T > & | a, | ||
const OpArg< T > & | b | ||
) |
Return Node smart pointer of Variable smart pointer.
EigenptrT<T> eteq::convolution | ( | teq::Shape & | outshape, |
const OpArg< T > & | input, | ||
const OpArg< T > & | kernel | ||
) |
Apply convolution of kernel across input.
EigenptrT<T> eteq::convolution_image_grad | ( | teq::Shape & | imageshape, |
const OpArg< T > & | kernel, | ||
const OpArg< T > & | super_composite | ||
) |
Applies the gradient of convolution with respect to image.
EigenptrT<T> eteq::convolution_kernel_grad | ( | teq::Shape & | kernelshape, |
const OpArg< T > & | image, | ||
const OpArg< T > & | super_composite | ||
) |
Applies the gradient of convolution with respect to kernel.
EigenptrT<T> eteq::cos | ( | teq::Shape & | outshape, |
const OpArg< T > & | in | ||
) |
Given reference to output array, and input vector ref, make output elements take cosine of inputs
EigenptrT<T> eteq::cube | ( | teq::Shape & | outshape, |
const OpArg< T > & | in | ||
) |
Derive root with respect to target and optimized.
EigenptrT<T> eteq::div | ( | teq::Shape & | outshape, |
const OpArg< T > & | a, | ||
const OpArg< T > & | b | ||
) |
Given arguments a, and b, for every pair of mapped elements sharing the same index divide Only accept 2 arguments
EigenptrT<T> eteq::eq | ( | teq::Shape & | outshape, |
const OpArg< T > & | a, | ||
const OpArg< T > & | b | ||
) |
Given arguments a, and b, for every pair of mapped elements sharing the same index apply == operator Only accept 2 arguments
EigenptrT<T> eteq::exp | ( | teq::Shape & | outshape, |
const OpArg< T > & | in | ||
) |
Given reference to output array, and input vector ref, make output elements take exponent of inputs
CoordptrT eteq::extend | ( | teq::RankT | rank, |
std::vector< teq::DimT > | ext | ||
) |
Return CoordMap wrapper of extension parameters.
NodeptrT<T> eteq::extend_grad | ( | teq::iFunctor * | fwd, |
NodeptrT< T > | bwd, | ||
size_t | idx | ||
) |
Return extension gradient of extended functor node (bwd)
FuncArg<T> eteq::extend_map | ( | NodeptrT< T > | node, |
teq::RankT | rank, | ||
std::vector< teq::DimT > | ext | ||
) |
Return FuncArg<T> that extends input tensor by rank and extension vector E.g.: tensor w/ shape [2, 1, 1], rank = 1, ext = [3, 4] gets mapped to [2, 3, 4]
EngineT& eteq::get_engine | ( | void | ) |
Return global random generator.
teq::Shape eteq::get_shape | ( | const TensorT< T > & | tens | ) |
Return the teq Shape representation of Eigen Tensor.
teq::Shape eteq::get_shape | ( | const TensMapT< T > & | tens | ) |
Return the teq Shape representation of Eigen Tensor Map.
EigenptrT<T> eteq::gt | ( | teq::Shape & | outshape, |
const OpArg< T > & | a, | ||
const OpArg< T > & | b | ||
) |
Given arguments a, and b, for every pair of mapped elements sharing the same index apply > operator Only accept 2 arguments
Return FuncArg<T> that identity maps input tensor.
|
inlinestatic |
|
static |
EigenptrT<T> eteq::log | ( | teq::Shape & | outshape, |
const OpArg< T > & | in | ||
) |
Given reference to output array, and input vector ref, make output elements take natural log of inputs
EigenptrT<T> eteq::lt | ( | teq::Shape & | outshape, |
const OpArg< T > & | a, | ||
const OpArg< T > & | b | ||
) |
Given arguments a, and b, for every pair of mapped elements sharing the same index apply < operator Only accept 2 arguments
NodeptrT<T> eteq::make_constant | ( | T * | data, |
teq::Shape | shape | ||
) |
Return constant node given raw array and shape.
NodeptrT<T> eteq::make_constant_scalar | ( | T | scalar, |
teq::Shape | shape | ||
) |
Return constant node given scalar and shape.
|
inline |
Return Eigen Matrix wrapper given output shape, and Eigen operator creation and arguments
|
inline |
Return Eigen Tensor wrapper given output shape, and Eigen operator creation and arguments
NodeptrT<T> eteq::make_functor | ( | teq::Opcode | opcode, |
ArgsT< T > | args | ||
) |
Return functor node given opcode and node arguments.
|
inline |
Return Eigen Matrix given raw data and teq Shape.
|
inline |
Return Eigen Tensor given raw data and teq Shape.
|
inline |
Return Eigen Tensor filled with 0s given teq Shape.
VarptrT<T> eteq::make_variable | ( | teq::Shape | shape, |
std::string | label = "" |
||
) |
Return zero-initialized variable node of specified shape.
VarptrT<T> eteq::make_variable | ( | T * | data, |
teq::Shape | shape, | ||
std::string | label = "" |
||
) |
Return variable node given raw array and shape.
VarptrT<T> eteq::make_variable_scalar | ( | T | scalar, |
teq::Shape | shape, | ||
std::string | label = "" |
||
) |
Return variable node given scalar and shape.
Return Map of Matrix.
Return Tensor Map of Matrix.
EigenptrT<T> eteq::matmul | ( | teq::Shape & | outshape, |
const OpArg< T > & | a, | ||
const OpArg< T > & | b | ||
) |
Only applies to 2-d tensors Apply matrix multiplication of a and b
EigenptrT<T> eteq::max | ( | teq::Shape & | outshape, |
const OpArg< T > & | a, | ||
const OpArg< T > & | b | ||
) |
Given arguments, for every mapped index i in range [0:max_nelems], take the maximum all elements for all arguments
EigenptrT<T> eteq::min | ( | teq::Shape & | outshape, |
const OpArg< T > & | a, | ||
const OpArg< T > & | b | ||
) |
Given arguments, for every mapped index i in range [0:max_nelems], take the minimum all elements for all arguments
EigenptrT<T> eteq::mul | ( | teq::Shape & | outshape, |
const OpArg< T > & | a, | ||
const OpArg< T > & | b | ||
) |
EigenptrT<T> eteq::neg | ( | teq::Shape & | outshape, |
const OpArg< T > & | in | ||
) |
Given reference to output array, and input vector ref, make output elements take negatives of inputs
EigenptrT<T> eteq::neq | ( | teq::Shape & | outshape, |
const OpArg< T > & | a, | ||
const OpArg< T > & | b | ||
) |
Given arguments a, and b, for every pair of mapped elements sharing the same index apply != operator Only accept 2 arguments
GenF<T> eteq::norm_gen | ( | T | mean, |
T | stdev | ||
) |
Return normally generator function that produces numbers with mean and stdev (decimals only)
EigenptrT<T> eteq::pad | ( | teq::Shape & | outshape, |
const OpArg< T > & | in | ||
) |
Return Eigen data object representing data zero padding.
FuncArg<T> eteq::pad_map | ( | NodeptrT< T > | node, |
const std::pair< teq::DimT, teq::DimT > & | padding, | ||
teq::RankT | dimension | ||
) |
Return FuncArg<T> that pads tensor with 0s across specified dimension E.g.: tensor w/ shape [2, 3, 4], padding = {2,1}, dimension = 0 gets mapped to [5, 3, 4] where [0,:,:] and [3:5,:,:] are 0 (first, fourth, and fifth slices of the 1st dimension are 0)
opt::OptCtx eteq::parse | ( | std::string | content | ) |
Return optimization rules tied to ETEQ Builder specified in content.
opt::OptCtx eteq::parse_file | ( | std::string | filename | ) |
Return optimization rules tied to ETEQ Builder specified in file.
CoordptrT eteq::permute | ( | std::vector< teq::RankT > | dims | ) |
Return CoordMap wrapper of permute indices.
EigenptrT<T> eteq::permute | ( | teq::Shape & | outshape, |
const OpArg< T > & | in | ||
) |
Return Eigen data object representing transpose and permutation.
NodeptrT<T> eteq::permute_grad | ( | teq::iFunctor * | fwd, |
NodeptrT< T > | bwd, | ||
size_t | idx | ||
) |
Return permutation gradient of permuted functor node (bwd)
FuncArg<T> eteq::permute_map | ( | NodeptrT< T > | node, |
std::vector< teq::RankT > | order | ||
) |
Return FuncArg<T> that permutes input tensor by order E.g.: tensor w/ shape [2, 3, 4], order = [1, 2, 0] gets mapped to [3, 4, 2]
EigenptrT<T> eteq::pow | ( | teq::Shape & | outshape, |
const OpArg< T > & | a, | ||
const OpArg< T > & | b | ||
) |
Given arguments a, and b, for every pair of mapped elements sharing the same index apply std::pow operator Only accept 2 arguments
EigenptrT<T> eteq::rand_uniform | ( | teq::Shape & | outshape, |
const OpArg< T > & | a, | ||
const OpArg< T > & | b | ||
) |
Given arguments a, and b, for every pair of mapped elements sharing the same index apply std::uniform_distributon function Only accept 2 arguments
CoordptrT eteq::reduce | ( | std::vector< teq::RankT > | red_dims | ) |
Return CoordMap wrapper of reduction dimensions.
NodeptrT<T> eteq::reduce_grad | ( | const teq::FuncArg & | child, |
NodeptrT< T > | bwd, | ||
size_t | idx | ||
) |
Return reduction operator gradient of reduced functor node (bwd)
FuncArg<T> eteq::reduce_map | ( | NodeptrT< T > | node, |
teq::RankT | offset, | ||
teq::RankT | ndims | ||
) |
Return FuncArg<T> that reduces input tensor by units in reduction vector after specified rank E.g.: tensor w/ shape [2, 3, 4], offset = 1, ndims = 2 gets mapped to [2, 1, 1]
EigenptrT<T> eteq::reduce_sum | ( | teq::Shape & | outshape, |
const OpArg< T > & | in | ||
) |
Return Eigen data object representing reduction where aggregation is sum.
Return Eigen data object representing reduction where aggregation is prod
bool eteq::register_builder | ( | NodeBuilderF< T > | builder | ) |
Return true if tensor type successfully registers and maps to node builder, otherwise false
EigenptrT<T> eteq::round | ( | teq::Shape & | outshape, |
const OpArg< T > & | in | ||
) |
Given reference to output array, and input vector ref, make output elements take rounded values of inputs
EigenptrT<T> eteq::select | ( | teq::Shape & | outshape, |
const OpArg< T > & | condition, | ||
const OpArg< T > & | then, | ||
const OpArg< T > & | otherwise | ||
) |
Given a condition, then values and otherwise apply corresponding then value if condition is non-zero otherwise apply otherwise value
DimensionsT eteq::shape_convert | ( | teq::Shape | shape | ) |
Return Eigen shape of teq Shape.
EigenptrT<T> eteq::sigmoid | ( | teq::Shape & | outshape, |
const OpArg< T > & | in | ||
) |
EigenptrT<T> eteq::sigmoid_grad | ( | teq::Shape & | outshape, |
const OpArg< T > & | in | ||
) |
EigenptrT<T> eteq::sin | ( | teq::Shape & | outshape, |
const OpArg< T > & | in | ||
) |
Given reference to output array, and input vector ref, make output elements take sine of inputs
EigenptrT<T> eteq::slice | ( | teq::Shape & | outshape, |
const OpArg< T > & | in | ||
) |
Return Eigen data object representing data slicing of dimensions.
FuncArg<T> eteq::slice_map | ( | NodeptrT< T > | node, |
teq::RankT | offset, | ||
teq::RankT | extent, | ||
teq::RankT | dimension | ||
) |
Return FuncArg<T> that takes specific slice of tensor E.g.: tensor w/ shape [2, 3, 4], offset = 1, extent = 2, and dimension = 2 gets mapped to [3, 4, 2] that references [:,:,1:3] (second and third slices of the 3rd dimension)
EigenptrT<T> eteq::sqrt | ( | teq::Shape & | outshape, |
const OpArg< T > & | in | ||
) |
Given reference to output array, and input vector ref, make output elements take square root of inputs
EigenptrT<T> eteq::square | ( | teq::Shape & | outshape, |
const OpArg< T > & | in | ||
) |
EigenptrT<T> eteq::stride | ( | teq::Shape & | outshape, |
const OpArg< T > & | in | ||
) |
Return Eigen data object representing strided view of in.
FuncArg<T> eteq::stride_map | ( | NodeptrT< T > | node, |
const std::vector< teq::DimT > & | incrs | ||
) |
Return FuncArg<T> that takes elements of specific increments across dimensions starting from 0 E.g.: tensor w/ shape [2, 3, 4], incrs = {1, 2, 2} gets mapped to [2, 2, 2] where output[:,0,0] takes on input[:,0,0] output[:,1,0] takes on input[:,2,0] output[:,0,1] takes on input[:,0,2] output[:,1,1] takes on input[:,2,2]
EigenptrT<T> eteq::sub | ( | teq::Shape & | outshape, |
const OpArg< T > & | a, | ||
const OpArg< T > & | b | ||
) |
Given arguments a, and b, for every pair of mapped elements sharing the same index subtract Only accept 2 arguments
EigenptrT<T> eteq::tan | ( | teq::Shape & | outshape, |
const OpArg< T > & | in | ||
) |
Given reference to output array, and input vector ref, make output elements take tangent of inputs
EigenptrT<T> eteq::tanh | ( | teq::Shape & | outshape, |
const OpArg< T > & | in | ||
) |
Return Matrix Map given Tensor.
Return Tensor Map of Tensor.
Return Matrix Map of Tensor Map.
T eteq::unif | ( | const T & | a, |
const T & | b | ||
) |
Return uniformly generated number between a and b (integers only)
Return uniformly generate number between a and b (decimals only)
GenF<T> eteq::unif_gen | ( | const T & | a, |
const T & | b | ||
) |
Return uniformly generator function that produces numbers between a and b (integers only)
GenF<T> eteq::unif_gen | ( | T | a, |
T | b | ||
) |
Return uniformly generator function that produces numbers between a and b (decimals only)
|
static |
|
static |
|
static |