mxnet
Public Member Functions | Public Attributes | List of all members
dmlc::RowBlock< IndexType, DType > Struct Template Reference

a block of data, containing several rows in sparse matrix This is useful for (streaming-sxtyle) algorithms that scans through rows of data examples include: SGD, GD, L-BFGS, kmeans More...

#include <data.h>

Collaboration diagram for dmlc::RowBlock< IndexType, DType >:
Collaboration graph

Public Member Functions

Row< IndexType, DType > operator[] (size_t rowid) const
 get specific rows in the batch More...
 
size_t MemCostBytes (void) const
 
RowBlock Slice (size_t begin, size_t end) const
 slice a RowBlock to get rows in [begin, end) More...
 

Public Attributes

size_t size
 batch size More...
 
const size_t * offset
 array[size+1], row pointer to beginning of each rows More...
 
const DType * label
 array[size] label of each instance More...
 
const real_tweight
 With weight: array[size] label of each instance, otherwise nullptr. More...
 
const uint64_t * qid
 With qid: array[size] session id of each instance, otherwise nullptr. More...
 
const IndexType * field
 field id More...
 
const IndexType * index
 feature index More...
 
const DType * value
 feature value, can be NULL, indicating all values are 1 More...
 

Detailed Description

template<typename IndexType, typename DType = real_t>
struct dmlc::RowBlock< IndexType, DType >

a block of data, containing several rows in sparse matrix This is useful for (streaming-sxtyle) algorithms that scans through rows of data examples include: SGD, GD, L-BFGS, kmeans

The size of batch is usually large enough so that parallelizing over the rows can give significant speedup

Template Parameters
IndexTypetype to store the index used in row batch
DTypetype to store the label and value used in row batch

Member Function Documentation

template<typename IndexType , typename DType = real_t>
size_t dmlc::RowBlock< IndexType, DType >::MemCostBytes ( void  ) const
inline
Returns
memory cost of the block in bytes
template<typename IndexType , typename DType >
Row< IndexType, DType > dmlc::RowBlock< IndexType, DType >::operator[] ( size_t  rowid) const
inline

get specific rows in the batch

Parameters
rowidthe rowid in that row
Returns
the instance corresponding to the row
template<typename IndexType , typename DType = real_t>
RowBlock dmlc::RowBlock< IndexType, DType >::Slice ( size_t  begin,
size_t  end 
) const
inline

slice a RowBlock to get rows in [begin, end)

Parameters
beginthe begin row index
endthe end row index
Returns
the sliced RowBlock

Member Data Documentation

template<typename IndexType , typename DType = real_t>
const IndexType* dmlc::RowBlock< IndexType, DType >::field

field id

template<typename IndexType , typename DType = real_t>
const IndexType* dmlc::RowBlock< IndexType, DType >::index

feature index

template<typename IndexType , typename DType = real_t>
const DType* dmlc::RowBlock< IndexType, DType >::label

array[size] label of each instance

template<typename IndexType , typename DType = real_t>
const size_t* dmlc::RowBlock< IndexType, DType >::offset

array[size+1], row pointer to beginning of each rows

template<typename IndexType , typename DType = real_t>
const uint64_t* dmlc::RowBlock< IndexType, DType >::qid

With qid: array[size] session id of each instance, otherwise nullptr.

template<typename IndexType , typename DType = real_t>
size_t dmlc::RowBlock< IndexType, DType >::size

batch size

template<typename IndexType , typename DType = real_t>
const DType* dmlc::RowBlock< IndexType, DType >::value

feature value, can be NULL, indicating all values are 1

template<typename IndexType , typename DType = real_t>
const real_t* dmlc::RowBlock< IndexType, DType >::weight

With weight: array[size] label of each instance, otherwise nullptr.


The documentation for this struct was generated from the following file: