CUV
0.9.201304091348
|
Enumerations | |
enum | cuv::reduce_functor { RF_ADD, RF_MEAN, RF_ADD_SQUARED, RF_MAX, RF_ARGMAX, RF_ARGMIN, RF_MIN, RF_MULT, RF_LOGADDEXP, RF_ADDEXP } |
Reduce functor to reduce a matrix to a row or column. More... |
Functions | |
template<class V , class __value_type2 , class M , class L > | |
void | cuv::reduce_to_col (tensor< V, M > &dst, const tensor< __value_type2, M, L > &src, reduce_functor rf=RF_ADD, const __value_type2 &factNew=1.f, const __value_type2 &factOld=0.f) |
Reduce a matrix to one column using specified reduce functor (or add them up by default) | |
template<class V , class __value_type2 , class M , class L > | |
void | cuv::reduce_to_row (tensor< V, M > &dst, const tensor< __value_type2, M, L > &src, reduce_functor rf=RF_ADD, const __value_type2 &factNew=1.f, const __value_type2 &factOld=0.f) |
Reduce a matrix to one row using specified reduce functor (or add them up by default) | |
template<class V , class M , class L > | |
tensor< V, M > | cuv::sum (const tensor< V, M, L > &src, const int &axis) |
Convenience function that creates a new vector and performs reduction by summing along given axis. |
enum cuv::reduce_functor |
Reduce functor to reduce a matrix to a row or column.
Definition at line 185 of file matrix_ops.hpp.
void cuv::reduce_to_col | ( | tensor< V, M > & | dst, |
const tensor< __value_type2, M, L > & | src, | ||
reduce_functor | rf = RF_ADD , |
||
const __value_type2 & | factNew = 1.f , |
||
const __value_type2 & | factOld = 0.f |
||
) |
Reduce a matrix to one column using specified reduce functor (or add them up by default)
dst | Destination vector, dst.size = src.h() |
src | Source matrix |
rf | Reduce functor |
factNew | Scalar factor for result of reduce functor |
factOld | Scalar factor for former entry of dst Calculates dst= factOld * dst + factNew * rf(src) By default, the reduce functor is RF_ADD so that rf(src) is the sum over all columns of src. |
void cuv::reduce_to_row | ( | tensor< V, M > & | dst, |
const tensor< __value_type2, M, L > & | src, | ||
reduce_functor | rf = RF_ADD , |
||
const __value_type2 & | factNew = 1.f , |
||
const __value_type2 & | factOld = 0.f |
||
) |
Reduce a matrix to one row using specified reduce functor (or add them up by default)
dst | Destination vector, dst.size = src.w() |
src | Source matrix |
rf | Reduce functor |
factNew | Scalar factor for result of reduce functor |
factOld | Scalar factor for former entry of dst Calculates dst= factOld * dst + factNew * rf(src) By default, the reduce functor is RF_ADD so that rf(src) is the sum over all rows of src. |
tensor<V, M> cuv::sum | ( | const tensor< V, M, L > & | src, |
const int & | axis | ||
) |
Convenience function that creates a new vector and performs reduction by summing along given axis.
src | Source matrix |
axis | Along which axis (0 = reduce to row, 1 = reduce to col) |
Definition at line 239 of file matrix_ops.hpp.