Vowpal Wabbit
Typedefs | Functions | Variables
no_label Namespace Reference

Typedefs

typedef char no_label
 

Functions

char * bufread_no_label (shared_data *, label_data *, char *c)
 
size_t read_cached_no_label (shared_data *, void *, io_buf &)
 
float get_weight (void *)
 
char * bufcache_no_label (label_data *, char *c)
 
void cache_no_label (void *, io_buf &)
 
void default_no_label (void *)
 
bool test_label (void *)
 
void delete_no_label (void *)
 
void parse_no_label (parser *, shared_data *, void *, v_array< substring > &words)
 
void print_no_label_update (vw &all, example &ec)
 
void output_and_account_no_label_example (vw &all, example &ec)
 
void return_no_label_example (vw &all, void *, example &ec)
 

Variables

label_parser no_label_parser
 

Typedef Documentation

◆ no_label

typedef char no_label::no_label

Definition at line 14 of file no_label.h.

Function Documentation

◆ bufcache_no_label()

char* no_label::bufcache_no_label ( label_data ,
char *  c 
)

Definition at line 18 of file no_label.cc.

References c.

18 { return c; }
constexpr uint64_t c
Definition: rand48.cc:12

◆ bufread_no_label()

char* no_label::bufread_no_label ( shared_data ,
label_data ,
char *  c 
)

Definition at line 12 of file no_label.cc.

References c.

12 { return c; }
constexpr uint64_t c
Definition: rand48.cc:12

◆ cache_no_label()

void no_label::cache_no_label ( void *  ,
io_buf  
)

Definition at line 20 of file no_label.cc.

20 {}

◆ default_no_label()

void no_label::default_no_label ( void *  )

Definition at line 22 of file no_label.cc.

22 {}

◆ delete_no_label()

void no_label::delete_no_label ( void *  )

Definition at line 26 of file no_label.cc.

26 {}

◆ get_weight()

float no_label::get_weight ( void *  )

Definition at line 16 of file no_label.cc.

16 { return 1.; }

◆ output_and_account_no_label_example()

void no_label::output_and_account_no_label_example ( vw all,
example ec 
)

Definition at line 54 of file no_label.cc.

References f, vw::final_prediction_sink, example::loss, example::num_features, example::partial_prediction, example::pred, vw::print, print_no_label_update(), vw::raw_prediction, polyprediction::scalar, vw::sd, v_array< T >::size(), example::tag, example::test_only, shared_data::update(), and example::weight.

55 {
56  all.sd->update(ec.test_only, false, ec.loss, ec.weight, ec.num_features);
57 
58  all.print(all.raw_prediction, ec.partial_prediction, -1, ec.tag);
59  for (size_t i = 0; i < all.final_prediction_sink.size(); i++)
60  {
61  int f = (int)all.final_prediction_sink[i];
62  all.print(f, ec.pred.scalar, 0, ec.tag);
63  }
64 
65  print_no_label_update(all, ec);
66 }
v_array< char > tag
Definition: example.h:63
int raw_prediction
Definition: global_data.h:519
float scalar
Definition: example.h:45
v_array< int > final_prediction_sink
Definition: global_data.h:518
float partial_prediction
Definition: example.h:68
size_t size() const
Definition: v_array.h:68
shared_data * sd
Definition: global_data.h:375
size_t num_features
Definition: example.h:67
void update(bool test_example, bool labeled_example, float loss, float weight, size_t num_features)
Definition: global_data.h:190
float loss
Definition: example.h:70
void print_no_label_update(vw &all, example &ec)
Definition: no_label.cc:44
polyprediction pred
Definition: example.h:60
float weight
Definition: example.h:62
void(* print)(int, float, float, v_array< char >)
Definition: global_data.h:521
float f
Definition: cache.cc:40
bool test_only
Definition: example.h:76

◆ parse_no_label()

void no_label::parse_no_label ( parser ,
shared_data ,
void *  ,
v_array< substring > &  words 
)

Definition at line 28 of file no_label.cc.

References print_substring(), and v_array< T >::size().

29 {
30  switch (words.size())
31  {
32  case 0:
33  break;
34  default:
35  std::cout << "Error: " << words.size() << " is too many tokens for a simple label: ";
36  for (unsigned int i = 0; i < words.size(); ++i) print_substring(words[i]);
37  std::cout << std::endl;
38  }
39 }
size_t size() const
Definition: v_array.h:68
void print_substring(substring s)

◆ print_no_label_update()

void no_label::print_no_label_update ( vw all,
example ec 
)

Definition at line 44 of file no_label.cc.

References vw::bfgs, vw::current_pass, shared_data::dump_interval, vw::holdout_set_off, example::num_features, example::pred, shared_data::print_update(), vw::progress_add, vw::progress_arg, vw::quiet, polyprediction::scalar, vw::sd, shared_data::weighted_labeled_examples, and shared_data::weighted_unlabeled_examples.

Referenced by output_and_account_no_label_example().

45 {
47  !all.bfgs)
48  {
50  all.progress_arg);
51  }
52 }
float scalar
Definition: example.h:45
double weighted_unlabeled_examples
Definition: global_data.h:143
bool quiet
Definition: global_data.h:487
bool holdout_set_off
Definition: global_data.h:499
bool progress_add
Definition: global_data.h:545
shared_data * sd
Definition: global_data.h:375
float progress_arg
Definition: global_data.h:546
void print_update(bool holdout_set_off, size_t current_pass, float label, float prediction, size_t num_features, bool progress_add, float progress_arg)
Definition: global_data.h:225
bool bfgs
Definition: global_data.h:412
size_t num_features
Definition: example.h:67
uint64_t current_pass
Definition: global_data.h:396
double weighted_labeled_examples
Definition: global_data.h:141
polyprediction pred
Definition: example.h:60
float dump_interval
Definition: global_data.h:147

◆ read_cached_no_label()

size_t no_label::read_cached_no_label ( shared_data ,
void *  ,
io_buf  
)

Definition at line 14 of file no_label.cc.

14 { return 1; }

◆ return_no_label_example()

void no_label::return_no_label_example ( vw all,
void *  ,
example ec 
)

Definition at line 68 of file no_label.cc.

References VW::finish_example(), and output_and_account_example().

69 {
71  VW::finish_example(all, ec);
72 }
void output_and_account_example(vw &all, active &a, example &ec)
Definition: active.cc:105
void finish_example(vw &, example &)
Definition: parser.cc:881

◆ test_label()

bool no_label::test_label ( void *  )

Definition at line 24 of file no_label.cc.

24 { return false; }

Variable Documentation

◆ no_label_parser

label_parser no_label::no_label_parser
Initial value:
get_weight, nullptr, test_label, sizeof(nullptr)}
float get_weight(void *v)
Definition: simple_label.cc:37
void cache_no_label(void *, io_buf &)
Definition: no_label.cc:20
void parse_no_label(parser *, shared_data *, void *, v_array< substring > &words)
Definition: no_label.cc:28
size_t read_cached_no_label(shared_data *, void *, io_buf &)
Definition: no_label.cc:14
void default_no_label(void *)
Definition: no_label.cc:22
bool test_label(void *v)
Definition: simple_label.cc:70
void delete_no_label(void *)
Definition: no_label.cc:26

Definition at line 41 of file no_label.cc.

Referenced by lda_setup().