saaps.ann
Class WeightsCreator

java.lang.Object
  |
  +--saaps.ann.WeightsCreator

public class WeightsCreator
extends java.lang.Object

The WeightsCreator class is used to read weight data from an ASCII file.


Constructor Summary
WeightsCreator()
           
 
Method Summary
static Weights[] read(java.lang.String fileName)
          Read the weights from an ASCII file and create an array of Weights objects.
static Weights[] read(java.lang.String fileName, int numOfInputs)
          Deprecated. This method is replaced by read(String).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WeightsCreator

public WeightsCreator()
Method Detail

read

public static Weights[] read(java.lang.String fileName)
Read the weights from an ASCII file and create an array of Weights objects. The ASCII file must have the following format:
m n
w(1,1) w(1,2) ... w(1,n) b(1)
w(2,1) w(2,2) ... w(2,n) b(2)
... ... ... ... ...
w(m,1) w(m,2) ... w(m,n) b(m)
where m is the number of neurons and n is the number of inputs. The w(i,j) is the weight connecting input j to neuron i, and b(i) is the bias of neuron i. The order of the data in the ASCII file must be the same as above, however, the data need not be separated by new-lines, any white-space characters will work.
Parameters:
fileName - The file name of the ASCII weights file.
Returns:
An array of Weights objects. The number of Weights objects equals the number of neurons, and the number of weights in each Weights object equals the number of inputs.
See Also:
Weights

read

public static Weights[] read(java.lang.String fileName,
                             int numOfInputs)
Deprecated. This method is replaced by read(String).

Read the weights from an ASCII file specifying the number of inputs.