SHOGUN v0.9.0
公有成员 | 静态公有成员 | 保护成员 | 保护属性
CDotFeatures类参考

详细描述

Features that support dot products among other operations.

DotFeatures support the following operations:

\[r = {\bf x} \cdot {\bf x'}\]

\[r = {\bf x} \cdot {\bf z}\]

\[ {\bf z'} = \alpha {\bf x} + {\bf z} \]

在文件DotFeatures.h43行定义。

继承图,类CDotFeatures
Inheritance graph
[图例]

所有成员的列表。

公有成员

 CDotFeatures (int32_t size=0)
 CDotFeatures (const CDotFeatures &orig)
 CDotFeatures (CFile *loader)
virtual ~CDotFeatures ()
virtual int32_t get_dim_feature_space ()=0
virtual float64_t dot (int32_t vec_idx1, CDotFeatures *df, int32_t vec_idx2)=0
virtual float64_t dense_dot (int32_t vec_idx1, const float64_t *vec2, int32_t vec2_len)=0
virtual void add_to_dense_vec (float64_t alpha, int32_t vec_idx1, float64_t *vec2, int32_t vec2_len, bool abs_val=false)=0
virtual void dense_dot_range (float64_t *output, int32_t start, int32_t stop, float64_t *alphas, float64_t *vec, int32_t dim, float64_t b)
virtual void dense_dot_range_subset (int32_t *sub_index, int32_t num, float64_t *output, float64_t *alphas, float64_t *vec, int32_t dim, float64_t b)
virtual int32_t get_nnz_features_for_vector (int32_t num)=0
float64_t get_combined_feature_weight ()
void set_combined_feature_weight (float64_t nw)
virtual void get_feature_matrix (float64_t **dst, int32_t *num_feat, int32_t *num_vec)
virtual void get_feature_vector (float64_t **dst, int32_t *len, int32_t num)
void benchmark_add_to_dense_vector (int32_t repeats=5)
void benchmark_dense_dot_range (int32_t repeats=5)
virtual void * get_feature_iterator (int32_t vector_index)=0
virtual bool get_next_feature (int32_t &index, float64_t &value, void *iterator)=0
virtual void free_feature_iterator (void *iterator)=0

静态公有成员

static void * dense_dot_range_helper (void *p)

保护成员

void display_progress (int32_t start, int32_t stop, int32_t v)

保护属性

float64_t combined_weight
 feature weighting in combined dot features

构造及析构函数文档

CDotFeatures ( int32_t  size = 0)

constructor

参数:
sizecache size

在文件DotFeatures.cpp40行定义。

CDotFeatures ( const CDotFeatures orig)

copy constructor

在文件DotFeatures.cpp48行定义。

CDotFeatures ( CFile loader)

constructor

参数:
loaderFile object via which to load data

在文件DotFeatures.cpp55行定义。

virtual ~CDotFeatures ( ) [virtual]

在文件DotFeatures.h64行定义。


成员函数文档

virtual void add_to_dense_vec ( float64_t  alpha,
int32_t  vec_idx1,
float64_t vec2,
int32_t  vec2_len,
bool  abs_val = false 
) [pure virtual]

add vector 1 multiplied with alpha to dense vector2

参数:
alphascalar alpha
vec_idx1index of first vector
vec2pointer to real valued vector
vec2_lenlength of real valued vector
abs_valif true add the absolute value

CCombinedDotFeaturesCExplicitSpecFeaturesCHashedWDFeaturesCHashedWDFeaturesTransposedCImplicitWeightedSpecFeaturesCLBPPyrDotFeaturesCPolyFeaturesCSimpleFeatures< ST >CSNPFeaturesCSparseFeatures< ST >CSparsePolyFeaturesCWDFeaturesCSimpleFeatures< uint32_t >CSimpleFeatures< float64_t >CSimpleFeatures< uint16_t >CSparseFeatures< float64_t >内被实现。

void benchmark_add_to_dense_vector ( int32_t  repeats = 5)

run benchmark for add_to_dense_vec

在文件DotFeatures.cpp320行定义。

void benchmark_dense_dot_range ( int32_t  repeats = 5)

run benchmark for dense_dot_range

在文件DotFeatures.cpp343行定义。

virtual float64_t dense_dot ( int32_t  vec_idx1,
const float64_t vec2,
int32_t  vec2_len 
) [pure virtual]

compute dot product between vector1 and a dense vector

参数:
vec_idx1index of first vector
vec2pointer to real valued vector
vec2_lenlength of real valued vector

CCombinedDotFeaturesCExplicitSpecFeaturesCHashedWDFeaturesCHashedWDFeaturesTransposedCImplicitWeightedSpecFeaturesCLBPPyrDotFeaturesCPolyFeaturesCSimpleFeatures< ST >CSNPFeaturesCSparseFeatures< ST >CSparsePolyFeaturesCWDFeaturesCSimpleFeatures< uint32_t >CSimpleFeatures< float64_t >CSimpleFeatures< uint16_t >CSparseFeatures< float64_t >内被实现。

void dense_dot_range ( float64_t output,
int32_t  start,
int32_t  stop,
float64_t alphas,
float64_t vec,
int32_t  dim,
float64_t  b 
) [virtual]

Compute the dot product for a range of vectors. This function makes use of dense_dot alphas[i] * sparse[i]^T * w + b

参数:
outputresult for the given vector range
startstart vector range from this idx
stopstop vector range at this idx
alphasscalars to multiply with, may be NULL
vecdense vector to compute dot product with
dimlength of the dense vector
bbias

note that the result will be written to output[0...(stop-start-1)]

CCombinedDotFeaturesCHashedWDFeaturesTransposed重载。

在文件DotFeatures.cpp68行定义。

void * dense_dot_range_helper ( void *  p) [static]

Compute the dot product for a range of vectors. This function is called by the threads created in dense_dot_range

CHashedWDFeaturesTransposed重载。

在文件DotFeatures.cpp232行定义。

void dense_dot_range_subset ( int32_t *  sub_index,
int32_t  num,
float64_t output,
float64_t alphas,
float64_t vec,
int32_t  dim,
float64_t  b 
) [virtual]

Compute the dot product for a subset of vectors. This function makes use of dense_dot alphas[i] * sparse[i]^T * w + b

参数:
sub_indexindex for which to compute outputs
numlength of index
outputresult for the given vector range
alphasscalars to multiply with, may be NULL
vecdense vector to compute dot product with
dimlength of the dense vector
bbias

CCombinedDotFeaturesCHashedWDFeaturesTransposed重载。

在文件DotFeatures.cpp154行定义。

void display_progress ( int32_t  start,
int32_t  stop,
int32_t  v 
) [protected]

display progress output

参数:
startminimum value
stopmaximum value
vcurrent value

在文件DotFeatures.h216行定义。

virtual float64_t dot ( int32_t  vec_idx1,
CDotFeatures df,
int32_t  vec_idx2 
) [pure virtual]

compute dot product between vector1 and vector2, appointed by their indices

参数:
vec_idx1index of first vector
dfDotFeatures (of same kind) to compute dot product with
vec_idx2index of second vector

CCombinedDotFeaturesCExplicitSpecFeaturesCHashedWDFeaturesCHashedWDFeaturesTransposedCImplicitWeightedSpecFeaturesCLBPPyrDotFeaturesCPolyFeaturesCSimpleFeatures< ST >CSNPFeaturesCSparseFeatures< ST >CSparsePolyFeaturesCWDFeaturesCSimpleFeatures< uint32_t >CSimpleFeatures< float64_t >CSimpleFeatures< uint16_t >CSparseFeatures< float64_t >内被实现。

virtual void free_feature_iterator ( void *  iterator) [pure virtual]
float64_t get_combined_feature_weight ( )

get combined feature weight

返回:
combined feature weight

在文件DotFeatures.h147行定义。

virtual int32_t get_dim_feature_space ( ) [pure virtual]

obtain the dimensionality of the feature space

(not mix this up with the dimensionality of the input space, usually obtained via get_num_features())

返回:
dimensionality

CCombinedDotFeaturesCExplicitSpecFeaturesCHashedWDFeaturesCHashedWDFeaturesTransposedCImplicitWeightedSpecFeaturesCLBPPyrDotFeaturesCPolyFeaturesCSimpleFeatures< ST >CSNPFeaturesCSparseFeatures< ST >CSparsePolyFeaturesCWDFeaturesCSimpleFeatures< uint32_t >CSimpleFeatures< float64_t >CSimpleFeatures< uint16_t >CSparseFeatures< float64_t >内被实现。

virtual void* get_feature_iterator ( int32_t  vector_index) [pure virtual]

iterate over the non-zero features

call get_feature_iterator first, followed by get_next_feature and free_feature_iterator to cleanup

参数:
vector_indexthe index of the vector over whose components to iterate over
返回:
feature iterator (to be passed to get_next_feature)

CCombinedDotFeaturesCExplicitSpecFeaturesCHashedWDFeaturesCHashedWDFeaturesTransposedCImplicitWeightedSpecFeaturesCLBPPyrDotFeaturesCPolyFeaturesCSimpleFeatures< ST >CSNPFeaturesCSparseFeatures< ST >CSparsePolyFeaturesCWDFeaturesCSimpleFeatures< uint32_t >CSimpleFeatures< float64_t >CSimpleFeatures< uint16_t >CSparseFeatures< float64_t >内被实现。

void get_feature_matrix ( float64_t **  dst,
int32_t *  num_feat,
int32_t *  num_vec 
) [virtual]

get a copy of the feature matrix (in feature space) num_feat,num_vectors are returned by reference

参数:
dstdestination to store matrix in
num_featnumber of features (rows of matrix)
num_vecnumber of vectors (columns of matrix)

CSimpleFeatures< float64_t >重载。

在文件DotFeatures.cpp285行定义。

void get_feature_vector ( float64_t **  dst,
int32_t *  len,
int32_t  num 
) [virtual]

get a copy of the feature matrix (in feature space) num_feat,num_vectors are returned by reference

参数:
dstdestination to store matrix in
lennumber of features
numindex of vector

CSimpleFeatures< float64_t >重载。

在文件DotFeatures.cpp307行定义。

virtual bool get_next_feature ( int32_t &  index,
float64_t value,
void *  iterator 
) [pure virtual]

iterate over the non-zero features

call this function with the iterator returned by get_first_feature and call free_feature_iterator to cleanup

参数:
indexis returned by reference (-1 when not available)
valueis returned by reference
iteratoras returned by get_first_feature
返回:
true if a new non-zero feature got returned

CCombinedDotFeaturesCExplicitSpecFeaturesCHashedWDFeaturesCHashedWDFeaturesTransposedCImplicitWeightedSpecFeaturesCLBPPyrDotFeaturesCPolyFeaturesCSimpleFeatures< ST >CSNPFeaturesCSparseFeatures< ST >CSparsePolyFeaturesCWDFeaturesCSimpleFeatures< uint32_t >CSimpleFeatures< float64_t >CSimpleFeatures< uint16_t >CSparseFeatures< float64_t >内被实现。

virtual int32_t get_nnz_features_for_vector ( int32_t  num) [pure virtual]

get number of non-zero features in vector

(in case accurate estimates are too expensive overestimating is OK)

参数:
numwhich vector
返回:
number of sparse features in vector

CCombinedDotFeaturesCExplicitSpecFeaturesCHashedWDFeaturesCHashedWDFeaturesTransposedCImplicitWeightedSpecFeaturesCLBPPyrDotFeaturesCPolyFeaturesCSimpleFeatures< ST >CSNPFeaturesCSparseFeatures< ST >CSparsePolyFeaturesCWDFeaturesCSimpleFeatures< uint32_t >CSimpleFeatures< float64_t >CSimpleFeatures< uint16_t >CSparseFeatures< float64_t >内被实现。

void set_combined_feature_weight ( float64_t  nw)

set combined kernel weight

参数:
nwnew combined feature weight

在文件DotFeatures.h153行定义。


成员数据文档

feature weighting in combined dot features

在文件DotFeatures.h228行定义。


该类的文档由以下文件生成:

SHOGUN Machine Learning Toolbox - Documentation