|
|
Intro Network Classes Overview Data Classes Overview Packages havBpNet:J Home Page
Creating a collection of patterns using the havTdata class
Each instance of havTdata will contain a data-set. A data-set contains some number of patterns where each pattern contains an input pattern and, optionally, an expected pattern. When creating an instance of havTdata, you must specify several things:
Consider the following code excerpt which creates two data sets - one for training data - a second for test data used to determine network performance during training.
//=========== pattern and layer sizes
static int number_of_test_patterns = 104; // number of patterns in test data set
static int number_of_train_patterns = 104; // number of patterns in training data set
static int pattern_size = 60; // number of input elements in a pattern
static int expected_size = 1; // number of output (expected) elements in a pattern
//=========== data file names
static String infile = new String("sonartrain.dat"); // input data file name
static String testfile = new String("sonartest.dat"); // input test data file name
. . .
//========== create data sets for training and test data (creation reads in data)
havTdata train_data = new havTdata(number_of_train_patterns, pattern_size, expected_size,
infile, havSys.havFALSE, 1.0);
havTdata test_data = new havTdata(number_of_test_patterns, pattern_size, expected_size,
testfile, havSys.havFALSE, 1.0);
|
By the end of this excerpt, both data sets have been created and filled from their respective files.
The havTdata class is smart enough to remember that havlog scaling has been applied so that later, as we ask for errors, we will be given errors in un-scaled form.
Creating a data-set for Input patterns only
The example above illustrates creation of havTdata data-sets for patterns containing both input pattern and expected-pattern components. To create a data-set for patterns without expected-pattern parts, the expected_size parameter should be set to zero.
Intro Network Classes Overview Data Classes Overview Packages
Copyright © 1998 by hav.Software. All Rights Reserved.