oneDNN Wrapper
|
DataLoader allows to create a dataloader object to implement minibatch stochastic gradient descent. More...
#include <data_loader.h>
Public Member Functions | |
void | write_to_memory (dnnl::memory dst_mem_features, dnnl::memory dst_mem_labels) |
Method that writes the curr batch to memory and moves the index forward. | |
DataLoader (std::string features_path, std::string labels_path, int _minibatch_size, std::vector< int > dataset_shape, dnnl::engine _eng) | |
Construct a new Data Loader object. More... | |
Public Attributes | |
int | dataset_size |
Total number of samples. | |
int | minibatch_size |
Minibatch size. | |
std::vector< float > | dataset |
Vector containing the entire dataset. | |
std::vector< float > | dataset_labels |
Vector containing the labels. | |
std::vector< float > | curr_batch |
Vector containing the current batch that will be written to the engine. | |
std::vector< float > | curr_batch_labels |
Vector containing the labels that will be written to the engine. | |
DataLoader allows to create a dataloader object to implement minibatch stochastic gradient descent.
DataLoader::DataLoader | ( | std::string | features_path, |
std::string | labels_path, | ||
int | _minibatch_size, | ||
std::vector< int > | dataset_shape, | ||
dnnl::engine | _eng | ||
) |
Construct a new Data Loader object.
This allows the creation of a class which implements minibatch stochastic gradient descent
features_path | path to the text file containing the flattened features (in row-major order) |
labels_path | path to the labels corresponding to the features |
_minibatch_size | size of the minibatch (-1 for full batch) |
dataset_shape | shape of the single sample eg. {C} or {C, H, W}, the N will be stored in the dataset_size variable |
_eng | oneAPI engine |