79 bool parallelize =
true,
80 int = -1)
const override;
87 bool parallelize =
true,
88 int = -1)
const override;
101 filesystem::path cache_path;
103 uint64_t record_bytes_ = 0;
104 uint64_t labels_off_ = 0;
105 uint32_t num_classes_ = 0;
106 vector<int32_t> labels_ram;
108 vector<string> labels_tokens;
110 Index width_no_padding = 0;
112 Index regions_number = 1000;
113 Index region_rows = 6;
114 Index region_variables = 6;
virtual Index get_samples_number() const
Returns the total number of samples (rows) in the data matrix.
Definition dataset.h:74
virtual void unscale_features(const string &, const vector< Descriptives > &)
Reverts a previously applied scaling using the supplied descriptives.
Definition dataset.h:375
Thread-safe positional file reader (pread on POSIX, overlapped ReadFile on Windows).
Definition io_utilities.h:20
void set_image_padding(int new_padding)
Definition image_dataset.h:59
Index get_samples_number() const override
Returns the number of image samples in the dataset.
vector< Descriptives > scale_features(const string &) override
Scales image pixel values for the given feature role.
void to_JSON(JsonWriter &) const override
Writes dataset state to a JSON writer.
const AugmentationSettings & get_augmentation() const
Definition image_dataset.h:49
ImageDataset(const filesystem::path &)
Creates an image dataset by reading the BMP archive at the given path.
void unscale_features(const string &)
Reverts the pixel scaling for the given feature role.
Index get_channels_number() const
Returns the number of image channels (typically 1 or 3).
ImageDataset(const Index=0, const Shape &={0, 0, 0}, const Shape &={0})
Creates an image dataset with the given sample count, image shape and target shape.
void read_bmp(const Shape &new_input_shape={ 0, 0, 0 })
Reads BMP images into the dataset, resizing to new_input_shape when non-zero.
void fill_inputs(const vector< Index > &, const vector< Index > &, float *, bool is_training, bool parallelize=true, int=-1) const override
Streams pixel data of the selected samples into the destination buffer.
void from_JSON(const JsonDocument &) override
Loads dataset state from a JSON document.
void set_augmentation(const AugmentationSettings &new_augmentation)
Definition image_dataset.h:50
void fill_targets(const vector< Index > &, const vector< Index > &, float *, bool is_training, bool parallelize=true, int=-1) const override
Writes one-hot encoded labels of the selected samples into the destination buffer.
void set_data_random() override
Generates random image data, replacing the current contents.
void augment_inputs(float *, Index) const override
Applies the configured augmentations in place to a batch of images.
Definition adaptive_moment_estimation.h:14
Image augmentation parameters: reflections, rotations and translations applied at training.
Definition image_dataset.h:19
bool enabled
Definition image_dataset.h:20
float vertical_translation_minimum
Definition image_dataset.h:27
bool reflection_axis_y
Definition image_dataset.h:22
bool reflection_axis_x
Definition image_dataset.h:21
float vertical_translation_maximum
Definition image_dataset.h:28
float rotation_minimum
Definition image_dataset.h:23
float rotation_maximum
Definition image_dataset.h:24
float horizontal_translation_maximum
Definition image_dataset.h:26
float horizontal_translation_minimum
Definition image_dataset.h:25
Fixed-capacity small-vector describing tensor dimensions (rank up to MaxRank).
Definition tensor_utilities.h:42