org.joone.structure
Class NetworkAsCFOProblem

java.lang.Object
  extended by CFOProblem
      extended by org.joone.structure.NetworkAsCFOProblem

public class NetworkAsCFOProblem
extends CFOProblem

Describes the network as a oat CFOProblem. This class is used to transform a network into a optimisation problem, where the weights and potentially the initial states of the network are the domain of the problem and the network global error function the goal function.

Author:
mg

Field Summary
protected  double[] current
          The current network solution
protected  int cycleCount
          Number of times that we've cycled through the network
protected  java.util.Set<javax.swing.event.ChangeListener> cycleListeners
          Change listeners that are notified as the network completes a cycle
protected  NeuralNet network
          The network we are optimising here
protected  java.lang.Object[] optimise
          The array of objects that we need to optimise.
protected  double[][] preapreMinMax
          The parameter ranges
protected  java.util.Random random
          The random number generator to use when generating initial guesses
protected  double stdev
          The standard deviation to use when generating initial guesses
 
Constructor Summary
NetworkAsCFOProblem(NeuralNet network, boolean includeInitialStates)
          Create a new problem based on the network
 
Method Summary
 void addCycleListener(javax.swing.event.ChangeListener listener)
          Add a new cycle listener
 double[][] getInitialGuess(int desiredCount)
          A CFOProblem will typically create its own random initial guesses.
 java.lang.String getName()
          Anyone has any better suggestions
 SUPPORTED_DIMENSIONS[] getSupportDimensionality()
          This is multidimensional
protected  void init(NodesAndWeights nodesAndWeights, boolean includeInitialStates)
          Initialise
 boolean isMinimization()
          Yebo
protected  double[][] preapreMinMax()
          We leave this to the last, allowing the user to change the range for example
protected  double[][] preapreOptima()
          We are also looking for this
protected  double problemSpecificCost(double[] v)
          Run through one iteration of the network and return the global error
 void removeCycleListener(javax.swing.event.ChangeListener listener)
          Remove the given cycle listener
 void setCurrent(double[] current)
          Set the current solution to that contained in the array
 void useCurrent(double stdev, java.util.Random random)
          Use the current network weight and initial state values as an initial guess.
 void useRandom(double stdev, java.util.Random random)
          Use a random initial guess, generated using the given standard deviation and random number generator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cycleListeners

protected java.util.Set<javax.swing.event.ChangeListener> cycleListeners
Change listeners that are notified as the network completes a cycle


network

protected NeuralNet network
The network we are optimising here


cycleCount

protected int cycleCount
Number of times that we've cycled through the network


optimise

protected java.lang.Object[] optimise
The array of objects that we need to optimise. This represents a combination of weights and initial states, potentially only weights.


current

protected double[] current
The current network solution


stdev

protected double stdev
The standard deviation to use when generating initial guesses


random

protected java.util.Random random
The random number generator to use when generating initial guesses


preapreMinMax

protected double[][] preapreMinMax
The parameter ranges

Constructor Detail

NetworkAsCFOProblem

public NetworkAsCFOProblem(NeuralNet network,
                           boolean includeInitialStates)
Create a new problem based on the network

Parameters:
network - the network we want to optimise
includeInitialStates - if true, the network's initial states, if any, will form part of the problem and also be optimised
Method Detail

useCurrent

public void useCurrent(double stdev,
                       java.util.Random random)
Use the current network weight and initial state values as an initial guess. The alternative is to use random weights

Parameters:
stdev - the standard deviation to use when generating random initial guess around the current network solution
random - the random number generator to use to generate the initial guesses with

useRandom

public void useRandom(double stdev,
                      java.util.Random random)
Use a random initial guess, generated using the given standard deviation and random number generator

Parameters:
stdev - the standard deviation to use when generating random initial guesses
random - the random number generator to use to generate the initial guesses with

init

protected void init(NodesAndWeights nodesAndWeights,
                    boolean includeInitialStates)
Initialise

Parameters:
nodesAndWeights - the network's nodes and weights
includeInitialStates - if true, the network initial state is also optimised

getName

public java.lang.String getName()
Anyone has any better suggestions


getSupportDimensionality

public SUPPORTED_DIMENSIONS[] getSupportDimensionality()
This is multidimensional


preapreMinMax

protected double[][] preapreMinMax()
We leave this to the last, allowing the user to change the range for example


preapreOptima

protected double[][] preapreOptima()
We are also looking for this


isMinimization

public boolean isMinimization()
Yebo


getInitialGuess

public double[][] getInitialGuess(int desiredCount)
A CFOProblem will typically create its own random initial guesses. Sometimes we want to continue from where we left off, and then this is useful.


problemSpecificCost

protected double problemSpecificCost(double[] v)
Run through one iteration of the network and return the global error


addCycleListener

public void addCycleListener(javax.swing.event.ChangeListener listener)
Add a new cycle listener

Parameters:
listener - listener that will be notified when the network completes a cycle

removeCycleListener

public void removeCycleListener(javax.swing.event.ChangeListener listener)
Remove the given cycle listener


setCurrent

public void setCurrent(double[] current)
Set the current solution to that contained in the array



Submit Feedback to pmarrone@users.sourceforge.net