jhplot
Class HNeuralNet

java.lang.Object
  extended by jhplot.HNeuralNet

public class HNeuralNet
extends java.lang.Object

Neural net calculations. Based on Backpropagation NN.


Constructor Summary
HNeuralNet()
          Create a network net and set name for the network
 
Method Summary
 void addFeedForwardLayer(int neuronCount)
          Construct this layer with a sigmoid threshold function.
 org.encog.neural.data.basic.BasicNeuralDataSet editData()
          Edit data
 org.encog.neural.networks.BasicNetwork editNetwork()
          Edit a neural net in a frame
 org.encog.neural.data.basic.BasicNeuralDataSet getData()
          Get data
 java.util.ArrayList<java.lang.Double> getEpochError()
          Returns errors for each epoch.
 org.encog.neural.networks.Network getNetwork()
          Return neural net back.
 org.encog.neural.data.basic.BasicNeuralDataSet predict()
          Generate predictions for the data.
 org.encog.neural.data.basic.BasicNeuralDataSet predict(org.encog.neural.data.basic.BasicNeuralDataSet data)
          Evaluate data set using currenr NN
 org.encog.neural.data.NeuralData predict(org.encog.neural.data.NeuralData input)
          Evaluate data using currenr NN
 P0D predict(P0D input)
          Generate prediction for input data
 PND predict(PND input)
          Generate predictions for all input data
 int read(java.lang.String file, java.lang.String name)
          Read a neural net from a file.
 void reset()
          Reset the weight matrix and the thresholds.
 java.lang.String save(java.lang.String file, java.lang.String name, java.lang.String description)
          Save current status of neural net.
 void setData(double[][] input)
          Construct a data set from an input
 void setData(double[][] input, double[][] ideal)
          Construct a data set from an input and idea array.
 void setData(PND input)
          Set data
 void setData(PND input, PND ideal)
          Set data for training.
 void show()
          Show Net in EncodeDocument.
 void showNetwork()
          Show a neural net in a frame
 PND standardize(PND input)
          Standardize each column.
 int trainBackpopogation(boolean isShow, int maxEpoch, double learnRate, double momentum, double errorMinEpoch)
          Training neural network.Construct a backpropagation trainer.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HNeuralNet

public HNeuralNet()
Create a network net and set name for the network

Parameters:
name - name for the network
Method Detail

reset

public void reset()
Reset the weight matrix and the thresholds.


addFeedForwardLayer

public void addFeedForwardLayer(int neuronCount)
Construct this layer with a sigmoid threshold function. Use sigmoid for activation.

Parameters:
neuronCount - How many neurons in this layer

setData

public void setData(double[][] input,
                    double[][] ideal)
Construct a data set from an input and idea array. Used for supervized training.

Parameters:
input - The input into the neural network for training.
ideal - The ideal output for training.

setData

public void setData(double[][] input)
Construct a data set from an input

Parameters:
input - The input into the neural network for training.

setData

public void setData(PND input,
                    PND ideal)
Set data for training.

Parameters:
input - input data set
ideal - expected resul.

setData

public void setData(PND input)
Set data

Parameters:
input - input data set

standardize

public PND standardize(PND input)
Standardize each column. This means S(i)= (X(i) - mean) / std fot each column in PND;

Parameters:
input - PND
Returns:
new PND after standardize

getData

public org.encog.neural.data.basic.BasicNeuralDataSet getData()
Get data

Returns:
data

predict

public org.encog.neural.data.NeuralData predict(org.encog.neural.data.NeuralData input)
Evaluate data using currenr NN

Returns:
data

predict

public P0D predict(P0D input)
Generate prediction for input data

Parameters:
input - input data for predictions

predict

public org.encog.neural.data.basic.BasicNeuralDataSet predict(org.encog.neural.data.basic.BasicNeuralDataSet data)
Evaluate data set using currenr NN

Returns:
data after NN evaluation

predict

public PND predict(PND input)
Generate predictions for all input data

Parameters:
input - input data for prediction
Returns:
data with predictions

predict

public org.encog.neural.data.basic.BasicNeuralDataSet predict()
Generate predictions for the data. The data should be set with the method setData(PND) or setData(array[][])

Returns:
predictions

trainBackpopogation

public int trainBackpopogation(boolean isShow,
                               int maxEpoch,
                               double learnRate,
                               double momentum,
                               double errorMinEpoch)
Training neural network.Construct a backpropagation trainer. Typical example: train(5000, 0.1, 0.25, 0.001);

Parameters:
isShow - Show learning on a pop-up plot
maxEpoch - maximum number of epochs
learnRate - The rate at which the weight matrix will be adjusted based on learning.
momentum - The influence that previous iteration's training deltas will have on the current iteration.
errorMinEpoch - min error for epoch.
Returns:
returns the epoch at which training was stopped.

save

public java.lang.String save(java.lang.String file,
                             java.lang.String name,
                             java.lang.String description)
Save current status of neural net.

Parameters:
file - File name
name - Name of this neural network
description - description
Returns:
what is done

read

public int read(java.lang.String file,
                java.lang.String name)
Read a neural net from a file.

Parameters:
file - File name
name - Name of this neural network
Returns:
0 if it is OK. -1 if file not found; -2: if NN not found.

getNetwork

public org.encog.neural.networks.Network getNetwork()
Return neural net back.

Returns:
network

showNetwork

public void showNetwork()
Show a neural net in a frame


editNetwork

public org.encog.neural.networks.BasicNetwork editNetwork()
Edit a neural net in a frame


editData

public org.encog.neural.data.basic.BasicNeuralDataSet editData()
Edit data

Returns:
corrected BasicNeuralDataSet

show

public void show()
Show Net in EncodeDocument.


getEpochError

public java.util.ArrayList<java.lang.Double> getEpochError()
Returns errors for each epoch. If the max epoch number was set in the train() method. The array may have less entries if learning has reached the minimum error.

Returns:
arrays of errors for each epoch


jHepWork 1.7 (C) Chekanov