|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.encog.engine.network.flat.FlatNetwork
public class FlatNetwork
Implements a flat (vector based) neural network in the Encog Engine. This is meant to be a very highly efficient feedforward, or simple recurrent, neural network. It uses a minimum of objects and is designed with one principal in mind-- SPEED. Readability, code reuse, object oriented programming are all secondary in consideration. Vector based neural networks are also very good for GPU processing. The flat network classes will make use of the GPU if you have enabled GPU processing. See the Encog class for more info.
| Field Summary | |
|---|---|
static double |
DEFAULT_BIAS_ACTIVATION
The default bias activation. |
static double |
NO_BIAS_ACTIVATION
The value that indicates that there is no bias activation. |
| Constructor Summary | |
|---|---|
FlatNetwork()
Default constructor. |
|
FlatNetwork(FlatLayer[] layers)
Create a flat network from an array of layers. |
|
FlatNetwork(int input,
int hidden1,
int hidden2,
int output,
boolean tanh)
Construct a flat neural network. |
|
| Method Summary | |
|---|---|
double |
calculateError(EngineIndexableSet data)
Calculate the error for this neural network. |
void |
clearConnectionLimit()
|
void |
clearContext()
Clear any context neurons. |
FlatNetwork |
clone()
Clone the network. |
void |
cloneFlatNetwork(FlatNetwork result)
|
void |
compute(double[] input,
double[] output)
Calculate the output for the given input. |
protected void |
computeLayer(int currentLayer)
Calculate a layer. |
void |
decodeNetwork(double[] data)
Decode the specified data into the weights of the neural network. |
double[] |
encodeNetwork()
Encode the neural network to an array of doubles. |
ActivationFunction[] |
getActivationFunctions()
|
int |
getBeginTraining()
|
double |
getConnectionLimit()
|
int[] |
getContextTargetOffset()
|
int[] |
getContextTargetSize()
|
int |
getEncodeLength()
|
int |
getEndTraining()
|
int |
getInputCount()
|
int[] |
getLayerCounts()
|
int[] |
getLayerFeedCounts()
|
int[] |
getLayerIndex()
|
double[] |
getLayerOutput()
|
int |
getNeuronCount()
|
int |
getOutputCount()
|
int[] |
getWeightIndex()
|
double[] |
getWeights()
|
Class<?> |
hasSameActivationFunction()
Neural networks with only one type of activation function offer certain optimization options. |
void |
init(FlatLayer[] layers)
Construct a flat network. |
boolean |
isLimited()
|
void |
randomize()
Perform a simple randomization of the weights of the neural network between -1 and 1. |
void |
randomize(double hi,
double lo)
Perform a simple randomization of the weights of the neural network between the specified hi and lo. |
void |
setBeginTraining(int beginTraining)
|
void |
setConnectionLimit(double connectionLimit)
|
void |
setEndTraining(int endTraining)
|
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final double DEFAULT_BIAS_ACTIVATION
public static final double NO_BIAS_ACTIVATION
| Constructor Detail |
|---|
public FlatNetwork()
public FlatNetwork(FlatLayer[] layers)
layers - The layers.
public FlatNetwork(int input,
int hidden1,
int hidden2,
int output,
boolean tanh)
input - Neurons in the input layer.hidden1 - Neurons in the first hidden layer. Zero for no first hidden
layer.hidden2 - Neurons in the second hidden layer. Zero for no second hidden
layer.output - Neurons in the output layer.tanh - True if this is a tanh activation, false for sigmoid.| Method Detail |
|---|
public double calculateError(EngineIndexableSet data)
data - The training set.
public void clearContext()
public FlatNetwork clone()
clone in class Objectpublic void cloneFlatNetwork(FlatNetwork result)
public void compute(double[] input,
double[] output)
compute in interface EngineMachineLearninginput - The input.output - Output will be placed here.protected void computeLayer(int currentLayer)
currentLayer - The layer to calculate.public void decodeNetwork(double[] data)
decodeNetwork in interface EngineNeuralNetworkdata - The data to be decoded.public double[] encodeNetwork()
encodeNetwork in interface EngineNeuralNetworkpublic int[] getContextTargetOffset()
public int[] getContextTargetSize()
public int getEncodeLength()
getEncodeLength in interface EngineNeuralNetworkpublic int getInputCount()
getInputCount in interface EngineMachineLearningpublic int[] getLayerCounts()
public int[] getLayerFeedCounts()
public int[] getLayerIndex()
public double[] getLayerOutput()
public int getNeuronCount()
public int getOutputCount()
getOutputCount in interface EngineMachineLearningpublic int[] getWeightIndex()
public double[] getWeights()
public Class<?> hasSameActivationFunction()
public void init(FlatLayer[] layers)
layers - The layers of the network to create.public void randomize()
public void randomize(double hi,
double lo)
hi - The network high.lo - The network low.public int getBeginTraining()
public void setBeginTraining(int beginTraining)
beginTraining - the beginTraining to setpublic int getEndTraining()
public void setEndTraining(int endTraining)
endTraining - the endTraining to setpublic double getConnectionLimit()
public void setConnectionLimit(double connectionLimit)
connectionLimit - the connectionLimit to setpublic boolean isLimited()
public void clearConnectionLimit()
public ActivationFunction[] getActivationFunctions()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||