Tenncor
Namespaces | Classes | Typedefs | Functions | Variables
eteq Namespace Reference

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...
 
EngineTget_engine (void)
 Return global random generator. More...
 
template<typename T , typename std::enable_if< std::is_integral< T >::value >::type * = nullptr>
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
 

Detailed Description

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

Typedef Documentation

◆ ArgsT

template<typename T >
using eteq::ArgsT = typedef std::vector<FuncArg<T> >

Type of typed functor arguments.

◆ BuilderArgsT

using eteq::BuilderArgsT = typedef std::vector<BuilderArg>

Vector of FuncArg.

◆ CoordptrT

using eteq::CoordptrT = typedef std::shared_ptr<CoordMap>

Type of iCoordMap smartpointer.

◆ DimensionsT

using eteq::DimensionsT = typedef std::array<Eigen::Index,8>

Eigen shape.

◆ EigenptrT

template<typename T >
using eteq::EigenptrT = typedef std::shared_ptr<iEigen<T> >

Smart point of generic Eigen data object.

◆ EngineT

using eteq::EngineT = typedef std::default_random_engine

RNG engine used.

◆ GenF

template<typename T >
using eteq::GenF = typedef std::function<T()>

Function that returns a generated number.

◆ MatMapT

template<typename T >
using eteq::MatMapT = typedef Eigen::Map<MatrixT<T> >

Eigen Matrix Map (reference)

◆ MatrixT

template<typename T >
using eteq::MatrixT = typedef Eigen::Matrix<T,Eigen::Dynamic,Eigen::Dynamic,Eigen::RowMajor>

Eigen Matrix.

◆ NodeBuilderF

template<typename T >
using eteq::NodeBuilderF = typedef std::function<NodeptrT<T>(teq::TensptrT)>

Function for building a node from tensor.

◆ NodeptrT

template<typename T >
using eteq::NodeptrT = typedef std::shared_ptr<iNode<T> >

Smart pointer of node.

◆ NodesT

template<typename T >
using eteq::NodesT = typedef std::vector<NodeptrT<T> >

Vector of nodes.

◆ ReduceOutT

template<typename OP , size_t N, typename T >
using eteq::ReduceOutT = typedef Eigen::TensorReductionOp<OP, const std::array<teq::RankT,N>,const TensMapT<T> >

Generic Eigen reduction operator.

◆ TensMapT

template<typename T >
using eteq::TensMapT = typedef Eigen::TensorMap<TensorT<T> >

Eigen Tensor Map (reference)

◆ TensorT

template<typename T >
using eteq::TensorT = typedef Eigen::Tensor<T,8>

Eigen Tensor.

◆ VarptrT

template<typename T >
using eteq::VarptrT = typedef std::shared_ptr<VariableNode<T> >

Smart pointer of variable nodes to preserve assign functions.

Function Documentation

◆ abs()

template<typename T >
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

◆ add()

template<typename T >
EigenptrT<T> eteq::add ( teq::Shape outshape,
const OpArg< T > &  a,
const OpArg< T > &  b 
)

◆ convert_to_node()

template<typename T >
NodeptrT<T> eteq::convert_to_node ( VarptrT< T >  var)

Return Node smart pointer of Variable smart pointer.

◆ convolution()

template<typename T >
EigenptrT<T> eteq::convolution ( teq::Shape outshape,
const OpArg< T > &  input,
const OpArg< T > &  kernel 
)

Apply convolution of kernel across input.

◆ convolution_image_grad()

template<typename T >
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.

◆ convolution_kernel_grad()

template<typename T >
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.

◆ coorderize()

static CoordptrT eteq::coorderize ( ::NumList list)
static

◆ cos()

template<typename T >
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

◆ cube()

template<typename T >
EigenptrT<T> eteq::cube ( teq::Shape outshape,
const OpArg< T > &  in 
)

◆ derive()

template<typename T >
NodeptrT<T> eteq::derive ( NodeptrT< T >  root,
NodeptrT< T >  target 
)

Derive root with respect to target and optimized.

◆ div()

template<typename T >
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

◆ eq()

template<typename T >
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

◆ exp()

template<typename T >
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

◆ extend()

CoordptrT eteq::extend ( teq::RankT  rank,
std::vector< teq::DimT ext 
)

Return CoordMap wrapper of extension parameters.

◆ extend_grad()

template<typename T >
NodeptrT<T> eteq::extend_grad ( teq::iFunctor fwd,
NodeptrT< T >  bwd,
size_t  idx 
)

Return extension gradient of extended functor node (bwd)

◆ extend_map()

template<typename T >
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]

◆ get_engine()

EngineT& eteq::get_engine ( void  )

Return global random generator.

◆ get_shape() [1/2]

