|
The Encog Project | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.encog.neural.data.buffer.BufferedNeuralDataSet
public class BufferedNeuralDataSet
This class is not memory based, so very long files can be used, without running out of memory. This dataset uses a binary file as a buffer. When used with a slower access dataset, such as CSV, XML or SQL, where parsing must occur, this dataset can be used to load from the slower dataset and train at much higher speeds. If you are going to create a binary file, by using the add methods, you must call beginLoad to cause Encog to open an output file. Once the data has been loaded, call endLoad. The floating point numbers stored to the binary file may not be cross platform.
| Nested Class Summary | |
|---|---|
class |
BufferedNeuralDataSet.BufferedNeuralDataSetIterator
An iterator to move through the buffered data set. |
| Field Summary | |
|---|---|
static java.lang.String |
ERROR_ADD
Error message for ADD. |
static java.lang.String |
ERROR_REMOVE
Error message for REMOVE. |
| Constructor Summary | |
|---|---|
BufferedNeuralDataSet(java.io.File bufferFile)
Construct a buffered dataset using the specified file. |
|
| Method Summary | |
|---|---|
void |
add(NeuralData data1)
Add only input data, for an unsupervised dataset. |
void |
add(NeuralData inputData,
NeuralData idealData)
Add both the input and ideal data. |
void |
add(NeuralDataPair inputData)
Add a data pair of both input and ideal data. |
void |
beginLoad(int inputSize,
int idealSize)
Begin loading to the binary file. |
void |
close()
Close all iterators. |
void |
endLoad()
This method should be called once all the data has been loaded. |
int |
getIdealSize()
|
int |
getInputSize()
|
void |
getRecord(long index,
NeuralDataPair pair)
Get a record by index and copy it into the specified pair. |
long |
getRecordCount()
Determine the total number of records in the set. |
BufferedNeuralDataSet.BufferedNeuralDataSetIterator |
iterator()
|
void |
load(NeuralDataSet source)
Load from the specified data source into the binary file. |
Indexable |
openAdditional()
Open a second buffered data set, useful for multithreading. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String ERROR_ADD
public static final java.lang.String ERROR_REMOVE
| Constructor Detail |
|---|
public BufferedNeuralDataSet(java.io.File bufferFile)
bufferFile - The file to read/write binary data to/from.| Method Detail |
|---|
public void add(NeuralData data1)
add in interface NeuralDataSetdata1 - The data to be added.
public void add(NeuralData inputData,
NeuralData idealData)
add in interface NeuralDataSetinputData - The input data.idealData - The ideal data.public void add(NeuralDataPair inputData)
add in interface NeuralDataSetinputData - The pair to add.
public void beginLoad(int inputSize,
int idealSize)
inputSize - The input size.idealSize - The ideal size.public void close()
close in interface NeuralDataSetpublic void endLoad()
public int getIdealSize()
getIdealSize in interface NeuralDataSetpublic int getInputSize()
getInputSize in interface NeuralDataSet
public void getRecord(long index,
NeuralDataPair pair)
getRecord in interface Indexableindex - The index to load.pair - THe pair to copy into.public long getRecordCount()
Indexable
getRecordCount in interface Indexablepublic BufferedNeuralDataSet.BufferedNeuralDataSetIterator iterator()
iterator in interface java.lang.Iterable<NeuralDataPair>public void load(NeuralDataSet source)
source - The source.public Indexable openAdditional()
openAdditional in interface Indexable
|
The Encog Project | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||