|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.encog.util.concurrency.job.ConcurrentJob
org.encog.neural.prune.PruneIncremental
public class PruneIncremental
This class is used to help determine the optimal configuration for the hidden layers of a neural network. It can accept a pattern, which specifies the type of neural network to create, and a list of the maximum and minimum hidden layer neurons. It will then attempt to train the neural network at all configurations and see which hidden neuron counts work the best. This method does not simply choose the network with the lowest error rate. A specifiable number of best networks are kept, which represent the networks with the lowest error rates. From this collection of networks, the best network is defined to be the one with the fewest number of connections. Not all starting random weights are created equal. Because of this, an option is provided to allow you to choose how many attempts you want the process to make, with different weights. All random weights are created using the default Nguyen-Widrow method normally used by Encog.
Constructor Summary | |
---|---|
PruneIncremental(MLDataSet training,
NeuralNetworkPattern pattern,
int iterations,
int weightTries,
int numTopResults,
StatusReportable report)
Construct an object to determine the optimal number of hidden layers and neurons for the specified training data and pattern. |
Method Summary | |
---|---|
void |
addHiddenLayer(int min,
int max)
Add a hidden layer's min and max. |
BasicNetwork |
getBestNetwork()
|
List<HiddenLayerParams> |
getHidden()
|
int |
getHidden1Size()
|
int |
getHidden2Size()
|
double |
getHigh()
|
int |
getIterations()
|
double |
getLow()
|
NeuralNetworkPattern |
getPattern()
|
double[][] |
getResults()
|
double[] |
getTopErrors()
|
BasicNetwork[] |
getTopNetworks()
|
MLDataSet |
getTraining()
|
void |
init()
Init for prune. |
int |
loadWorkload()
Get the next workload. |
static String |
networkToString(BasicNetwork network)
Format the network as a human readable string that lists the hidden layers. |
void |
performJobUnit(JobUnitContext context)
Perform an individual job unit, which is a single network to train and evaluate. |
void |
process()
Begin the prune process. |
Object |
requestNextTask()
Request the next task. |
Methods inherited from class org.encog.util.concurrency.job.ConcurrentJob |
---|
getShouldStop, getThreadCount, isRunning, processBackground, reportStatus, run, setReport, setThreadCount, stop |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PruneIncremental(MLDataSet training, NeuralNetworkPattern pattern, int iterations, int weightTries, int numTopResults, StatusReportable report)
training
- The training data to use.pattern
- The network pattern to use to solve this data.iterations
- How many iterations to try per network.weightTries
- The number of random weights to use.numTopResults
- The number of "top networks" to choose the most simple "best
network" from.report
- Object used to report status to.Method Detail |
---|
public static String networkToString(BasicNetwork network)
network
- The network to format.
public void addHiddenLayer(int min, int max)
min
- The minimum number of neurons for this layer.max
- The maximum number of neurons for this layer.public BasicNetwork getBestNetwork()
public List<HiddenLayerParams> getHidden()
public int getHidden1Size()
public int getHidden2Size()
public double getHigh()
public int getIterations()
public double getLow()
public NeuralNetworkPattern getPattern()
public double[][] getResults()
public double[] getTopErrors()
public BasicNetwork[] getTopNetworks()
public MLDataSet getTraining()
public void init()
public int loadWorkload()
loadWorkload
in class ConcurrentJob
public void performJobUnit(JobUnitContext context)
performJobUnit
in class ConcurrentJob
context
- Contains information about the job unit.public void process()
process
in class ConcurrentJob
public Object requestNextTask()
requestNextTask
in class ConcurrentJob
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |