DataLoader
See Base.iterate in General Methods
NNJulia.DataLoader
— TypeDataLoader(XData::T1, YData::T2, batchSize=1::Int, shuffle=false::Bool) where {T1<:Union{AbstractArray,Float64,Int64},T2<:Union{AbstractArray,Float64,Int64}}
This struct represent a DataLoader. A DataLoader is used to load a dataset with inputs and label, shuffle the data, separate it into batches, etc. It is possible to iterate over this struct to access the batches of the dataset.
For the first iteration, the list of indices is shuffled (if required). Then, it return a subpart of the dataset according to the batch size with this size : (dataSize...,batchSize)
For example, if the input data contains two values for a batch size of 4, this matrix will be returned :
[
1 0 1 1
0 1 0 1
]
Fields
- XData: The input data
- YData: The target output data
- batchSize: The size of the batches given to the network at eatch step
- indices: The list of indexes used to access the data. This list can be shuffled.
- shuffle: A boolean that indicates if the data needs to be shuffled
- nbBatch: The number of batch that compose the dataset