public class MemoryDiskMLDataSet extends Object implements org.encog.ml.data.MLDataSet
BasicMLDataSet and BufferedMLDataSet together.
With this data set, element is added firstly in memory, if over maxByteSize then element will be added into
disk.
This data set provide a very important feature to make in memory computing more stable. Even for some cases no enough memory, memory and disk will be leveraged together to accelerate computing.
Example almost same as BufferedMLDataSet:
MemoryDiskMLDataSet dataSet = new MemoryDiskMLDataSet(400, "a.txt"); dataSet.beginLoad(10, 1); dataSet.add(pair); dataSet.endLoad(); Iteratoriterator = dataSet.iterator(); while(iterator.hasNext()) { MLDataPair next = iterator.next(); ... } dataSet.close();
| Constructor and Description |
|---|
MemoryDiskMLDataSet(long maxByteSize,
String fileName)
Constructor with
maxByteSize and fileName |
MemoryDiskMLDataSet(long maxByteSize,
String fileName,
int inputCount,
int outputCount)
|
MemoryDiskMLDataSet(String fileName,
int inputCount,
int outputCount)
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(org.encog.ml.data.MLData data) |
void |
add(org.encog.ml.data.MLData inputData,
org.encog.ml.data.MLData idealData) |
void |
add(org.encog.ml.data.MLDataPair inputData) |
void |
beginLoad(int inputSize,
int idealSize)
Setting input variable size and output target size.
|
void |
close() |
void |
endLoad()
This method should be called once all the data has been loaded.
|
long |
getDiskCount() |
int |
getIdealSize() |
int |
getInputSize() |
long |
getMemoryCount() |
void |
getRecord(long index,
org.encog.ml.data.MLDataPair pair) |
long |
getRecordCount() |
boolean |
isSupervised() |
Iterator<org.encog.ml.data.MLDataPair> |
iterator() |
static void |
main(String[] args) |
org.encog.ml.data.MLDataSet |
openAdditional() |
public MemoryDiskMLDataSet(String fileName, int inputCount, int outputCount)
public MemoryDiskMLDataSet(long maxByteSize,
String fileName)
maxByteSize and fileNamepublic MemoryDiskMLDataSet(long maxByteSize,
String fileName,
int inputCount,
int outputCount)
public final void beginLoad(int inputSize,
int idealSize)
inputSize - input variable sizeidealSize - output target sizepublic final void endLoad()
public Iterator<org.encog.ml.data.MLDataPair> iterator()
public int getIdealSize()
getIdealSize in interface org.encog.ml.data.MLDataSetpublic int getInputSize()
getInputSize in interface org.encog.ml.data.MLDataSetpublic boolean isSupervised()
isSupervised in interface org.encog.ml.data.MLDataSetpublic long getRecordCount()
getRecordCount in interface org.encog.ml.data.MLDataSetpublic void getRecord(long index,
org.encog.ml.data.MLDataPair pair)
getRecord in interface org.encog.ml.data.MLDataSetpublic org.encog.ml.data.MLDataSet openAdditional()
openAdditional in interface org.encog.ml.data.MLDataSetpublic void add(org.encog.ml.data.MLData data)
add in interface org.encog.ml.data.MLDataSetpublic void add(org.encog.ml.data.MLData inputData,
org.encog.ml.data.MLData idealData)
add in interface org.encog.ml.data.MLDataSetpublic void add(org.encog.ml.data.MLDataPair inputData)
add in interface org.encog.ml.data.MLDataSetpublic void close()
close in interface org.encog.ml.data.MLDataSetpublic long getMemoryCount()
public long getDiskCount()
public static void main(String[] args)
Copyright © 2015. All Rights Reserved.