template<typename T >
teq::Shape eteq::get_shape ( const TensorT< T > &  tens)

Return the teq Shape representation of Eigen Tensor.

◆ get_shape() [2/2]

template<typename T >
teq::Shape eteq::get_shape ( const TensMapT< T > &  tens)

Return the teq Shape representation of Eigen Tensor Map.

◆ gt()

template<typename T >
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

◆ identity_map()

template<typename T >
FuncArg<T> eteq::identity_map ( NodeptrT< T >  node)

Return FuncArg<T> that identity maps input tensor.

◆ is_2d()

static bool eteq::is_2d ( teq::Shape  shape)
inlinestatic

◆ is_big_endian()

static bool eteq::is_big_endian ( void  )
static

◆ log()

template<typename T >
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

◆ lt()

template<typename T >
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

◆ make_constant()

template<typename T >
NodeptrT<T> eteq::make_constant ( T *  data,
teq::Shape  shape 
)

Return constant node given raw array and shape.

◆ make_constant_scalar()

template<typename T >
NodeptrT<T> eteq::make_constant_scalar ( scalar,
teq::Shape  shape 
)

Return constant node given scalar and shape.

◆ make_eigenmatrix()

template<typename T , typename EigenSource , typename EigenArgs >
EigenptrT<T> eteq::make_eigenmatrix ( DimensionsT  dims,
std::function< EigenSource(EigenArgs &)>  make_base,
EigenArgs  args 
)
inline

Return Eigen Matrix wrapper given output shape, and Eigen operator creation and arguments

◆ make_eigentensor()

template<typename T , typename EigenSource , typename EigenArgs >
EigenptrT<T> eteq::make_eigentensor ( DimensionsT  dims,
std::function< EigenSource(EigenArgs &)>  make_base,
EigenArgs  args 
)
inline

Return Eigen Tensor wrapper given output shape, and Eigen operator creation and arguments

◆ make_functor()

template<typename T >
NodeptrT<T> eteq::make_functor ( teq::Opcode  opcode,
ArgsT< T >  args 
)

Return functor node given opcode and node arguments.

◆ make_matmap()

template<typename T >
MatMapT<T> eteq::make_matmap ( T *  data,
const teq::Shape shape 
)
inline

Return Eigen Matrix given raw data and teq Shape.

◆ make_tensmap()

template<typename T >
TensMapT<T> eteq::make_tensmap ( T *  data,
const teq::Shape shape 
)
inline

Return Eigen Tensor given raw data and teq Shape.

◆ make_tensor()

template<typename T >
TensorT<T> eteq::make_tensor ( const teq::Shape shape)
inline

Return Eigen Tensor filled with 0s given teq Shape.

◆ make_variable() [1/2]

template<typename T >
VarptrT<T> eteq::make_variable ( teq::Shape  shape,
std::string  label = "" 
)

Return zero-initialized variable node of specified shape.

◆ make_variable() [2/2]

template<typename T >
VarptrT<T> eteq::make_variable ( T *  data,
teq::Shape  shape,
std::string  label = "" 
)

Return variable node given raw array and shape.

◆ make_variable_scalar()

template<typename T >
VarptrT<T> eteq::make_variable_scalar ( scalar,
teq::Shape  shape,
std::string  label = "" 
)

Return variable node given scalar and shape.

◆ mat_to_matmap()

template<typename T >
MatMapT<T> eteq::mat_to_matmap ( MatrixT< T > &  mat)
inline

Return Map of Matrix.

◆ mat_to_tensmap()

template<typename T >
TensMapT<T> eteq::mat_to_tensmap ( MatrixT< T > &  mat)
inline

Return Tensor Map of Matrix.

◆ matmul()

template<typename T >
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

◆ max()

template<typename T >
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

◆ min()

template<typename T >
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

◆ mul()

template<typename T >
EigenptrT<T> eteq::mul ( teq::Shape outshape,
const OpArg< T > &  a,
const OpArg< T > &  b 
)

◆ neg()

template<typename T >
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

◆ neq()

template<typename T >
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

◆ norm_gen()

template<typename T , typename std::enable_if<!std::is_integral< T >::value >::type * = nullptr>
GenF<T> eteq::norm_gen ( mean,
stdev 
)

Return normally generator function that produces numbers with mean and stdev (decimals only)

◆ pad()

template<typename T >
EigenptrT<T> eteq::pad ( teq::Shape outshape,
const OpArg< T > &  in 
)

Return Eigen data object representing data zero padding.

◆ pad_map()

template<typename T >
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)

◆ parse()

template<typename T >
opt::OptCtx eteq::parse ( std::string  content)

Return optimization rules tied to ETEQ Builder specified in content.

◆ parse_file()

