org.encog.neural.rbf
Class RBFNetwork
- java.lang.Object
-
- org.encog.ml.BasicML
-
- org.encog.neural.rbf.RBFNetwork
-
- All Implemented Interfaces:
- java.io.Serializable, MLEncodable, MLError, MLInput, MLInputOutput, MLMethod, MLOutput, MLProperties, MLRegression, MLResettable, ContainsFlat
public class RBFNetwork extends BasicML implements MLError, MLRegression, ContainsFlat, MLResettable, MLEncodable
RBF neural network.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description RBFNetwork()Construct RBF network.RBFNetwork(int inputCount, int hiddenCount, int outputCount, RBFEnum t)Construct RBF network.RBFNetwork(int inputCount, int outputCount, RadialBasisFunction[] rbf)Construct RBF network.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description doublecalculateError(MLDataSet data)Calculate the error for this neural network.MLDatacompute(MLData input)Compute regression.voiddecodeFromArray(double[] encoded)Decode an array to this object.intencodedArrayLength()voidencodeToArray(double[] encoded)Encode the object to the specified array.FlatNetworkgetFlat()intgetInputCount()intgetOutputCount()RadialBasisFunction[]getRBF()Get the RBF's.voidrandomizeRBFCentersAndWidths(double min, double max, RBFEnum t)Set the RBF components to random values.voidreset()Reset the weights.voidreset(int seed)Reset the weights with a seed.voidsetRBF(RadialBasisFunction[] rbf)Set the RBF's.voidsetRBFCentersAndWidths(double[][] centers, double[] widths, RBFEnum t)Array containing center position.voidsetRBFCentersAndWidthsEqualSpacing(double minPosition, double maxPosition, RBFEnum t, double volumeNeuronRBFWidth, boolean useWideEdgeRBFs)Equally spaces all hidden neurons within the n dimensional variable space.voidsetRBFFunction(int index, RBFEnum t, double[] centers, double width)Set an RBF function.voidupdateProperties()Update any objeccts when a property changes.-
Methods inherited from class org.encog.ml.BasicML
getProperties, getPropertyDouble, getPropertyLong, getPropertyString, setProperty, setProperty, setProperty
-
-
-
-
Constructor Detail
-
RBFNetwork
public RBFNetwork()
Construct RBF network.
-
RBFNetwork
public RBFNetwork(int inputCount, int hiddenCount, int outputCount, RBFEnum t)Construct RBF network.- Parameters:
inputCount- The input count.hiddenCount- The hidden count.outputCount- The output count.t- The RBF type.
-
RBFNetwork
public RBFNetwork(int inputCount, int outputCount, RadialBasisFunction[] rbf)Construct RBF network.- Parameters:
inputCount- The input count.outputCount- The output count.rbf- The RBF type.
-
-
Method Detail
-
calculateError
public double calculateError(MLDataSet data)
Calculate the error for this neural network.- Specified by:
calculateErrorin interfaceMLError- Parameters:
data- The training set.- Returns:
- The error percentage.
-
compute
public MLData compute(MLData input)
Compute regression.- Specified by:
computein interfaceMLRegression- Parameters:
input- The input data.- Returns:
- The output data.
-
getFlat
public FlatNetwork getFlat()
- Specified by:
getFlatin interfaceContainsFlat- Returns:
- The flat network associated with this neural network.
-
getInputCount
public int getInputCount()
- Specified by:
getInputCountin interfaceMLInput- Returns:
- The input.
-
getOutputCount
public int getOutputCount()
- Specified by:
getOutputCountin interfaceMLOutput- Returns:
- The output count.
-
getRBF
public RadialBasisFunction[] getRBF()
Get the RBF's.- Returns:
- The RBF's.
-
randomizeRBFCentersAndWidths
public void randomizeRBFCentersAndWidths(double min, double max, RBFEnum t)Set the RBF components to random values.- Parameters:
min- Minimum random value.max- Max random value.t- The type of RBF to use.
-
setRBF
public void setRBF(RadialBasisFunction[] rbf)
Set the RBF's.- Parameters:
rbf- The RBF's.
-
setRBFCentersAndWidths
public void setRBFCentersAndWidths(double[][] centers, double[] widths, RBFEnum t)Array containing center position. Row n contains centers for neuron n. Row n contains x elements for x number of dimensions.- Parameters:
centers- The centers.widths- Array containing widths. Row n contains widths for neuron n. Row n contains x elements for x number of dimensions.t- The RBF Function to use for this layer.
-
setRBFCentersAndWidthsEqualSpacing
public void setRBFCentersAndWidthsEqualSpacing(double minPosition, double maxPosition, RBFEnum t, double volumeNeuronRBFWidth, boolean useWideEdgeRBFs)Equally spaces all hidden neurons within the n dimensional variable space.- Parameters:
minPosition- The minimum position neurons should be centered. Typically 0.maxPosition- The maximum position neurons should be centered. Typically 1t- The RBF Function to use for this layer.volumeNeuronRBFWidth- The neuron width of neurons within the mesh.useWideEdgeRBFs- Enables wider RBF's around the boundary of the neuron mesh.
-
setRBFFunction
public void setRBFFunction(int index, RBFEnum t, double[] centers, double width)Set an RBF function.- Parameters:
index- The index to set.t- The function type.centers- The centers.width- The width.
-
updateProperties
public void updateProperties()
Update any objeccts when a property changes.- Specified by:
updatePropertiesin interfaceMLProperties- Specified by:
updatePropertiesin classBasicML
-
reset
public void reset()
Reset the weights.- Specified by:
resetin interfaceMLResettable
-
reset
public void reset(int seed)
Reset the weights with a seed.- Specified by:
resetin interfaceMLResettable- Parameters:
seed- The seed value.
-
encodedArrayLength
public int encodedArrayLength()
- Specified by:
encodedArrayLengthin interfaceMLEncodable- Returns:
- The length of an encoded array.
-
encodeToArray
public void encodeToArray(double[] encoded)
Encode the object to the specified array.- Specified by:
encodeToArrayin interfaceMLEncodable- Parameters:
encoded- The array.
-
decodeFromArray
public void decodeFromArray(double[] encoded)
Decode an array to this object.- Specified by:
decodeFromArrayin interfaceMLEncodable- Parameters:
encoded- The encoded array.
-
-
DMelt 3.0 © DataMelt by jWork.ORG