jeffheaton's picture

    In binary format, true is represented with the number one and false is represented with zero. Bipolar notation is another way to represent binary states. In bipolar notation true is represented by one and false is represented by negative one.

    Equation 2.18 describes how a Boolean number is converted into a bipolar number.

Equation 2.18: Boolean to Bipolar

A Threshold and Weight Matrix

    Equation 2.19 does the opposite. This equation shows how to convert a bipolar number into a boolean number.

Equation 2.19: Bipolar to Boolean

A Threshold and Weight Matrix

    Neural networks that operate on bool numbers will usually require these bool values to be expressed as bipolar numbers. To assist with this conversion, the BiPolarUtil class is provided. Table 2.2 summarized the functions provided by the BiPolarUtil class.

    The following code uses the BiPolarUtil class to construct a bipolar matrix.

bool booleanData2[,] = {
  new bool[2] {true,false},
  new bool[2] {false,true}
};
		
Matrix matrix2 = new Matrix(BiPolarUtil.Bipolar2double(booleanData2));

    This code will produce the matrix described in Equation 2.20.

Equation 2.20: A Bipolar Matrix

A Threshold and Weight Matrix

    This will be particularly useful in the next chapter in which a Hopfield neural network is presented. A Hopfield neural network makes use of bipolar matrixes.


Copyright 2005 - 2012 by Heaton Research, Inc.. Heaton Research™ and Encog™ are trademarks of Heaton Research. Click here for copyright, license and trademark information.