27 void setTasks(
bool task0,
bool task1,
bool task2)
34 void draw(
InputType& input,
unsigned int& label)
const 39 }
while (! m_task[taskindex]);
42 unsigned int y = (x1 > 0.0) ? 1 : 0;
43 double alpha = 0.05 * M_PI * taskindex;
44 input.
input.resize(2);
45 input.
input(0) = cos(alpha) * x1 - sin(alpha) * x2;
46 input.
input(1) = sin(alpha) * x1 + cos(alpha) * x2;
47 input.
task = taskindex;
56 int main(
int argc,
char** argv)
59 unsigned int ell_train = 1000;
60 unsigned int ell_test = 1000;
65 MultiTaskProblem problem;
66 problem.setTasks(
true,
true,
false);
68 problem.setTasks(
false,
false,
true);
73 for (
size_t i=0; i<ell_train; i++)
75 for (
size_t i=0; i<ell_test; i++)
90 cout <<
"training ..." << endl;
91 trainer.
train(ke, training);
92 cout <<
"done." << endl;
99 cout <<
"training error:\t" << trainError << endl;
103 cout <<
"test error:\t" << testError << endl;