Function Design: 3-Output Mapper Functions

Posted

The 3-output mapper functions are the simplest of all the new mapper functions, as they need to define only 3 intervals, one for each discrete output. For this series I chose to map the intervals to {-1, 0, +1} instead of {0, 1, 2} to explore the symmetry around zero.

Again, there are three different functions in this series – Map3A, Map3B, and Map3C – with 2, 3, and 4 arguments, respectively. And their performances are also exceptional: in this case all of them performed exactly the same, with 98% hits, which is also the same hit rate obtained both for the argmin and argmax functions of 3 arguments.

And here's their complete description in C++:

// Map3A(x0,x1): 3-Output Mapper Function
const double SLACK = 10.0;
double output = 0.0;
if (x[1] < (x[0] - SLACK))
output = -1.0;
else if (x[1] > (x[0] + SLACK))
output = 1.0;
return output;

// Map3B(x0,x1,x2): 3-Output Mapper Function
// evaluate min(x,y) and max(x,y)
double min = x[0];
double max = x[1];
if (min > x[1])
{
min = x[1];
max = x[0];
}

double output = 0.0;
if (x[2] < min)
output = -1.0;
else if (x[2] > max)
output = 1.0;
return output;

// Map3C(x0,x1,x2,x3): 3-Output Mapper Function
// evaluate min(x,y,z) and max(x,y,z)
//
// evaluate min(x,y,z)
double min = x[0];
if (min > x[1])
min = x[1];
if (min > x[2])
min = x[2];
// evaluate max(x,y,z)
double max = x[0];
if (max < x[1])
max = x[1];
if (max < x[2])
max = x[2];

double output = 0.0;
if (x[3] < min)
output = -1.0;
else if (x[3] > max)
output = 1.0;
return output;

In the next post I'll describe the other new class of discrete classifier functions: the elastic classifier functions introduced for the first time in the post "Function Design: New 3-6 Output Functions".

Author