havBpNet:J

All Packages  Class Hierarchy  This Package  Previous  Next  Index

havBpNet:J Home Page

Class havNN.havData.havTpat

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

public class havTpat
extends Object
The havTpat class implements a data pattern consisting of an INPUT PATTERN and an EXPECTED RESPONSE PATTERN pair.

Design, Implementation, and Usage Notes
The havTpat class was designed as a mechanism for holding individual training and/or consultation patterns for use by havBpNet++ neural network applications. Each instance of havTpat holds one pattern. Each pattern has two parts: an input-pattern and an expected-pattern. You will notice that many of the member functions of havTpat appear in several forms - one for each pattern part. For example, there are two member functions for applying M&S normalization:

Version:
1.1(java) 1/1/98

Constructor Index

 o havTpat(int, int, StreamTokenizer, havTdata)
Standard Constructor.

Method Index

 o CopyExp(double[])
Get a copy of the EXPECTED pattern (in its scaled and normalized form) in a caller supplied buffer.
 o CopyPat(double[])
Get a copy of the INPUT pattern (in its scaled and normalized form) in a caller supplied buffer.
 o CopyRawExp(double[])
Get a copy of the EXPECTED pattern (all scaling and normalization removed) in a caller supplied buffer.
 o CopyRawPat(double[])
Get a copy of the INPUT pattern (all scaling and normalization removed) in a caller supplied buffer.
 o Dohavlog(double)
Apply havlog scaling on BOTH INPUT and EXPECTED patterns of this data instance.
 o GetExp()
Get a reference to the EXPECTED pattern.
 o GetExp(int)
Get the i-th element (in its scaled and normalized form) from the EXPECTED pattern.
 o GetPat()
Get a reference to the INPUT pattern.
 o GetPat(int)
Get the i-th element (in its scaled and normalized form) fron the INPUT pattern.
 o GetRawExp(int)
Get the i-th element (all scaling and normalization removed) fron the EXPECTED pattern.
 o GetRawPat(int)
Get the i-th element (all scaling and normalization removed) fron the INPUT pattern.
 o NormalizeExp(double[], double[])
Apply the appropriate mean and standard deviations to the EXPECTED PATTERN in this data pattern instance.
 o NormalizePat(double[], double[])
Apply the appropriate mean and standard deviations to the INPUT PATTERN in this data pattern instance.
 o PrintPatError(havBpLayer, boolean)
Calculate error for a given pattern in an indicated output layer - optionally report error for the pattern to stdout.
 o PrintSignPatError(havBpLayer, boolean)
Calculate error (based on only the sign of expected and actual response values)for a given pattern in an indicated output layer - optionally report error for the pattern to stdout.

Constructors

 o havTpat
 public havTpat(int ps,
                int es,
                StreamTokenizer in,
                havTdata p) throws IOException
Standard Constructor.

Parameters:
ps - pattern size - number of elements in a single INPUT pattern.
es - expected size - number of elements in a single EXPECTED response pattern.
in - opened and positioned data file from which input and expected data patterns will be read.
p - the parent instance of havTdata to which this pattern belongs.
Throws: IOException
thrown if any IO Errors occur while reading input data.

Methods

 o PrintPatError
 public double PrintPatError(havBpLayer out,
                             boolean show_progress)
Calculate error for a given pattern in an indicated output layer - optionally report error for the pattern to stdout. This function will ...
  1. ) calculate the network's error for the current pattern,
  2. ) print (to stdout) a "pretty" report of network performance for a pattern and
  3. ) return the total pattern error.

NOTE: Since %AbsError is calculated as (expect-actual)/expect use of expected values of zero cause problems. This is avoided by assuming a %AbsErr of actual*100 when expect = 0.

Parameters:
out - the layer whose nodes are to be prpocessed.
show_progress - indicator to produce or not produce the report
 o PrintSignPatError
 public double PrintSignPatError(havBpLayer out,
                                 boolean show_progress)
Calculate error (based on only the sign of expected and actual response values)for a given pattern in an indicated output layer - optionally report error for the pattern to stdout. This function will ...
  1. ) calculate the network's error for the current pattern,
  2. ) print (to stdout) a "pretty" report of network performance for a pattern and
  3. ) return the total pattern error.

NOTE: error will be either 0% or 100%.

 o NormalizePat
 public void NormalizePat(double mn[],
                          double sd[])
Apply the appropriate mean and standard deviations to the INPUT PATTERN in this data pattern instance. ALSO, stores local copies of the referencese to the parent data set's pattern mean and pattern stdev members passed as agruments.

Parameters:
mn - array of MEAN values to apply.
sd - array of standard deviation values to apply.
 o NormalizeExp
 public void NormalizeExp(double mn[],
                          double sd[])
Apply the appropriate mean and standard deviations to the EXPECTED PATTERN in this data pattern instance. ALSO, stores local copies of the referencese to the parent data set's pattern mean and pattern stdev members passed as agruments.

Parameters:
mn - array of MEAN values to apply.
sd - array of standard deviation values to apply.
 o CopyPat
 public void CopyPat(double ret[])
Get a copy of the INPUT pattern (in its scaled and normalized form) in a caller supplied buffer.

Parameters:
ret - buffer in which the input pattern is to be returned.
 o CopyExp
 public double[] CopyExp(double ret[])
Get a copy of the EXPECTED pattern (in its scaled and normalized form) in a caller supplied buffer.

Parameters:
ret - buffer in which the expected pattern is to be returned.
 o CopyRawPat
 public void CopyRawPat(double ret[])
Get a copy of the INPUT pattern (all scaling and normalization removed) in a caller supplied buffer.

NOTE: The returned values will have had the effects of standard scaling (havSys.havlog) and normalization (mean & stdev) REMOVED.

Parameters:
ret - buffer in which the input pattern is to be returned.
 o CopyRawExp
 public void CopyRawExp(double ret[])
Get a copy of the EXPECTED pattern (all scaling and normalization removed) in a caller supplied buffer.

NOTE: The returned values will have had the effects of standard scaling (havSys.havlog) and normalization (mean & stdev) REMOVED.

Parameters:
ret - buffer in which the expected pattern is to be returned.
 o GetPat
 public double GetPat(int i)
Get the i-th element (in its scaled and normalized form) fron the INPUT pattern.

Parameters:
i - the index (from 0) of the pattern element to be returned.
 o GetRawPat
 public double GetRawPat(int i)
Get the i-th element (all scaling and normalization removed) fron the INPUT pattern.

Parameters:
i - the index (from 0) of the pattern element to be returned.
 o GetPat
 public double[] GetPat()
Get a reference to the INPUT pattern.

 o GetExp
 public double GetExp(int i)
Get the i-th element (in its scaled and normalized form) from the EXPECTED pattern.

Parameters:
i - the index (from 0) of the pattern element to be returned.
 o GetRawExp
 public double GetRawExp(int i)
Get the i-th element (all scaling and normalization removed) fron the EXPECTED pattern.

Parameters:
i - the index (from 0) of the pattern element to be returned.
 o GetExp
 public double[] GetExp()
Get a reference to the EXPECTED pattern.

 o Dohavlog
 public void Dohavlog(double shape)
Apply havlog scaling on BOTH INPUT and EXPECTED patterns of this data instance.

Parameters:
shape - the havlog shape factor to be used.

All Packages  Class Hierarchy  This Package  Previous  Next  Index

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