CUV
0.9.201304091348
|
Enumerations | |
enum | cuv::ScalarFunctor { SF_EXP, SF_SIN, SF_COS, SF_LOG, SF_SIGN, SF_SIGM, SF_DSIGM, SF_SQUARE, SF_SUBLIN, SF_ENERG, SF_INV, SF_SQRT, SF_NEGATE, SF_ABS, SF_SMAX, SF_POSLIN, SF_RECT, SF_DRECT, SF_COPY, SF_LOG1P, SF_POW, SF_DPOW, SF_ADD, SF_SUBTRACT, SF_RSUB, SF_MULT, SF_DIV, SF_RDIV, SF_LOGADDEXP, SF_MIN, SF_MAX, SF_ROBUST_ABS, SF_DROBUST_ABS, SF_EQ, SF_LT, SF_GT, SF_LEQ, SF_GEQ, SF_BERNOULLI_KL, SF_DBERNOULLI_KL, SF_AXPB, SF_TANH, SF_DTANH } |
Scalar Functors for vectors and matrices Applied pointwise to a vector/matrix. More... |
Functions | |
template<class D > | |
void | cuv::apply_scalar_functor (D &v, const ScalarFunctor &sf, const tensor< unsigned char, typename D::memory_space_type, typename D::memory_layout_type > *mask=NULL) |
apply a scalar functor to all elements of v. | |
template<class D , class S > | |
void | cuv::apply_scalar_functor (D &dst, const S &src, const ScalarFunctor &sf, const tensor< unsigned char, typename D::memory_space_type, typename D::memory_layout_type > *mask=NULL) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. apply a scalar functor to all elements of src. | |
template<class D > | |
void | cuv::apply_scalar_functor (D &v, const ScalarFunctor &sf, const typename D::value_type &p, const tensor< unsigned char, typename D::memory_space_type, typename D::memory_layout_type > *mask=NULL) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. in-place, one parameter. | |
template<class D , class S > | |
void | cuv::apply_scalar_functor (D &dst, const S &src, const ScalarFunctor &sf, const typename S::value_type &p, const tensor< unsigned char, typename D::memory_space_type, typename D::memory_layout_type > *mask=NULL) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.one parameter. | |
template<class D > | |
void | cuv::apply_scalar_functor (D &v, const ScalarFunctor &sf, const typename D::value_type &p, const typename D::value_type &p2, const tensor< unsigned char, typename D::memory_space_type, typename D::memory_layout_type > *mask=NULL) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.in-place, two parameters. | |
template<class D , class S > | |
void | cuv::apply_scalar_functor (D &dst, const S &src, const ScalarFunctor &sf, const typename S::value_type &p, const typename S::value_type &p2, const tensor< unsigned char, typename D::memory_space_type, typename D::memory_layout_type > *mask=NULL) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. |
enum cuv::ScalarFunctor |
Scalar Functors for vectors and matrices Applied pointwise to a vector/matrix.
Each entry x is transformed according to the given formular. Without scalar parameters: @li SF_COPY computes x (the identity) @li SF_EXP computes exp(x) @li SF_LOG computes log(x) @li SF_SIGN computes sign(x) @li SF_SIGM computes 1/(1+exp(-x)) @li SF_DSIGM computes x * (1-x) @li SF_TANH computes tanh(x) @li SF_DTANH computes x - x^2 @li SF_SIN computes sin(x) @li SF_COS computes cos(x) @li SF_SQUARE computes x*x @li SF_SUBLIN computes 1-x @li SF_ENERG computes -log(x) @li SF_INV computes 1/x @li SF_SQRT computes sqrt(x) @li SF_NEGATE computes -x @li SF_ABS computes absolute value of x @li SF_SMAX computes (1/x -1) * x @li SF_LOG1P computes \form#14
With one scalar parameter a:
With two scalar parameters a and b:
With zero OR two scalar parameters a and b:
Definition at line 192 of file tensor_ops.hpp.
void cuv::apply_scalar_functor | ( | D & | v, |
const ScalarFunctor & | sf, | ||
const tensor< unsigned char, typename D::memory_space_type, typename D::memory_layout_type > * | mask = NULL |
||
) |
apply a scalar functor to all elements of v.
Pseudocode:
in-place, no parameters
v | where we read from and write to |
sf | the applied scalar functor |
mask | optional |
Definition at line 290 of file tensor_ops.hpp.
void cuv::apply_scalar_functor | ( | D & | dst, |
const S & | src, | ||
const ScalarFunctor & | sf, | ||
const tensor< unsigned char, typename D::memory_space_type, typename D::memory_layout_type > * | mask = NULL |
||
) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. apply a scalar functor to all elements of src.
no parameters
dst | destination |
src | source |
sf | the scalar functor to be applied |
mask | optional mask |
Definition at line 308 of file tensor_ops.hpp.
void cuv::apply_scalar_functor | ( | D & | v, |
const ScalarFunctor & | sf, | ||
const typename D::value_type & | p, | ||
const tensor< unsigned char, typename D::memory_space_type, typename D::memory_layout_type > * | mask = NULL |
||
) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. in-place, one parameter.
This function applies a binary functor, fixing the second argument to a constant.
Pseudocode:
v | source and destination |
sf | the scalar functor to be applied |
p | parameter for binary functor |
mask | optional mask |
Definition at line 333 of file tensor_ops.hpp.
void cuv::apply_scalar_functor | ( | D & | dst, |
const S & | src, | ||
const ScalarFunctor & | sf, | ||
const typename S::value_type & | p, | ||
const tensor< unsigned char, typename D::memory_space_type, typename D::memory_layout_type > * | mask = NULL |
||
) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.one parameter.
This function applies a binary functor, fixing the second argument to a constant.
Pseudocode:
dst | destination |
src | source |
sf | the scalar functor to be applied |
p | parameter for binary functor |
mask | optional mask |
Definition at line 357 of file tensor_ops.hpp.
void cuv::apply_scalar_functor | ( | D & | v, |
const ScalarFunctor & | sf, | ||
const typename D::value_type & | p, | ||
const typename D::value_type & | p2, | ||
const tensor< unsigned char, typename D::memory_space_type, typename D::memory_layout_type > * | mask = NULL |
||
) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.in-place, two parameters.
This function applies a ternary functor, fixing the second and third argument to a constant.
Pseudocode:
v | source and destination |
sf | the scalar functor to be applied |
p | 2nd parameter for ternary functor |
p2 | 3rd parameter for ternary functor |
mask | optional mask |
Definition at line 382 of file tensor_ops.hpp.
void cuv::apply_scalar_functor | ( | D & | dst, |
const S & | src, | ||
const ScalarFunctor & | sf, | ||
const typename S::value_type & | p, | ||
const typename S::value_type & | p2, | ||
const tensor< unsigned char, typename D::memory_space_type, typename D::memory_layout_type > * | mask = NULL |
||
) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
two parameters. This function applies a ternary functor, fixing the second and third argument to a constant.
Pseudocode:
dst | destination |
src | source |
sf | the scalar functor to be applied |
p | 2nd parameter for ternary functor |
p2 | 3rd parameter for ternary functor |
mask | optional mask |
Definition at line 407 of file tensor_ops.hpp.