Medial Code Documentation
Loading...
Searching...
No Matches
Public Member Functions | Data Fields
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>

Public Member Functions

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

Data Fields

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

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

◆ MemCostBytes()

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

◆ operator[]()

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

◆ Slice()

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

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