  # 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 < (x - SLACK))
output = -1.0;
else if (x > (x + 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;
double max = x;
if (min > x)
{
min = x;
max = x;
}

double output = 0.0;
if (x < min)
output = -1.0;
else if (x > 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;
if (min > x)
min = x;
if (min > x)
min = x;
// evaluate max(x,y,z)
double max = x;
if (max < x)
max = x;
if (max < x)
max = x;

double output = 0.0;
if (x < min)
output = -1.0;
else if (x > 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