Chap 9.   Predictor-PolyNet Translation Layer
9.1   Encoding and Decoding Functions
9.2   Parameters
9.3   Chapter Project: Encoding and Decoding
9.4   Test Run

Chap 9.   Predictor-PolyNet Translation Layer

Chapters 8 – 11 will introduce the Presentation Layer components, abm2. If you do not want know the internal structure, please skip chapters 8, 9, 10, and 11.

There are two types of data used by neural network systems: user data (or application data), and neural data. Neural networks use neural data. User data depends on the application. The information processed by a neural network has to be prepared by Abm2. This is called Data Encoding. Similarly, after neural computation, Abm2 is responsible for converting the neural output data back into user-application data.  This is called Data Decoding.

This chapter discusses how to format the Predictor data for the PolyNet. Attrasoft Predictor is software that predicts a sequence. The last chapter discussed the Predictor in detail. The Predictor uses the Abm, not the PolyNet. This chapter, we will replace the Abm with the PolyNet.

The Abm2 class library is an interface between the PolyApplet and the data used by the Predictor software. There are two matching algorithms in the PolyApplet: Abm and PolyNet. The Abm2 class library will translate data for both algorithms. The Abm2 class library will play four roles:

Data Source                   Data Consumer              Description
Predictor Data               Abm                               Chap 8
Predictor Data               PolyNet                          Chap 9
DecisionMaker Data      Abm                               Chap 10
DecisionMaker Data      PolyNet                          Chap 11
We introduced the Abm2 class library in the last chapter. This chapter we will only discuss the topics related to PolyNet.

9.1   Encoding and Decoding Functions

The Encoding functions are:

bool predictorEncodePolyLinear   ();
The Decoding functions are:
bool predictorDecodePolyLinearReal   ();
bool predictorDecodePolyLinearInt   ();
9.2   Parameters

The Parameters are:

 public int Trend;
 public double Empty-Field;
Let the Trend be N, the Predictor will look at all N-row patterns, then it will look at the last N - 1 rows and make a prediction. The number of rows in the Trend is a user-selected variable: you decide the number of rows in the Trend. If you do not make a choice, the default value uses a 5-trend. To change the Trend, use this property.

The Precision-level is fixed at 10 and is not a parameter for the PolyNet.

The Empty-Field means whenever the Predictor meets this number, it will ignore the number. The reason for this parameter is to handle cases where there are missing entries in the historical data.
 

Figure 9.1   Chapter 9 Project.

9.3   Chapter Project: Encoding and Decoding

This chapter project is basically the same as the last one, with the exceptions of the Abm encoding/decoding being replaced by PolyNet encoding/decoding. The file I/O part has been implemented and the neural computing part has been implemented. The only job that needs to be done here is Data Encoding and Decoding.

There are two pairs of Encoding and Decoding:

Integer Prediction:

 private void button16_Click_1(object sender, System.EventArgs e)
  {
   y.predictorEncodePolyLinear   ();
   richTextBox1.AppendText ( "Encoding End!\n") ;
  }
private void button25_Click(object sender, System.EventArgs e)
  {
   y.predictorDecodePolyLinearInt   ();
   y.openOutputFile ();
  }
Real Prediction:
private void button16_Click_1(object sender, System.EventArgs e)
  {
   y.predictorEncodePolyLinear   ();
   richTextBox1.AppendText ( "Encoding End!\n") ;
  }
private void button25_Click(object sender, System.EventArgs e)
  {
   y.predictorDecodePolyLinearReal   ();
   y.openOutputFile ();
  }


9.4   Test Run

Step 1. Files.

Enter the five data files in the following (default selection):

Input:   D_math1a.txt:
Train:   example1a.txt
Recognition:  example1c.txt
Neural Output: example1d.txt
Output:  example2c.txt
Step 2. Encoding.

Click the “PolyNet Int” encoding button.

Step 3. Neural Computing.

Click the “P Distribute” button (P = PolyNet) to complete the neural computing.

Step 4. Decoding.

Click the “PolyNet Int” decoding button.

Step 5. Repeat Steps 2- 4 for Real Prediction.

In summary, we introduced the part of the Abm2 class library that translates the Predictor data to and from the PolyNet data.
 
 

Return