CUV
0.9.201304091348
|
Enumerations | |
enum | cuv::BinaryFunctor { BF_1ST, BF_2ND, BF_EQ, BF_AND, BF_OR, BF_POW, BF_ADD, BF_SUBTRACT, BF_MULT, BF_DIV, BF_MIN, BF_MAX, BF_ATAN2, BF_NORM, BF_LOGADDEXP, BF_LOGCE_OF_LOGISTIC, BF_BERNOULLI_KL, BF_DBERNOULLI_KL, BF_AXPY, BF_XPBY, BF_AXPBY, BF_EPSILON_INSENSITIVE_LOSS, BF_DEPSILON_INSENSITIVE_LOSS, BF_HINGE_LOSS, BF_DHINGE_LOSS, BF_SQHINGE_LOSS, BF_DSQHINGE_LOSS } |
Binary functors for vectors and matrices. More... |
Functions | |
template<class D , class S > | |
void | cuv::apply_binary_functor (D &v, const S &w, const BinaryFunctor &bf) |
in-place, no parameters. | |
template<class D , class S , class S2 > | |
void | cuv::apply_binary_functor (D &v, const S &w, const S2 &w2, const BinaryFunctor &bf) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
template<class D , class S > | |
void | cuv::apply_binary_functor (D &v, const S &w, const BinaryFunctor &bf, const typename S::value_type ¶m) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
template<class D , class S , class S2 > | |
void | cuv::apply_binary_functor (D &v, const S &w, const S2 &w2, const BinaryFunctor &bf, const typename S::value_type ¶m) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
template<class D , class S > | |
void | cuv::apply_binary_functor (D &v, const S &w, const BinaryFunctor &bf, const typename S::value_type ¶m, const typename S::value_type ¶m2) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
template<class D , class S , class S2 > | |
void | cuv::apply_binary_functor (D &v, const S &w, const S2 &w2, const BinaryFunctor &bf, const typename S::value_type ¶m, const typename S::value_type ¶m2) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
template<class __value_type , class __memory_space_type , class __memory_layout_type > | |
void | cuv::copy (tensor< __value_type, __memory_space_type, __memory_layout_type > &dst, const tensor< __value_type, __memory_space_type, __memory_layout_type > &src) |
Copy one vector into another. |
enum cuv::BinaryFunctor |
Binary functors for vectors and matrices.
Applied pointwise to a vector/matrix. The target entry x is calculated from the two source entries x,y according to the given formular. Without scalar parameters: @li BF_1ST evaluates to x @li BF_2ND evaluates to y @li BF_EQ computes x == y @li BF_AND computes x && y @li BF_OR computes x || y @li BF_ADD computes x += y @li BF_POW computes pow(x,y) @li BF_SUBTRACT computes x -= y @li BF_MULT computes x *= y @li BF_DIV computes x /= y @li BF_MIN computes x = min(x,y) @li BF_MAX computes x = max(x,y) @li BF_LOGADDEXP computes x = log(exp(x)+exp(y))
With one scalar parameter a: @li BF_AXPY computes x = a * x + y @li BF_XPBY computes x += a * y @li BF_EPSILON_INSENSITIVE_LOSS computes \form#26 @li BF_DEPSILON_INSENSITIVE_LOSS computes derivative of \form#27 w.r.t. y @li BF_HINGE_LOSS computes \form#28 @li BF_DHINGE_LOSS computes derivative of \form#29 w.r.t. y @li BF_SQHINGE_LOSS computes \form#30 @li BF_DSQHINGE_LOSS computes derivative of \form#31 w.r.t. y With two scalar parameters a and b: @li BF_AXPBY computes x = a * x + b * y
Definition at line 459 of file tensor_ops.hpp.
void cuv::apply_binary_functor | ( | D & | v, |
const S & | w, | ||
const BinaryFunctor & | bf | ||
) |
in-place, no parameters.
Applies a binary functor pointwise.
Pseudocode:
v | source and destination |
w | second source |
bf | binary functor to be applied |
Definition at line 530 of file tensor_ops.hpp.
void cuv::apply_binary_functor | ( | D & | v, |
const S & | w, | ||
const S2 & | w2, | ||
const BinaryFunctor & | bf | ||
) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
no parameters.
Applies a binary functor pointwise.
Pseudocode:
v | destination |
w | first source |
w2 | second source |
bf | binary functor to be applied |
Definition at line 553 of file tensor_ops.hpp.
void cuv::apply_binary_functor | ( | D & | v, |
const S & | w, | ||
const BinaryFunctor & | bf, | ||
const typename S::value_type & | param | ||
) |
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.
Applies a ternary functor pointwise, fixing the 3rd argument to a constant.
Pseudocode:
v | source and destination |
w | second source |
bf | binary functor to be applied |
param | third parameter of ternary functor |
Definition at line 577 of file tensor_ops.hpp.
void cuv::apply_binary_functor | ( | D & | v, |
const S & | w, | ||
const S2 & | w2, | ||
const BinaryFunctor & | bf, | ||
const typename S::value_type & | param | ||
) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
one parameter.
Applies a ternary functor pointwise, fixing the 3rd argument to a constant.
Pseudocode:
v | destination |
w | first source |
w2 | second source |
bf | binary functor to be applied |
param | third parameter of ternary functor |
Definition at line 602 of file tensor_ops.hpp.
void cuv::apply_binary_functor | ( | D & | v, |
const S & | w, | ||
const BinaryFunctor & | bf, | ||
const typename S::value_type & | param, | ||
const typename S::value_type & | param2 | ||
) |
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.
Applies a four-ary functor pointwise, fixing the 3rd and 4th argument to constants.
Pseudocode:
v | source and destination |
w | second source |
bf | binary functor to be applied |
param | third parameter of four-ary functor |
param2 | fourth parameter of four-ary functor |
Definition at line 626 of file tensor_ops.hpp.
void cuv::apply_binary_functor | ( | D & | v, |
const S & | w, | ||
const S2 & | w2, | ||
const BinaryFunctor & | bf, | ||
const typename S::value_type & | param, | ||
const typename S::value_type & | param2 | ||
) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
two parameters.
Applies a four-ary functor pointwise, fixing the 3rd and 4th argument to constants.
Pseudocode:
v | destination |
w | first source |
w2 | second source |
bf | binary functor to be applied |
param | third parameter of four-ary functor |
param2 | third parameter of four-ary functor |
Definition at line 651 of file tensor_ops.hpp.
void cuv::copy | ( | tensor< __value_type, __memory_space_type, __memory_layout_type > & | dst, |
const tensor< __value_type, __memory_space_type, __memory_layout_type > & | src | ||
) |
Copy one vector into another.
dst | Destination vector |
src | Source vector |
This is a convenience wrapper that applies the binary functor SF_COPY
Definition at line 663 of file tensor_ops.hpp.