template<typename T >
opt::OptCtx eteq::parse_file ( std::string  filename)

Return optimization rules tied to ETEQ Builder specified in file.

◆ permute() [1/2]

CoordptrT eteq::permute ( std::vector< teq::RankT dims)

Return CoordMap wrapper of permute indices.

◆ permute() [2/2]

template<typename T >
EigenptrT<T> eteq::permute ( teq::Shape outshape,
const OpArg< T > &  in 
)

Return Eigen data object representing transpose and permutation.

◆ permute_grad()

template<typename T >
NodeptrT<T> eteq::permute_grad ( teq::iFunctor fwd,
NodeptrT< T >  bwd,
size_t  idx 
)

Return permutation gradient of permuted functor node (bwd)

◆ permute_map()

template<typename T >
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]

◆ pow()

template<typename T >
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

◆ rand_uniform()

template<typename T >
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

◆ reduce()

CoordptrT eteq::reduce ( std::vector< teq::RankT red_dims)

Return CoordMap wrapper of reduction dimensions.

◆ reduce_grad()

template<typename T >
NodeptrT<T> eteq::reduce_grad ( const teq::FuncArg child,
NodeptrT< T >  bwd,
size_t  idx 
)

Return reduction operator gradient of reduced functor node (bwd)

◆ reduce_map()

template<typename T >
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]

◆ reduce_sum()

template<typename T >
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

◆ register_builder()

template<typename TensType , typename T >
bool eteq::register_builder ( NodeBuilderF< T >  builder)

Return true if tensor type successfully registers and maps to node builder, otherwise false

◆ round()

template<typename T >
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

◆ select()

template<typename T >
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

◆ shape_convert()

DimensionsT eteq::shape_convert ( teq::Shape  shape)

Return Eigen shape of teq Shape.

◆ sigmoid()

template<typename T >
EigenptrT<T> eteq::sigmoid ( teq::Shape outshape,
const OpArg< T > &  in 
)

◆ sigmoid_grad()

template<typename T >
EigenptrT<T> eteq::sigmoid_grad ( teq::Shape outshape,
const OpArg< T > &  in 
)

◆ sin()

template<typename T >
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

◆ slice()

template<typename T >
EigenptrT<T> eteq::slice ( teq::Shape outshape,
const OpArg< T > &  in 
)

Return Eigen data object representing data slicing of dimensions.

◆ slice_map()

template<typename T >
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)

◆ sqrt()

template<typename T >
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

◆ square()

template<typename T >
EigenptrT<T> eteq::square ( teq::Shape outshape,
const OpArg< T > &  in 
)

◆ stride()

template<typename T >
EigenptrT<T> eteq::stride ( teq::Shape outshape,
const OpArg< T > &  in 
)

Return Eigen data object representing strided view of in.

◆ stride_map()

template<typename T >
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]

◆ sub()

template<typename T >
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

◆ tan()

template<typename T >
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

◆ tanh()

template<typename T >
EigenptrT<T> eteq::tanh ( teq::Shape outshape,
const OpArg< T > &  in 
)

◆ tens_to_matmap()

template<typename T >
MatMapT<T> eteq::tens_to_matmap ( TensorT< T > &  tens)
inline

Return Matrix Map given Tensor.

◆ tens_to_tensmap()

template<typename T >
TensMapT<T> eteq::tens_to_tensmap ( TensorT< T > &  tens)
inline

Return Tensor Map of Tensor.

◆ tensmap_to_matmap()

template<typename T >
MatMapT<T> eteq::tensmap_to_matmap ( TensMapT< T > &  tens)
inline

Return Matrix Map of Tensor Map.

◆ unif()

template<typename T , typename std::enable_if< std::is_integral< T >::value >::type * = nullptr>
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)

◆ unif_gen() [1/2]

template<typename T , typename std::enable_if< std::is_integral< T >::value >::type * = nullptr>
GenF<T> eteq::unif_gen ( const T &  a,
const T &  b 
)

Return uniformly generator function that produces numbers between a and b (integers only)

◆ unif_gen() [2/2]

template<typename T , typename std::enable_if<!std::is_integral< T >::value >::type * = nullptr>
GenF<T> eteq::unif_gen ( a,
b 
)

Return uniformly generator function that produces numbers between a and b (decimals only)

◆ vectorize()

static std::vector<double> eteq::vectorize ( ::NumList list)
static

Variable Documentation

◆ label_limit

const size_t eteq::label_limit = 5
static

◆ non_bijectives

std::unordered_set<size_t> eteq::non_bijectives
static
Initial value:
=
{
egen::REDUCE_SUM,
egen::REDUCE_PROD,
egen::REDUCE_MIN,
egen::REDUCE_MAX,
egen::EXTEND,
}