clarion.nacs
Class ProbBPNet

java.lang.Object
  extended byclarion.nacs.ProbBPNet

public class ProbBPNet
extends java.lang.Object


Field Summary
protected  double alpha
          learning rate.
protected  double[] desiredOutputs
          the desired outputs.
protected  int INPUT_NUM
          the number of input units.
protected  double[] inputs
          the inputs
protected  int OUTPUT_NUM
          the number of output units.
protected  double[] outputs
          the outputs.
protected  double[][] weights
          the weights.
 
Constructor Summary
ProbBPNet(int num1, int num2, double lr)
          constructor.
 
Method Summary
 void backward()
          Updates the weights.
 void forward()
          Computes the actual outputs.
 double getOutput(int idx)
          Returns a specific output.
 void getOutputs(double[] arr)
          Returns the outputs.
 void initWeights()
          initialization routine.
 void setDesiredOutputs(double[] arr)
          Sets the desired outputs in terms of an array of activations.
 void setDesiredOutputs(int[] arr)
          Sets the desired outputs.
 void setInputs(double[] arr)
          Sets the inputs in terms of an array of activations.
 void setInputs(int[] arr)
          Sets the inputs.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

alpha

protected double alpha
learning rate.


INPUT_NUM

protected int INPUT_NUM
the number of input units.


OUTPUT_NUM

protected int OUTPUT_NUM
the number of output units.


inputs

protected double[] inputs
the inputs


outputs

protected double[] outputs
the outputs.


desiredOutputs

protected double[] desiredOutputs
the desired outputs.


weights

protected double[][] weights
the weights.

Constructor Detail

ProbBPNet

public ProbBPNet(int num1,
                 int num2,
                 double lr)
constructor.

Parameters:
num1 - the number of inputs.
num2 - the number of outputs.
lr - learning rate.
Method Detail

getOutput

public double getOutput(int idx)
Returns a specific output.

Parameters:
idx - the index to the specific output.
Returns:
the specific output.

getOutputs

public void getOutputs(double[] arr)
Returns the outputs.

Parameters:
arr - the array to store the outputs.
Returns:
the outputs.

setInputs

public void setInputs(int[] arr)
Sets the inputs.

Parameters:
arr - the array used to set the inputs.

setInputs

public void setInputs(double[] arr)
Sets the inputs in terms of an array of activations.

Parameters:
arr - the array used to set the inputs.

setDesiredOutputs

public void setDesiredOutputs(int[] arr)
Sets the desired outputs.

Parameters:
arr - the array used to set the desired outputs.

setDesiredOutputs

public void setDesiredOutputs(double[] arr)
Sets the desired outputs in terms of an array of activations.

Parameters:
arr - the array used to set the desired outputs.

forward

public void forward()
Computes the actual outputs.


backward

public void backward()
Updates the weights.


initWeights

public void initWeights()
initialization routine.