./gradlew dataset -Pwhich=<name>
However, you can also add your own dataset without the need of writing a custom Dataset
service if your files adhere to certain rules. In order to do so, you need to create a directory for the dataset and add one or more JSON descriptors to it that tell DIANNE how it should interpret the data. For every descriptor, a service will be created. Each descriptor should contain at least the following items:
name
: The name of the dataset.type
: One of the types listed below.inputDims
: Dimensions of the inputs as an integer array, e.g. [3,32,32] for CIFAR-10.noSamples
: Number of samples in the dataset.
There are also a number of items that are only required for supervised learning:
targetDims
: Dimensions of the targets as an integer array, e.g. [10] for CIFAR-10.labelsFile
: Labels for the different target dimensions, if applicable (as for example with classification). This is optional.
Currently we support the following automatic configurations.
### FileDataset ### Reads a number of files as raw blob of unsigned bytes for classification. Input data is automatically rescaled from [0,255] to [0,1]. Targets are interpreted as class indices (so a maximum of 256 labels is supported), and are converted to a one-hot encoding. Following options need to be set:inputFiles
: A string array with the input data files. Multiple samples can be in the same file.targetFiles
: A string array with the target data files. Each input file needs to have a matching target file. Each byte in the target file is read as a separate class index, labeling the corresponding input bytes in the matching input data file.files
: Can be used instead ofinputFiles
andtargetFiles
when the inputs and labels are in the same file. It is assumed that the class index comes first, and is followed by the input bytes.prefetch
: Whether to prefetch the data. This can speedup the start of the learning, but increases memory usage.
file
: The ASCII file to be read.separator
: The character used to separate the different values. By default this is ",", hence the name.inputOffset
: The column at which to start reading the input, counting from the start of the line.targetOffset
: The column at which to start reading the target, counting from the end of the input (so use 0 if consecutive).classification
: Boolean value indicating if this dataset is used for classification. Iftrue
, a single integer target value is read and interpreted as the class index. This is then converted into a one-hot encoding.
Note: You can optionally omit the noSamples
options, as this can be determined automatically by counting the number of lines in the file.
targetsFile
: File containing the class indices on separate lines. These indices are then converted to one-hot encoding.
range
(*) : Integer array specifying the samples that are allowed. Can be specified as either[max]
for indices in [0,max],[min,max]
or by specifying only valid indices[i,j,...]
.max
andmin,max
(without brackets) are also possible.
vlip
(*) : Probability of performing a vertical flip (default is 0).hflip
(*) : Probability of performing a horizontal flip (default is 0).
rotationTheta
(*) : Either a single real valuetheta
resulting in uniform random rotation in [-theta, theta] or an integer array[min_theta,max_theta]
resulting in rotations in [-min_theta, max_theta]. Defaults to [-pi, pi].center
: Point of rotation specified as integer array[x,y]
. By default, the point of rotation is randomly selected.middle
: Boolean value for using the center of the image as the point of rotation (default isfalse
). This is overwritten bycenter
.
cropWidth
(*) : Either a single integer value resulting in crops with fixed width or an integer array[min,max]
resulting in crops with uniform random width in [min,max].cropHeight
(*) : Either a single integer value resulting in crops with fixed height or an integer array[min,max]
resulting in crops with uniform random height in [min,max].cropPadding
: Integer value for optional zero-padding on the sides (default is 0).
frame
(*) : Integer array of size 2 or 3 with the desired image dimensions.
labels
: Integer array of the class indices that need to be preserved.other
: Boolean value indicating whether the remaining class indices need to be aggregated into an "other" label or not (default isfalse
).
center
: Boolean value indicating if we only need to look at the center pixel of the mask or look at the sum over all pixels (default isfalse
).threshold
: Real value indicating the threshold above which the class is 1 instead of 0 (default is 0.5).
binarize
(*) : Real value indicating the threshold above which values will be set to 1, or 0 otherwise (default is 0.5).