havBpNet:J

All Packages  Class Hierarchy  This Package  Previous  Next  Index

havBpNet:J Home Page

Class havNN.havData.havTdata

java.lang.Object
   |
   +----havNN.havData.havTdata

public class havTdata
extends Object
The havTdata class implements a data collection class that can be used for handling input and expected data patterns used in training or consulting a neural net constructed with havBpNet-J.

Design, Implementation, and Usage Notes The havTdata class was designed as a mechanism for holding a collection of patterns and for controlling those operations that are typically performed on the entire collection of patterns (like reading, scaling, random ordering, etc.). You will notice that many of the methods appear in several forms: one for operating on entire patterns (both the input-pattern & expected-pattern parts) or on the individual parts of patterns. For example, there are three methods for calculation of mean and std-dev parameters:

This was done to allow a high degree of flexibility; however, we expect that the first form will be most often used.

Version:
1.1(java) 1/1/98

Constructor Index

 o havTdata(int, int, int, String, int, double)
Standard Constructor.

Method Index

 o CalculateMean()
Calculate the Means for both INPUT and EXPECTED patterns.
 o CalculateParms()
Calculate Mean and Standard Deviation values.
 o CalculateStdDev()
Calculate the standard-deviations for both the input and expected pattern elements of all patterns in the data set.
 o CopyMean(double[])
Copy this instance's EXPECTED Pattern Means into a caller supplied array.
 o CopyParms(havTdata)
Copy the INPUT and EXPECTED Pattern Mean & Std-dev values FROM another instance of havTdata.
 o CopyPMean(double[])
Copy this instance's INPUT Pattern Means into a caller supplied array.
 o CopyPStdDev(double[])
Copy this instance's INPUT Pattern Std-dev's into a caller supplied array.
 o CopyStdDev(double[])
Copy this instance's EXPECTED Pattern Std-dev's into a caller supplied array.
 o GetMean()
Get a reference to the local list of EXPECTED Pattern Mean values.
 o GetMean(int)
Get the Mean of the i-th EXPECTED Pattern element.
 o GetPat(int)
Get the pnum-th pattern.
 o GetPMean()
Get a reference to the local list of INPUT Pattern Mean values.
 o GetPMean(int)
Get the Mean of the i-th INPUT Pattern element.
 o GetPStdDev()
Get a reference to the local list of INPUT Pattern Std-dev values.
 o GetPStdDev(int)
Get the Std-dev of the i-th INPUT Pattern element.
 o GetRandPat(int)
Get the pnum-th RANDOM pattern.
 o GetStdDev()
Get a reference to the local list of INPUT Pattern Std-dev values.
 o GetStdDev(int)
Get the Std-dev of the i-th INPUT Pattern element.
 o Normalize()
Apply Mean & Std-dev Normalization to both INPUT & EXPECTED patterns.
 o NormalizeExp()
Apply Mean & Std-dev Normalization to EXPECTED patterns.
 o NormalizePat()
Apply Mean & Std-dev Normalization to INPUT patterns.
 o PutMean(double[])
Set EXPECTED Means.
 o PutPMean(double[])
Set INPUT Means.
 o PutPStdDev(double[])
Set INPUT Std-dev's.
 o PutStdDev(double[])
Set EXPECTED Std-dev's.
 o Randomize()
Generate new random pattern order.
 o RestoreParms(StreamTokenizer)
Restore the mean and standard-deviation values.
 o SaveParms(FileOutputStream)
Save the mean and standard-deviation values.
 o ShowRandList()
Print the current random order list to stdout.
 o SkipRestoreParms(StreamTokenizer)
Skip saved Mean & Std-dev data in a SAVE file.

Constructors

 o havTdata
 public havTdata(int num_pat,
                 int pat_size,
                 int exp_size,
                 String fname,
                 int do_havlog,
                 double shape) throws IOException
Standard Constructor.

Parameters:
num_pat - number of patterns in the dataset.
pat_size - number of elements in an INPUT pattern.
exp_size - number of elements in an EXPECTED pattern.
fname - name of the file containing the data to be read in.
do_havlog - havSys.havTRUE means to perform havlog scaling on data.
shape - shaping factor for havlog scaling.
Throws: IOException
thrown if IO error occurs while reading data.

Methods

 o GetPat
 public havTpat GetPat(int pnum)
Get the pnum-th pattern.

Parameters:
pnum - index (from 0) of the pattern to be returned.
 o GetRandPat
 public havTpat GetRandPat(int pnum)
Get the pnum-th RANDOM pattern.

Parameters:
pnum - index (from 0) of the pattern in the random order list to be returned.
 o SaveParms
 public void SaveParms(FileOutputStream out) throws IOException
Save the mean and standard-deviation values. Mean and Std-dev for both the pattern and expected values are saved in the caller indicated file.

Parameters:
out - the SAVE file. The SAVE file is expected to be open and positioned prior to using this method.
Throws: IOException
thrown if IO error occurs while writing data.
 o RestoreParms
 public void RestoreParms(StreamTokenizer in) throws IOException
Restore the mean and standard-deviation values. Mean and Std-dev for both the pattern and expected values are restored from the caller indicated file.

Parameters:
in - the SAVE file. The SAVE file is expected to be open and positioned prior to using this method.
Throws: IOException
thrown if IO error occurs while reading data.
 o SkipRestoreParms
 public void SkipRestoreParms(StreamTokenizer in) throws IOException
