Permalink
Browse files

made loss viewable by sender

  • Loading branch information...
1 parent 84d09d6 commit 8fce3bccd890733f4150230a70c90d035396b652 @JohnLangford JohnLangford committed Sep 30, 2009
Showing with 5 additions and 2 deletions.
  1. +1 −0 global_data.cc
  2. +1 −0 global_data.h
  3. +2 −2 message_relay.cc
  4. +1 −0 parse_args.cc
View
@@ -1,6 +1,7 @@
#include <pthread.h>
#include "global_data.h"
#include "multisource.h"
+#include "message_relay.h"
global_data global;
pthread_mutex_t io = PTHREAD_MUTEX_INITIALIZER;
View
@@ -32,6 +32,7 @@ struct global_data {
size_t unique_id; //unique id for each node in the network, id == 0 means extra io.
void (*print)(int,float,v_array<char>);
+ loss_function* loss;
char* program_name;
View
@@ -10,8 +10,8 @@ void* mesg_relay(void* in)
{
example *ec = blocking_get_delay_example(global.num_threads());
ec->final_prediction = ps.p;
- // label_data* ld = (label_data*)ec->ld;
- ec->loss = 0;//global.reg.loss->getLoss(ec->final_prediction, ld->label) * ld->weight;
+ label_data* ld = (label_data*)ec->ld;
+ ec->loss = global.loss->getLoss(ec->final_prediction, ld->label) * ld->weight;
finish_example(ec);
}
return NULL;
View
@@ -131,6 +131,7 @@ po::variables_map parse_args(int argc, char *argv[], boost::program_options::opt
if(vm.count("quantiles_tau"))
loss_parameter = vm["quantiles_tau"].as<double>();
r.loss = getLossFunction(loss_function, loss_parameter);
+ global.loss = r.loss;
vars.eta *= pow(vars.t, vars.power_t);
if (!global.quiet)

0 comments on commit 8fce3bc

Please sign in to comment.