27 bool is_labelled, int32_t size)
30 init(file, is_labelled, size);
35 bool is_labelled, int32_t size)
38 init(file, is_labelled, size);
71 parser.set_free_vector_after_release(
false);
75 SG_ERROR(
"The input cannot be reset! Please use 1 pass.\n")
95 vec = SG_REALLOC(
float32_t, vec, len, dim);
96 memset(&vec[len], 0, (dim-len) *
sizeof(
float32_t));
106 vec = SG_REALLOC(
float64_t, vec, len, dim);
107 memset(&vec[len], 0, (dim-len) *
sizeof(
float64_t));
115 if (gravity < fabsf(w))
138 void CStreamingVwFeatures::init()
149 void CStreamingVwFeatures::init(
CStreamingVwFile* file,
bool is_labelled, int32_t size)
154 parser.init(file, is_labelled, size);
155 parser.set_free_vector_after_release(
false);
168 parser.init(file, is_labelled, size);
169 parser.set_free_vector_after_release(
false);
177 void CStreamingVwFeatures::setup_example(
VwExample* ae)
204 ae->
atomics[constant_namespace].push(temp);
213 j->weight_index = j->weight_index*stride;
228 += (ae->
atomics[(int32_t)(i[0])].end - ae->
atomics[(int32_t)(i[0])].begin)
229 *(ae->
atomics[(int32_t)(i[1])].end - ae->
atomics[(int32_t)(i[1])].begin);
292 parser.finalize_example();
virtual void reset_stream()
uint32_t vw_size_t
vw_size_t typedef to work across platforms
virtual void set_env(CVwEnvironment *vw_env)
T get_element(int32_t index) const
float64_t weighted_examples
Weighted examples.
T * end
Pointer to last set element in the array.
virtual void set_vector_and_label_reader()
virtual EFeatureClass get_feature_class() const
virtual void release_example()
virtual float32_t dot(CStreamingDotFeatures *df)
T * begin
Pointer to first element of the array.
static const float64_t INFTY
infinity
CVwEnvironment * env
Environment for VW.
Class CVwEnvironment is the environment used by VW.
virtual void add_to_dense_vec(float32_t alpha, VwExample *&ex, float32_t *vec2, int32_t vec2_len, bool abs_val=false)
VwExample * current_example
Example currently being processed.
virtual bool is_seekable()
virtual int32_t get_num_vectors() const
bool has_labels
Whether examples are labelled or not.
vw_size_t num_features
Number of features.
virtual VwExample * get_example()
int64_t example_number
Example number.
float32_t total_sum_feat_sq
Total sum of square of features.
virtual void start_parser()
virtual void get_vector(bool *&vector, int32_t &len)
#define SG_NOTIMPLEMENTED
virtual int32_t get_num_features()
vw_size_t num_bits
log_2 of the number of features
virtual int32_t get_dim_feature_space() const
int32_t get_num_elements() const
virtual EFeatureType get_feature_type() const
float64_t sum_feat_sq[256]
Sum of square of features.
void push(const T &new_elem)
CStreamingFile * working_file
The StreamingFile object to read from.
EFeatureClass
shogun feature class
float32_t label
Label value.
virtual void reset_stream()
v_array< vw_size_t > indices
Array of namespaces.
virtual float32_t dense_dot_truncated(const float32_t *vec2, VwExample *&ex, float32_t gravity)
float64_t current_label
The current example's label.
virtual CVwEnvironment * get_env()
float32_t weight
Weight of example.
float64_t weighted_labels
Weighted labels.
virtual float64_t get_label()
bool ignore_some
Whether some namespaces are ignored.
DynArray< char * > pairs
Pairs of features to cross for quadratic updates.
const int32_t constant_hash
Constant used to access the constant feature.
vw_size_t stride
Number of elements in weight vector per feature.
virtual int32_t get_nnz_features_for_vector()
virtual void set_vector_reader()
vw_size_t example_counter
Example counter.
virtual float32_t real_weight(float32_t w, float32_t gravity)
Streaming features that support dot products among other operations.
float32_t example_t
t value for this example
SGSparseVectorEntry< T > * features
vw_size_t mask
Mask used for hashing.
Class StreamingVwCacheFile to read vector-by-vector from VW cache files.
vw_size_t total_features
Total number of features.
virtual bool get_next_example()
EFeatureType
shogun feature type
Class StreamingVwFile to read vector-by-vector from Vowpal Wabbit data files. It reads the example an...
float32_t global_weight
Global weight.
virtual void get_vector_and_label(bool *&vector, int32_t &len, float64_t &label)
all of classes and functions are contained in the shogun namespace
void set_read_functions()
int32_t current_length
Number of features in current example.
virtual void end_parser()
bool seekable
Whether the stream is seekable.
The class Features is the base class of all feature objects.
VwLabel * ld
Label object.
CFeatures * duplicate() const
template class SGSparseVector The assumtion is that the stored SGSparseVectorEntry* vector is orde...
vw_size_t thread_mask
Mask used by regressor for learning.
virtual float32_t dense_dot(VwExample *&ex, const float32_t *vec2)
vw_size_t passes_complete
Number of passes complete.
bool ignore[256]
Which namespaces to ignore.
vw_size_t example_count
Number of examples processed at a point of time.
CInputParser< VwExample > parser
The parser object, which reads from input and returns parsed example objects.
virtual void expand_if_required(float32_t *&vec, int32_t &len)
float64_t sum_loss
Sum of losses.
v_array< VwFeature > atomics[256]
Array of features.