Skip saved Mean & Std-dev data in a SAVE file. This method will position a SAVE file past the havTdata mean and standard-deviation values in the indicated save file.

Parameters:
in - the SAVE file.
Throws: IOException
thrown if IO error occurs while reading data.
 o CalculateParms
 public void CalculateParms()
Calculate Mean and Standard Deviation values. This method will calculate the mean and standard-deviation values for the patterns currently in the patterns member. There will be one mean and one standard-deviation for each element in both the input pattern and the expected pattern.

 o Randomize
 public void Randomize()
Generate new random pattern order. This method will generate a new random order list for pattern processing. The list will be stored in the rand_list member. This function may be called as often and whenever desired.

 o ShowRandList
 public void ShowRandList()
Print the current random order list to stdout.

 o CopyParms
 public void CopyParms(havTdata in)
Copy the INPUT and EXPECTED Pattern Mean & Std-dev values FROM another instance of havTdata. Both input and expected patterns are copied.

Parameters:
in - the havTpat instance FROM which patterns are to be copied.
 o CopyPMean
 public void CopyPMean(double m[])
Copy this instance's INPUT Pattern Means into a caller supplied array.

Parameters:
m - the array INTO which data is copied.
 o GetPMean
 public double GetPMean(int i)
Get the Mean of the i-th INPUT Pattern element.

Parameters:
i - the index (from 0) of the element who's mean is to be returned.
 o GetPMean
 public double[] GetPMean()
Get a reference to the local list of INPUT Pattern Mean values.

 o CopyPStdDev
 public void CopyPStdDev(double s[])
Copy this instance's INPUT Pattern Std-dev's into a caller supplied array.

Parameters:
s - the array INTO which data is copied.
 o GetPStdDev
 public double GetPStdDev(int i)
Get the Std-dev of the i-th INPUT Pattern element.

Parameters:
i - the index (from 0) of the element who's mean is to be returned.
 o GetPStdDev
 public double[] GetPStdDev()
Get a reference to the local list of INPUT Pattern Std-dev values.

 o CopyMean
 public void CopyMean(double m[])
Copy this instance's EXPECTED Pattern Means into a caller supplied array.

Parameters:
m - the array INTO which data is copied.
 o GetMean
 public double GetMean(int i)
Get the Mean of the i-th EXPECTED Pattern element.

Parameters:
i - the index (from 0) of the element who's mean is to be returned.
 o GetMean
 public double[] GetMean()
Get a reference to the local list of EXPECTED Pattern Mean values.

 o CopyStdDev
 public void CopyStdDev(double s[])
Copy this instance's EXPECTED Pattern Std-dev's into a caller supplied array.

Parameters:
s - the array INTO which data is copied.
 o GetStdDev
 public double GetStdDev(int i)
Get the Std-dev of the i-th INPUT Pattern element.

Parameters:
i - the index (from 0) of the element who's mean is to be returned.
 o GetStdDev
 public double[] GetStdDev()
Get a reference to the local list of INPUT Pattern Std-dev values.

 o CalculateMean
 public void CalculateMean()
Calculate the Means for both INPUT and EXPECTED patterns. There will be one mean for each element in the input pattern and expected pattern. Mean is calculated for each element (ele[k]) as the sum of ele[k] for all patterns in the data set divided by the number of patterns in the data set.

 o PutPMean
 public void PutPMean(double m[])
Set INPUT Means. Sets all Mean values to a caller supplied list of values.

Parameters:
m - caller supplied list of values.
 o PutMean
 public void PutMean(double m[])
Set EXPECTED Means. Sets all Mean values to a caller supplied list of values.

Parameters:
m - caller supplied list of values.
 o CalculateStdDev
 public void CalculateStdDev()
Calculate the standard-deviations for both the input and expected pattern elements of all patterns in the data set. For each pattern element (ele[k]) the standard deviation is calculated as the sqrt of the sum of the squared differences between the pattern's ele[k] and the mean for ele[k].

 o PutPStdDev
 public void PutPStdDev(double s[])
Set INPUT Std-dev's. Replace this instance's INPUT pattern standard-deviations by a caller supplied list of std-dev values.

Parameters:
s - the caller supplied list of Std-dev values.
 o PutStdDev
 public void PutStdDev(double s[])
Set EXPECTED Std-dev's. Replace this instance's EXPECTED pattern standard-deviations by a caller supplied list of std-dev values.

Parameters:
s - the caller supplied list of Std-dev values.
 o Normalize
 public void Normalize()
Apply Mean & Std-dev Normalization to both INPUT & EXPECTED patterns.

 o NormalizePat
 public void NormalizePat()
Apply Mean & Std-dev Normalization to INPUT patterns. Each element (ele k of pattern i) is modified by subtracting the appropriate Mean and dividing by the appropriate Standard-deviation as ...
ele[i][k] = (ele[i][k] - mean[k]) / stdev[k]

 o NormalizeExp
 public void NormalizeExp()
Apply Mean & Std-dev Normalization to EXPECTED patterns. Each element (ele k of pattern i) is modified by subtracting the appropriate Mean and dividing by the appropriate Standard-deviation as ...
ele[i][k] = (ele[i][k] - mean[k]) / stdev[k]


All Packages  Class Hierarchy  This Package  Previous  Next  Index

Copyright © 1998 by hav.Software. All Rights Reserved.