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:
- NormalizePat(...) - which performs M&S normalization on the input-pattern part
and
- NormalizeExp(...) - which performs M&S normalization on the expected-pattern
part.
- Version:
- 1.1(java) 1/1/98
-
havTpat(int, int, StreamTokenizer, havTdata)
- Standard Constructor.
-
CopyExp(double[])
- Get a copy of the EXPECTED pattern (in its scaled and normalized form) in a caller supplied
buffer.
-
CopyPat(double[])
- Get a copy of the INPUT pattern (in its scaled and normalized form) in a caller supplied
buffer.
-
CopyRawExp(double[])
- Get a copy of the EXPECTED pattern (all scaling and normalization removed) in a caller supplied
buffer.
-
CopyRawPat(double[])
- Get a copy of the INPUT pattern (all scaling and normalization removed) in a caller supplied
buffer.
-
Dohavlog(double)
- Apply havlog scaling on BOTH INPUT and EXPECTED patterns of this data instance.
-
GetExp()
- Get a reference to the EXPECTED pattern.
-
GetExp(int)
- Get the i-th element (in its scaled and normalized form) from the EXPECTED pattern.
-
GetPat()
- Get a reference to the INPUT pattern.
-
GetPat(int)
- Get the i-th element (in its scaled and normalized form) fron the INPUT pattern.
-
GetRawExp(int)
- Get the i-th element (all scaling and normalization removed) fron the EXPECTED pattern.
-
GetRawPat(int)
- Get the i-th element (all scaling and normalization removed) fron the INPUT pattern.
-
NormalizeExp(double[], double[])
- Apply the appropriate mean and standard deviations to the EXPECTED PATTERN in this data pattern
instance.
-
NormalizePat(double[], double[])
- Apply the appropriate mean and standard deviations to the INPUT PATTERN in this data pattern
instance.
-
PrintPatError(havBpLayer, boolean)
- Calculate error for a given pattern in an indicated output layer - optionally report error for
the pattern to stdout.
-
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.
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.
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 ...
- ) calculate the network's error for the current pattern,
- ) print (to stdout) a "pretty" report of network performance for a pattern and
- ) 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
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 ...
- ) calculate the network's error for the current pattern,
- ) print (to stdout) a "pretty" report of network performance for a pattern and
- ) return the total pattern error.
NOTE: error will be either 0% or 100%.
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.
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.
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.
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.
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.
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.
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.
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.
GetPat
public double[] GetPat()
- Get a reference to the INPUT pattern.
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.
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.
GetExp
public double[] GetExp()
- Get a reference to the EXPECTED pattern.
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.