org.joone.samples.util
Class ParityInputSynapse
- java.lang.Object
-
- org.joone.engine.Synapse
-
- org.joone.io.StreamInputSynapse
-
- org.joone.samples.util.ParityInputSynapse
-
- All Implemented Interfaces:
- java.io.Serializable, InputPatternListener, Learnable, LearnableSynapse, NeuralElement, OutputPatternListener, Inspectable, InputSynapse, PlugInListener
public class ParityInputSynapse extends StreamInputSynapse
This synapse creates input and desired output data for the parity problem. The parity problem is the problem where numbers (in binary form) having an even number of ones should output a zero and numbers having an odd number of ones should output a one.
The partity problem is a problem that is often used to test new learning algorithms, etc., because the problem is quite difficult. Whenever one bit changes the output should be the opposite.
This class is also mainly created to test new techniques.
The default size of the parity problem is two, that is, it creates the training data for the XOR problem.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description ParityInputSynapse()Creates a new instance of ParityInputSynapse
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description doublegetLowerBit()Gets the value used for the lower bit.intgetNumOfPatterns()Gets the number of patterns that exist for the parity problem, that is2^parity-size.intgetParitySize()Gets the parity size, that is, the number of bits of the input pattern.doublegetUpperBit()Gets the value used for the upper bit.voidsetLowerBit(double aValue)Sets the value for the lower bit.voidsetParitySize(int aSize)Sets the number of bits the parity problem should consist of, that is, the number of bits the input should consist of.voidsetUpperBit(double aValue)Sets the value for the upper bit.-
Methods inherited from class org.joone.io.StreamInputSynapse
addPlugIn, addPlugInListener, check, dataChanged, fwdGet, fwdGet, getAdvancedColumnSelector, getAllPlugInListeners, getCurrentRow, getDecimalPoint, getFirstCol, getFirstRow, getInputPatterns, getInputVector, getLastCol, getLastRow, getMaxBufSize, getPlugIn, getStream, gotoFirstLine, gotoLine, InspectableTitle, Inspections, isBuffered, isEOF, isStepCounter, numColumns, readAll, removeAllPlugIns, removePlugInListener, reset, resetInput, revPut, setAdvancedColumnSelector, setBuffered, setDecimalPoint, setFirstCol, setFirstRow, setInputPatterns, setLastCol, setLastRow, setMaxBufSize, setPlugin, setPlugIn, setStepCounter
-
Methods inherited from class org.joone.engine.Synapse
addNoise, canCountSteps, fwdPut, getIgnoreBefore, getInputDimension, getLearner, getLearningRate, getMomentum, getMonitor, getName, getOutputDimension, getWeights, init, initLearner, isEnabled, isInputFull, isLoopBack, isOutputFull, randomize, revGet, setEnabled, setIgnoreBefore, setInputDimension, setInputFull, setLearningRate, setLoopBack, setMomentum, setMonitor, setName, setOutputDimension, setOutputFull, setWeights
-
-
-
-
Constructor Detail
-
ParityInputSynapse
public ParityInputSynapse()
Creates a new instance of ParityInputSynapse
-
-
Method Detail
-
setParitySize
public void setParitySize(int aSize)
Sets the number of bits the parity problem should consist of, that is, the number of bits the input should consist of. For example, a size 2, is the XOR problem.- Parameters:
aSize- the size / number of bits for the input.
-
getParitySize
public int getParitySize()
Gets the parity size, that is, the number of bits of the input pattern.- Returns:
- the parity size.
-
getNumOfPatterns
public int getNumOfPatterns()
Gets the number of patterns that exist for the parity problem, that is2^parity-size.- Returns:
- the number of patterns that exist for the parity problem based on the parity size.
-
setUpperBit
public void setUpperBit(double aValue)
Sets the value for the upper bit.- Parameters:
aValue- the value to use for the upper bit.
-
getUpperBit
public double getUpperBit()
Gets the value used for the upper bit.
-
setLowerBit
public void setLowerBit(double aValue)
Sets the value for the lower bit.- Parameters:
aValue- the value to use for the lower bit.
-
getLowerBit
public double getLowerBit()
Gets the value used for the lower bit.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG