Package org.nd4j.linalg.dataset.api
Interface MultiDataSet
-
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
MultiDataSet
public interface MultiDataSet extends Serializable
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description List<MultiDataSet>
asList()
SplitV the MultiDataSet into a list of individual examples.MultiDataSet
copy()
Clone the datasetvoid
detach()
This method detaches this MultiDataSet from current Workspace (if any)List<Serializable>
getExampleMetaData()
Get the example metadata, or null if no metadata has been set<T extends Serializable>
List<T>getExampleMetaData(Class<T> metaDataType)
Get the example metadata, or null if no metadata has been set
Note: this method results in an unchecked cast - care should be taken when using this!INDArray[]
getFeatures()
Get all of the input features, as an array of INDArraysINDArray
getFeatures(int index)
Get a single feature/input arrayINDArray
getFeaturesMaskArray(int index)
Get the specified feature mask array.INDArray[]
getFeaturesMaskArrays()
Get the feature mask arrays.INDArray[]
getLabels()
Get all of the labels, as an array of INDArraysINDArray
getLabels(int index)
Get a single label/output arrayINDArray
getLabelsMaskArray(int index)
Get the specified label mask array.INDArray[]
getLabelsMaskArrays()
Get the labels mask arrays.long
getMemoryFootprint()
This method returns memory amount occupied by this MultiDataSet.boolean
hasMaskArrays()
Whether there are any mask arrays (features or labels) present for this MultiDataSetboolean
isEmpty()
void
load(File from)
Load the contents of this MultiDataSet from the specified filevoid
load(InputStream from)
Load the contents of this MultiDataSet from the specified stream.void
migrate()
This method migrates this MultiDataSet into current Workspace (if any)int
numFeatureArrays()
Number of arrays of features/input data in the MultiDataSetint
numLabelsArrays()
Number of arrays of label/output data in the MultiDataSetvoid
save(File to)
Save this MultiDataSet to the specified filevoid
save(OutputStream to)
Save this MultiDataSet to the specified stream.void
setExampleMetaData(List<? extends Serializable> exampleMetaData)
Set the metadata for this MultiDataSet
By convention: the metadata can be any serializable object, one per example in the MultiDataSetvoid
setFeatures(int idx, INDArray features)
Set a single features array (by index) for the MultiDataSetvoid
setFeatures(INDArray[] features)
Set all of the features arrays for the MultiDataSetvoid
setFeaturesMaskArray(int idx, INDArray maskArray)
Set a single feature mask array by indexvoid
setFeaturesMaskArrays(INDArray[] maskArrays)
Set the feature mask arraysvoid
setLabels(int idx, INDArray labels)
Set a single labels array (by index) for the MultiDataSetvoid
setLabels(INDArray[] labels)
Set all of the labels arrays for the MultiDataSetvoid
setLabelsMaskArray(int idx, INDArray labelsMaskArray)
Set a single labels mask array by indexvoid
setLabelsMaskArray(INDArray[] labels)
Set the labels mask arraysvoid
shuffle()
Shuffle the order of the examples in the MultiDataSet.
-
-
-
Method Detail
-
numFeatureArrays
int numFeatureArrays()
Number of arrays of features/input data in the MultiDataSet
-
numLabelsArrays
int numLabelsArrays()
Number of arrays of label/output data in the MultiDataSet
-
getFeatures
INDArray[] getFeatures()
Get all of the input features, as an array of INDArrays
-
getFeatures
INDArray getFeatures(int index)
Get a single feature/input array
-
setFeatures
void setFeatures(INDArray[] features)
Set all of the features arrays for the MultiDataSet
-
setFeatures
void setFeatures(int idx, INDArray features)
Set a single features array (by index) for the MultiDataSet
-
getLabels
INDArray[] getLabels()
Get all of the labels, as an array of INDArrays
-
getLabels
INDArray getLabels(int index)
Get a single label/output array
-
setLabels
void setLabels(INDArray[] labels)
Set all of the labels arrays for the MultiDataSet
-
setLabels
void setLabels(int idx, INDArray labels)
Set a single labels array (by index) for the MultiDataSet
-
hasMaskArrays
boolean hasMaskArrays()
Whether there are any mask arrays (features or labels) present for this MultiDataSet
-
getFeaturesMaskArrays
INDArray[] getFeaturesMaskArrays()
Get the feature mask arrays. May return null if no feature mask arrays are present; otherwise, any entry in the array may be null if no mask array is present for that particular feature
-
getFeaturesMaskArray
INDArray getFeaturesMaskArray(int index)
Get the specified feature mask array. Returns null if no feature mask is present for that particular feature/input
-
setFeaturesMaskArrays
void setFeaturesMaskArrays(INDArray[] maskArrays)
Set the feature mask arrays
-
setFeaturesMaskArray
void setFeaturesMaskArray(int idx, INDArray maskArray)
Set a single feature mask array by index
-
getLabelsMaskArrays
INDArray[] getLabelsMaskArrays()
Get the labels mask arrays. May return null if no labels mask arrays are present; otherwise, any entry in the array may be null if no mask array is present for that particular label
-
getLabelsMaskArray
INDArray getLabelsMaskArray(int index)
Get the specified label mask array. Returns null if no label mask is present for that particular feature/input
-
setLabelsMaskArray
void setLabelsMaskArray(INDArray[] labels)
Set the labels mask arrays
-
setLabelsMaskArray
void setLabelsMaskArray(int idx, INDArray labelsMaskArray)
Set a single labels mask array by index
-
save
void save(OutputStream to) throws IOException
Save this MultiDataSet to the specified stream. Stream will be closed after saving.- Throws:
IOException
-
save
void save(File to) throws IOException
Save this MultiDataSet to the specified file- Throws:
IOException
-
load
void load(InputStream from) throws IOException
Load the contents of this MultiDataSet from the specified stream. Stream will be closed after loading.- Throws:
IOException
-
load
void load(File from) throws IOException
Load the contents of this MultiDataSet from the specified file- Throws:
IOException
-
asList
List<MultiDataSet> asList()
SplitV the MultiDataSet into a list of individual examples.- Returns:
- List of MultiDataSets, each with 1 example
-
copy
MultiDataSet copy()
Clone the dataset- Returns:
- a clone of the dataset
-
setExampleMetaData
void setExampleMetaData(List<? extends Serializable> exampleMetaData)
Set the metadata for this MultiDataSet
By convention: the metadata can be any serializable object, one per example in the MultiDataSet- Parameters:
exampleMetaData
- Example metadata to set
-
getExampleMetaData
<T extends Serializable> List<T> getExampleMetaData(Class<T> metaDataType)
Get the example metadata, or null if no metadata has been set
Note: this method results in an unchecked cast - care should be taken when using this!- Type Parameters:
T
- Type of metadata- Parameters:
metaDataType
- Class of the metadata (used for opType information)- Returns:
- List of metadata objects
-
getExampleMetaData
List<Serializable> getExampleMetaData()
Get the example metadata, or null if no metadata has been set- Returns:
- List of metadata instances
-
getMemoryFootprint
long getMemoryFootprint()
This method returns memory amount occupied by this MultiDataSet.- Returns:
- value in bytes
-
migrate
void migrate()
This method migrates this MultiDataSet into current Workspace (if any)
-
detach
void detach()
This method detaches this MultiDataSet from current Workspace (if any)
-
isEmpty
boolean isEmpty()
- Returns:
- True if the MultiDataSet is empty (all features/labels arrays are empty)
-
shuffle
void shuffle()
Shuffle the order of the examples in the MultiDataSet. Note that this generally won't make any difference in practice unless the MultiDataSet is later split.
-
-