HNeuralNet
jhplot

Class HNeuralNet



  • public class HNeuralNetextends Object
    Neural Netwrork calculations. Based on Backpropagation.
    • 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
      • addFeedForwardLayerWithBias

        public void addFeedForwardLayerWithBias(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
      • predict

        public MLData predict(MLData input)
        Evaluate data using current NN
        Returns:
        data
      • predict

        public P0D predict(P0D input)
        Generate prediction for input data
        Parameters:
        input - input data for predictions
      • predict

        public PND predict(PND input)
        Generate predictions for all input data. Assumes that the predicted array has less then 3 dimensions.
        Parameters:
        input - input data for prediction
        Returns:
        data with predictions
      • trainBackpropagation

        public int trainBackpropagation(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 String save(String file)
        Save current status of neural net.
        Parameters:
        file - File name
        Returns:
        what is done
      • read

        public int read(String file)
        Read a neural net from a file.
        Parameters:
        file - File name
        Returns:
        0 if it is OK. -1 if file not found; -2: if NN not found.
      • getNetwork

        public BasicNetwork getNetwork()
        Return neural net back.
        Returns:
        network
      • showNetwork

        public void showNetwork()
        Show a neural net in a frame.
      • showWeights

        public void showWeights()
        Show a neural net weights in a separate frame.
      • analyzeNetwork

        public AnalyzeNetwork analyzeNetwork()
        Analyse the current neural network.
        Returns:
        analyzer
      • editNetwork

        public BasicNetwork editNetwork()
        Edit a neural net in a frame
      • show

        public void show()
        Show Net in EncodeDocument.
      • getEpochError

        public ArrayList<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
      • doc

        public void doc()
        Show online documentation.

SCaVis 1.8 © jWork.org