Deep Learning Algorithm Implementations 1.0.0
C++ implementations of fundamental deep learning algorithms
|
#include <data_loader.hpp>
Public Member Functions | |
Dataset () | |
Default constructor for empty dataset. | |
Dataset (const MatrixD &features, const MatrixD &labels) | |
Constructor with feature and label matrices. | |
void | add_sample (const std::vector< T > &feature, const std::vector< T > &label) |
Add a single sample to the dataset. | |
size_t | size () const |
Get the number of samples in the dataset. | |
std::pair< MatrixD, MatrixD > | get_batch (size_t start_idx, size_t batch_size) const |
Extract a batch of samples from the dataset. | |
void | shuffle () |
Randomly shuffle the dataset samples. | |
Definition at line 52 of file data_loader.hpp.
dl::utils::Dataset< T >::Dataset | ( | ) |
Default constructor for empty dataset.
Definition at line 15 of file data_loader.cpp.
dl::utils::Dataset< T >::Dataset | ( | const MatrixD & | features, |
const MatrixD & | labels | ||
) |
Constructor with feature and label matrices.
features | Matrix containing input features (samples x features) |
labels | Matrix containing target labels (samples x outputs) |
Definition at line 18 of file data_loader.cpp.
void dl::utils::Dataset< T >::add_sample | ( | const std::vector< T > & | feature, |
const std::vector< T > & | label | ||
) |
Add a single sample to the dataset.
feature | Feature vector for the sample |
label | Label vector for the sample |
Definition at line 26 of file data_loader.cpp.
std::pair< MatrixD, MatrixD > dl::utils::Dataset< T >::get_batch | ( | size_t | start_idx, |
size_t | batch_size | ||
) | const |
Extract a batch of samples from the dataset.
start_idx | Starting index for the batch |
batch_size | Number of samples in the batch |
Definition at line 38 of file data_loader.cpp.
void dl::utils::Dataset< T >::shuffle | ( | ) |
Randomly shuffle the dataset samples.
Definition at line 52 of file data_loader.cpp.
size_t dl::utils::Dataset< T >::size | ( | ) | const |
Get the number of samples in the dataset.
Definition at line 32 of file data_loader.cpp.