CUV  0.9.201304091348
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Namespaces | Classes | Typedefs | Enumerations | Functions
cuv Namespace Reference

contains all cuv functionality More...

Namespaces

namespace  alex_conv
 wrappers of convolution operations by Alex Kriszevsky
namespace  integral_img
 integral image computation
namespace  sep_conv
 separable convolution

Classes

struct  allocator
 Allocator allows allocation, deallocation and copying depending on memory_space_type. More...
struct  allocator< value_type, size_type, host_memory_space >
 specialization of template allocator for host_memory_space More...
class  cuda_array
 Wrapper for a 2D CUDAArray. More...
class  dia_matrix
 Class for diagonal matrices. More...
class  filter_factory
class  interleaved_image
 a wrapper around a tensor to provide an interleaved (e.g. More...
class  matrix
 Basic matrix class. More...
struct  reference
 This objects acts like a reference to the object stored at the wrapped pointer. More...
struct  column_major
 Tag for column major matrices. More...
struct  row_major
 Tag for row major matrices. More...
struct  linear_memory_tag
 tag for linear memory More...
struct  pitched_memory_tag
 tag for pitched memory More...
struct  other_memory_layout
 converts from column to row-major and vice versa More...
struct  other_memory_layout< column_major >
 specialisation: converts from column to row-major More...
struct  other_memory_layout< row_major >
 specialisation: converts from row to column-major More...
struct  other_memory_space
 converts from dev to host memory space and vice versa More...
struct  other_memory_space< dev_memory_space >
 specialisation: converts from dev_memory_space to host_memory_space More...
struct  other_memory_space< host_memory_space >
 specialisation: converts from host_memory_space to dev_memory_space More...
class  memory
 simply keeps a pointer and deallocates it when destroyed More...
class  linear_memory
 represents contiguous memory More...
class  pitched_memory
 represents 2D non-contiguous ("pitched") memory More...
struct  tensor_info
 contains infos about shape and stride on host and in the tensor data space. More...
class  tensor
 represents an n-dimensional array on GPU or CPU. More...
class  tensor_view
 primarily used as result of tensor::operator[] More...
struct  switch_value_type
 create a tensor type with the same template parameters, but with switched value type More...
struct  switch_memory_layout_type
 create a tensor type with the same template parameters, but with switched memory_layout_type More...
struct  switch_memory_space_type
 create a tensor type with the same template parameters, but with switched memory_space_type More...
class  image_pyramid
 image pyramid decreasing in size logarithmically. More...
class  host_block_descriptor
 Dummy Block descriptor on host. More...
class  dev_block_descriptor
 Block descriptors on device this class is needed for DIA_Mat = Dense_Mat * Dense_Mat it stores all blocks of size SPARSE_DIA_BLOCK_SIZE x SPARSE_DIA_BLOCK_SIZE of a regluar grid where at least one diagonal crosses the block. More...
struct  vector_type_traits
struct  vector_type_traits< float4 >
struct  vector_type_traits< float3 >
struct  vector_type_traits< float2 >
struct  vector_type_traits< float1 >
struct  vector_type_traits< float >
struct  vector< 1 >
struct  vector< 2 >
struct  vector< 3 >
struct  vector< 4 >
struct  host_memory_space
 Tag for host memory. More...
struct  dev_memory_space
 Tag for device memory. More...
struct  FalseType
 defines "False" More...
struct  TrueType
 defines "True" More...
struct  IsSame
 Checks whether two types are equal. More...
struct  IsSame< T, T >
struct  IsDifferent
 Checks whether two types are different. More...
struct  IsDifferent< T, T >
struct  unconst
 Remove "const" from a type. More...
struct  unconst< const T >
struct  If
 Switch result depending on Condition. More...
struct  If< false, Then, Else >
struct  EnableIfC
 enable-if controlled creation of SFINAE conditions More...
struct  EnableIfC< false, T >
struct  EnableIf
struct  DisableIf

Typedefs

typedef
boost::detail::multi_array::index_range
< boost::detail::multi_array::index,
boost::detail::multi_array::size_type > 
index_range
 defines an index range, stolen from boost::multi_array
typedef index_range::index index
 the index type used in index_range, useful for comparator syntax in

Enumerations

enum  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...
enum  NullaryFunctor { NF_FILL, NF_SEQ }
 Nullary functors for vectors and matrices. More...
enum  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...
enum  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 Archive , class value_type , class index_type >
void serialize (Archive &ar, cuv::dia_matrix< value_type, host_memory_space, index_type > &m, const unsigned int version)
 Serialize/deserialize a host-dia-matrix to/from an archive.
template void serialize (boost::archive::binary_oarchive &, dia_matrix< float, host_memory_space, unsigned int > &, unsigned int)
 explicit instantiation of serialization for dia-matrices in binary oarchives
template<class V , class M , class L , class S >
void fill (tensor< V, M, L > &v, const V &p)
 used in implementation of tensor.operator= for value_type argument
template<class V , class M0 , class M1 , class L0 , class L1 >
bool copy_memory (tensor< V, M0, L0 > &dst, const tensor< V, M1, L1 > &src, bool force_dst_contiguous)
 tries to copy memory, succeeds if shapes match AND both tensors are c_contiguous of 2dcopyable.
template<class V , class M0 , class M1 , class L0 , class L1 >
void copy_memory (tensor< V, M0, L0 > &dst, const tensor< V, M1, L1 > &src, linear_memory_tag)
 copies between different memory spaces
template<class V , class M0 , class M1 , class L0 , class L1 >
void copy_memory (tensor< V, M0, L0 > &dst, const tensor< V, M1, L1 > &src, pitched_memory_tag)
 copies between different memory spaces
template<class V , class V2 , class M , class M2 , class L >
bool equal_shape (const tensor< V, M, L > &a, const tensor< V2, M2, L > &b)
 test whether two tensors have the same shape
template<class Dst , class Src >
void convert (Dst &dst, const Src &src)
 Convert matrices and vectors between different formats.
template<class T , class S , class I >
void gaussian_pyramid_downsample (tensor< T, S, row_major > &dst, const cuda_array< T, S, I > &src, const unsigned int interleaved_channels)
 sample down an image by a factor of 2
template<class T , class S , class I >
void gaussian_pyramid_upsample (tensor< T, S, row_major > &dst, const cuda_array< T, S, I > &src)
template<class TDest , class T , class S , class I >
void get_pixel_classes (tensor< TDest, S, row_major > &dst, const cuda_array< T, S, I > &src, float scale_fact)
template<class T , class S , class I >
void gaussian (tensor< T, S, row_major > &dst, const cuda_array< T, S, I > &src)
template<class __value_typeA , class __value_typeB , class __memory_space_type , class __memory_layout_type >
void image_move (tensor< __value_typeA, __memory_space_type, __memory_layout_type > &dst, const tensor< __value_typeB, __memory_space_type, __memory_layout_type > &src, const unsigned int &image_width, const unsigned int &image_height, const unsigned int &num_maps, const int &xshift, const int &yshift)
 Shift images by given amount.
template<class __value_type , class __memory_layout_type , class __index_type >
void densedense_to_dia (dia_matrix< __value_type, dev_memory_space, __index_type > &C, const dev_block_descriptor< __value_type, __index_type > &Cbd, const tensor< __value_type, dev_memory_space, __memory_layout_type > &A, const tensor< __value_type, dev_memory_space, __memory_layout_type > &B, const __value_type &factAB=1.f, const __value_type &factC=0.f)
 DIA_Mat <- Dense_Mat * Dense_Mat_transposed.
template<class __value_type , class __memory_layout_type , class __index_type >
void densedense_to_dia (dia_matrix< __value_type, host_memory_space, __index_type > &C, const host_block_descriptor< __value_type, __index_type > &Cbd, const tensor< __value_type, host_memory_space, __memory_layout_type > &A, const tensor< __value_type, host_memory_space, __memory_layout_type > &B, const __value_type &factAB=1.f, const __value_type &factC=0.f)
template<class T , class M >
void avg_diagonals (cuv::tensor< T, M > &dst, const cuv::dia_matrix< T, M > &dia)
 get the average of all diagonals of a diagonal matrix
template<class V , class M , class __memory_layout , class __index_type >
tensor< V, M, __memory_layout > * blockview (tensor< V, M, __memory_layout > &matrix, __index_type start_rows, __index_type num_rows, __index_type start_cols, __index_type num_cols)
 Generate a view to a block inside an existing matrix.
template<class V , class M , class L >
void prod (tensor< V, M, L > &C, const tensor< V, M, L > &A, const tensor< V, M, L > &B, char transA='n', char transB='n', const float &factAB=1.f, const float &factC=0.f)
 Matrix multiplication and other BLAS3 functionality.
template<class V , class M , class L >
void prod (tensor< V, M, L > &C, const tensor< V, M, L > &A, const tensor< V, M, typename other_memory_layout< L >::type > &B, const float &factAB=1.f, const float &factC=0.f)
template<class V , class M , class L >
void prod (tensor< V, M, L > &C, const tensor< V, M, typename other_memory_layout< L >::type > &A, const tensor< V, M, L > &B, const float &factAB=1.f, const float &factC=0.f)
template<class V , class M , class L >
void prod (tensor< V, M, L > &C, const dia_matrix< V, M > &A, const tensor< V, M, L > &B, char transA='n', char transB='n', const float &factAB=1.f, const float &factC=0.f)
template<class V , class M , class L >
void transpose (tensor< V, M, L > &dst, const tensor< V, M, L > &src)
 Transpose a matrix.
template<class V , class T , class M >
cuv::tensor< V, T, typename
other_memory_layout< M >::type > * 
transposed_view_p (cuv::tensor< V, T, M > &src)
 Transpose a matrix by creating a view with different storage.
template<class V , class T , class M >
std::auto_ptr< cuv::tensor< V,
T, typename
other_memory_layout< M >::type > > 
transposed_view (cuv::tensor< V, T, M > &src)
 As in.
template<class V , class T , class M >
const cuv::tensor< V, T,
typename other_memory_layout
< M >::type > * 
transposed_view_p (const cuv::tensor< V, T, M > &src)
 Const variant of.
template<class V , class T , class M >
std::auto_ptr< const
cuv::tensor< V, T, typename
other_memory_layout< M >::type > > 
transposed_view (const cuv::tensor< V, T, M > &src)
 As in.
template<class V , class __value_type2 , class M , class L >
void 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 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 > 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.
template<class V , class M >
void spmv (tensor< V, M > &dst, const dia_matrix< V, M > &A, const tensor< V, M > &v, char transA='n', const float &factAv=1.f, const float &factC=0.f)
 Calculates product of a sparse matrix and a vector.
template<class V , class V2 , class M , class L >
void matrix_op_vec (tensor< V, M, L > &Dst, const tensor< V, M, L > &Src, const tensor< V2, M > &v, int axis, BinaryFunctor bf, float factNew=1.f, float factOld=0.f, int n_params=0, float param0=0.f, float param1=0.f)
 Apply a binary functor on one axis of a tensor and a n-1-dimensional tensor.
template<class V , class M , class L >
void matrix_plus_col (tensor< V, M, L > &A, const tensor< V, M > &v)
 Add a vector to each column of a matrix A.
template<class V , class M , class L >
void matrix_times_col (tensor< V, M, L > &A, const tensor< V, M > &v)
 Multiply each column of a matrix A pointwise with a vector v.
template<class V , class M , class L >
void matrix_divide_col (tensor< V, M, L > &A, const tensor< V, M > &v)
 Devide each column of a matrix A pointwise by a vector v.
template<class V , class M , class L >
void matrix_plus_row (tensor< V, M, L > &A, const tensor< V, M > &v)
 Add a vector to each row of a matrix A.
template<class V , class M , class L >
void matrix_times_row (tensor< V, M, L > &A, const tensor< V, M > &v)
 Multiply each row of a matrix A pointwise with a vector v.
template<class V , class M , class L >
void matrix_divide_row (tensor< V, M, L > &A, const tensor< V, M > &v)
 Devide each row of a matrix A pointwise by a vector v.
template<class V , class M , class T >
void fill_rnd_uniform (tensor< V, M, T > &dst)
 Fill a matrix/vector with random numbers uniformly distributed between zero and one.
template<class V , class M , class T >
void rnd_binarize (tensor< V, M, T > &dst)
 Binarize a matrix/vector to 1 or 0 with probability given by current values.
template<class V , class M , class T >
void add_rnd_normal (tensor< V, M, T > &dst, const float &std=1.0f)
 Add random numbers (normally distributed, mean 0) to a matrix/vector.
void initialize_mersenne_twister_seeds (unsigned int seed=0)
 Initialize Mersenne twister to generate random numbers on GPU.
void deinit_rng (unsigned int seed=0)
 destruction counterpart to
template<class __value_type , class __memory_space_type , class S >
void rprop (tensor< __value_type, __memory_space_type > &W, tensor< __value_type, __memory_space_type > &dW, tensor< S, __memory_space_type > &dW_old, tensor< __value_type, __memory_space_type > &rate, const float &decay=0.0f, const float &sparsedecay=0.0f)
 Does a gradient descent step using the "RPROP" algorithm.
template<class __value_type , class __memory_space_type , class S >
void rprop (tensor< __value_type, __memory_space_type, column_major > &W, tensor< __value_type, __memory_space_type, column_major > &dW, tensor< S, __memory_space_type, column_major > &dW_old, tensor< __value_type, __memory_space_type, column_major > &rate, const float &decay=0.0f, const float &sparsedecay=0.0f)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. casting column major to row major since working on linear memory anyway.
template<class __value_type , class __memory_space_type >
void learn_step_weight_decay (tensor< __value_type, __memory_space_type > &W, const tensor< __value_type, __memory_space_type > &dW, const float &learnrate, const float &decay=0.0f, const float &sparsedecay=0.0f)
 Do a step of gradient descent with optional weight decay.
template<class V , class M >
void learn_step_weight_decay_momentum (tensor< V, M > &W, tensor< V, M > &momentum, const tensor< V, M > &dW, const float &learnrate, const float &momentum_weight=0.9, const float &decay=0.0f, const float &sparsedecay=0.0f)
 Same as learn_step_weight_decay, but with momentum.
template<class __value_type , class __memory_space_type >
void learn_step_weight_decay (tensor< __value_type, __memory_space_type, column_major > &W, const tensor< __value_type, __memory_space_type, column_major > &dW, const float &learnrate, const float &decay=0.0f, const float &sparsedecay=0.0f)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. casting column major to row major since working on linear memory anyway.
template<class __value_type , class __memory_space_type >
void apply_0ary_functor (tensor< __value_type, __memory_space_type > &v, const NullaryFunctor &sf)
 Apply a pointwise nullary functor to a vector.
template<class __value_type , class __memory_space_type >
void apply_0ary_functor (tensor< __value_type, __memory_space_type, column_major > &v, const NullaryFunctor &sf)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
template<class V1 , class M >
void apply_0ary_functor (tensor< V1, M > &v, const NullaryFunctor &sf, const V1 &param)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
template<class V1 , class M >
void apply_0ary_functor (tensor< V1, M, column_major > &v, const NullaryFunctor &sf, const V1 &param)
 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 sequence (tensor< __value_type, __memory_space_type, __memory_layout_type > &v)
 Fill a vector with a sequence of numbers.
template<class __value_type , class __memory_space_type , class __memory_layout_type , class S >
void fill (tensor< __value_type, __memory_space_type, __memory_layout_type > &v, const S &p)
 Fill a vector with a value.
template<class D >
void 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 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 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 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 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 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.
template<class D , class S >
void apply_binary_functor (D &v, const S &w, const BinaryFunctor &bf)
 in-place, no parameters.
template<class D , class S , class S2 >
void 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 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.
template<class D , class S , class S2 >
void 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.
template<class D , class S >
void 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.
template<class D , class S , class S2 >
void 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.
template<class __value_type , class __memory_space_type , class __memory_layout_type >
void 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.
template<class __value_type , class __memory_space_type >
bool has_inf (const tensor< __value_type, __memory_space_type > &v)
 Check whether a float vector contains "Inf" or "-Inf".
template<class __value_type , class __memory_space_type >
bool has_inf (const tensor< __value_type, __memory_space_type, column_major > &v)
template<class __value_type , class __memory_space_type >
bool has_nan (const tensor< __value_type, __memory_space_type > &v)
 Check whether a float vector contains "NaN".
template<class __value_type , class __memory_space_type >
bool has_nan (const tensor< __value_type, __memory_space_type, column_major > &v)
template<class __value_type , class __memory_space_type >
unsigned int count (const tensor< __value_type, __memory_space_type > &v, const __value_type &s)
 Count the elements with a certain scalar value in a vector.
template<class __value_type , class __memory_space_type >
unsigned int count (const tensor< __value_type, __memory_space_type, column_major > &v, const __value_type &s)
template<class __value_type , class __memory_space_type >
float sum (const tensor< __value_type, __memory_space_type > &v)
 Return the sum of a vector.
template<class __value_type , class __memory_space_type >
float sum (const tensor< __value_type, __memory_space_type, column_major > &v)
template<class __value_type , class __memory_space_type >
float norm2 (const tensor< __value_type, __memory_space_type > &v)
 Return the two-norm or Euclidean norm of a vector.
template<class __value_type , class __memory_space_type >
float norm2 (const tensor< __value_type, __memory_space_type, column_major > &v)
template<class __value_type , class __memory_space_type >
float diff_norm2 (const tensor< __value_type, __memory_space_type > &v, const tensor< __value_type, __memory_space_type > &w)
 Return the two-norm or of the difference of two vectors.
template<class __value_type , class __memory_space_type >
float diff_norm2 (const tensor< __value_type, __memory_space_type, column_major > &v, const tensor< __value_type, __memory_space_type, column_major > &w)
template<class __value_type , class __memory_space_type >
float norm1 (const tensor< __value_type, __memory_space_type > &v)
 Return the one-norm or sum-norm of a vector.
template<class __value_type , class __memory_space_type >
float norm1 (const tensor< __value_type, __memory_space_type, column_major > &v)
template<class __value_type , class __memory_space_type >
float minimum (const tensor< __value_type, __memory_space_type > &v)
 Return the minimum entry of a vector.
template<class __value_type , class __memory_space_type >
float minimum (const tensor< __value_type, __memory_space_type, column_major > &v)
template<class __value_type , class __memory_space_type >
float maximum (const tensor< __value_type, __memory_space_type > &v)
 Return the maximum entry of a vector.
template<class __value_type , class __memory_space_type >
float maximum (const tensor< __value_type, __memory_space_type, column_major > &v)
template<class __value_type , class __memory_space_type >
float mean (const tensor< __value_type, __memory_space_type > &v)
 Return the mean of the entries of a vector.
template<class __value_type , class __memory_space_type >
float mean (const tensor< __value_type, __memory_space_type, column_major > &v)
template<class __value_type , class __memory_space_type >
float var (const tensor< __value_type, __memory_space_type > &v)
 Return the variation of the entries of a vector.
template<class __value_type , class __memory_space_type >
float var (const tensor< __value_type, __memory_space_type, column_major > &v)
template<class __value_type , class __memory_space_type >
tensor< __value_type,
__memory_space_type >
::index_type 
arg_max (const tensor< __value_type, __memory_space_type > &v)
 Return the index of the maximum element.
template<class __value_type , class __memory_space_type >
tensor< __value_type,
__memory_space_type,
column_major >::index_type 
arg_max (const tensor< __value_type, __memory_space_type, column_major > &v)
template<class __value_type , class __memory_space_type >
tensor< __value_type,
__memory_space_type >
::index_type 
arg_min (const tensor< __value_type, __memory_space_type > &v)
 Return the index of the minimum element.
template<class __value_type , class __memory_space_type >
tensor< __value_type,
__memory_space_type,
column_major >::index_type 
arg_min (const tensor< __value_type, __memory_space_type, column_major > &v)
void cuvAssertFailed (const char *msg)
 fail with an error message, a stack trace and a runtime_exception (the nicest failures you've seen ^^!)
void checkCudaError (const char *msg)
 check whether cuda thinks there was an error and fail with msg, if this is the case
void initCUDA (int dev=0)
 Initializes CUDA context.
void exitCUDA ()
 quit cuda
void safeThreadSync ()
 synch threads from plain (non-cuda) C++
int getFreeDeviceMemory ()
 Get available memory on device.
int getMaxDeviceMemory ()
 Get device memory.
int countDevices ()
 Returns number of CUDA devices.
int getCurrentDevice ()
 Get device id of current CUDA context.

Detailed Description

contains all cuv functionality

Typedef Documentation

typedef index_range::index cuv::index

the index type used in index_range, useful for comparator syntax in

See Also
index_range

Definition at line 129 of file tensor.hpp.

typedef boost::detail::multi_array::index_range<boost::detail::multi_array::index,boost::detail::multi_array::size_type> cuv::index_range

defines an index range, stolen from boost::multi_array

examples:

index(1) <= index_range() < index(3)

Definition at line 125 of file tensor.hpp.

Function Documentation

template<class T , class M >
void cuv::avg_diagonals ( cuv::tensor< T, M > &  dst,
const cuv::dia_matrix< T, M > &  dia 
)

get the average of all diagonals of a diagonal matrix

Parameters
dstthe vector where the results are stored in
diathe diagonal matrix where the diagonals are supposed to be summed
template<class V , class M , class __memory_layout , class __index_type >
tensor<V,M,__memory_layout>* cuv::blockview ( tensor< V, M, __memory_layout > &  matrix,
__index_type  start_rows,
__index_type  num_rows,
__index_type  start_cols,
__index_type  num_cols 
)

Generate a view to a block inside an existing matrix.

Parameters
matrixMatrix to generate a view from
start_rowsFirst row in block
num_rowsNumber of rows in block
start_colsFirst column in block
num_colsNumber of columns in block
Returns
View of specified block inside matrix
    Returns a matrix of size num_rows x num_cols that is a view to the entries of matrix,
    starting at entry start_rows,start_cols to entry start_rows+num_rows,start_cols+num_cols.
    For row major matrices, this only works with start_cols=0 and num_cols=matrix.w().
    For column major matrices, this only works with start_rows=0 and num_rows=matrix.h().
template<class __value_type , class __memory_layout_type , class __index_type >
void cuv::densedense_to_dia ( dia_matrix< __value_type, dev_memory_space, __index_type > &  C,
const dev_block_descriptor< __value_type, __index_type > &  Cbd,
const tensor< __value_type, dev_memory_space, __memory_layout_type > &  A,
const tensor< __value_type, dev_memory_space, __memory_layout_type > &  B,
const __value_type &  factAB = 1.f,
const __value_type &  factC = 0.f 
)

DIA_Mat <- Dense_Mat * Dense_Mat_transposed.

This is one special case for matrix multiplication, where the second matrix is transposed and only the elements on the diagonals of a DIA matrix must be computed. The function is needed for the backwards-pass of a neural network.

Parameters
Ctarget matrix
Cbdblock descriptor (is not changed, so you can re-use the bd for all matrices with same layout)
AA as in C=A*B'
BB as in C=A*B'
factABthe result of A*B is multiplied with this factAB and then added to factC*C
factCthe result of A*B is multiplied with this factAB and then added to factC*C
template<class __value_typeA , class __value_typeB , class __memory_space_type , class __memory_layout_type >
void cuv::image_move ( tensor< __value_typeA, __memory_space_type, __memory_layout_type > &  dst,
const tensor< __value_typeB, __memory_space_type, __memory_layout_type > &  src,
const unsigned int &  image_width,
const unsigned int &  image_height,
const unsigned int &  num_maps,
const int &  xshift,
const int &  yshift 
)

Shift images by given amount.

Parameters
dstwhere the moved images are written
srcunsigned char where original images are taken from
src_image_sizewidth and height of image in source
dst_image_sizewidth and height of image in destination
src_num_mapshow many maps there are in src
xshifthow much to shift right
yshifthow much to shift down
template<class Archive , class value_type , class index_type >
void cuv::serialize ( Archive &  ar,
cuv::dia_matrix< value_type, host_memory_space, index_type > &  m,
const unsigned int  version 
)

Serialize/deserialize a host-dia-matrix to/from an archive.

Parameters
arthe archive
mthe dia-matrix to serialize
versionnot used

Definition at line 60 of file sparse_matrix_io.hpp.